From db28f45f3aa0788536c37db0fbeef8ac365cc313 Mon Sep 17 00:00:00 2001 From: Mihail Novikov Date: Mon, 19 Nov 2018 00:46:53 +0300 Subject: [PATCH 001/924] [@types/react-table] Change SortingRule --- types/react-table/index.d.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/types/react-table/index.d.ts b/types/react-table/index.d.ts index 2e9c14980c..04917fb7d1 100644 --- a/types/react-table/index.d.ts +++ b/types/react-table/index.d.ts @@ -38,12 +38,10 @@ export interface Filter { value: any; pivotId?: string; } -/** NOTE: to many configuration ways (only true values are confusing) */ + export interface SortingRule { id: string; - sort?: 'desc' | 'asc'; - asc?: true; - desc?: true; + desc: boolean; } export interface TableProps extends From d98923c80cbccfbd5f109d503829f564b00ce0e9 Mon Sep 17 00:00:00 2001 From: Mihail Novikov Date: Fri, 11 Jan 2019 15:27:31 +0300 Subject: [PATCH 002/924] Change react-table version --- types/react-table/index.d.ts | 93 ++++++++++++++++++++++++------------ 1 file changed, 62 insertions(+), 31 deletions(-) diff --git a/types/react-table/index.d.ts b/types/react-table/index.d.ts index 09499e1010..ac0fc16e6d 100644 --- a/types/react-table/index.d.ts +++ b/types/react-table/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-table 6.7 +// Type definitions for react-table 6.6 // Project: https://github.com/react-tools/react-table // Definitions by: Roy Xue , // Pavel Sakalo , @@ -13,21 +13,53 @@ export type ReactTableFunction = (value?: any) => void; export type AccessorFunction = (row: D) => any; export type Accessor = string | string[] | AccessorFunction; export type Aggregator = (values: any, rows: any) => any; -export type TableCellRenderer = ((cellInfo: CellInfo, column: any) => React.ReactNode) | React.ReactNode; -export type FilterRender = (params: { column: Column, filter: any, onChange: ReactTableFunction, key?: string }) => React.ReactElement; -export type PivotRenderer = ((cellInfo: CellInfo) => React.ReactNode) | (() => any) | string | React.ReactNode; +export type TableCellRenderer = + | ((cellInfo: CellInfo, column: any) => React.ReactNode) + | React.ReactNode; +export type FilterRender = ( + params: { column: Column; filter: any; onChange: ReactTableFunction; key?: string } +) => React.ReactElement; +export type PivotRenderer = + | ((cellInfo: CellInfo) => React.ReactNode) + | (() => any) + | string + | React.ReactNode; -export type ComponentPropsGetter0 = (finalState: any, rowInfo: undefined, column: undefined, instance?: any) => object | undefined; -export type ComponentPropsGetterR = (finalState: any, rowInfo?: RowInfo, column?: undefined, instance?: any) => object | undefined; -export type ComponentPropsGetterC = (finalState: any, rowInfo?: undefined, column?: Column, instance?: any) => object | undefined; -export type ComponentPropsGetterRC = (finalState: any, rowInfo?: RowInfo, column?: Column, instance?: any) => object | undefined; +export type ComponentPropsGetter0 = ( + finalState: any, + rowInfo: undefined, + column: undefined, + instance?: any +) => object | undefined; +export type ComponentPropsGetterR = ( + finalState: any, + rowInfo?: RowInfo, + column?: undefined, + instance?: any +) => object | undefined; +export type ComponentPropsGetterC = ( + finalState: any, + rowInfo?: undefined, + column?: Column, + instance?: any +) => object | undefined; +export type ComponentPropsGetterRC = ( + finalState: any, + rowInfo?: RowInfo, + column?: Column, + instance?: any +) => object | undefined; export type DefaultFilterFunction = (filter: Filter, row: any, column: any) => boolean; export type FilterFunction = (filter: Filter, rows: any[], column: any) => any[]; export type SubComponentFunction = (rowInfo: RowInfo) => React.ReactNode; export type PageChangeFunction = (page: number) => void; export type PageSizeChangeFunction = (newPageSize: number, newPage: number) => void; -export type SortedChangeFunction = (newSorted: SortingRule[], column: any, additive: boolean) => void; +export type SortedChangeFunction = ( + newSorted: SortingRule[], + column: any, + additive: boolean +) => void; export type FilteredChangeFunction = (newFiltering: Filter[], column: any, value: any) => void; export type ExpandedChangeFunction = (column: any, event: any, isTouch: boolean) => void; export type ResizedChangeFunction = (newResized: Resize[], event: any) => void; @@ -48,13 +80,13 @@ export interface SortingRule { desc: boolean; } -export interface TableProps extends - Partial, - Partial, - Partial, - Partial, - Partial, - Partial { +export interface TableProps + extends Partial, + Partial, + Partial, + Partial, + Partial, + Partial { /** Default: [] */ data: D[]; @@ -381,13 +413,12 @@ export interface TextProps { rowsText: string; } -export interface GlobalColumn extends - Column.Basics, - Column.CellProps, - Column.FilterProps, - Column.FooterProps, - Column.HeaderProps { -} +export interface GlobalColumn + extends Column.Basics, + Column.CellProps, + Column.FilterProps, + Column.FooterProps, + Column.HeaderProps {} export namespace Column { /** Basic column props */ @@ -556,12 +587,12 @@ export interface PivotDefaults { render: TableCellRenderer; } -export interface Column extends - Partial, - Partial, - Partial, - Partial, - Partial { +export interface Column + extends Partial, + Partial, + Partial, + Partial, + Partial { /** * Property name as string or Accessor * @example: 'myProperty' @@ -670,7 +701,7 @@ export interface RowInfo { original: any; } -export interface CellInfo extends RowInfo, Pick { +export interface CellInfo extends RowInfo, Pick { /* true if this row is expanded */ isExpanded: boolean; @@ -728,7 +759,7 @@ export interface FinalState extends TableProps { } export const ReactTableDefaults: TableProps; -export default class ReactTable extends React.Component>> { } +export default class ReactTable extends React.Component>> {} export interface Instance extends ReactTable { context: any; From 05522459752e6eee6c83c5ad8c61b587f7999a74 Mon Sep 17 00:00:00 2001 From: Mihail Novikov Date: Fri, 11 Jan 2019 15:29:33 +0300 Subject: [PATCH 003/924] Revert code formatting --- types/react-table/index.d.ts | 91 ++++++++++++------------------------ 1 file changed, 30 insertions(+), 61 deletions(-) diff --git a/types/react-table/index.d.ts b/types/react-table/index.d.ts index ac0fc16e6d..bc6347ae8a 100644 --- a/types/react-table/index.d.ts +++ b/types/react-table/index.d.ts @@ -13,53 +13,21 @@ export type ReactTableFunction = (value?: any) => void; export type AccessorFunction = (row: D) => any; export type Accessor = string | string[] | AccessorFunction; export type Aggregator = (values: any, rows: any) => any; -export type TableCellRenderer = - | ((cellInfo: CellInfo, column: any) => React.ReactNode) - | React.ReactNode; -export type FilterRender = ( - params: { column: Column; filter: any; onChange: ReactTableFunction; key?: string } -) => React.ReactElement; -export type PivotRenderer = - | ((cellInfo: CellInfo) => React.ReactNode) - | (() => any) - | string - | React.ReactNode; +export type TableCellRenderer = ((cellInfo: CellInfo, column: any) => React.ReactNode) | React.ReactNode; +export type FilterRender = (params: { column: Column, filter: any, onChange: ReactTableFunction, key?: string }) => React.ReactElement; +export type PivotRenderer = ((cellInfo: CellInfo) => React.ReactNode) | (() => any) | string | React.ReactNode; -export type ComponentPropsGetter0 = ( - finalState: any, - rowInfo: undefined, - column: undefined, - instance?: any -) => object | undefined; -export type ComponentPropsGetterR = ( - finalState: any, - rowInfo?: RowInfo, - column?: undefined, - instance?: any -) => object | undefined; -export type ComponentPropsGetterC = ( - finalState: any, - rowInfo?: undefined, - column?: Column, - instance?: any -) => object | undefined; -export type ComponentPropsGetterRC = ( - finalState: any, - rowInfo?: RowInfo, - column?: Column, - instance?: any -) => object | undefined; +export type ComponentPropsGetter0 = (finalState: any, rowInfo: undefined, column: undefined, instance?: any) => object | undefined; +export type ComponentPropsGetterR = (finalState: any, rowInfo?: RowInfo, column?: undefined, instance?: any) => object | undefined; +export type ComponentPropsGetterC = (finalState: any, rowInfo?: undefined, column?: Column, instance?: any) => object | undefined; +export type ComponentPropsGetterRC = (finalState: any, rowInfo?: RowInfo, column?: Column, instance?: any) => object | undefined; export type DefaultFilterFunction = (filter: Filter, row: any, column: any) => boolean; export type FilterFunction = (filter: Filter, rows: any[], column: any) => any[]; export type SubComponentFunction = (rowInfo: RowInfo) => React.ReactNode; export type PageChangeFunction = (page: number) => void; export type PageSizeChangeFunction = (newPageSize: number, newPage: number) => void; -export type SortedChangeFunction = ( - newSorted: SortingRule[], - column: any, - additive: boolean -) => void; +export type SortedChangeFunction = (newSorted: SortingRule[], column: any, additive: boolean) => void; export type FilteredChangeFunction = (newFiltering: Filter[], column: any, value: any) => void; export type ExpandedChangeFunction = (column: any, event: any, isTouch: boolean) => void; export type ResizedChangeFunction = (newResized: Resize[], event: any) => void; @@ -80,13 +48,13 @@ export interface SortingRule { desc: boolean; } -export interface TableProps - extends Partial, - Partial, - Partial, - Partial, - Partial, - Partial { +export interface TableProps extends + Partial, + Partial, + Partial, + Partial, + Partial, + Partial { /** Default: [] */ data: D[]; @@ -413,12 +381,13 @@ export interface TextProps { rowsText: string; } -export interface GlobalColumn - extends Column.Basics, - Column.CellProps, - Column.FilterProps, - Column.FooterProps, - Column.HeaderProps {} +export interface GlobalColumn extends + Column.Basics, + Column.CellProps, + Column.FilterProps, + Column.FooterProps, + Column.HeaderProps { +} export namespace Column { /** Basic column props */ @@ -587,12 +556,12 @@ export interface PivotDefaults { render: TableCellRenderer; } -export interface Column - extends Partial, - Partial, - Partial, - Partial, - Partial { +export interface Column extends + Partial, + Partial, + Partial, + Partial, + Partial { /** * Property name as string or Accessor * @example: 'myProperty' @@ -701,7 +670,7 @@ export interface RowInfo { original: any; } -export interface CellInfo extends RowInfo, Pick { +export interface CellInfo extends RowInfo, Pick { /* true if this row is expanded */ isExpanded: boolean; @@ -759,7 +728,7 @@ export interface FinalState extends TableProps { } export const ReactTableDefaults: TableProps; -export default class ReactTable extends React.Component>> {} +export default class ReactTable extends React.Component>> { } export interface Instance extends ReactTable { context: any; From c2e5d91390ab6a6e52c919bc7c3dfd8b3f126d64 Mon Sep 17 00:00:00 2001 From: Max Bo Date: Wed, 16 Jan 2019 11:23:08 +1100 Subject: [PATCH 004/924] Update react-google-recaptcha types - Added the `onErrored?: () => void;` prop, with description sourced from https://developers.google.com/recaptcha/docs/display --- types/react-google-recaptcha/index.d.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/types/react-google-recaptcha/index.d.ts b/types/react-google-recaptcha/index.d.ts index 6636e6c5b6..b705aaf8f6 100644 --- a/types/react-google-recaptcha/index.d.ts +++ b/types/react-google-recaptcha/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for React Google Recaptcha 0.10 +// Type definitions for React Google Recaptcha 1.0 // Project: https://github.com/dozoisch/react-google-recaptcha // Definitions by: Koala Human , Tom Sturge // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -66,6 +66,12 @@ export interface ReCAPTCHAProps { * Optional callback, called when a challenge expires and has to be redone by the user. */ onExpired?: () => void; + /** + * Optional callback, called when reCAPTCHA encounters an error (usually network connectivity) + * and cannot continue until connectivity is restored. If you specify a function here, you are + * responsible for informing the user that they should retry. + */ + onErrored?: () => void; /** * Optional set the stoken parameter, which allows the captcha to be used from different domains, * @see reCAPTCHA secure-token From 1cb13b7179f16845d5da3c99e00e06eafcf9eb54 Mon Sep 17 00:00:00 2001 From: Antonio Pavlinovic Date: Mon, 4 Feb 2019 11:07:51 +0100 Subject: [PATCH 005/924] Adds elo-rank typings --- types/elo-rank/elo-rank-tests.ts | 7 +++++++ types/elo-rank/index.d.ts | 14 ++++++++++++++ types/elo-rank/tsconfig.json | 22 ++++++++++++++++++++++ types/elo-rank/tslint.json | 1 + 4 files changed, 44 insertions(+) create mode 100644 types/elo-rank/elo-rank-tests.ts create mode 100644 types/elo-rank/index.d.ts create mode 100644 types/elo-rank/tsconfig.json create mode 100644 types/elo-rank/tslint.json diff --git a/types/elo-rank/elo-rank-tests.ts b/types/elo-rank/elo-rank-tests.ts new file mode 100644 index 0000000000..7cf7955a14 --- /dev/null +++ b/types/elo-rank/elo-rank-tests.ts @@ -0,0 +1,7 @@ +import EloRank from 'elo-rank'; + +var test = new EloRank(); + +test.getKFactor(); // $ExpectType number +test.getExpected(1200, 1500); // $ExpectType number +test.updateRating(test.getExpected(1200, 1500), 1300, 1500); // $ExpectType number \ No newline at end of file diff --git a/types/elo-rank/index.d.ts b/types/elo-rank/index.d.ts new file mode 100644 index 0000000000..c2a797cbcb --- /dev/null +++ b/types/elo-rank/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for elo-rank 1.0 +// Project: https://github.com/dmamills/elo-rank#readme +// Definitions by: Antonio Pavlinovic +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export class EloRank { + constructor(kFactor?: number); + + setKFactor(kFactor: number): void; + getKFactor(): number; + getExpected(a: number, b: number): number; + + updateRating(expected: number, actual: number, current: number): number; +} diff --git a/types/elo-rank/tsconfig.json b/types/elo-rank/tsconfig.json new file mode 100644 index 0000000000..7ec166bf13 --- /dev/null +++ b/types/elo-rank/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", + "elo-rank-tests.ts" + ] +} diff --git a/types/elo-rank/tslint.json b/types/elo-rank/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/elo-rank/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 04a782f4b0342f452ce09ee8cd39af8563ee1a52 Mon Sep 17 00:00:00 2001 From: Antonio Pavlinovic Date: Mon, 4 Feb 2019 12:11:30 +0100 Subject: [PATCH 006/924] strictFunctionTypes set to true --- types/elo-rank/index.d.ts | 2 +- types/elo-rank/tsconfig.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/types/elo-rank/index.d.ts b/types/elo-rank/index.d.ts index c2a797cbcb..d3265cb15b 100644 --- a/types/elo-rank/index.d.ts +++ b/types/elo-rank/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Antonio Pavlinovic // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -export class EloRank { +export default class EloRank { constructor(kFactor?: number); setKFactor(kFactor: number): void; diff --git a/types/elo-rank/tsconfig.json b/types/elo-rank/tsconfig.json index 7ec166bf13..2ebd08f352 100644 --- a/types/elo-rank/tsconfig.json +++ b/types/elo-rank/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" From 8ab5b5ff732a1d9a8cc47c3a11c08e2a36c7b31e Mon Sep 17 00:00:00 2001 From: Antonio Pavlinovic Date: Mon, 4 Feb 2019 12:18:03 +0100 Subject: [PATCH 007/924] Fixing lint errors --- types/elo-rank/elo-rank-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/elo-rank/elo-rank-tests.ts b/types/elo-rank/elo-rank-tests.ts index 7cf7955a14..ce5f70dd2e 100644 --- a/types/elo-rank/elo-rank-tests.ts +++ b/types/elo-rank/elo-rank-tests.ts @@ -1,6 +1,6 @@ import EloRank from 'elo-rank'; -var test = new EloRank(); +const test = new EloRank(); test.getKFactor(); // $ExpectType number test.getExpected(1200, 1500); // $ExpectType number From cdd038c9d44acf8f20fe31233c66be4fab8e16f3 Mon Sep 17 00:00:00 2001 From: Antonio Pavlinovic Date: Mon, 4 Feb 2019 12:20:24 +0100 Subject: [PATCH 008/924] Fix tslint errors --- types/elo-rank/elo-rank-tests.ts | 2 +- types/elo-rank/index.d.ts | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/types/elo-rank/elo-rank-tests.ts b/types/elo-rank/elo-rank-tests.ts index ce5f70dd2e..2d3c40ad14 100644 --- a/types/elo-rank/elo-rank-tests.ts +++ b/types/elo-rank/elo-rank-tests.ts @@ -4,4 +4,4 @@ const test = new EloRank(); test.getKFactor(); // $ExpectType number test.getExpected(1200, 1500); // $ExpectType number -test.updateRating(test.getExpected(1200, 1500), 1300, 1500); // $ExpectType number \ No newline at end of file +test.updateRating(test.getExpected(1200, 1500), 1300, 1500); // $ExpectType number diff --git a/types/elo-rank/index.d.ts b/types/elo-rank/index.d.ts index d3265cb15b..b702e6bd9a 100644 --- a/types/elo-rank/index.d.ts +++ b/types/elo-rank/index.d.ts @@ -5,10 +5,8 @@ export default class EloRank { constructor(kFactor?: number); - setKFactor(kFactor: number): void; getKFactor(): number; getExpected(a: number, b: number): number; - updateRating(expected: number, actual: number, current: number): number; } From 19e524a21c3f8d6cf2ef097b429146e0299d1db7 Mon Sep 17 00:00:00 2001 From: Antonio Pavlinovic Date: Thu, 7 Feb 2019 14:53:54 +0100 Subject: [PATCH 009/924] Fixes export default --- types/elo-rank/elo-rank-tests.ts | 2 +- types/elo-rank/index.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/elo-rank/elo-rank-tests.ts b/types/elo-rank/elo-rank-tests.ts index 2d3c40ad14..2e53764042 100644 --- a/types/elo-rank/elo-rank-tests.ts +++ b/types/elo-rank/elo-rank-tests.ts @@ -1,4 +1,4 @@ -import EloRank from 'elo-rank'; +import { EloRank } from "elo-rank"; const test = new EloRank(); diff --git a/types/elo-rank/index.d.ts b/types/elo-rank/index.d.ts index b702e6bd9a..c9e6178750 100644 --- a/types/elo-rank/index.d.ts +++ b/types/elo-rank/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Antonio Pavlinovic // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -export default class EloRank { +export class EloRank { constructor(kFactor?: number); setKFactor(kFactor: number): void; getKFactor(): number; From 8b70ba807f8182852d62fdd6aafdfad7f2572c59 Mon Sep 17 00:00:00 2001 From: JMH Date: Sat, 9 Feb 2019 10:48:29 -0600 Subject: [PATCH 010/924] [detox] remove detox as named export, make it a default export instead --- types/detox/index.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/detox/index.d.ts b/types/detox/index.d.ts index 977f32e249..4a81cf3dbc 100644 --- a/types/detox/index.d.ts +++ b/types/detox/index.d.ts @@ -434,10 +434,12 @@ declare global { } } -export { by, detox, device, element, waitFor }; +export { by, device, element, waitFor }; // Not exporting the global `expect` from the top of the file here // because `expect` conflicts with the global `expect` of jest and // therefore exporting it doesn't work. The global `expect` is kept // for backwards compatibility though. export const expect: Detox.Expect>; + +export default detox; From f794cf4dead09652eae471fd751260dad97bb0a7 Mon Sep 17 00:00:00 2001 From: JMH Date: Sat, 9 Feb 2019 10:49:44 -0600 Subject: [PATCH 011/924] [detox] Add test for importing default export --- types/detox/test/detox-jest-setup-tests.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/detox/test/detox-jest-setup-tests.ts b/types/detox/test/detox-jest-setup-tests.ts index 7a2a9a3901..c0b1ea2127 100644 --- a/types/detox/test/detox-jest-setup-tests.ts +++ b/types/detox/test/detox-jest-setup-tests.ts @@ -2,6 +2,7 @@ declare var beforeAll: (callback: () => void) => void; declare var beforeEach: (callback: () => void) => void; declare var afterAll: (callback: () => void) => void; +import defaultDetox from "detox"; import adapter from "detox/runners/jest/adapter"; // Normally the Detox configuration from the project's package.json like so: @@ -18,7 +19,7 @@ beforeAll(async () => { initGlobals: false, launchApp: false, }; - await detox.init(config, initOptions); + await defaultDetox.init(config, initOptions); }); beforeEach(async () => { From 0aaf38806d1838ad54bf9cc4530447650760292a Mon Sep 17 00:00:00 2001 From: supaiku Date: Mon, 11 Feb 2019 03:27:17 +0100 Subject: [PATCH 012/924] fix: export default --- types/animejs/animejs-tests.ts | 2 +- types/animejs/index.d.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/types/animejs/animejs-tests.ts b/types/animejs/animejs-tests.ts index 697c79f738..926f89acc8 100644 --- a/types/animejs/animejs-tests.ts +++ b/types/animejs/animejs-tests.ts @@ -1,4 +1,4 @@ -import * as anime from 'animejs'; +import anime from 'animejs'; const test1 = anime({ targets: 'div', diff --git a/types/animejs/index.d.ts b/types/animejs/index.d.ts index 069187b15e..bbfb21963b 100644 --- a/types/animejs/index.d.ts +++ b/types/animejs/index.d.ts @@ -133,5 +133,4 @@ declare namespace anime { declare function anime(params: anime.AnimeParams): anime.AnimeInstance; -export = anime; -export as namespace anime; +export default anime; From cc7c708a5b30715c562af232cb5d4096e5e40aec Mon Sep 17 00:00:00 2001 From: Antonio Pavlinovic Date: Mon, 11 Feb 2019 11:14:09 +0100 Subject: [PATCH 013/924] Export changes --- types/elo-rank/index.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/elo-rank/index.d.ts b/types/elo-rank/index.d.ts index c9e6178750..2a1f63c7ff 100644 --- a/types/elo-rank/index.d.ts +++ b/types/elo-rank/index.d.ts @@ -3,10 +3,12 @@ // Definitions by: Antonio Pavlinovic // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -export class EloRank { +declare class EloRank { constructor(kFactor?: number); setKFactor(kFactor: number): void; getKFactor(): number; getExpected(a: number, b: number): number; updateRating(expected: number, actual: number, current: number): number; } + +export = EloRank; \ No newline at end of file From c748258bfb7000ad864d6d8cb01a30710471938a Mon Sep 17 00:00:00 2001 From: Antonio Pavlinovic Date: Mon, 11 Feb 2019 11:44:28 +0100 Subject: [PATCH 014/924] Fixing build --- types/elo-rank/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/elo-rank/index.d.ts b/types/elo-rank/index.d.ts index 2a1f63c7ff..df0cd09c9e 100644 --- a/types/elo-rank/index.d.ts +++ b/types/elo-rank/index.d.ts @@ -11,4 +11,4 @@ declare class EloRank { updateRating(expected: number, actual: number, current: number): number; } -export = EloRank; \ No newline at end of file +export = EloRank; From 353f6026f11ca58ff2629b8e57d5d2513a3bb654 Mon Sep 17 00:00:00 2001 From: Antonio Pavlinovic Date: Mon, 11 Feb 2019 12:21:36 +0100 Subject: [PATCH 015/924] Testing CI --- types/elo-rank/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/elo-rank/index.d.ts b/types/elo-rank/index.d.ts index df0cd09c9e..541d070394 100644 --- a/types/elo-rank/index.d.ts +++ b/types/elo-rank/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Antonio Pavlinovic // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare class EloRank { +class EloRank { constructor(kFactor?: number); setKFactor(kFactor: number): void; getKFactor(): number; From aefa57eaf893873aef0b36b9ec7dbac2a436ed36 Mon Sep 17 00:00:00 2001 From: Antonio Pavlinovic Date: Mon, 11 Feb 2019 12:25:54 +0100 Subject: [PATCH 016/924] Changes needed for exports --- types/elo-rank/elo-rank-tests.ts | 2 +- types/elo-rank/index.d.ts | 2 +- types/elo-rank/tsconfig.json | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/types/elo-rank/elo-rank-tests.ts b/types/elo-rank/elo-rank-tests.ts index 2e53764042..4032d46f0a 100644 --- a/types/elo-rank/elo-rank-tests.ts +++ b/types/elo-rank/elo-rank-tests.ts @@ -1,4 +1,4 @@ -import { EloRank } from "elo-rank"; +import EloRank from "elo-rank"; const test = new EloRank(); diff --git a/types/elo-rank/index.d.ts b/types/elo-rank/index.d.ts index 541d070394..df0cd09c9e 100644 --- a/types/elo-rank/index.d.ts +++ b/types/elo-rank/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Antonio Pavlinovic // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -class EloRank { +declare class EloRank { constructor(kFactor?: number); setKFactor(kFactor: number): void; getKFactor(): number; diff --git a/types/elo-rank/tsconfig.json b/types/elo-rank/tsconfig.json index 2ebd08f352..21cf1d2f88 100644 --- a/types/elo-rank/tsconfig.json +++ b/types/elo-rank/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", From 624cbdaa3e2476934ada28aadf26aec29d813ecc Mon Sep 17 00:00:00 2001 From: Antonio Pavlinovic Date: Mon, 11 Feb 2019 14:35:42 +0100 Subject: [PATCH 017/924] Typescript 2.7 --- types/elo-rank/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/elo-rank/index.d.ts b/types/elo-rank/index.d.ts index df0cd09c9e..25f046cbd3 100644 --- a/types/elo-rank/index.d.ts +++ b/types/elo-rank/index.d.ts @@ -2,8 +2,9 @@ // Project: https://github.com/dmamills/elo-rank#readme // Definitions by: Antonio Pavlinovic // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.7 -declare class EloRank { +class EloRank { constructor(kFactor?: number); setKFactor(kFactor: number): void; getKFactor(): number; From 4f37515efcd0647c86a1f88d97a159104f71c774 Mon Sep 17 00:00:00 2001 From: tylerprice1 <33133203+tylerprice1@users.noreply.github.com> Date: Mon, 11 Feb 2019 17:11:53 -0500 Subject: [PATCH 018/924] Update index.d.ts --- types/jasmine-data_driven_tests/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/jasmine-data_driven_tests/index.d.ts b/types/jasmine-data_driven_tests/index.d.ts index 6e6a070eaa..7c9a4d148c 100644 --- a/types/jasmine-data_driven_tests/index.d.ts +++ b/types/jasmine-data_driven_tests/index.d.ts @@ -6,6 +6,8 @@ declare var all: JasmineDataDrivenTest; declare var xall: JasmineDataDrivenTest; +declare var using: JasmineDataDrivenTest; +declare var xusing: JasmineDataDrivenTest; interface JasmineDataDrivenTest { ( From d35f65ac1410e3effb48be44de8615c5da53484b Mon Sep 17 00:00:00 2001 From: Antonio Pavlinovic Date: Tue, 12 Feb 2019 11:36:04 +0100 Subject: [PATCH 019/924] Typescript madness --- types/elo-rank/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/elo-rank/index.d.ts b/types/elo-rank/index.d.ts index 25f046cbd3..489be40fdc 100644 --- a/types/elo-rank/index.d.ts +++ b/types/elo-rank/index.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.7 -class EloRank { +declare class EloRank { constructor(kFactor?: number); setKFactor(kFactor: number): void; getKFactor(): number; From 3a137a2977475fd4d5b0ce54ec3a9c1ba936ca2c Mon Sep 17 00:00:00 2001 From: lukostry Date: Wed, 13 Feb 2019 14:23:38 +0100 Subject: [PATCH 020/924] Add definitions for ink-select-input --- types/ink-select-input/index.d.ts | 23 ++++++++++++++++ .../ink-select-input-tests.tsx | 27 +++++++++++++++++++ types/ink-select-input/tsconfig.json | 24 +++++++++++++++++ types/ink-select-input/tslint.json | 1 + 4 files changed, 75 insertions(+) create mode 100644 types/ink-select-input/index.d.ts create mode 100644 types/ink-select-input/ink-select-input-tests.tsx create mode 100644 types/ink-select-input/tsconfig.json create mode 100644 types/ink-select-input/tslint.json diff --git a/types/ink-select-input/index.d.ts b/types/ink-select-input/index.d.ts new file mode 100644 index 0000000000..2dc38d2a86 --- /dev/null +++ b/types/ink-select-input/index.d.ts @@ -0,0 +1,23 @@ +// Type definitions for ink-select-input 2.0 +// Project: https://github.com/vadimdemedes/ink-select-input#readme +// Definitions by: Ɓukasz Ostrowski +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { Component, InkComponent } from 'ink'; + +export interface ItemOfSelectInput { + label: string; + value: any; +} + +export interface SelectInputProps { + focus?: boolean; + indicatorComponent?: InkComponent; + itemComponent?: InkComponent; + items?: ReadonlyArray; + limit?: number; + onSelect?: (item: T) => void; +} + +export default class SelectInput extends Component { } diff --git a/types/ink-select-input/ink-select-input-tests.tsx b/types/ink-select-input/ink-select-input-tests.tsx new file mode 100644 index 0000000000..4120cbf43e --- /dev/null +++ b/types/ink-select-input/ink-select-input-tests.tsx @@ -0,0 +1,27 @@ +/** @jsx h */ +import { h, InkComponent } from 'ink'; +import SelectInput from 'ink-select-input'; + +interface DemoItem { + label: string; + value: string; +} + +const items: ReadonlyArray = [{ + label: 'First', + value: 'first' +}, { + label: 'Second', + value: 'second' +}, { + label: 'Third', + value: 'third' +}]; + +const Demo: InkComponent = () => { + const handleSelect = (item: DemoItem) => { + console.log(item); + }; + + return ; +}; diff --git a/types/ink-select-input/tsconfig.json b/types/ink-select-input/tsconfig.json new file mode 100644 index 0000000000..4ae1e800aa --- /dev/null +++ b/types/ink-select-input/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "jsx": "react", + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ink-select-input-tests.tsx" + ] +} diff --git a/types/ink-select-input/tslint.json b/types/ink-select-input/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ink-select-input/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 206498123c51310a97798a8bfdfbe309c20173ac Mon Sep 17 00:00:00 2001 From: Walter Barbagallo Date: Wed, 13 Feb 2019 14:31:27 +0100 Subject: [PATCH 021/924] Removed wrong type reference to FormData FormData is ambiguous. It can be resolved with [lib.dom FormData interface](https://github.com/Microsoft/TypeScript/blob/v3.3.1/lib/lib.dom.d.ts#L5196), or it can break the compiler if the dom lib is not included in the compilerOptions lib. --- types/redux-form/index.d.ts | 1 + types/redux-form/lib/actions.d.ts | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/types/redux-form/index.d.ts b/types/redux-form/index.d.ts index 8997d682a8..b0229791dd 100644 --- a/types/redux-form/index.d.ts +++ b/types/redux-form/index.d.ts @@ -13,6 +13,7 @@ // Kamil Wojcik // Mohamed Shaaban // Ethan Setnik +// Walter Barbagallo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 3.0 import { diff --git a/types/redux-form/lib/actions.d.ts b/types/redux-form/lib/actions.d.ts index 955d3d3f5e..85fec56908 100644 --- a/types/redux-form/lib/actions.d.ts +++ b/types/redux-form/lib/actions.d.ts @@ -36,11 +36,11 @@ export declare function registerField(form: string, name: string, type: FieldTyp export declare function reset(form: string): FormAction; export declare function resetSection(form: string, ...sections: string[]): FormAction; export declare function startAsyncValidation(form: string): FormAction; -export declare function stopAsyncValidation(form: string, errors?: FormErrors): FormAction; +export declare function stopAsyncValidation(form: string, errors?: FormErrors): FormAction; export declare function setSubmitFailed(form: string, ...fields: string[]): FormAction; export declare function setSubmitSucceeded(form: string, ...fields: string[]): FormAction; export declare function startSubmit(form: string): FormAction; -export declare function stopSubmit(form: string, errors?: FormErrors): FormAction; +export declare function stopSubmit(form: string, errors?: FormErrors): FormAction; export declare function submit(form: string): FormAction; export declare function clearSubmit(form: string): FormAction; export declare function clearSubmitErrors(form: string): FormAction; @@ -49,8 +49,8 @@ export declare function clearFields(form: string, keepTouched: boolean, persiste export declare function touch(form: string, ...fields: string[]): FormAction; export declare function unregisterField(form: string, name: string): FormAction; export declare function untouch(form: string, ...fields: string[]): FormAction; -export declare function updateSyncErrors(from: string, syncErrors: FormErrors, error: T): FormAction; -export declare function updateSyncWarnings(form: string, syncWarnings: FormWarnings, warning: T): FormAction; +export declare function updateSyncErrors(from: string, syncErrors: FormErrors, error: T): FormAction; +export declare function updateSyncWarnings(form: string, syncWarnings: FormWarnings, warning: T): FormAction; declare const actions: { arrayInsert: typeof arrayInsert, From e3262d7e9ed71b754aeb032d2b4caa8e48b8e09c Mon Sep 17 00:00:00 2001 From: Jacob Gardner Date: Thu, 14 Feb 2019 12:37:59 -0600 Subject: [PATCH 022/924] Update to version 2.8 and fix _.get --- types/lodash-es/index.d.ts | 2 +- types/lodash.add/index.d.ts | 2 +- types/lodash.after/index.d.ts | 2 +- types/lodash.ary/index.d.ts | 2 +- types/lodash.assign/index.d.ts | 2 +- types/lodash.assignin/index.d.ts | 2 +- types/lodash.assigninwith/index.d.ts | 2 +- types/lodash.assignwith/index.d.ts | 2 +- types/lodash.at/index.d.ts | 2 +- types/lodash.attempt/index.d.ts | 2 +- types/lodash.before/index.d.ts | 2 +- types/lodash.bind/index.d.ts | 2 +- types/lodash.bindall/index.d.ts | 2 +- types/lodash.bindkey/index.d.ts | 2 +- types/lodash.camelcase/index.d.ts | 2 +- types/lodash.capitalize/index.d.ts | 2 +- types/lodash.castarray/index.d.ts | 2 +- types/lodash.ceil/index.d.ts | 2 +- types/lodash.chunk/index.d.ts | 2 +- types/lodash.clamp/index.d.ts | 2 +- types/lodash.clone/index.d.ts | 2 +- types/lodash.clonedeep/index.d.ts | 2 +- types/lodash.clonedeepwith/index.d.ts | 2 +- types/lodash.clonewith/index.d.ts | 2 +- types/lodash.compact/index.d.ts | 2 +- types/lodash.concat/index.d.ts | 2 +- types/lodash.cond/index.d.ts | 2 +- types/lodash.constant/index.d.ts | 2 +- types/lodash.countby/index.d.ts | 2 +- types/lodash.create/index.d.ts | 2 +- types/lodash.curry/index.d.ts | 2 +- types/lodash.curryright/index.d.ts | 2 +- types/lodash.debounce/index.d.ts | 2 +- types/lodash.deburr/index.d.ts | 2 +- types/lodash.defaults/index.d.ts | 2 +- types/lodash.defaultsdeep/index.d.ts | 2 +- types/lodash.defer/index.d.ts | 2 +- types/lodash.delay/index.d.ts | 2 +- types/lodash.difference/index.d.ts | 2 +- types/lodash.differenceby/index.d.ts | 2 +- types/lodash.differencewith/index.d.ts | 2 +- types/lodash.divide/index.d.ts | 2 +- types/lodash.drop/index.d.ts | 2 +- types/lodash.dropright/index.d.ts | 2 +- types/lodash.droprightwhile/index.d.ts | 2 +- types/lodash.dropwhile/index.d.ts | 2 +- types/lodash.endswith/index.d.ts | 2 +- types/lodash.eq/index.d.ts | 2 +- types/lodash.escape/index.d.ts | 2 +- types/lodash.escaperegexp/index.d.ts | 2 +- types/lodash.every/index.d.ts | 2 +- types/lodash.fill/index.d.ts | 2 +- types/lodash.filter/index.d.ts | 2 +- types/lodash.find/index.d.ts | 2 +- types/lodash.findindex/index.d.ts | 2 +- types/lodash.findkey/index.d.ts | 2 +- types/lodash.findlast/index.d.ts | 2 +- types/lodash.findlastindex/index.d.ts | 2 +- types/lodash.findlastkey/index.d.ts | 2 +- types/lodash.first/index.d.ts | 2 +- types/lodash.flatmap/index.d.ts | 2 +- types/lodash.flatmapdeep/index.d.ts | 2 +- types/lodash.flatmapdepth/index.d.ts | 2 +- types/lodash.flatten/index.d.ts | 2 +- types/lodash.flattendeep/index.d.ts | 2 +- types/lodash.flattendepth/index.d.ts | 2 +- types/lodash.flip/index.d.ts | 2 +- types/lodash.floor/index.d.ts | 2 +- types/lodash.flow/index.d.ts | 2 +- types/lodash.flowright/index.d.ts | 2 +- types/lodash.foreach/index.d.ts | 2 +- types/lodash.foreachright/index.d.ts | 2 +- types/lodash.forin/index.d.ts | 2 +- types/lodash.forinright/index.d.ts | 2 +- types/lodash.forown/index.d.ts | 2 +- types/lodash.forownright/index.d.ts | 2 +- types/lodash.frompairs/index.d.ts | 2 +- types/lodash.functions/index.d.ts | 2 +- types/lodash.functionsin/index.d.ts | 2 +- types/lodash.get/index.d.ts | 2 +- types/lodash.groupby/index.d.ts | 2 +- types/lodash.gt/index.d.ts | 2 +- types/lodash.gte/index.d.ts | 2 +- types/lodash.has/index.d.ts | 2 +- types/lodash.hasin/index.d.ts | 2 +- types/lodash.head/index.d.ts | 2 +- types/lodash.identity/index.d.ts | 2 +- types/lodash.includes/index.d.ts | 2 +- types/lodash.indexof/index.d.ts | 2 +- types/lodash.initial/index.d.ts | 2 +- types/lodash.inrange/index.d.ts | 2 +- types/lodash.intersection/index.d.ts | 2 +- types/lodash.intersectionby/index.d.ts | 2 +- types/lodash.intersectionwith/index.d.ts | 2 +- types/lodash.invert/index.d.ts | 2 +- types/lodash.invertby/index.d.ts | 2 +- types/lodash.invoke/index.d.ts | 2 +- types/lodash.invokemap/index.d.ts | 2 +- types/lodash.isarguments/index.d.ts | 2 +- types/lodash.isarray/index.d.ts | 2 +- types/lodash.isarraybuffer/index.d.ts | 2 +- types/lodash.isarraylike/index.d.ts | 2 +- types/lodash.isarraylikeobject/index.d.ts | 2 +- types/lodash.isboolean/index.d.ts | 2 +- types/lodash.isbuffer/index.d.ts | 2 +- types/lodash.isdate/index.d.ts | 2 +- types/lodash.iselement/index.d.ts | 2 +- types/lodash.isempty/index.d.ts | 2 +- types/lodash.isequal/index.d.ts | 2 +- types/lodash.isequalwith/index.d.ts | 2 +- types/lodash.iserror/index.d.ts | 2 +- types/lodash.isfinite/index.d.ts | 2 +- types/lodash.isfunction/index.d.ts | 2 +- types/lodash.isinteger/index.d.ts | 2 +- types/lodash.islength/index.d.ts | 2 +- types/lodash.ismap/index.d.ts | 2 +- types/lodash.ismatch/index.d.ts | 2 +- types/lodash.ismatchwith/index.d.ts | 2 +- types/lodash.isnan/index.d.ts | 2 +- types/lodash.isnative/index.d.ts | 2 +- types/lodash.isnil/index.d.ts | 2 +- types/lodash.isnull/index.d.ts | 2 +- types/lodash.isnumber/index.d.ts | 2 +- types/lodash.isobject/index.d.ts | 2 +- types/lodash.isobjectlike/index.d.ts | 2 +- types/lodash.isplainobject/index.d.ts | 2 +- types/lodash.isregexp/index.d.ts | 2 +- types/lodash.issafeinteger/index.d.ts | 2 +- types/lodash.isset/index.d.ts | 2 +- types/lodash.isstring/index.d.ts | 2 +- types/lodash.issymbol/index.d.ts | 2 +- types/lodash.istypedarray/index.d.ts | 2 +- types/lodash.isundefined/index.d.ts | 2 +- types/lodash.isweakmap/index.d.ts | 2 +- types/lodash.isweakset/index.d.ts | 2 +- types/lodash.iteratee/index.d.ts | 2 +- types/lodash.join/index.d.ts | 2 +- types/lodash.kebabcase/index.d.ts | 2 +- types/lodash.keyby/index.d.ts | 2 +- types/lodash.keys/index.d.ts | 2 +- types/lodash.keysin/index.d.ts | 2 +- types/lodash.last/index.d.ts | 2 +- types/lodash.lastindexof/index.d.ts | 2 +- types/lodash.lowercase/index.d.ts | 2 +- types/lodash.lowerfirst/index.d.ts | 2 +- types/lodash.lt/index.d.ts | 2 +- types/lodash.lte/index.d.ts | 2 +- types/lodash.mapkeys/index.d.ts | 2 +- types/lodash.mapvalues/index.d.ts | 2 +- types/lodash.matches/index.d.ts | 2 +- types/lodash.matchesproperty/index.d.ts | 2 +- types/lodash.max/index.d.ts | 2 +- types/lodash.maxby/index.d.ts | 2 +- types/lodash.mean/index.d.ts | 2 +- types/lodash.meanby/index.d.ts | 2 +- types/lodash.memoize/index.d.ts | 2 +- types/lodash.merge/index.d.ts | 2 +- types/lodash.mergewith/index.d.ts | 2 +- types/lodash.method/index.d.ts | 2 +- types/lodash.methodof/index.d.ts | 2 +- types/lodash.min/index.d.ts | 2 +- types/lodash.minby/index.d.ts | 2 +- types/lodash.mixin/index.d.ts | 2 +- types/lodash.negate/index.d.ts | 2 +- types/lodash.noop/index.d.ts | 2 +- types/lodash.now/index.d.ts | 2 +- types/lodash.nth/index.d.ts | 2 +- types/lodash.ntharg/index.d.ts | 2 +- types/lodash.omit/index.d.ts | 2 +- types/lodash.omitby/index.d.ts | 2 +- types/lodash.once/index.d.ts | 2 +- types/lodash.orderby/index.d.ts | 2 +- types/lodash.over/index.d.ts | 2 +- types/lodash.overargs/index.d.ts | 2 +- types/lodash.overevery/index.d.ts | 2 +- types/lodash.oversome/index.d.ts | 2 +- types/lodash.pad/index.d.ts | 2 +- types/lodash.padend/index.d.ts | 2 +- types/lodash.padstart/index.d.ts | 2 +- types/lodash.parseint/index.d.ts | 2 +- types/lodash.partial/index.d.ts | 2 +- types/lodash.partialright/index.d.ts | 2 +- types/lodash.partition/index.d.ts | 2 +- types/lodash.pick/index.d.ts | 2 +- types/lodash.pickby/index.d.ts | 2 +- types/lodash.property/index.d.ts | 2 +- types/lodash.propertyof/index.d.ts | 2 +- types/lodash.pull/index.d.ts | 2 +- types/lodash.pullall/index.d.ts | 2 +- types/lodash.pullallby/index.d.ts | 2 +- types/lodash.pullallwith/index.d.ts | 2 +- types/lodash.pullat/index.d.ts | 2 +- types/lodash.random/index.d.ts | 2 +- types/lodash.range/index.d.ts | 2 +- types/lodash.rangeright/index.d.ts | 2 +- types/lodash.rearg/index.d.ts | 2 +- types/lodash.reduce/index.d.ts | 2 +- types/lodash.reduceright/index.d.ts | 2 +- types/lodash.reject/index.d.ts | 2 +- types/lodash.remove/index.d.ts | 2 +- types/lodash.repeat/index.d.ts | 2 +- types/lodash.replace/index.d.ts | 2 +- types/lodash.rest/index.d.ts | 2 +- types/lodash.result/index.d.ts | 2 +- types/lodash.reverse/index.d.ts | 2 +- types/lodash.round/index.d.ts | 2 +- types/lodash.sample/index.d.ts | 2 +- types/lodash.samplesize/index.d.ts | 2 +- types/lodash.set/index.d.ts | 2 +- types/lodash.setwith/index.d.ts | 2 +- types/lodash.shuffle/index.d.ts | 2 +- types/lodash.size/index.d.ts | 2 +- types/lodash.slice/index.d.ts | 2 +- types/lodash.snakecase/index.d.ts | 2 +- types/lodash.some/index.d.ts | 2 +- types/lodash.sortby/index.d.ts | 2 +- types/lodash.sortedindex/index.d.ts | 2 +- types/lodash.sortedindexby/index.d.ts | 2 +- types/lodash.sortedindexof/index.d.ts | 2 +- types/lodash.sortedlastindex/index.d.ts | 2 +- types/lodash.sortedlastindexby/index.d.ts | 2 +- types/lodash.sortedlastindexof/index.d.ts | 2 +- types/lodash.sorteduniq/index.d.ts | 2 +- types/lodash.sorteduniqby/index.d.ts | 2 +- types/lodash.split/index.d.ts | 2 +- types/lodash.spread/index.d.ts | 2 +- types/lodash.startcase/index.d.ts | 2 +- types/lodash.startswith/index.d.ts | 2 +- types/lodash.subtract/index.d.ts | 2 +- types/lodash.sum/index.d.ts | 2 +- types/lodash.sumby/index.d.ts | 2 +- types/lodash.tail/index.d.ts | 2 +- types/lodash.take/index.d.ts | 2 +- types/lodash.takeright/index.d.ts | 2 +- types/lodash.takerightwhile/index.d.ts | 2 +- types/lodash.takewhile/index.d.ts | 2 +- types/lodash.template/index.d.ts | 2 +- types/lodash.throttle/index.d.ts | 2 +- types/lodash.times/index.d.ts | 2 +- types/lodash.toarray/index.d.ts | 2 +- types/lodash.tofinite/index.d.ts | 2 +- types/lodash.tointeger/index.d.ts | 2 +- types/lodash.tolength/index.d.ts | 2 +- types/lodash.tolower/index.d.ts | 2 +- types/lodash.tonumber/index.d.ts | 2 +- types/lodash.topairs/index.d.ts | 2 +- types/lodash.topairsin/index.d.ts | 2 +- types/lodash.topath/index.d.ts | 2 +- types/lodash.toplainobject/index.d.ts | 2 +- types/lodash.tosafeinteger/index.d.ts | 2 +- types/lodash.tostring/index.d.ts | 2 +- types/lodash.toupper/index.d.ts | 2 +- types/lodash.transform/index.d.ts | 2 +- types/lodash.trim/index.d.ts | 2 +- types/lodash.trimend/index.d.ts | 2 +- types/lodash.trimstart/index.d.ts | 2 +- types/lodash.truncate/index.d.ts | 2 +- types/lodash.unary/index.d.ts | 2 +- types/lodash.unescape/index.d.ts | 2 +- types/lodash.union/index.d.ts | 2 +- types/lodash.unionby/index.d.ts | 2 +- types/lodash.unionwith/index.d.ts | 2 +- types/lodash.uniq/index.d.ts | 2 +- types/lodash.uniqby/index.d.ts | 2 +- types/lodash.uniqueid/index.d.ts | 2 +- types/lodash.uniqwith/index.d.ts | 2 +- types/lodash.unset/index.d.ts | 2 +- types/lodash.unzip/index.d.ts | 2 +- types/lodash.unzipwith/index.d.ts | 2 +- types/lodash.update/index.d.ts | 2 +- types/lodash.updatewith/index.d.ts | 2 +- types/lodash.uppercase/index.d.ts | 2 +- types/lodash.upperfirst/index.d.ts | 2 +- types/lodash.values/index.d.ts | 2 +- types/lodash.valuesin/index.d.ts | 2 +- types/lodash.without/index.d.ts | 2 +- types/lodash.words/index.d.ts | 2 +- types/lodash.wrap/index.d.ts | 2 +- types/lodash.xor/index.d.ts | 2 +- types/lodash.xorby/index.d.ts | 2 +- types/lodash.xorwith/index.d.ts | 2 +- types/lodash.zip/index.d.ts | 2 +- types/lodash.zipobject/index.d.ts | 2 +- types/lodash.zipobjectdeep/index.d.ts | 2 +- types/lodash.zipwith/index.d.ts | 2 +- types/lodash/common/object.d.ts | 4 ++-- types/lodash/index.d.ts | 2 +- types/lodash/scripts/generate-modules.ts | 2 +- 288 files changed, 289 insertions(+), 289 deletions(-) diff --git a/types/lodash-es/index.d.ts b/types/lodash-es/index.d.ts index 61eb6016ee..1b1aefab48 100644 --- a/types/lodash-es/index.d.ts +++ b/types/lodash-es/index.d.ts @@ -2,7 +2,7 @@ // Project: http://lodash.com/, https://lodash.com/custom-builds // Definitions by: Stephen Lautier , e-cloud // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 export { default as add } from "./add"; export { default as after } from "./after"; diff --git a/types/lodash.add/index.d.ts b/types/lodash.add/index.d.ts index 742a2fc000..772346a2d0 100644 --- a/types/lodash.add/index.d.ts +++ b/types/lodash.add/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.after/index.d.ts b/types/lodash.after/index.d.ts index 48adaf8994..6656fce6bb 100644 --- a/types/lodash.after/index.d.ts +++ b/types/lodash.after/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.ary/index.d.ts b/types/lodash.ary/index.d.ts index d442d3ad4d..989aa725a5 100644 --- a/types/lodash.ary/index.d.ts +++ b/types/lodash.ary/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.assign/index.d.ts b/types/lodash.assign/index.d.ts index 549fb7af74..0630a711ff 100644 --- a/types/lodash.assign/index.d.ts +++ b/types/lodash.assign/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.assignin/index.d.ts b/types/lodash.assignin/index.d.ts index 34e644c6b9..1c816068a1 100644 --- a/types/lodash.assignin/index.d.ts +++ b/types/lodash.assignin/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.assigninwith/index.d.ts b/types/lodash.assigninwith/index.d.ts index ba48574c0d..0068b84dd0 100644 --- a/types/lodash.assigninwith/index.d.ts +++ b/types/lodash.assigninwith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.assignwith/index.d.ts b/types/lodash.assignwith/index.d.ts index b88032631e..609055f4c1 100644 --- a/types/lodash.assignwith/index.d.ts +++ b/types/lodash.assignwith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.at/index.d.ts b/types/lodash.at/index.d.ts index a307f84553..d2b42c712b 100644 --- a/types/lodash.at/index.d.ts +++ b/types/lodash.at/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.attempt/index.d.ts b/types/lodash.attempt/index.d.ts index 71b89a092f..380c968a6a 100644 --- a/types/lodash.attempt/index.d.ts +++ b/types/lodash.attempt/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.before/index.d.ts b/types/lodash.before/index.d.ts index f19139a5ee..d3709654fe 100644 --- a/types/lodash.before/index.d.ts +++ b/types/lodash.before/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.bind/index.d.ts b/types/lodash.bind/index.d.ts index e90ebaa4c1..cab39bbda7 100644 --- a/types/lodash.bind/index.d.ts +++ b/types/lodash.bind/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.bindall/index.d.ts b/types/lodash.bindall/index.d.ts index 4a4cb0de76..82e411a336 100644 --- a/types/lodash.bindall/index.d.ts +++ b/types/lodash.bindall/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.bindkey/index.d.ts b/types/lodash.bindkey/index.d.ts index 86c9c13672..039ed71905 100644 --- a/types/lodash.bindkey/index.d.ts +++ b/types/lodash.bindkey/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.camelcase/index.d.ts b/types/lodash.camelcase/index.d.ts index 6fbedc08d6..a9beabf396 100644 --- a/types/lodash.camelcase/index.d.ts +++ b/types/lodash.camelcase/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.capitalize/index.d.ts b/types/lodash.capitalize/index.d.ts index fbe1b177ee..61843a4996 100644 --- a/types/lodash.capitalize/index.d.ts +++ b/types/lodash.capitalize/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.castarray/index.d.ts b/types/lodash.castarray/index.d.ts index 41e53aecff..733fb69735 100644 --- a/types/lodash.castarray/index.d.ts +++ b/types/lodash.castarray/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.ceil/index.d.ts b/types/lodash.ceil/index.d.ts index d6e055af91..cb8fd23386 100644 --- a/types/lodash.ceil/index.d.ts +++ b/types/lodash.ceil/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.chunk/index.d.ts b/types/lodash.chunk/index.d.ts index c85c5c988c..652c83f8c1 100644 --- a/types/lodash.chunk/index.d.ts +++ b/types/lodash.chunk/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.clamp/index.d.ts b/types/lodash.clamp/index.d.ts index 7bc75b42e9..796172867c 100644 --- a/types/lodash.clamp/index.d.ts +++ b/types/lodash.clamp/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.clone/index.d.ts b/types/lodash.clone/index.d.ts index 62da74b22d..810ff9158b 100644 --- a/types/lodash.clone/index.d.ts +++ b/types/lodash.clone/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.clonedeep/index.d.ts b/types/lodash.clonedeep/index.d.ts index 5f25f0cfa7..9eb31632f4 100644 --- a/types/lodash.clonedeep/index.d.ts +++ b/types/lodash.clonedeep/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.clonedeepwith/index.d.ts b/types/lodash.clonedeepwith/index.d.ts index 9725303ac2..3ceef35da9 100644 --- a/types/lodash.clonedeepwith/index.d.ts +++ b/types/lodash.clonedeepwith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.clonewith/index.d.ts b/types/lodash.clonewith/index.d.ts index b02127620c..fa57374c7a 100644 --- a/types/lodash.clonewith/index.d.ts +++ b/types/lodash.clonewith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.compact/index.d.ts b/types/lodash.compact/index.d.ts index 48b4bbd7e1..3155457aa3 100644 --- a/types/lodash.compact/index.d.ts +++ b/types/lodash.compact/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.concat/index.d.ts b/types/lodash.concat/index.d.ts index 576dd6aa6b..7c31abca34 100644 --- a/types/lodash.concat/index.d.ts +++ b/types/lodash.concat/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.cond/index.d.ts b/types/lodash.cond/index.d.ts index 633e40809e..18aa811fd1 100644 --- a/types/lodash.cond/index.d.ts +++ b/types/lodash.cond/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.constant/index.d.ts b/types/lodash.constant/index.d.ts index 5122739117..d928f61e6f 100644 --- a/types/lodash.constant/index.d.ts +++ b/types/lodash.constant/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.countby/index.d.ts b/types/lodash.countby/index.d.ts index 1f569be971..b3194f1f47 100644 --- a/types/lodash.countby/index.d.ts +++ b/types/lodash.countby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.create/index.d.ts b/types/lodash.create/index.d.ts index 173f439a2f..562121278b 100644 --- a/types/lodash.create/index.d.ts +++ b/types/lodash.create/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.curry/index.d.ts b/types/lodash.curry/index.d.ts index d569ccb852..660782b829 100644 --- a/types/lodash.curry/index.d.ts +++ b/types/lodash.curry/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.curryright/index.d.ts b/types/lodash.curryright/index.d.ts index 0d13c7d705..706da25049 100644 --- a/types/lodash.curryright/index.d.ts +++ b/types/lodash.curryright/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.debounce/index.d.ts b/types/lodash.debounce/index.d.ts index 4babb92e45..d337350c38 100644 --- a/types/lodash.debounce/index.d.ts +++ b/types/lodash.debounce/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.deburr/index.d.ts b/types/lodash.deburr/index.d.ts index 103ae6f0b9..3325320abc 100644 --- a/types/lodash.deburr/index.d.ts +++ b/types/lodash.deburr/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.defaults/index.d.ts b/types/lodash.defaults/index.d.ts index 9d92dd3021..8e5745fe18 100644 --- a/types/lodash.defaults/index.d.ts +++ b/types/lodash.defaults/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.defaultsdeep/index.d.ts b/types/lodash.defaultsdeep/index.d.ts index d1f1e1aa4e..8dffb26c17 100644 --- a/types/lodash.defaultsdeep/index.d.ts +++ b/types/lodash.defaultsdeep/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.defer/index.d.ts b/types/lodash.defer/index.d.ts index 12247d6273..d09ea8f6f2 100644 --- a/types/lodash.defer/index.d.ts +++ b/types/lodash.defer/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.delay/index.d.ts b/types/lodash.delay/index.d.ts index 2ad1ff79d3..0b8ee66e74 100644 --- a/types/lodash.delay/index.d.ts +++ b/types/lodash.delay/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.difference/index.d.ts b/types/lodash.difference/index.d.ts index 9843b97496..09b032c1bb 100644 --- a/types/lodash.difference/index.d.ts +++ b/types/lodash.difference/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.differenceby/index.d.ts b/types/lodash.differenceby/index.d.ts index 24d95da85a..be5647692c 100644 --- a/types/lodash.differenceby/index.d.ts +++ b/types/lodash.differenceby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.differencewith/index.d.ts b/types/lodash.differencewith/index.d.ts index 32f51678ab..c353d4319a 100644 --- a/types/lodash.differencewith/index.d.ts +++ b/types/lodash.differencewith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.divide/index.d.ts b/types/lodash.divide/index.d.ts index 7abbafd7bd..61f5234af6 100644 --- a/types/lodash.divide/index.d.ts +++ b/types/lodash.divide/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.drop/index.d.ts b/types/lodash.drop/index.d.ts index 9eaf528d73..33d3e19039 100644 --- a/types/lodash.drop/index.d.ts +++ b/types/lodash.drop/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.dropright/index.d.ts b/types/lodash.dropright/index.d.ts index 73056b73a4..3cf5d6649a 100644 --- a/types/lodash.dropright/index.d.ts +++ b/types/lodash.dropright/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.droprightwhile/index.d.ts b/types/lodash.droprightwhile/index.d.ts index a145e956ee..8321da6b6d 100644 --- a/types/lodash.droprightwhile/index.d.ts +++ b/types/lodash.droprightwhile/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.dropwhile/index.d.ts b/types/lodash.dropwhile/index.d.ts index 7be29abfc4..4f8b336310 100644 --- a/types/lodash.dropwhile/index.d.ts +++ b/types/lodash.dropwhile/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.endswith/index.d.ts b/types/lodash.endswith/index.d.ts index d27aea64c5..6626ffd52a 100644 --- a/types/lodash.endswith/index.d.ts +++ b/types/lodash.endswith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.eq/index.d.ts b/types/lodash.eq/index.d.ts index 1e577a2dac..14d17ed08a 100644 --- a/types/lodash.eq/index.d.ts +++ b/types/lodash.eq/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.escape/index.d.ts b/types/lodash.escape/index.d.ts index 3b9b0845ad..c357bee3c3 100644 --- a/types/lodash.escape/index.d.ts +++ b/types/lodash.escape/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.escaperegexp/index.d.ts b/types/lodash.escaperegexp/index.d.ts index 5d508bf40f..17f67d618f 100644 --- a/types/lodash.escaperegexp/index.d.ts +++ b/types/lodash.escaperegexp/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.every/index.d.ts b/types/lodash.every/index.d.ts index d4443355a4..2a05255eec 100644 --- a/types/lodash.every/index.d.ts +++ b/types/lodash.every/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.fill/index.d.ts b/types/lodash.fill/index.d.ts index 21eca6cb70..59208388f6 100644 --- a/types/lodash.fill/index.d.ts +++ b/types/lodash.fill/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.filter/index.d.ts b/types/lodash.filter/index.d.ts index b7eaf4d001..cf8134b740 100644 --- a/types/lodash.filter/index.d.ts +++ b/types/lodash.filter/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.find/index.d.ts b/types/lodash.find/index.d.ts index a4723afa63..09a5a0c21d 100644 --- a/types/lodash.find/index.d.ts +++ b/types/lodash.find/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.findindex/index.d.ts b/types/lodash.findindex/index.d.ts index 04045617e0..6b237ba285 100644 --- a/types/lodash.findindex/index.d.ts +++ b/types/lodash.findindex/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.findkey/index.d.ts b/types/lodash.findkey/index.d.ts index 151b5e28d8..f102aa20d3 100644 --- a/types/lodash.findkey/index.d.ts +++ b/types/lodash.findkey/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.findlast/index.d.ts b/types/lodash.findlast/index.d.ts index e06477e488..92a91432e1 100644 --- a/types/lodash.findlast/index.d.ts +++ b/types/lodash.findlast/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.findlastindex/index.d.ts b/types/lodash.findlastindex/index.d.ts index 982b1d3880..9bf1b1eddb 100644 --- a/types/lodash.findlastindex/index.d.ts +++ b/types/lodash.findlastindex/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.findlastkey/index.d.ts b/types/lodash.findlastkey/index.d.ts index 7ce6837eb7..4563f2b91e 100644 --- a/types/lodash.findlastkey/index.d.ts +++ b/types/lodash.findlastkey/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.first/index.d.ts b/types/lodash.first/index.d.ts index cd48bdc4bf..4bd8f1e059 100644 --- a/types/lodash.first/index.d.ts +++ b/types/lodash.first/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.flatmap/index.d.ts b/types/lodash.flatmap/index.d.ts index 11cd11337b..22222c405a 100644 --- a/types/lodash.flatmap/index.d.ts +++ b/types/lodash.flatmap/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.flatmapdeep/index.d.ts b/types/lodash.flatmapdeep/index.d.ts index d4f10edf3e..55c43f881e 100644 --- a/types/lodash.flatmapdeep/index.d.ts +++ b/types/lodash.flatmapdeep/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.flatmapdepth/index.d.ts b/types/lodash.flatmapdepth/index.d.ts index 91fb6bd576..812fa36c8a 100644 --- a/types/lodash.flatmapdepth/index.d.ts +++ b/types/lodash.flatmapdepth/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.flatten/index.d.ts b/types/lodash.flatten/index.d.ts index 3689f19e15..e1d21df7fe 100644 --- a/types/lodash.flatten/index.d.ts +++ b/types/lodash.flatten/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.flattendeep/index.d.ts b/types/lodash.flattendeep/index.d.ts index 791f2b384f..79cee1753f 100644 --- a/types/lodash.flattendeep/index.d.ts +++ b/types/lodash.flattendeep/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.flattendepth/index.d.ts b/types/lodash.flattendepth/index.d.ts index 443cdc0cd0..7de6a821a2 100644 --- a/types/lodash.flattendepth/index.d.ts +++ b/types/lodash.flattendepth/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.flip/index.d.ts b/types/lodash.flip/index.d.ts index 6adfc21057..d492ebad75 100644 --- a/types/lodash.flip/index.d.ts +++ b/types/lodash.flip/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.floor/index.d.ts b/types/lodash.floor/index.d.ts index 27cfda6f21..b99f1ec111 100644 --- a/types/lodash.floor/index.d.ts +++ b/types/lodash.floor/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.flow/index.d.ts b/types/lodash.flow/index.d.ts index e6be4df9cc..5a1fe32a7b 100644 --- a/types/lodash.flow/index.d.ts +++ b/types/lodash.flow/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.flowright/index.d.ts b/types/lodash.flowright/index.d.ts index aa53e08fff..13e7b524a6 100644 --- a/types/lodash.flowright/index.d.ts +++ b/types/lodash.flowright/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.foreach/index.d.ts b/types/lodash.foreach/index.d.ts index 464cb0e867..c865bb8f27 100644 --- a/types/lodash.foreach/index.d.ts +++ b/types/lodash.foreach/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.foreachright/index.d.ts b/types/lodash.foreachright/index.d.ts index 9ad225ae54..978db0e694 100644 --- a/types/lodash.foreachright/index.d.ts +++ b/types/lodash.foreachright/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.forin/index.d.ts b/types/lodash.forin/index.d.ts index 54669de7f9..f2a1a3eca6 100644 --- a/types/lodash.forin/index.d.ts +++ b/types/lodash.forin/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.forinright/index.d.ts b/types/lodash.forinright/index.d.ts index cfa0a1843a..68973aff3b 100644 --- a/types/lodash.forinright/index.d.ts +++ b/types/lodash.forinright/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.forown/index.d.ts b/types/lodash.forown/index.d.ts index e1df00c22a..bad9b72cfd 100644 --- a/types/lodash.forown/index.d.ts +++ b/types/lodash.forown/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.forownright/index.d.ts b/types/lodash.forownright/index.d.ts index 1a349592fd..4f4a2177aa 100644 --- a/types/lodash.forownright/index.d.ts +++ b/types/lodash.forownright/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.frompairs/index.d.ts b/types/lodash.frompairs/index.d.ts index f73cb2b9dd..3789bbb735 100644 --- a/types/lodash.frompairs/index.d.ts +++ b/types/lodash.frompairs/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.functions/index.d.ts b/types/lodash.functions/index.d.ts index 40abae2872..e885cd4bb7 100644 --- a/types/lodash.functions/index.d.ts +++ b/types/lodash.functions/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.functionsin/index.d.ts b/types/lodash.functionsin/index.d.ts index 17cca60180..0ffe3755ab 100644 --- a/types/lodash.functionsin/index.d.ts +++ b/types/lodash.functionsin/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.get/index.d.ts b/types/lodash.get/index.d.ts index 7ad640da93..37aade43bd 100644 --- a/types/lodash.get/index.d.ts +++ b/types/lodash.get/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.groupby/index.d.ts b/types/lodash.groupby/index.d.ts index 9363e47b41..9c2279c767 100644 --- a/types/lodash.groupby/index.d.ts +++ b/types/lodash.groupby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.gt/index.d.ts b/types/lodash.gt/index.d.ts index 6a973547b0..2ef5f7aab9 100644 --- a/types/lodash.gt/index.d.ts +++ b/types/lodash.gt/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.gte/index.d.ts b/types/lodash.gte/index.d.ts index f968e8bb20..543e8894d1 100644 --- a/types/lodash.gte/index.d.ts +++ b/types/lodash.gte/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.has/index.d.ts b/types/lodash.has/index.d.ts index 4f917d5187..39347aa215 100644 --- a/types/lodash.has/index.d.ts +++ b/types/lodash.has/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.hasin/index.d.ts b/types/lodash.hasin/index.d.ts index ca286c6cd9..fd9674ec9d 100644 --- a/types/lodash.hasin/index.d.ts +++ b/types/lodash.hasin/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.head/index.d.ts b/types/lodash.head/index.d.ts index e26f114bf0..055cd0ac90 100644 --- a/types/lodash.head/index.d.ts +++ b/types/lodash.head/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.identity/index.d.ts b/types/lodash.identity/index.d.ts index 986c039d2e..53593f2f97 100644 --- a/types/lodash.identity/index.d.ts +++ b/types/lodash.identity/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.includes/index.d.ts b/types/lodash.includes/index.d.ts index 1b490f7aed..3efd02ba00 100644 --- a/types/lodash.includes/index.d.ts +++ b/types/lodash.includes/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.indexof/index.d.ts b/types/lodash.indexof/index.d.ts index 8102c6a697..8d6dc6dbdf 100644 --- a/types/lodash.indexof/index.d.ts +++ b/types/lodash.indexof/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.initial/index.d.ts b/types/lodash.initial/index.d.ts index 9fa9218416..62d5c9dc61 100644 --- a/types/lodash.initial/index.d.ts +++ b/types/lodash.initial/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.inrange/index.d.ts b/types/lodash.inrange/index.d.ts index 3a817d9d2d..db7dc74a0e 100644 --- a/types/lodash.inrange/index.d.ts +++ b/types/lodash.inrange/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.intersection/index.d.ts b/types/lodash.intersection/index.d.ts index 044cd6949d..35dfe76821 100644 --- a/types/lodash.intersection/index.d.ts +++ b/types/lodash.intersection/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.intersectionby/index.d.ts b/types/lodash.intersectionby/index.d.ts index a1d01a7c5d..f66da889fa 100644 --- a/types/lodash.intersectionby/index.d.ts +++ b/types/lodash.intersectionby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.intersectionwith/index.d.ts b/types/lodash.intersectionwith/index.d.ts index ff7cba542d..ae5e281b33 100644 --- a/types/lodash.intersectionwith/index.d.ts +++ b/types/lodash.intersectionwith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.invert/index.d.ts b/types/lodash.invert/index.d.ts index 112bbee8e6..024a4f6a97 100644 --- a/types/lodash.invert/index.d.ts +++ b/types/lodash.invert/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.invertby/index.d.ts b/types/lodash.invertby/index.d.ts index f7c8ef8ee7..9ad74a615c 100644 --- a/types/lodash.invertby/index.d.ts +++ b/types/lodash.invertby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.invoke/index.d.ts b/types/lodash.invoke/index.d.ts index fb979c2079..aee1886286 100644 --- a/types/lodash.invoke/index.d.ts +++ b/types/lodash.invoke/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.invokemap/index.d.ts b/types/lodash.invokemap/index.d.ts index 7cefb18454..6acb2bdf4b 100644 --- a/types/lodash.invokemap/index.d.ts +++ b/types/lodash.invokemap/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isarguments/index.d.ts b/types/lodash.isarguments/index.d.ts index 9f8704e327..d5f8290412 100644 --- a/types/lodash.isarguments/index.d.ts +++ b/types/lodash.isarguments/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isarray/index.d.ts b/types/lodash.isarray/index.d.ts index 60299a147c..efaac7606b 100644 --- a/types/lodash.isarray/index.d.ts +++ b/types/lodash.isarray/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isarraybuffer/index.d.ts b/types/lodash.isarraybuffer/index.d.ts index ddeee837b6..5fcf63deb6 100644 --- a/types/lodash.isarraybuffer/index.d.ts +++ b/types/lodash.isarraybuffer/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isarraylike/index.d.ts b/types/lodash.isarraylike/index.d.ts index 761e226f3d..a96f1d5085 100644 --- a/types/lodash.isarraylike/index.d.ts +++ b/types/lodash.isarraylike/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isarraylikeobject/index.d.ts b/types/lodash.isarraylikeobject/index.d.ts index 8a3562ef04..ffa5d3db69 100644 --- a/types/lodash.isarraylikeobject/index.d.ts +++ b/types/lodash.isarraylikeobject/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isboolean/index.d.ts b/types/lodash.isboolean/index.d.ts index 60d3b863a8..888c9da1da 100644 --- a/types/lodash.isboolean/index.d.ts +++ b/types/lodash.isboolean/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isbuffer/index.d.ts b/types/lodash.isbuffer/index.d.ts index e39e927ff1..1b0e57db15 100644 --- a/types/lodash.isbuffer/index.d.ts +++ b/types/lodash.isbuffer/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isdate/index.d.ts b/types/lodash.isdate/index.d.ts index cba12e469a..f1cfb78cbb 100644 --- a/types/lodash.isdate/index.d.ts +++ b/types/lodash.isdate/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.iselement/index.d.ts b/types/lodash.iselement/index.d.ts index 751b675421..7a54b5c77e 100644 --- a/types/lodash.iselement/index.d.ts +++ b/types/lodash.iselement/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isempty/index.d.ts b/types/lodash.isempty/index.d.ts index 92bf9b2168..736796c517 100644 --- a/types/lodash.isempty/index.d.ts +++ b/types/lodash.isempty/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isequal/index.d.ts b/types/lodash.isequal/index.d.ts index 0a00fb83ce..c2ad0dff8c 100644 --- a/types/lodash.isequal/index.d.ts +++ b/types/lodash.isequal/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isequalwith/index.d.ts b/types/lodash.isequalwith/index.d.ts index 05eaecdbd0..5703d53f84 100644 --- a/types/lodash.isequalwith/index.d.ts +++ b/types/lodash.isequalwith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.iserror/index.d.ts b/types/lodash.iserror/index.d.ts index 5e31aa33de..5bdb9e5a7a 100644 --- a/types/lodash.iserror/index.d.ts +++ b/types/lodash.iserror/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isfinite/index.d.ts b/types/lodash.isfinite/index.d.ts index 7d4874cd4a..b22a988b59 100644 --- a/types/lodash.isfinite/index.d.ts +++ b/types/lodash.isfinite/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isfunction/index.d.ts b/types/lodash.isfunction/index.d.ts index b0876bfe82..7fd82f56e3 100644 --- a/types/lodash.isfunction/index.d.ts +++ b/types/lodash.isfunction/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isinteger/index.d.ts b/types/lodash.isinteger/index.d.ts index e42d7bb1ac..381e14831f 100644 --- a/types/lodash.isinteger/index.d.ts +++ b/types/lodash.isinteger/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.islength/index.d.ts b/types/lodash.islength/index.d.ts index 86c63fd45b..7e503fa682 100644 --- a/types/lodash.islength/index.d.ts +++ b/types/lodash.islength/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.ismap/index.d.ts b/types/lodash.ismap/index.d.ts index 10ebdf8fe4..fb3f9c1c7c 100644 --- a/types/lodash.ismap/index.d.ts +++ b/types/lodash.ismap/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.ismatch/index.d.ts b/types/lodash.ismatch/index.d.ts index 6439efb285..c19458f06e 100644 --- a/types/lodash.ismatch/index.d.ts +++ b/types/lodash.ismatch/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.ismatchwith/index.d.ts b/types/lodash.ismatchwith/index.d.ts index 322b329308..6c80c60c84 100644 --- a/types/lodash.ismatchwith/index.d.ts +++ b/types/lodash.ismatchwith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isnan/index.d.ts b/types/lodash.isnan/index.d.ts index 3f2067314f..ef81584b37 100644 --- a/types/lodash.isnan/index.d.ts +++ b/types/lodash.isnan/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isnative/index.d.ts b/types/lodash.isnative/index.d.ts index eb00733bee..102f340608 100644 --- a/types/lodash.isnative/index.d.ts +++ b/types/lodash.isnative/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isnil/index.d.ts b/types/lodash.isnil/index.d.ts index fed4d9b833..1de6260b05 100644 --- a/types/lodash.isnil/index.d.ts +++ b/types/lodash.isnil/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isnull/index.d.ts b/types/lodash.isnull/index.d.ts index 73ebb73e1b..9f8dfeda80 100644 --- a/types/lodash.isnull/index.d.ts +++ b/types/lodash.isnull/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isnumber/index.d.ts b/types/lodash.isnumber/index.d.ts index 28132eb6a9..58b64fef97 100644 --- a/types/lodash.isnumber/index.d.ts +++ b/types/lodash.isnumber/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isobject/index.d.ts b/types/lodash.isobject/index.d.ts index e1e05723b8..5a25a3afab 100644 --- a/types/lodash.isobject/index.d.ts +++ b/types/lodash.isobject/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isobjectlike/index.d.ts b/types/lodash.isobjectlike/index.d.ts index 6ad791127f..b81bfe36a8 100644 --- a/types/lodash.isobjectlike/index.d.ts +++ b/types/lodash.isobjectlike/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isplainobject/index.d.ts b/types/lodash.isplainobject/index.d.ts index c76bc92a64..b285500c3c 100644 --- a/types/lodash.isplainobject/index.d.ts +++ b/types/lodash.isplainobject/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isregexp/index.d.ts b/types/lodash.isregexp/index.d.ts index 65669eed68..1a79d6b965 100644 --- a/types/lodash.isregexp/index.d.ts +++ b/types/lodash.isregexp/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.issafeinteger/index.d.ts b/types/lodash.issafeinteger/index.d.ts index 62bf5880c3..efc8de999e 100644 --- a/types/lodash.issafeinteger/index.d.ts +++ b/types/lodash.issafeinteger/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isset/index.d.ts b/types/lodash.isset/index.d.ts index 76a6789d52..44d01fc904 100644 --- a/types/lodash.isset/index.d.ts +++ b/types/lodash.isset/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isstring/index.d.ts b/types/lodash.isstring/index.d.ts index 81bcc8236a..7835175fd1 100644 --- a/types/lodash.isstring/index.d.ts +++ b/types/lodash.isstring/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.issymbol/index.d.ts b/types/lodash.issymbol/index.d.ts index 51a1313671..9837ca6d48 100644 --- a/types/lodash.issymbol/index.d.ts +++ b/types/lodash.issymbol/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.istypedarray/index.d.ts b/types/lodash.istypedarray/index.d.ts index 5721a94c58..4d81b5ecfa 100644 --- a/types/lodash.istypedarray/index.d.ts +++ b/types/lodash.istypedarray/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isundefined/index.d.ts b/types/lodash.isundefined/index.d.ts index a0f2f068fc..a9a516f63c 100644 --- a/types/lodash.isundefined/index.d.ts +++ b/types/lodash.isundefined/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isweakmap/index.d.ts b/types/lodash.isweakmap/index.d.ts index 28dc1febf5..cd754e9608 100644 --- a/types/lodash.isweakmap/index.d.ts +++ b/types/lodash.isweakmap/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isweakset/index.d.ts b/types/lodash.isweakset/index.d.ts index 72465044fd..124a9f588d 100644 --- a/types/lodash.isweakset/index.d.ts +++ b/types/lodash.isweakset/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.iteratee/index.d.ts b/types/lodash.iteratee/index.d.ts index 29e1cc29fd..5c641bbaa1 100644 --- a/types/lodash.iteratee/index.d.ts +++ b/types/lodash.iteratee/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.join/index.d.ts b/types/lodash.join/index.d.ts index 7769af5a06..e2c58c2536 100644 --- a/types/lodash.join/index.d.ts +++ b/types/lodash.join/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.kebabcase/index.d.ts b/types/lodash.kebabcase/index.d.ts index 70ca258fe0..0223fc8eb1 100644 --- a/types/lodash.kebabcase/index.d.ts +++ b/types/lodash.kebabcase/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.keyby/index.d.ts b/types/lodash.keyby/index.d.ts index e02a4dd3f5..67e5902601 100644 --- a/types/lodash.keyby/index.d.ts +++ b/types/lodash.keyby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.keys/index.d.ts b/types/lodash.keys/index.d.ts index 177620ea0c..9d804e483c 100644 --- a/types/lodash.keys/index.d.ts +++ b/types/lodash.keys/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.keysin/index.d.ts b/types/lodash.keysin/index.d.ts index 98dd57b500..f00b24fcbd 100644 --- a/types/lodash.keysin/index.d.ts +++ b/types/lodash.keysin/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.last/index.d.ts b/types/lodash.last/index.d.ts index dc2fadedb3..b2279e60d2 100644 --- a/types/lodash.last/index.d.ts +++ b/types/lodash.last/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.lastindexof/index.d.ts b/types/lodash.lastindexof/index.d.ts index 891d2ca084..7e714b06bb 100644 --- a/types/lodash.lastindexof/index.d.ts +++ b/types/lodash.lastindexof/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.lowercase/index.d.ts b/types/lodash.lowercase/index.d.ts index 05a5a0a20e..b816bde588 100644 --- a/types/lodash.lowercase/index.d.ts +++ b/types/lodash.lowercase/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.lowerfirst/index.d.ts b/types/lodash.lowerfirst/index.d.ts index 05f3e6d760..1619781afe 100644 --- a/types/lodash.lowerfirst/index.d.ts +++ b/types/lodash.lowerfirst/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.lt/index.d.ts b/types/lodash.lt/index.d.ts index c9ef9da1b9..e2d1dc8d22 100644 --- a/types/lodash.lt/index.d.ts +++ b/types/lodash.lt/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.lte/index.d.ts b/types/lodash.lte/index.d.ts index 7361ef610e..be320a60df 100644 --- a/types/lodash.lte/index.d.ts +++ b/types/lodash.lte/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.mapkeys/index.d.ts b/types/lodash.mapkeys/index.d.ts index 145fe41b89..cba5ab4abb 100644 --- a/types/lodash.mapkeys/index.d.ts +++ b/types/lodash.mapkeys/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.mapvalues/index.d.ts b/types/lodash.mapvalues/index.d.ts index 86fb63ed4d..2c13c37ee8 100644 --- a/types/lodash.mapvalues/index.d.ts +++ b/types/lodash.mapvalues/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.matches/index.d.ts b/types/lodash.matches/index.d.ts index ebdc90e017..0c265e0e21 100644 --- a/types/lodash.matches/index.d.ts +++ b/types/lodash.matches/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.matchesproperty/index.d.ts b/types/lodash.matchesproperty/index.d.ts index 533656be56..36c628043c 100644 --- a/types/lodash.matchesproperty/index.d.ts +++ b/types/lodash.matchesproperty/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.max/index.d.ts b/types/lodash.max/index.d.ts index 99aa8e2ffc..322203fc10 100644 --- a/types/lodash.max/index.d.ts +++ b/types/lodash.max/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.maxby/index.d.ts b/types/lodash.maxby/index.d.ts index 9362902bf4..8279522ee0 100644 --- a/types/lodash.maxby/index.d.ts +++ b/types/lodash.maxby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.mean/index.d.ts b/types/lodash.mean/index.d.ts index 2edd6adb1b..afadecc5c9 100644 --- a/types/lodash.mean/index.d.ts +++ b/types/lodash.mean/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.meanby/index.d.ts b/types/lodash.meanby/index.d.ts index a4305a0560..22670d65cf 100644 --- a/types/lodash.meanby/index.d.ts +++ b/types/lodash.meanby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.memoize/index.d.ts b/types/lodash.memoize/index.d.ts index 869ae4ba7d..81ecaa8bd4 100644 --- a/types/lodash.memoize/index.d.ts +++ b/types/lodash.memoize/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.merge/index.d.ts b/types/lodash.merge/index.d.ts index a757f0694e..e64484c886 100644 --- a/types/lodash.merge/index.d.ts +++ b/types/lodash.merge/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.mergewith/index.d.ts b/types/lodash.mergewith/index.d.ts index ea3ceda237..fc5915711b 100644 --- a/types/lodash.mergewith/index.d.ts +++ b/types/lodash.mergewith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.method/index.d.ts b/types/lodash.method/index.d.ts index 6d36760961..b9c0ee7168 100644 --- a/types/lodash.method/index.d.ts +++ b/types/lodash.method/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.methodof/index.d.ts b/types/lodash.methodof/index.d.ts index 057ef55108..8eb4aeb235 100644 --- a/types/lodash.methodof/index.d.ts +++ b/types/lodash.methodof/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.min/index.d.ts b/types/lodash.min/index.d.ts index e8a613f17f..15a5331e7e 100644 --- a/types/lodash.min/index.d.ts +++ b/types/lodash.min/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.minby/index.d.ts b/types/lodash.minby/index.d.ts index d9b6a58bfe..a900c32f9d 100644 --- a/types/lodash.minby/index.d.ts +++ b/types/lodash.minby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.mixin/index.d.ts b/types/lodash.mixin/index.d.ts index ff0a8975da..6ef86909af 100644 --- a/types/lodash.mixin/index.d.ts +++ b/types/lodash.mixin/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.negate/index.d.ts b/types/lodash.negate/index.d.ts index 3043694532..e28d931810 100644 --- a/types/lodash.negate/index.d.ts +++ b/types/lodash.negate/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.noop/index.d.ts b/types/lodash.noop/index.d.ts index 30a76c63ce..98decb3a5f 100644 --- a/types/lodash.noop/index.d.ts +++ b/types/lodash.noop/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.now/index.d.ts b/types/lodash.now/index.d.ts index 1cb3ed1cea..e8ba1e9ccd 100644 --- a/types/lodash.now/index.d.ts +++ b/types/lodash.now/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.nth/index.d.ts b/types/lodash.nth/index.d.ts index 5368fd7dee..940e4e06d8 100644 --- a/types/lodash.nth/index.d.ts +++ b/types/lodash.nth/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.ntharg/index.d.ts b/types/lodash.ntharg/index.d.ts index d444e2cbee..2fcbd89332 100644 --- a/types/lodash.ntharg/index.d.ts +++ b/types/lodash.ntharg/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.omit/index.d.ts b/types/lodash.omit/index.d.ts index 38d60f8538..efa2526c38 100644 --- a/types/lodash.omit/index.d.ts +++ b/types/lodash.omit/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.omitby/index.d.ts b/types/lodash.omitby/index.d.ts index 5946e410ac..aa258237f7 100644 --- a/types/lodash.omitby/index.d.ts +++ b/types/lodash.omitby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.once/index.d.ts b/types/lodash.once/index.d.ts index fbe506150b..7fca8f4016 100644 --- a/types/lodash.once/index.d.ts +++ b/types/lodash.once/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.orderby/index.d.ts b/types/lodash.orderby/index.d.ts index 2e8c5c5da4..02a4de9edf 100644 --- a/types/lodash.orderby/index.d.ts +++ b/types/lodash.orderby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.over/index.d.ts b/types/lodash.over/index.d.ts index 2d078c4853..1c77a3d71b 100644 --- a/types/lodash.over/index.d.ts +++ b/types/lodash.over/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.overargs/index.d.ts b/types/lodash.overargs/index.d.ts index 18b7024397..5ca77279e4 100644 --- a/types/lodash.overargs/index.d.ts +++ b/types/lodash.overargs/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.overevery/index.d.ts b/types/lodash.overevery/index.d.ts index 7ca277f428..d2d142abc2 100644 --- a/types/lodash.overevery/index.d.ts +++ b/types/lodash.overevery/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.oversome/index.d.ts b/types/lodash.oversome/index.d.ts index abf71cb967..a2f48b5d3f 100644 --- a/types/lodash.oversome/index.d.ts +++ b/types/lodash.oversome/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.pad/index.d.ts b/types/lodash.pad/index.d.ts index 516d851dec..c7ffc0da65 100644 --- a/types/lodash.pad/index.d.ts +++ b/types/lodash.pad/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.padend/index.d.ts b/types/lodash.padend/index.d.ts index fdaf51da25..044163e4d0 100644 --- a/types/lodash.padend/index.d.ts +++ b/types/lodash.padend/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.padstart/index.d.ts b/types/lodash.padstart/index.d.ts index a91cd5339e..f5e01e7136 100644 --- a/types/lodash.padstart/index.d.ts +++ b/types/lodash.padstart/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.parseint/index.d.ts b/types/lodash.parseint/index.d.ts index 727c8d66c7..6c34469a8c 100644 --- a/types/lodash.parseint/index.d.ts +++ b/types/lodash.parseint/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.partial/index.d.ts b/types/lodash.partial/index.d.ts index 18d68aa00a..1849abe6e4 100644 --- a/types/lodash.partial/index.d.ts +++ b/types/lodash.partial/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.partialright/index.d.ts b/types/lodash.partialright/index.d.ts index b005408404..c8fe88b0c0 100644 --- a/types/lodash.partialright/index.d.ts +++ b/types/lodash.partialright/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.partition/index.d.ts b/types/lodash.partition/index.d.ts index 8abce2b57f..7fbe400757 100644 --- a/types/lodash.partition/index.d.ts +++ b/types/lodash.partition/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.pick/index.d.ts b/types/lodash.pick/index.d.ts index e2f2df3d30..7a71bc2c30 100644 --- a/types/lodash.pick/index.d.ts +++ b/types/lodash.pick/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.pickby/index.d.ts b/types/lodash.pickby/index.d.ts index fdf61e9468..ae4e2f3581 100644 --- a/types/lodash.pickby/index.d.ts +++ b/types/lodash.pickby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.property/index.d.ts b/types/lodash.property/index.d.ts index 0701c0ef8b..979d95c2af 100644 --- a/types/lodash.property/index.d.ts +++ b/types/lodash.property/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.propertyof/index.d.ts b/types/lodash.propertyof/index.d.ts index 5c22792ce8..521dd2b560 100644 --- a/types/lodash.propertyof/index.d.ts +++ b/types/lodash.propertyof/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.pull/index.d.ts b/types/lodash.pull/index.d.ts index c9f543ff15..c07b0e40c9 100644 --- a/types/lodash.pull/index.d.ts +++ b/types/lodash.pull/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.pullall/index.d.ts b/types/lodash.pullall/index.d.ts index 7cce80257d..4fafdb508c 100644 --- a/types/lodash.pullall/index.d.ts +++ b/types/lodash.pullall/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.pullallby/index.d.ts b/types/lodash.pullallby/index.d.ts index 77adee2864..dc8848cfee 100644 --- a/types/lodash.pullallby/index.d.ts +++ b/types/lodash.pullallby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.pullallwith/index.d.ts b/types/lodash.pullallwith/index.d.ts index f11192ffbe..c636aa8fa0 100644 --- a/types/lodash.pullallwith/index.d.ts +++ b/types/lodash.pullallwith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.pullat/index.d.ts b/types/lodash.pullat/index.d.ts index 4b04d54fac..64a9117c48 100644 --- a/types/lodash.pullat/index.d.ts +++ b/types/lodash.pullat/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.random/index.d.ts b/types/lodash.random/index.d.ts index 48147b1b5a..6d922d9092 100644 --- a/types/lodash.random/index.d.ts +++ b/types/lodash.random/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.range/index.d.ts b/types/lodash.range/index.d.ts index 9ca85ee30c..66dabf2396 100644 --- a/types/lodash.range/index.d.ts +++ b/types/lodash.range/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.rangeright/index.d.ts b/types/lodash.rangeright/index.d.ts index f17168e479..7340a99329 100644 --- a/types/lodash.rangeright/index.d.ts +++ b/types/lodash.rangeright/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.rearg/index.d.ts b/types/lodash.rearg/index.d.ts index bdde2bd4af..77055518df 100644 --- a/types/lodash.rearg/index.d.ts +++ b/types/lodash.rearg/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.reduce/index.d.ts b/types/lodash.reduce/index.d.ts index f7f58198eb..e3be80b931 100644 --- a/types/lodash.reduce/index.d.ts +++ b/types/lodash.reduce/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.reduceright/index.d.ts b/types/lodash.reduceright/index.d.ts index 4fc2a4d54a..94d81edcce 100644 --- a/types/lodash.reduceright/index.d.ts +++ b/types/lodash.reduceright/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.reject/index.d.ts b/types/lodash.reject/index.d.ts index b183695eec..32586896cd 100644 --- a/types/lodash.reject/index.d.ts +++ b/types/lodash.reject/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.remove/index.d.ts b/types/lodash.remove/index.d.ts index 449e9d62de..2b8ccd14ab 100644 --- a/types/lodash.remove/index.d.ts +++ b/types/lodash.remove/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.repeat/index.d.ts b/types/lodash.repeat/index.d.ts index fcd29d00f0..3f3c7f5968 100644 --- a/types/lodash.repeat/index.d.ts +++ b/types/lodash.repeat/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.replace/index.d.ts b/types/lodash.replace/index.d.ts index b3421ff41a..6a4f26ecf1 100644 --- a/types/lodash.replace/index.d.ts +++ b/types/lodash.replace/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.rest/index.d.ts b/types/lodash.rest/index.d.ts index bcc5c5e083..3990959f1e 100644 --- a/types/lodash.rest/index.d.ts +++ b/types/lodash.rest/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.result/index.d.ts b/types/lodash.result/index.d.ts index 684c213eea..dd84bf8c63 100644 --- a/types/lodash.result/index.d.ts +++ b/types/lodash.result/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.reverse/index.d.ts b/types/lodash.reverse/index.d.ts index 72dbe9e2fe..d9dcb45151 100644 --- a/types/lodash.reverse/index.d.ts +++ b/types/lodash.reverse/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.round/index.d.ts b/types/lodash.round/index.d.ts index 7311d157ce..f0b0e6265e 100644 --- a/types/lodash.round/index.d.ts +++ b/types/lodash.round/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.sample/index.d.ts b/types/lodash.sample/index.d.ts index 2eb8119f0e..877558ce2f 100644 --- a/types/lodash.sample/index.d.ts +++ b/types/lodash.sample/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.samplesize/index.d.ts b/types/lodash.samplesize/index.d.ts index 1df16efad5..5f15be7673 100644 --- a/types/lodash.samplesize/index.d.ts +++ b/types/lodash.samplesize/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.set/index.d.ts b/types/lodash.set/index.d.ts index 686e1588bc..ee2b863bc0 100644 --- a/types/lodash.set/index.d.ts +++ b/types/lodash.set/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.setwith/index.d.ts b/types/lodash.setwith/index.d.ts index b61d8ae119..c18a224f15 100644 --- a/types/lodash.setwith/index.d.ts +++ b/types/lodash.setwith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.shuffle/index.d.ts b/types/lodash.shuffle/index.d.ts index d9374b5072..6f51221766 100644 --- a/types/lodash.shuffle/index.d.ts +++ b/types/lodash.shuffle/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.size/index.d.ts b/types/lodash.size/index.d.ts index 18c18eeced..3182d16b2c 100644 --- a/types/lodash.size/index.d.ts +++ b/types/lodash.size/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.slice/index.d.ts b/types/lodash.slice/index.d.ts index c2381806b5..17521a280d 100644 --- a/types/lodash.slice/index.d.ts +++ b/types/lodash.slice/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.snakecase/index.d.ts b/types/lodash.snakecase/index.d.ts index 7b468103ae..1f60bb6ea5 100644 --- a/types/lodash.snakecase/index.d.ts +++ b/types/lodash.snakecase/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.some/index.d.ts b/types/lodash.some/index.d.ts index 9fb21515a8..747c615db4 100644 --- a/types/lodash.some/index.d.ts +++ b/types/lodash.some/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.sortby/index.d.ts b/types/lodash.sortby/index.d.ts index 14de9ae556..cf6bccdd9b 100644 --- a/types/lodash.sortby/index.d.ts +++ b/types/lodash.sortby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.sortedindex/index.d.ts b/types/lodash.sortedindex/index.d.ts index 23a331e64a..d428632316 100644 --- a/types/lodash.sortedindex/index.d.ts +++ b/types/lodash.sortedindex/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.sortedindexby/index.d.ts b/types/lodash.sortedindexby/index.d.ts index 6fa690eb63..dc421df6fc 100644 --- a/types/lodash.sortedindexby/index.d.ts +++ b/types/lodash.sortedindexby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.sortedindexof/index.d.ts b/types/lodash.sortedindexof/index.d.ts index 1905dc923c..373c81d67f 100644 --- a/types/lodash.sortedindexof/index.d.ts +++ b/types/lodash.sortedindexof/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.sortedlastindex/index.d.ts b/types/lodash.sortedlastindex/index.d.ts index 8759590288..498ff7b018 100644 --- a/types/lodash.sortedlastindex/index.d.ts +++ b/types/lodash.sortedlastindex/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.sortedlastindexby/index.d.ts b/types/lodash.sortedlastindexby/index.d.ts index d513d18674..8cc6c8a025 100644 --- a/types/lodash.sortedlastindexby/index.d.ts +++ b/types/lodash.sortedlastindexby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.sortedlastindexof/index.d.ts b/types/lodash.sortedlastindexof/index.d.ts index 14d5656d62..4b178fd7f4 100644 --- a/types/lodash.sortedlastindexof/index.d.ts +++ b/types/lodash.sortedlastindexof/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.sorteduniq/index.d.ts b/types/lodash.sorteduniq/index.d.ts index 04af0325a0..6be5df9a27 100644 --- a/types/lodash.sorteduniq/index.d.ts +++ b/types/lodash.sorteduniq/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.sorteduniqby/index.d.ts b/types/lodash.sorteduniqby/index.d.ts index 26c838a01d..895c8a34a1 100644 --- a/types/lodash.sorteduniqby/index.d.ts +++ b/types/lodash.sorteduniqby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.split/index.d.ts b/types/lodash.split/index.d.ts index 5400e2345a..2202c761e6 100644 --- a/types/lodash.split/index.d.ts +++ b/types/lodash.split/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.spread/index.d.ts b/types/lodash.spread/index.d.ts index d96b12d1ba..a3113af5c9 100644 --- a/types/lodash.spread/index.d.ts +++ b/types/lodash.spread/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.startcase/index.d.ts b/types/lodash.startcase/index.d.ts index 2c00230290..8f1ab25a26 100644 --- a/types/lodash.startcase/index.d.ts +++ b/types/lodash.startcase/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.startswith/index.d.ts b/types/lodash.startswith/index.d.ts index fbd92b4c40..4001dbe382 100644 --- a/types/lodash.startswith/index.d.ts +++ b/types/lodash.startswith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.subtract/index.d.ts b/types/lodash.subtract/index.d.ts index 676efb6f17..7d2c052c8b 100644 --- a/types/lodash.subtract/index.d.ts +++ b/types/lodash.subtract/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.sum/index.d.ts b/types/lodash.sum/index.d.ts index b19d67a4ce..f8affc3248 100644 --- a/types/lodash.sum/index.d.ts +++ b/types/lodash.sum/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.sumby/index.d.ts b/types/lodash.sumby/index.d.ts index a5f6ac015a..6ad30c02c5 100644 --- a/types/lodash.sumby/index.d.ts +++ b/types/lodash.sumby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.tail/index.d.ts b/types/lodash.tail/index.d.ts index 51c89ef6b9..f6a7a4432c 100644 --- a/types/lodash.tail/index.d.ts +++ b/types/lodash.tail/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.take/index.d.ts b/types/lodash.take/index.d.ts index dffe621124..54c6f0aeec 100644 --- a/types/lodash.take/index.d.ts +++ b/types/lodash.take/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.takeright/index.d.ts b/types/lodash.takeright/index.d.ts index 637926a744..33b8e9fa89 100644 --- a/types/lodash.takeright/index.d.ts +++ b/types/lodash.takeright/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.takerightwhile/index.d.ts b/types/lodash.takerightwhile/index.d.ts index 376124310a..2acf63e0ed 100644 --- a/types/lodash.takerightwhile/index.d.ts +++ b/types/lodash.takerightwhile/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.takewhile/index.d.ts b/types/lodash.takewhile/index.d.ts index 8e5e2958b5..0b14c3bfa7 100644 --- a/types/lodash.takewhile/index.d.ts +++ b/types/lodash.takewhile/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.template/index.d.ts b/types/lodash.template/index.d.ts index 9060d5e979..e9acd12f83 100644 --- a/types/lodash.template/index.d.ts +++ b/types/lodash.template/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.throttle/index.d.ts b/types/lodash.throttle/index.d.ts index 0e5e2c3d79..08eaa2b832 100644 --- a/types/lodash.throttle/index.d.ts +++ b/types/lodash.throttle/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.times/index.d.ts b/types/lodash.times/index.d.ts index dfbfcb0425..1cf2a01684 100644 --- a/types/lodash.times/index.d.ts +++ b/types/lodash.times/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.toarray/index.d.ts b/types/lodash.toarray/index.d.ts index ea13431aa1..49638ccaaa 100644 --- a/types/lodash.toarray/index.d.ts +++ b/types/lodash.toarray/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.tofinite/index.d.ts b/types/lodash.tofinite/index.d.ts index 5639c9ba0f..941862c1cf 100644 --- a/types/lodash.tofinite/index.d.ts +++ b/types/lodash.tofinite/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.tointeger/index.d.ts b/types/lodash.tointeger/index.d.ts index d662ff0695..ee777f9d05 100644 --- a/types/lodash.tointeger/index.d.ts +++ b/types/lodash.tointeger/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.tolength/index.d.ts b/types/lodash.tolength/index.d.ts index a198d6cb5f..7052ee2311 100644 --- a/types/lodash.tolength/index.d.ts +++ b/types/lodash.tolength/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.tolower/index.d.ts b/types/lodash.tolower/index.d.ts index a056bef4ae..70449618ca 100644 --- a/types/lodash.tolower/index.d.ts +++ b/types/lodash.tolower/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.tonumber/index.d.ts b/types/lodash.tonumber/index.d.ts index 85587a3563..55628f487b 100644 --- a/types/lodash.tonumber/index.d.ts +++ b/types/lodash.tonumber/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.topairs/index.d.ts b/types/lodash.topairs/index.d.ts index dec1a83e18..ffe09c636b 100644 --- a/types/lodash.topairs/index.d.ts +++ b/types/lodash.topairs/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.topairsin/index.d.ts b/types/lodash.topairsin/index.d.ts index 580cd15f14..204174fa67 100644 --- a/types/lodash.topairsin/index.d.ts +++ b/types/lodash.topairsin/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.topath/index.d.ts b/types/lodash.topath/index.d.ts index 5778b4a5a8..013f65f9c9 100644 --- a/types/lodash.topath/index.d.ts +++ b/types/lodash.topath/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.toplainobject/index.d.ts b/types/lodash.toplainobject/index.d.ts index 26f7eb62b3..d16b64795f 100644 --- a/types/lodash.toplainobject/index.d.ts +++ b/types/lodash.toplainobject/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.tosafeinteger/index.d.ts b/types/lodash.tosafeinteger/index.d.ts index 5429fe3a24..b9fe0a892a 100644 --- a/types/lodash.tosafeinteger/index.d.ts +++ b/types/lodash.tosafeinteger/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.tostring/index.d.ts b/types/lodash.tostring/index.d.ts index d7aec37cf9..b60288c45b 100644 --- a/types/lodash.tostring/index.d.ts +++ b/types/lodash.tostring/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.toupper/index.d.ts b/types/lodash.toupper/index.d.ts index a19a7f2293..33838721bb 100644 --- a/types/lodash.toupper/index.d.ts +++ b/types/lodash.toupper/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.transform/index.d.ts b/types/lodash.transform/index.d.ts index 524dcce29d..a7e1105053 100644 --- a/types/lodash.transform/index.d.ts +++ b/types/lodash.transform/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.trim/index.d.ts b/types/lodash.trim/index.d.ts index 634b4f5843..2114ce53d6 100644 --- a/types/lodash.trim/index.d.ts +++ b/types/lodash.trim/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.trimend/index.d.ts b/types/lodash.trimend/index.d.ts index 5931c425c1..68c43e43ce 100644 --- a/types/lodash.trimend/index.d.ts +++ b/types/lodash.trimend/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.trimstart/index.d.ts b/types/lodash.trimstart/index.d.ts index 6e9ff19aae..e875ff46d7 100644 --- a/types/lodash.trimstart/index.d.ts +++ b/types/lodash.trimstart/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.truncate/index.d.ts b/types/lodash.truncate/index.d.ts index 640143ae7d..cf8c3e0463 100644 --- a/types/lodash.truncate/index.d.ts +++ b/types/lodash.truncate/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.unary/index.d.ts b/types/lodash.unary/index.d.ts index c1cab16bf4..a378016527 100644 --- a/types/lodash.unary/index.d.ts +++ b/types/lodash.unary/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.unescape/index.d.ts b/types/lodash.unescape/index.d.ts index 1a6c126529..c14e2e9ce1 100644 --- a/types/lodash.unescape/index.d.ts +++ b/types/lodash.unescape/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.union/index.d.ts b/types/lodash.union/index.d.ts index f8e1c3982b..53ad3cd971 100644 --- a/types/lodash.union/index.d.ts +++ b/types/lodash.union/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.unionby/index.d.ts b/types/lodash.unionby/index.d.ts index ec59f1b5c6..ee22897482 100644 --- a/types/lodash.unionby/index.d.ts +++ b/types/lodash.unionby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.unionwith/index.d.ts b/types/lodash.unionwith/index.d.ts index a724b6ed00..cbbb33d10e 100644 --- a/types/lodash.unionwith/index.d.ts +++ b/types/lodash.unionwith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.uniq/index.d.ts b/types/lodash.uniq/index.d.ts index d3fcc99bf8..46f82b7c46 100644 --- a/types/lodash.uniq/index.d.ts +++ b/types/lodash.uniq/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.uniqby/index.d.ts b/types/lodash.uniqby/index.d.ts index fdf318f2cc..7588831282 100644 --- a/types/lodash.uniqby/index.d.ts +++ b/types/lodash.uniqby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.uniqueid/index.d.ts b/types/lodash.uniqueid/index.d.ts index f0b38f23ed..57ed8587d5 100644 --- a/types/lodash.uniqueid/index.d.ts +++ b/types/lodash.uniqueid/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.uniqwith/index.d.ts b/types/lodash.uniqwith/index.d.ts index 65f00cc772..d312905e57 100644 --- a/types/lodash.uniqwith/index.d.ts +++ b/types/lodash.uniqwith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.unset/index.d.ts b/types/lodash.unset/index.d.ts index 4308337560..654f468535 100644 --- a/types/lodash.unset/index.d.ts +++ b/types/lodash.unset/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.unzip/index.d.ts b/types/lodash.unzip/index.d.ts index a0d6e933c1..4738306fe4 100644 --- a/types/lodash.unzip/index.d.ts +++ b/types/lodash.unzip/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.unzipwith/index.d.ts b/types/lodash.unzipwith/index.d.ts index 0f95c0377f..16bbed9242 100644 --- a/types/lodash.unzipwith/index.d.ts +++ b/types/lodash.unzipwith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.update/index.d.ts b/types/lodash.update/index.d.ts index 165804f25f..42c7338066 100644 --- a/types/lodash.update/index.d.ts +++ b/types/lodash.update/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.updatewith/index.d.ts b/types/lodash.updatewith/index.d.ts index 3ae0594188..45f319a1d6 100644 --- a/types/lodash.updatewith/index.d.ts +++ b/types/lodash.updatewith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.uppercase/index.d.ts b/types/lodash.uppercase/index.d.ts index fb25f87be6..fcc0bd2431 100644 --- a/types/lodash.uppercase/index.d.ts +++ b/types/lodash.uppercase/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.upperfirst/index.d.ts b/types/lodash.upperfirst/index.d.ts index f58a6853f3..3c10682234 100644 --- a/types/lodash.upperfirst/index.d.ts +++ b/types/lodash.upperfirst/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.values/index.d.ts b/types/lodash.values/index.d.ts index 9bba06f1a2..695f2edcdc 100644 --- a/types/lodash.values/index.d.ts +++ b/types/lodash.values/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.valuesin/index.d.ts b/types/lodash.valuesin/index.d.ts index 3da65eabb7..3d1a489783 100644 --- a/types/lodash.valuesin/index.d.ts +++ b/types/lodash.valuesin/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.without/index.d.ts b/types/lodash.without/index.d.ts index 624fdd8918..059ad9cd74 100644 --- a/types/lodash.without/index.d.ts +++ b/types/lodash.without/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.words/index.d.ts b/types/lodash.words/index.d.ts index 304f7c3145..d27c6304fc 100644 --- a/types/lodash.words/index.d.ts +++ b/types/lodash.words/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.wrap/index.d.ts b/types/lodash.wrap/index.d.ts index 410c955027..753d51ffd3 100644 --- a/types/lodash.wrap/index.d.ts +++ b/types/lodash.wrap/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.xor/index.d.ts b/types/lodash.xor/index.d.ts index 0426670d24..7556c23b6e 100644 --- a/types/lodash.xor/index.d.ts +++ b/types/lodash.xor/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.xorby/index.d.ts b/types/lodash.xorby/index.d.ts index d1ebbbd9fa..527c871371 100644 --- a/types/lodash.xorby/index.d.ts +++ b/types/lodash.xorby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.xorwith/index.d.ts b/types/lodash.xorwith/index.d.ts index 6adaa16d35..59f2c2c830 100644 --- a/types/lodash.xorwith/index.d.ts +++ b/types/lodash.xorwith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.zip/index.d.ts b/types/lodash.zip/index.d.ts index 3ad6804c4f..c101c378ae 100644 --- a/types/lodash.zip/index.d.ts +++ b/types/lodash.zip/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.zipobject/index.d.ts b/types/lodash.zipobject/index.d.ts index a4c0d0e444..3fa098f79a 100644 --- a/types/lodash.zipobject/index.d.ts +++ b/types/lodash.zipobject/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.zipobjectdeep/index.d.ts b/types/lodash.zipobjectdeep/index.d.ts index b942a3e4c6..6391b92bd8 100644 --- a/types/lodash.zipobjectdeep/index.d.ts +++ b/types/lodash.zipobjectdeep/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.zipwith/index.d.ts b/types/lodash.zipwith/index.d.ts index 39c39005d7..2f123f19b1 100644 --- a/types/lodash.zipwith/index.d.ts +++ b/types/lodash.zipwith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash/common/object.d.ts b/types/lodash/common/object.d.ts index b136e9469b..d36b603f42 100644 --- a/types/lodash/common/object.d.ts +++ b/types/lodash/common/object.d.ts @@ -1685,8 +1685,8 @@ declare module "../index" { get( object: TObject | null | undefined, path: TKey | [TKey], - defaultValue: TDefault - ): TObject[TKey] | TDefault; + defaultValue: TDefault, + ): Exclude | TDefault; /** * @see _.get diff --git a/types/lodash/index.d.ts b/types/lodash/index.d.ts index 94cabd0f37..45fb97d010 100644 --- a/types/lodash/index.d.ts +++ b/types/lodash/index.d.ts @@ -10,7 +10,7 @@ // Jack Moore , // Dominique Rau // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 /// /// diff --git a/types/lodash/scripts/generate-modules.ts b/types/lodash/scripts/generate-modules.ts index 28d5e585c3..523f23e6e6 100644 --- a/types/lodash/scripts/generate-modules.ts +++ b/types/lodash/scripts/generate-modules.ts @@ -56,7 +56,7 @@ async function globalDefinitionText(moduleName: string): Promise { // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// Typescript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts From ff6ca21aa5c6addcc7c99abd3e2c20e0860178d2 Mon Sep 17 00:00:00 2001 From: Jeff Held Date: Thu, 14 Feb 2019 12:40:30 -0600 Subject: [PATCH 023/924] Use export = instead of export default --- types/detox/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/detox/index.d.ts b/types/detox/index.d.ts index 4a81cf3dbc..7ac69c1e1f 100644 --- a/types/detox/index.d.ts +++ b/types/detox/index.d.ts @@ -442,4 +442,4 @@ export { by, device, element, waitFor }; // for backwards compatibility though. export const expect: Detox.Expect>; -export default detox; +export = detox; From ca8d73dbc9d57342b5dfec6fa745e1509c7d03fe Mon Sep 17 00:00:00 2001 From: Jacob Gardner Date: Thu, 14 Feb 2019 12:40:39 -0600 Subject: [PATCH 024/924] Fix TypeScript version header --- types/jest-image-snapshot/jest-image-snapshot-tests.ts | 2 +- types/lodash-es/index.d.ts | 2 +- types/lodash.add/index.d.ts | 2 +- types/lodash.after/index.d.ts | 2 +- types/lodash.ary/index.d.ts | 2 +- types/lodash.assign/index.d.ts | 2 +- types/lodash.assignin/index.d.ts | 2 +- types/lodash.assigninwith/index.d.ts | 2 +- types/lodash.assignwith/index.d.ts | 2 +- types/lodash.at/index.d.ts | 2 +- types/lodash.attempt/index.d.ts | 2 +- types/lodash.before/index.d.ts | 2 +- types/lodash.bind/index.d.ts | 2 +- types/lodash.bindall/index.d.ts | 2 +- types/lodash.bindkey/index.d.ts | 2 +- types/lodash.camelcase/index.d.ts | 2 +- types/lodash.capitalize/index.d.ts | 2 +- types/lodash.castarray/index.d.ts | 2 +- types/lodash.ceil/index.d.ts | 2 +- types/lodash.chunk/index.d.ts | 2 +- types/lodash.clamp/index.d.ts | 2 +- types/lodash.clone/index.d.ts | 2 +- types/lodash.clonedeep/index.d.ts | 2 +- types/lodash.clonedeepwith/index.d.ts | 2 +- types/lodash.clonewith/index.d.ts | 2 +- types/lodash.compact/index.d.ts | 2 +- types/lodash.concat/index.d.ts | 2 +- types/lodash.cond/index.d.ts | 2 +- types/lodash.constant/index.d.ts | 2 +- types/lodash.countby/index.d.ts | 2 +- types/lodash.create/index.d.ts | 2 +- types/lodash.curry/index.d.ts | 2 +- types/lodash.curryright/index.d.ts | 2 +- types/lodash.debounce/index.d.ts | 2 +- types/lodash.deburr/index.d.ts | 2 +- types/lodash.defaults/index.d.ts | 2 +- types/lodash.defaultsdeep/index.d.ts | 2 +- types/lodash.defer/index.d.ts | 2 +- types/lodash.delay/index.d.ts | 2 +- types/lodash.difference/index.d.ts | 2 +- types/lodash.differenceby/index.d.ts | 2 +- types/lodash.differencewith/index.d.ts | 2 +- types/lodash.divide/index.d.ts | 2 +- types/lodash.drop/index.d.ts | 2 +- types/lodash.dropright/index.d.ts | 2 +- types/lodash.droprightwhile/index.d.ts | 2 +- types/lodash.dropwhile/index.d.ts | 2 +- types/lodash.endswith/index.d.ts | 2 +- types/lodash.eq/index.d.ts | 2 +- types/lodash.escape/index.d.ts | 2 +- types/lodash.escaperegexp/index.d.ts | 2 +- types/lodash.every/index.d.ts | 2 +- types/lodash.fill/index.d.ts | 2 +- types/lodash.filter/index.d.ts | 2 +- types/lodash.find/index.d.ts | 2 +- types/lodash.findindex/index.d.ts | 2 +- types/lodash.findkey/index.d.ts | 2 +- types/lodash.findlast/index.d.ts | 2 +- types/lodash.findlastindex/index.d.ts | 2 +- types/lodash.findlastkey/index.d.ts | 2 +- types/lodash.first/index.d.ts | 2 +- types/lodash.flatmap/index.d.ts | 2 +- types/lodash.flatmapdeep/index.d.ts | 2 +- types/lodash.flatmapdepth/index.d.ts | 2 +- types/lodash.flatten/index.d.ts | 2 +- types/lodash.flattendeep/index.d.ts | 2 +- types/lodash.flattendepth/index.d.ts | 2 +- types/lodash.flip/index.d.ts | 2 +- types/lodash.floor/index.d.ts | 2 +- types/lodash.flow/index.d.ts | 2 +- types/lodash.flowright/index.d.ts | 2 +- types/lodash.foreach/index.d.ts | 2 +- types/lodash.foreachright/index.d.ts | 2 +- types/lodash.forin/index.d.ts | 2 +- types/lodash.forinright/index.d.ts | 2 +- types/lodash.forown/index.d.ts | 2 +- types/lodash.forownright/index.d.ts | 2 +- types/lodash.frompairs/index.d.ts | 2 +- types/lodash.functions/index.d.ts | 2 +- types/lodash.functionsin/index.d.ts | 2 +- types/lodash.get/index.d.ts | 2 +- types/lodash.groupby/index.d.ts | 2 +- types/lodash.gt/index.d.ts | 2 +- types/lodash.gte/index.d.ts | 2 +- types/lodash.has/index.d.ts | 2 +- types/lodash.hasin/index.d.ts | 2 +- types/lodash.head/index.d.ts | 2 +- types/lodash.identity/index.d.ts | 2 +- types/lodash.includes/index.d.ts | 2 +- types/lodash.indexof/index.d.ts | 2 +- types/lodash.initial/index.d.ts | 2 +- types/lodash.inrange/index.d.ts | 2 +- types/lodash.intersection/index.d.ts | 2 +- types/lodash.intersectionby/index.d.ts | 2 +- types/lodash.intersectionwith/index.d.ts | 2 +- types/lodash.invert/index.d.ts | 2 +- types/lodash.invertby/index.d.ts | 2 +- types/lodash.invoke/index.d.ts | 2 +- types/lodash.invokemap/index.d.ts | 2 +- types/lodash.isarguments/index.d.ts | 2 +- types/lodash.isarray/index.d.ts | 2 +- types/lodash.isarraybuffer/index.d.ts | 2 +- types/lodash.isarraylike/index.d.ts | 2 +- types/lodash.isarraylikeobject/index.d.ts | 2 +- types/lodash.isboolean/index.d.ts | 2 +- types/lodash.isbuffer/index.d.ts | 2 +- types/lodash.isdate/index.d.ts | 2 +- types/lodash.iselement/index.d.ts | 2 +- types/lodash.isempty/index.d.ts | 2 +- types/lodash.isequal/index.d.ts | 2 +- types/lodash.isequalwith/index.d.ts | 2 +- types/lodash.iserror/index.d.ts | 2 +- types/lodash.isfinite/index.d.ts | 2 +- types/lodash.isfunction/index.d.ts | 2 +- types/lodash.isinteger/index.d.ts | 2 +- types/lodash.islength/index.d.ts | 2 +- types/lodash.ismap/index.d.ts | 2 +- types/lodash.ismatch/index.d.ts | 2 +- types/lodash.ismatchwith/index.d.ts | 2 +- types/lodash.isnan/index.d.ts | 2 +- types/lodash.isnative/index.d.ts | 2 +- types/lodash.isnil/index.d.ts | 2 +- types/lodash.isnull/index.d.ts | 2 +- types/lodash.isnumber/index.d.ts | 2 +- types/lodash.isobject/index.d.ts | 2 +- types/lodash.isobjectlike/index.d.ts | 2 +- types/lodash.isplainobject/index.d.ts | 2 +- types/lodash.isregexp/index.d.ts | 2 +- types/lodash.issafeinteger/index.d.ts | 2 +- types/lodash.isset/index.d.ts | 2 +- types/lodash.isstring/index.d.ts | 2 +- types/lodash.issymbol/index.d.ts | 2 +- types/lodash.istypedarray/index.d.ts | 2 +- types/lodash.isundefined/index.d.ts | 2 +- types/lodash.isweakmap/index.d.ts | 2 +- types/lodash.isweakset/index.d.ts | 2 +- types/lodash.iteratee/index.d.ts | 2 +- types/lodash.join/index.d.ts | 2 +- types/lodash.kebabcase/index.d.ts | 2 +- types/lodash.keyby/index.d.ts | 2 +- types/lodash.keys/index.d.ts | 2 +- types/lodash.keysin/index.d.ts | 2 +- types/lodash.last/index.d.ts | 2 +- types/lodash.lastindexof/index.d.ts | 2 +- types/lodash.lowercase/index.d.ts | 2 +- types/lodash.lowerfirst/index.d.ts | 2 +- types/lodash.lt/index.d.ts | 2 +- types/lodash.lte/index.d.ts | 2 +- types/lodash.mapkeys/index.d.ts | 2 +- types/lodash.mapvalues/index.d.ts | 2 +- types/lodash.matches/index.d.ts | 2 +- types/lodash.matchesproperty/index.d.ts | 2 +- types/lodash.max/index.d.ts | 2 +- types/lodash.maxby/index.d.ts | 2 +- types/lodash.mean/index.d.ts | 2 +- types/lodash.meanby/index.d.ts | 2 +- types/lodash.memoize/index.d.ts | 2 +- types/lodash.merge/index.d.ts | 2 +- types/lodash.mergewith/index.d.ts | 2 +- types/lodash.method/index.d.ts | 2 +- types/lodash.methodof/index.d.ts | 2 +- types/lodash.min/index.d.ts | 2 +- types/lodash.minby/index.d.ts | 2 +- types/lodash.mixin/index.d.ts | 2 +- types/lodash.negate/index.d.ts | 2 +- types/lodash.noop/index.d.ts | 2 +- types/lodash.now/index.d.ts | 2 +- types/lodash.nth/index.d.ts | 2 +- types/lodash.ntharg/index.d.ts | 2 +- types/lodash.omit/index.d.ts | 2 +- types/lodash.omitby/index.d.ts | 2 +- types/lodash.once/index.d.ts | 2 +- types/lodash.orderby/index.d.ts | 2 +- types/lodash.over/index.d.ts | 2 +- types/lodash.overargs/index.d.ts | 2 +- types/lodash.overevery/index.d.ts | 2 +- types/lodash.oversome/index.d.ts | 2 +- types/lodash.pad/index.d.ts | 2 +- types/lodash.padend/index.d.ts | 2 +- types/lodash.padstart/index.d.ts | 2 +- types/lodash.parseint/index.d.ts | 2 +- types/lodash.partial/index.d.ts | 2 +- types/lodash.partialright/index.d.ts | 2 +- types/lodash.partition/index.d.ts | 2 +- types/lodash.pick/index.d.ts | 2 +- types/lodash.pickby/index.d.ts | 2 +- types/lodash.property/index.d.ts | 2 +- types/lodash.propertyof/index.d.ts | 2 +- types/lodash.pull/index.d.ts | 2 +- types/lodash.pullall/index.d.ts | 2 +- types/lodash.pullallby/index.d.ts | 2 +- types/lodash.pullallwith/index.d.ts | 2 +- types/lodash.pullat/index.d.ts | 2 +- types/lodash.random/index.d.ts | 2 +- types/lodash.range/index.d.ts | 2 +- types/lodash.rangeright/index.d.ts | 2 +- types/lodash.rearg/index.d.ts | 2 +- types/lodash.reduce/index.d.ts | 2 +- types/lodash.reduceright/index.d.ts | 2 +- types/lodash.reject/index.d.ts | 2 +- types/lodash.remove/index.d.ts | 2 +- types/lodash.repeat/index.d.ts | 2 +- types/lodash.replace/index.d.ts | 2 +- types/lodash.rest/index.d.ts | 2 +- types/lodash.result/index.d.ts | 2 +- types/lodash.reverse/index.d.ts | 2 +- types/lodash.round/index.d.ts | 2 +- types/lodash.sample/index.d.ts | 2 +- types/lodash.samplesize/index.d.ts | 2 +- types/lodash.set/index.d.ts | 2 +- types/lodash.setwith/index.d.ts | 2 +- types/lodash.shuffle/index.d.ts | 2 +- types/lodash.size/index.d.ts | 2 +- types/lodash.slice/index.d.ts | 2 +- types/lodash.snakecase/index.d.ts | 2 +- types/lodash.some/index.d.ts | 2 +- types/lodash.sortby/index.d.ts | 2 +- types/lodash.sortedindex/index.d.ts | 2 +- types/lodash.sortedindexby/index.d.ts | 2 +- types/lodash.sortedindexof/index.d.ts | 2 +- types/lodash.sortedlastindex/index.d.ts | 2 +- types/lodash.sortedlastindexby/index.d.ts | 2 +- types/lodash.sortedlastindexof/index.d.ts | 2 +- types/lodash.sorteduniq/index.d.ts | 2 +- types/lodash.sorteduniqby/index.d.ts | 2 +- types/lodash.split/index.d.ts | 2 +- types/lodash.spread/index.d.ts | 2 +- types/lodash.startcase/index.d.ts | 2 +- types/lodash.startswith/index.d.ts | 2 +- types/lodash.subtract/index.d.ts | 2 +- types/lodash.sum/index.d.ts | 2 +- types/lodash.sumby/index.d.ts | 2 +- types/lodash.tail/index.d.ts | 2 +- types/lodash.take/index.d.ts | 2 +- types/lodash.takeright/index.d.ts | 2 +- types/lodash.takerightwhile/index.d.ts | 2 +- types/lodash.takewhile/index.d.ts | 2 +- types/lodash.template/index.d.ts | 2 +- types/lodash.throttle/index.d.ts | 2 +- types/lodash.times/index.d.ts | 2 +- types/lodash.toarray/index.d.ts | 2 +- types/lodash.tofinite/index.d.ts | 2 +- types/lodash.tointeger/index.d.ts | 2 +- types/lodash.tolength/index.d.ts | 2 +- types/lodash.tolower/index.d.ts | 2 +- types/lodash.tonumber/index.d.ts | 2 +- types/lodash.topairs/index.d.ts | 2 +- types/lodash.topairsin/index.d.ts | 2 +- types/lodash.topath/index.d.ts | 2 +- types/lodash.toplainobject/index.d.ts | 2 +- types/lodash.tosafeinteger/index.d.ts | 2 +- types/lodash.tostring/index.d.ts | 2 +- types/lodash.toupper/index.d.ts | 2 +- types/lodash.transform/index.d.ts | 2 +- types/lodash.trim/index.d.ts | 2 +- types/lodash.trimend/index.d.ts | 2 +- types/lodash.trimstart/index.d.ts | 2 +- types/lodash.truncate/index.d.ts | 2 +- types/lodash.unary/index.d.ts | 2 +- types/lodash.unescape/index.d.ts | 2 +- types/lodash.union/index.d.ts | 2 +- types/lodash.unionby/index.d.ts | 2 +- types/lodash.unionwith/index.d.ts | 2 +- types/lodash.uniq/index.d.ts | 2 +- types/lodash.uniqby/index.d.ts | 2 +- types/lodash.uniqueid/index.d.ts | 2 +- types/lodash.uniqwith/index.d.ts | 2 +- types/lodash.unset/index.d.ts | 2 +- types/lodash.unzip/index.d.ts | 2 +- types/lodash.unzipwith/index.d.ts | 2 +- types/lodash.update/index.d.ts | 2 +- types/lodash.updatewith/index.d.ts | 2 +- types/lodash.uppercase/index.d.ts | 2 +- types/lodash.upperfirst/index.d.ts | 2 +- types/lodash.values/index.d.ts | 2 +- types/lodash.valuesin/index.d.ts | 2 +- types/lodash.without/index.d.ts | 2 +- types/lodash.words/index.d.ts | 2 +- types/lodash.wrap/index.d.ts | 2 +- types/lodash.xor/index.d.ts | 2 +- types/lodash.xorby/index.d.ts | 2 +- types/lodash.xorwith/index.d.ts | 2 +- types/lodash.zip/index.d.ts | 2 +- types/lodash.zipobject/index.d.ts | 2 +- types/lodash.zipobjectdeep/index.d.ts | 2 +- types/lodash.zipwith/index.d.ts | 2 +- types/lodash/scripts/generate-modules.ts | 2 +- types/office-runtime/index.d.ts | 2 +- types/websocket-async/index.d.ts | 2 +- 289 files changed, 289 insertions(+), 289 deletions(-) diff --git a/types/jest-image-snapshot/jest-image-snapshot-tests.ts b/types/jest-image-snapshot/jest-image-snapshot-tests.ts index 07f6debed7..402e505bb0 100644 --- a/types/jest-image-snapshot/jest-image-snapshot-tests.ts +++ b/types/jest-image-snapshot/jest-image-snapshot-tests.ts @@ -1,4 +1,4 @@ -// Typescript Version: 2.3 +// TypeScript Version: 2.3 import { toMatchImageSnapshot, configureToMatchImageSnapshot, MatchImageSnapshotOptions } from 'jest-image-snapshot'; it('should be able to use toMatchImageSnapshot in a test', () => { diff --git a/types/lodash-es/index.d.ts b/types/lodash-es/index.d.ts index 1b1aefab48..3e9fcfa69c 100644 --- a/types/lodash-es/index.d.ts +++ b/types/lodash-es/index.d.ts @@ -2,7 +2,7 @@ // Project: http://lodash.com/, https://lodash.com/custom-builds // Definitions by: Stephen Lautier , e-cloud // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 export { default as add } from "./add"; export { default as after } from "./after"; diff --git a/types/lodash.add/index.d.ts b/types/lodash.add/index.d.ts index 772346a2d0..baddebd61a 100644 --- a/types/lodash.add/index.d.ts +++ b/types/lodash.add/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.after/index.d.ts b/types/lodash.after/index.d.ts index 6656fce6bb..fc56217da5 100644 --- a/types/lodash.after/index.d.ts +++ b/types/lodash.after/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.ary/index.d.ts b/types/lodash.ary/index.d.ts index 989aa725a5..1d44bac65a 100644 --- a/types/lodash.ary/index.d.ts +++ b/types/lodash.ary/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.assign/index.d.ts b/types/lodash.assign/index.d.ts index 0630a711ff..439ca018b5 100644 --- a/types/lodash.assign/index.d.ts +++ b/types/lodash.assign/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.assignin/index.d.ts b/types/lodash.assignin/index.d.ts index 1c816068a1..33c31dbc31 100644 --- a/types/lodash.assignin/index.d.ts +++ b/types/lodash.assignin/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.assigninwith/index.d.ts b/types/lodash.assigninwith/index.d.ts index 0068b84dd0..17d76a4304 100644 --- a/types/lodash.assigninwith/index.d.ts +++ b/types/lodash.assigninwith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.assignwith/index.d.ts b/types/lodash.assignwith/index.d.ts index 609055f4c1..d95702fd18 100644 --- a/types/lodash.assignwith/index.d.ts +++ b/types/lodash.assignwith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.at/index.d.ts b/types/lodash.at/index.d.ts index d2b42c712b..278854bab6 100644 --- a/types/lodash.at/index.d.ts +++ b/types/lodash.at/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.attempt/index.d.ts b/types/lodash.attempt/index.d.ts index 380c968a6a..9db30b6fd0 100644 --- a/types/lodash.attempt/index.d.ts +++ b/types/lodash.attempt/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.before/index.d.ts b/types/lodash.before/index.d.ts index d3709654fe..482c458fd4 100644 --- a/types/lodash.before/index.d.ts +++ b/types/lodash.before/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.bind/index.d.ts b/types/lodash.bind/index.d.ts index cab39bbda7..bf22c45a09 100644 --- a/types/lodash.bind/index.d.ts +++ b/types/lodash.bind/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.bindall/index.d.ts b/types/lodash.bindall/index.d.ts index 82e411a336..135c532028 100644 --- a/types/lodash.bindall/index.d.ts +++ b/types/lodash.bindall/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.bindkey/index.d.ts b/types/lodash.bindkey/index.d.ts index 039ed71905..12553e21b8 100644 --- a/types/lodash.bindkey/index.d.ts +++ b/types/lodash.bindkey/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.camelcase/index.d.ts b/types/lodash.camelcase/index.d.ts index a9beabf396..8f01a3bf38 100644 --- a/types/lodash.camelcase/index.d.ts +++ b/types/lodash.camelcase/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.capitalize/index.d.ts b/types/lodash.capitalize/index.d.ts index 61843a4996..5e0ffdced3 100644 --- a/types/lodash.capitalize/index.d.ts +++ b/types/lodash.capitalize/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.castarray/index.d.ts b/types/lodash.castarray/index.d.ts index 733fb69735..f27ca127a6 100644 --- a/types/lodash.castarray/index.d.ts +++ b/types/lodash.castarray/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.ceil/index.d.ts b/types/lodash.ceil/index.d.ts index cb8fd23386..f49a415e20 100644 --- a/types/lodash.ceil/index.d.ts +++ b/types/lodash.ceil/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.chunk/index.d.ts b/types/lodash.chunk/index.d.ts index 652c83f8c1..0591152d32 100644 --- a/types/lodash.chunk/index.d.ts +++ b/types/lodash.chunk/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.clamp/index.d.ts b/types/lodash.clamp/index.d.ts index 796172867c..38624c2214 100644 --- a/types/lodash.clamp/index.d.ts +++ b/types/lodash.clamp/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.clone/index.d.ts b/types/lodash.clone/index.d.ts index 810ff9158b..333915a404 100644 --- a/types/lodash.clone/index.d.ts +++ b/types/lodash.clone/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.clonedeep/index.d.ts b/types/lodash.clonedeep/index.d.ts index 9eb31632f4..369942bf05 100644 --- a/types/lodash.clonedeep/index.d.ts +++ b/types/lodash.clonedeep/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.clonedeepwith/index.d.ts b/types/lodash.clonedeepwith/index.d.ts index 3ceef35da9..9d37cbea6d 100644 --- a/types/lodash.clonedeepwith/index.d.ts +++ b/types/lodash.clonedeepwith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.clonewith/index.d.ts b/types/lodash.clonewith/index.d.ts index fa57374c7a..0a099fd494 100644 --- a/types/lodash.clonewith/index.d.ts +++ b/types/lodash.clonewith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.compact/index.d.ts b/types/lodash.compact/index.d.ts index 3155457aa3..553668fcb3 100644 --- a/types/lodash.compact/index.d.ts +++ b/types/lodash.compact/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.concat/index.d.ts b/types/lodash.concat/index.d.ts index 7c31abca34..f96ec742b9 100644 --- a/types/lodash.concat/index.d.ts +++ b/types/lodash.concat/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.cond/index.d.ts b/types/lodash.cond/index.d.ts index 18aa811fd1..83fa5ef27a 100644 --- a/types/lodash.cond/index.d.ts +++ b/types/lodash.cond/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.constant/index.d.ts b/types/lodash.constant/index.d.ts index d928f61e6f..03c2713bdf 100644 --- a/types/lodash.constant/index.d.ts +++ b/types/lodash.constant/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.countby/index.d.ts b/types/lodash.countby/index.d.ts index b3194f1f47..24b895f079 100644 --- a/types/lodash.countby/index.d.ts +++ b/types/lodash.countby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.create/index.d.ts b/types/lodash.create/index.d.ts index 562121278b..dca4287417 100644 --- a/types/lodash.create/index.d.ts +++ b/types/lodash.create/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.curry/index.d.ts b/types/lodash.curry/index.d.ts index 660782b829..f24b40caed 100644 --- a/types/lodash.curry/index.d.ts +++ b/types/lodash.curry/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.curryright/index.d.ts b/types/lodash.curryright/index.d.ts index 706da25049..b10ea20902 100644 --- a/types/lodash.curryright/index.d.ts +++ b/types/lodash.curryright/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.debounce/index.d.ts b/types/lodash.debounce/index.d.ts index d337350c38..02f0bfc874 100644 --- a/types/lodash.debounce/index.d.ts +++ b/types/lodash.debounce/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.deburr/index.d.ts b/types/lodash.deburr/index.d.ts index 3325320abc..f1c22579cc 100644 --- a/types/lodash.deburr/index.d.ts +++ b/types/lodash.deburr/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.defaults/index.d.ts b/types/lodash.defaults/index.d.ts index 8e5745fe18..b369cbbed2 100644 --- a/types/lodash.defaults/index.d.ts +++ b/types/lodash.defaults/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.defaultsdeep/index.d.ts b/types/lodash.defaultsdeep/index.d.ts index 8dffb26c17..4cafcffe76 100644 --- a/types/lodash.defaultsdeep/index.d.ts +++ b/types/lodash.defaultsdeep/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.defer/index.d.ts b/types/lodash.defer/index.d.ts index d09ea8f6f2..9a015ee473 100644 --- a/types/lodash.defer/index.d.ts +++ b/types/lodash.defer/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.delay/index.d.ts b/types/lodash.delay/index.d.ts index 0b8ee66e74..9fb968dc1f 100644 --- a/types/lodash.delay/index.d.ts +++ b/types/lodash.delay/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.difference/index.d.ts b/types/lodash.difference/index.d.ts index 09b032c1bb..53d2f688e0 100644 --- a/types/lodash.difference/index.d.ts +++ b/types/lodash.difference/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.differenceby/index.d.ts b/types/lodash.differenceby/index.d.ts index be5647692c..11b877c8bd 100644 --- a/types/lodash.differenceby/index.d.ts +++ b/types/lodash.differenceby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.differencewith/index.d.ts b/types/lodash.differencewith/index.d.ts index c353d4319a..7bcaf0e374 100644 --- a/types/lodash.differencewith/index.d.ts +++ b/types/lodash.differencewith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.divide/index.d.ts b/types/lodash.divide/index.d.ts index 61f5234af6..87b705f72b 100644 --- a/types/lodash.divide/index.d.ts +++ b/types/lodash.divide/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.drop/index.d.ts b/types/lodash.drop/index.d.ts index 33d3e19039..0bdebee18c 100644 --- a/types/lodash.drop/index.d.ts +++ b/types/lodash.drop/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.dropright/index.d.ts b/types/lodash.dropright/index.d.ts index 3cf5d6649a..305d9185ad 100644 --- a/types/lodash.dropright/index.d.ts +++ b/types/lodash.dropright/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.droprightwhile/index.d.ts b/types/lodash.droprightwhile/index.d.ts index 8321da6b6d..f93a0e2bf8 100644 --- a/types/lodash.droprightwhile/index.d.ts +++ b/types/lodash.droprightwhile/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.dropwhile/index.d.ts b/types/lodash.dropwhile/index.d.ts index 4f8b336310..c319c28cad 100644 --- a/types/lodash.dropwhile/index.d.ts +++ b/types/lodash.dropwhile/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.endswith/index.d.ts b/types/lodash.endswith/index.d.ts index 6626ffd52a..08da3f984e 100644 --- a/types/lodash.endswith/index.d.ts +++ b/types/lodash.endswith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.eq/index.d.ts b/types/lodash.eq/index.d.ts index 14d17ed08a..2108d43241 100644 --- a/types/lodash.eq/index.d.ts +++ b/types/lodash.eq/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.escape/index.d.ts b/types/lodash.escape/index.d.ts index c357bee3c3..7fc4195d57 100644 --- a/types/lodash.escape/index.d.ts +++ b/types/lodash.escape/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.escaperegexp/index.d.ts b/types/lodash.escaperegexp/index.d.ts index 17f67d618f..790be82ef5 100644 --- a/types/lodash.escaperegexp/index.d.ts +++ b/types/lodash.escaperegexp/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.every/index.d.ts b/types/lodash.every/index.d.ts index 2a05255eec..c1daeeaf8b 100644 --- a/types/lodash.every/index.d.ts +++ b/types/lodash.every/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.fill/index.d.ts b/types/lodash.fill/index.d.ts index 59208388f6..b80b6f3766 100644 --- a/types/lodash.fill/index.d.ts +++ b/types/lodash.fill/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.filter/index.d.ts b/types/lodash.filter/index.d.ts index cf8134b740..620b5afa5f 100644 --- a/types/lodash.filter/index.d.ts +++ b/types/lodash.filter/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.find/index.d.ts b/types/lodash.find/index.d.ts index 09a5a0c21d..2e872ac18f 100644 --- a/types/lodash.find/index.d.ts +++ b/types/lodash.find/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.findindex/index.d.ts b/types/lodash.findindex/index.d.ts index 6b237ba285..d809dc25c1 100644 --- a/types/lodash.findindex/index.d.ts +++ b/types/lodash.findindex/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.findkey/index.d.ts b/types/lodash.findkey/index.d.ts index f102aa20d3..d3d190c961 100644 --- a/types/lodash.findkey/index.d.ts +++ b/types/lodash.findkey/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.findlast/index.d.ts b/types/lodash.findlast/index.d.ts index 92a91432e1..82c796b516 100644 --- a/types/lodash.findlast/index.d.ts +++ b/types/lodash.findlast/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.findlastindex/index.d.ts b/types/lodash.findlastindex/index.d.ts index 9bf1b1eddb..07fcecb2aa 100644 --- a/types/lodash.findlastindex/index.d.ts +++ b/types/lodash.findlastindex/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.findlastkey/index.d.ts b/types/lodash.findlastkey/index.d.ts index 4563f2b91e..538349029a 100644 --- a/types/lodash.findlastkey/index.d.ts +++ b/types/lodash.findlastkey/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.first/index.d.ts b/types/lodash.first/index.d.ts index 4bd8f1e059..c4e173b32e 100644 --- a/types/lodash.first/index.d.ts +++ b/types/lodash.first/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.flatmap/index.d.ts b/types/lodash.flatmap/index.d.ts index 22222c405a..376fa4dde5 100644 --- a/types/lodash.flatmap/index.d.ts +++ b/types/lodash.flatmap/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.flatmapdeep/index.d.ts b/types/lodash.flatmapdeep/index.d.ts index 55c43f881e..b6173e3aa4 100644 --- a/types/lodash.flatmapdeep/index.d.ts +++ b/types/lodash.flatmapdeep/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.flatmapdepth/index.d.ts b/types/lodash.flatmapdepth/index.d.ts index 812fa36c8a..748e76f598 100644 --- a/types/lodash.flatmapdepth/index.d.ts +++ b/types/lodash.flatmapdepth/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.flatten/index.d.ts b/types/lodash.flatten/index.d.ts index e1d21df7fe..7ce8c0b8b6 100644 --- a/types/lodash.flatten/index.d.ts +++ b/types/lodash.flatten/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.flattendeep/index.d.ts b/types/lodash.flattendeep/index.d.ts index 79cee1753f..aeff806101 100644 --- a/types/lodash.flattendeep/index.d.ts +++ b/types/lodash.flattendeep/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.flattendepth/index.d.ts b/types/lodash.flattendepth/index.d.ts index 7de6a821a2..439b417f7d 100644 --- a/types/lodash.flattendepth/index.d.ts +++ b/types/lodash.flattendepth/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.flip/index.d.ts b/types/lodash.flip/index.d.ts index d492ebad75..bd2c9ab212 100644 --- a/types/lodash.flip/index.d.ts +++ b/types/lodash.flip/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.floor/index.d.ts b/types/lodash.floor/index.d.ts index b99f1ec111..1824957522 100644 --- a/types/lodash.floor/index.d.ts +++ b/types/lodash.floor/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.flow/index.d.ts b/types/lodash.flow/index.d.ts index 5a1fe32a7b..7423e07409 100644 --- a/types/lodash.flow/index.d.ts +++ b/types/lodash.flow/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.flowright/index.d.ts b/types/lodash.flowright/index.d.ts index 13e7b524a6..b81ad62b46 100644 --- a/types/lodash.flowright/index.d.ts +++ b/types/lodash.flowright/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.foreach/index.d.ts b/types/lodash.foreach/index.d.ts index c865bb8f27..cc2b19c167 100644 --- a/types/lodash.foreach/index.d.ts +++ b/types/lodash.foreach/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.foreachright/index.d.ts b/types/lodash.foreachright/index.d.ts index 978db0e694..7508ed4471 100644 --- a/types/lodash.foreachright/index.d.ts +++ b/types/lodash.foreachright/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.forin/index.d.ts b/types/lodash.forin/index.d.ts index f2a1a3eca6..c84824f65b 100644 --- a/types/lodash.forin/index.d.ts +++ b/types/lodash.forin/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.forinright/index.d.ts b/types/lodash.forinright/index.d.ts index 68973aff3b..62ff91a3e4 100644 --- a/types/lodash.forinright/index.d.ts +++ b/types/lodash.forinright/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.forown/index.d.ts b/types/lodash.forown/index.d.ts index bad9b72cfd..15623c7360 100644 --- a/types/lodash.forown/index.d.ts +++ b/types/lodash.forown/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.forownright/index.d.ts b/types/lodash.forownright/index.d.ts index 4f4a2177aa..13e34be0dd 100644 --- a/types/lodash.forownright/index.d.ts +++ b/types/lodash.forownright/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.frompairs/index.d.ts b/types/lodash.frompairs/index.d.ts index 3789bbb735..580e3182a8 100644 --- a/types/lodash.frompairs/index.d.ts +++ b/types/lodash.frompairs/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.functions/index.d.ts b/types/lodash.functions/index.d.ts index e885cd4bb7..cf107f3212 100644 --- a/types/lodash.functions/index.d.ts +++ b/types/lodash.functions/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.functionsin/index.d.ts b/types/lodash.functionsin/index.d.ts index 0ffe3755ab..c3cb89d7cd 100644 --- a/types/lodash.functionsin/index.d.ts +++ b/types/lodash.functionsin/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.get/index.d.ts b/types/lodash.get/index.d.ts index 37aade43bd..991f9fee99 100644 --- a/types/lodash.get/index.d.ts +++ b/types/lodash.get/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.groupby/index.d.ts b/types/lodash.groupby/index.d.ts index 9c2279c767..1e784cc320 100644 --- a/types/lodash.groupby/index.d.ts +++ b/types/lodash.groupby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.gt/index.d.ts b/types/lodash.gt/index.d.ts index 2ef5f7aab9..ca969f2462 100644 --- a/types/lodash.gt/index.d.ts +++ b/types/lodash.gt/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.gte/index.d.ts b/types/lodash.gte/index.d.ts index 543e8894d1..2f6a589c46 100644 --- a/types/lodash.gte/index.d.ts +++ b/types/lodash.gte/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.has/index.d.ts b/types/lodash.has/index.d.ts index 39347aa215..4fc7c51bec 100644 --- a/types/lodash.has/index.d.ts +++ b/types/lodash.has/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.hasin/index.d.ts b/types/lodash.hasin/index.d.ts index fd9674ec9d..3789cda6fa 100644 --- a/types/lodash.hasin/index.d.ts +++ b/types/lodash.hasin/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.head/index.d.ts b/types/lodash.head/index.d.ts index 055cd0ac90..3a9f3883c1 100644 --- a/types/lodash.head/index.d.ts +++ b/types/lodash.head/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.identity/index.d.ts b/types/lodash.identity/index.d.ts index 53593f2f97..66b66ab307 100644 --- a/types/lodash.identity/index.d.ts +++ b/types/lodash.identity/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.includes/index.d.ts b/types/lodash.includes/index.d.ts index 3efd02ba00..34096d9006 100644 --- a/types/lodash.includes/index.d.ts +++ b/types/lodash.includes/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.indexof/index.d.ts b/types/lodash.indexof/index.d.ts index 8d6dc6dbdf..64ac787a5d 100644 --- a/types/lodash.indexof/index.d.ts +++ b/types/lodash.indexof/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.initial/index.d.ts b/types/lodash.initial/index.d.ts index 62d5c9dc61..49c86bb7c9 100644 --- a/types/lodash.initial/index.d.ts +++ b/types/lodash.initial/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.inrange/index.d.ts b/types/lodash.inrange/index.d.ts index db7dc74a0e..1f3c456d3a 100644 --- a/types/lodash.inrange/index.d.ts +++ b/types/lodash.inrange/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.intersection/index.d.ts b/types/lodash.intersection/index.d.ts index 35dfe76821..b79e8b9050 100644 --- a/types/lodash.intersection/index.d.ts +++ b/types/lodash.intersection/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.intersectionby/index.d.ts b/types/lodash.intersectionby/index.d.ts index f66da889fa..e57c36bfa4 100644 --- a/types/lodash.intersectionby/index.d.ts +++ b/types/lodash.intersectionby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.intersectionwith/index.d.ts b/types/lodash.intersectionwith/index.d.ts index ae5e281b33..561a2ad538 100644 --- a/types/lodash.intersectionwith/index.d.ts +++ b/types/lodash.intersectionwith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.invert/index.d.ts b/types/lodash.invert/index.d.ts index 024a4f6a97..905632930b 100644 --- a/types/lodash.invert/index.d.ts +++ b/types/lodash.invert/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.invertby/index.d.ts b/types/lodash.invertby/index.d.ts index 9ad74a615c..181970a286 100644 --- a/types/lodash.invertby/index.d.ts +++ b/types/lodash.invertby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.invoke/index.d.ts b/types/lodash.invoke/index.d.ts index aee1886286..82ddb56083 100644 --- a/types/lodash.invoke/index.d.ts +++ b/types/lodash.invoke/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.invokemap/index.d.ts b/types/lodash.invokemap/index.d.ts index 6acb2bdf4b..28ed42e42b 100644 --- a/types/lodash.invokemap/index.d.ts +++ b/types/lodash.invokemap/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isarguments/index.d.ts b/types/lodash.isarguments/index.d.ts index d5f8290412..1f9b59f548 100644 --- a/types/lodash.isarguments/index.d.ts +++ b/types/lodash.isarguments/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isarray/index.d.ts b/types/lodash.isarray/index.d.ts index efaac7606b..96a64836d4 100644 --- a/types/lodash.isarray/index.d.ts +++ b/types/lodash.isarray/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isarraybuffer/index.d.ts b/types/lodash.isarraybuffer/index.d.ts index 5fcf63deb6..3c44819f19 100644 --- a/types/lodash.isarraybuffer/index.d.ts +++ b/types/lodash.isarraybuffer/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isarraylike/index.d.ts b/types/lodash.isarraylike/index.d.ts index a96f1d5085..a56d9bbfa6 100644 --- a/types/lodash.isarraylike/index.d.ts +++ b/types/lodash.isarraylike/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isarraylikeobject/index.d.ts b/types/lodash.isarraylikeobject/index.d.ts index ffa5d3db69..545d6a3519 100644 --- a/types/lodash.isarraylikeobject/index.d.ts +++ b/types/lodash.isarraylikeobject/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isboolean/index.d.ts b/types/lodash.isboolean/index.d.ts index 888c9da1da..cf84173cd1 100644 --- a/types/lodash.isboolean/index.d.ts +++ b/types/lodash.isboolean/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isbuffer/index.d.ts b/types/lodash.isbuffer/index.d.ts index 1b0e57db15..34b164cfa3 100644 --- a/types/lodash.isbuffer/index.d.ts +++ b/types/lodash.isbuffer/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isdate/index.d.ts b/types/lodash.isdate/index.d.ts index f1cfb78cbb..3023be1957 100644 --- a/types/lodash.isdate/index.d.ts +++ b/types/lodash.isdate/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.iselement/index.d.ts b/types/lodash.iselement/index.d.ts index 7a54b5c77e..9e83bcacc3 100644 --- a/types/lodash.iselement/index.d.ts +++ b/types/lodash.iselement/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isempty/index.d.ts b/types/lodash.isempty/index.d.ts index 736796c517..b0516dca34 100644 --- a/types/lodash.isempty/index.d.ts +++ b/types/lodash.isempty/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isequal/index.d.ts b/types/lodash.isequal/index.d.ts index c2ad0dff8c..0bae99d588 100644 --- a/types/lodash.isequal/index.d.ts +++ b/types/lodash.isequal/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isequalwith/index.d.ts b/types/lodash.isequalwith/index.d.ts index 5703d53f84..2c00d66f7c 100644 --- a/types/lodash.isequalwith/index.d.ts +++ b/types/lodash.isequalwith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.iserror/index.d.ts b/types/lodash.iserror/index.d.ts index 5bdb9e5a7a..ae18901b11 100644 --- a/types/lodash.iserror/index.d.ts +++ b/types/lodash.iserror/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isfinite/index.d.ts b/types/lodash.isfinite/index.d.ts index b22a988b59..398f037e5b 100644 --- a/types/lodash.isfinite/index.d.ts +++ b/types/lodash.isfinite/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isfunction/index.d.ts b/types/lodash.isfunction/index.d.ts index 7fd82f56e3..4dd84dbde7 100644 --- a/types/lodash.isfunction/index.d.ts +++ b/types/lodash.isfunction/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isinteger/index.d.ts b/types/lodash.isinteger/index.d.ts index 381e14831f..8ea23c1c00 100644 --- a/types/lodash.isinteger/index.d.ts +++ b/types/lodash.isinteger/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.islength/index.d.ts b/types/lodash.islength/index.d.ts index 7e503fa682..1567bba3f5 100644 --- a/types/lodash.islength/index.d.ts +++ b/types/lodash.islength/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.ismap/index.d.ts b/types/lodash.ismap/index.d.ts index fb3f9c1c7c..bebdcf2c6b 100644 --- a/types/lodash.ismap/index.d.ts +++ b/types/lodash.ismap/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.ismatch/index.d.ts b/types/lodash.ismatch/index.d.ts index c19458f06e..64f40ce6a9 100644 --- a/types/lodash.ismatch/index.d.ts +++ b/types/lodash.ismatch/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.ismatchwith/index.d.ts b/types/lodash.ismatchwith/index.d.ts index 6c80c60c84..382c6d6253 100644 --- a/types/lodash.ismatchwith/index.d.ts +++ b/types/lodash.ismatchwith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isnan/index.d.ts b/types/lodash.isnan/index.d.ts index ef81584b37..9e5c35cce4 100644 --- a/types/lodash.isnan/index.d.ts +++ b/types/lodash.isnan/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isnative/index.d.ts b/types/lodash.isnative/index.d.ts index 102f340608..e374f644c2 100644 --- a/types/lodash.isnative/index.d.ts +++ b/types/lodash.isnative/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isnil/index.d.ts b/types/lodash.isnil/index.d.ts index 1de6260b05..6120f80ea6 100644 --- a/types/lodash.isnil/index.d.ts +++ b/types/lodash.isnil/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isnull/index.d.ts b/types/lodash.isnull/index.d.ts index 9f8dfeda80..4c42cf8e06 100644 --- a/types/lodash.isnull/index.d.ts +++ b/types/lodash.isnull/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isnumber/index.d.ts b/types/lodash.isnumber/index.d.ts index 58b64fef97..722da3ade2 100644 --- a/types/lodash.isnumber/index.d.ts +++ b/types/lodash.isnumber/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isobject/index.d.ts b/types/lodash.isobject/index.d.ts index 5a25a3afab..3490c30643 100644 --- a/types/lodash.isobject/index.d.ts +++ b/types/lodash.isobject/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isobjectlike/index.d.ts b/types/lodash.isobjectlike/index.d.ts index b81bfe36a8..a475ce9b0e 100644 --- a/types/lodash.isobjectlike/index.d.ts +++ b/types/lodash.isobjectlike/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isplainobject/index.d.ts b/types/lodash.isplainobject/index.d.ts index b285500c3c..087f9aeba9 100644 --- a/types/lodash.isplainobject/index.d.ts +++ b/types/lodash.isplainobject/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isregexp/index.d.ts b/types/lodash.isregexp/index.d.ts index 1a79d6b965..1ffd065e36 100644 --- a/types/lodash.isregexp/index.d.ts +++ b/types/lodash.isregexp/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.issafeinteger/index.d.ts b/types/lodash.issafeinteger/index.d.ts index efc8de999e..f3f5fe9c3a 100644 --- a/types/lodash.issafeinteger/index.d.ts +++ b/types/lodash.issafeinteger/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isset/index.d.ts b/types/lodash.isset/index.d.ts index 44d01fc904..a39e705480 100644 --- a/types/lodash.isset/index.d.ts +++ b/types/lodash.isset/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isstring/index.d.ts b/types/lodash.isstring/index.d.ts index 7835175fd1..bc54bf85ea 100644 --- a/types/lodash.isstring/index.d.ts +++ b/types/lodash.isstring/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.issymbol/index.d.ts b/types/lodash.issymbol/index.d.ts index 9837ca6d48..b59db2a3ef 100644 --- a/types/lodash.issymbol/index.d.ts +++ b/types/lodash.issymbol/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.istypedarray/index.d.ts b/types/lodash.istypedarray/index.d.ts index 4d81b5ecfa..76ca43e3b0 100644 --- a/types/lodash.istypedarray/index.d.ts +++ b/types/lodash.istypedarray/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isundefined/index.d.ts b/types/lodash.isundefined/index.d.ts index a9a516f63c..e893f5c4da 100644 --- a/types/lodash.isundefined/index.d.ts +++ b/types/lodash.isundefined/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isweakmap/index.d.ts b/types/lodash.isweakmap/index.d.ts index cd754e9608..651c976447 100644 --- a/types/lodash.isweakmap/index.d.ts +++ b/types/lodash.isweakmap/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.isweakset/index.d.ts b/types/lodash.isweakset/index.d.ts index 124a9f588d..bf5ed2716e 100644 --- a/types/lodash.isweakset/index.d.ts +++ b/types/lodash.isweakset/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.iteratee/index.d.ts b/types/lodash.iteratee/index.d.ts index 5c641bbaa1..cecd754bf7 100644 --- a/types/lodash.iteratee/index.d.ts +++ b/types/lodash.iteratee/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.join/index.d.ts b/types/lodash.join/index.d.ts index e2c58c2536..357d8d151c 100644 --- a/types/lodash.join/index.d.ts +++ b/types/lodash.join/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.kebabcase/index.d.ts b/types/lodash.kebabcase/index.d.ts index 0223fc8eb1..307f821ce9 100644 --- a/types/lodash.kebabcase/index.d.ts +++ b/types/lodash.kebabcase/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.keyby/index.d.ts b/types/lodash.keyby/index.d.ts index 67e5902601..93626ab4d2 100644 --- a/types/lodash.keyby/index.d.ts +++ b/types/lodash.keyby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.keys/index.d.ts b/types/lodash.keys/index.d.ts index 9d804e483c..3db0980f97 100644 --- a/types/lodash.keys/index.d.ts +++ b/types/lodash.keys/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.keysin/index.d.ts b/types/lodash.keysin/index.d.ts index f00b24fcbd..1e3f0bbcfa 100644 --- a/types/lodash.keysin/index.d.ts +++ b/types/lodash.keysin/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.last/index.d.ts b/types/lodash.last/index.d.ts index b2279e60d2..8403d5af99 100644 --- a/types/lodash.last/index.d.ts +++ b/types/lodash.last/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.lastindexof/index.d.ts b/types/lodash.lastindexof/index.d.ts index 7e714b06bb..e991ef92b6 100644 --- a/types/lodash.lastindexof/index.d.ts +++ b/types/lodash.lastindexof/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.lowercase/index.d.ts b/types/lodash.lowercase/index.d.ts index b816bde588..dc349eeb90 100644 --- a/types/lodash.lowercase/index.d.ts +++ b/types/lodash.lowercase/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.lowerfirst/index.d.ts b/types/lodash.lowerfirst/index.d.ts index 1619781afe..6bd7aa96ff 100644 --- a/types/lodash.lowerfirst/index.d.ts +++ b/types/lodash.lowerfirst/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.lt/index.d.ts b/types/lodash.lt/index.d.ts index e2d1dc8d22..b4ccae8b22 100644 --- a/types/lodash.lt/index.d.ts +++ b/types/lodash.lt/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.lte/index.d.ts b/types/lodash.lte/index.d.ts index be320a60df..e3a61cfaa0 100644 --- a/types/lodash.lte/index.d.ts +++ b/types/lodash.lte/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.mapkeys/index.d.ts b/types/lodash.mapkeys/index.d.ts index cba5ab4abb..c5b4cae952 100644 --- a/types/lodash.mapkeys/index.d.ts +++ b/types/lodash.mapkeys/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.mapvalues/index.d.ts b/types/lodash.mapvalues/index.d.ts index 2c13c37ee8..a6c2eaac45 100644 --- a/types/lodash.mapvalues/index.d.ts +++ b/types/lodash.mapvalues/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.matches/index.d.ts b/types/lodash.matches/index.d.ts index 0c265e0e21..415a6d2738 100644 --- a/types/lodash.matches/index.d.ts +++ b/types/lodash.matches/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.matchesproperty/index.d.ts b/types/lodash.matchesproperty/index.d.ts index 36c628043c..3e84c8decb 100644 --- a/types/lodash.matchesproperty/index.d.ts +++ b/types/lodash.matchesproperty/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.max/index.d.ts b/types/lodash.max/index.d.ts index 322203fc10..5957bcde74 100644 --- a/types/lodash.max/index.d.ts +++ b/types/lodash.max/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.maxby/index.d.ts b/types/lodash.maxby/index.d.ts index 8279522ee0..a7a06208c4 100644 --- a/types/lodash.maxby/index.d.ts +++ b/types/lodash.maxby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.mean/index.d.ts b/types/lodash.mean/index.d.ts index afadecc5c9..59c53c0dde 100644 --- a/types/lodash.mean/index.d.ts +++ b/types/lodash.mean/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.meanby/index.d.ts b/types/lodash.meanby/index.d.ts index 22670d65cf..b0374e7d20 100644 --- a/types/lodash.meanby/index.d.ts +++ b/types/lodash.meanby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.memoize/index.d.ts b/types/lodash.memoize/index.d.ts index 81ecaa8bd4..efe1a8b04b 100644 --- a/types/lodash.memoize/index.d.ts +++ b/types/lodash.memoize/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.merge/index.d.ts b/types/lodash.merge/index.d.ts index e64484c886..898750eb58 100644 --- a/types/lodash.merge/index.d.ts +++ b/types/lodash.merge/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.mergewith/index.d.ts b/types/lodash.mergewith/index.d.ts index fc5915711b..e35006bc36 100644 --- a/types/lodash.mergewith/index.d.ts +++ b/types/lodash.mergewith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.method/index.d.ts b/types/lodash.method/index.d.ts index b9c0ee7168..8168f96211 100644 --- a/types/lodash.method/index.d.ts +++ b/types/lodash.method/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.methodof/index.d.ts b/types/lodash.methodof/index.d.ts index 8eb4aeb235..ba2dfb7012 100644 --- a/types/lodash.methodof/index.d.ts +++ b/types/lodash.methodof/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.min/index.d.ts b/types/lodash.min/index.d.ts index 15a5331e7e..b5b52fe095 100644 --- a/types/lodash.min/index.d.ts +++ b/types/lodash.min/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.minby/index.d.ts b/types/lodash.minby/index.d.ts index a900c32f9d..8c3d8dfcdb 100644 --- a/types/lodash.minby/index.d.ts +++ b/types/lodash.minby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.mixin/index.d.ts b/types/lodash.mixin/index.d.ts index 6ef86909af..fd9e480f31 100644 --- a/types/lodash.mixin/index.d.ts +++ b/types/lodash.mixin/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.negate/index.d.ts b/types/lodash.negate/index.d.ts index e28d931810..d771f63eb4 100644 --- a/types/lodash.negate/index.d.ts +++ b/types/lodash.negate/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.noop/index.d.ts b/types/lodash.noop/index.d.ts index 98decb3a5f..963f951c93 100644 --- a/types/lodash.noop/index.d.ts +++ b/types/lodash.noop/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.now/index.d.ts b/types/lodash.now/index.d.ts index e8ba1e9ccd..508d07e777 100644 --- a/types/lodash.now/index.d.ts +++ b/types/lodash.now/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.nth/index.d.ts b/types/lodash.nth/index.d.ts index 940e4e06d8..66cda782a2 100644 --- a/types/lodash.nth/index.d.ts +++ b/types/lodash.nth/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.ntharg/index.d.ts b/types/lodash.ntharg/index.d.ts index 2fcbd89332..e7bd831879 100644 --- a/types/lodash.ntharg/index.d.ts +++ b/types/lodash.ntharg/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.omit/index.d.ts b/types/lodash.omit/index.d.ts index efa2526c38..7e15b2f9f9 100644 --- a/types/lodash.omit/index.d.ts +++ b/types/lodash.omit/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.omitby/index.d.ts b/types/lodash.omitby/index.d.ts index aa258237f7..209ff398bf 100644 --- a/types/lodash.omitby/index.d.ts +++ b/types/lodash.omitby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.once/index.d.ts b/types/lodash.once/index.d.ts index 7fca8f4016..4dc4c566ae 100644 --- a/types/lodash.once/index.d.ts +++ b/types/lodash.once/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.orderby/index.d.ts b/types/lodash.orderby/index.d.ts index 02a4de9edf..485075ca90 100644 --- a/types/lodash.orderby/index.d.ts +++ b/types/lodash.orderby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.over/index.d.ts b/types/lodash.over/index.d.ts index 1c77a3d71b..0e4d238680 100644 --- a/types/lodash.over/index.d.ts +++ b/types/lodash.over/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.overargs/index.d.ts b/types/lodash.overargs/index.d.ts index 5ca77279e4..bcaa606780 100644 --- a/types/lodash.overargs/index.d.ts +++ b/types/lodash.overargs/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.overevery/index.d.ts b/types/lodash.overevery/index.d.ts index d2d142abc2..85c5b82167 100644 --- a/types/lodash.overevery/index.d.ts +++ b/types/lodash.overevery/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.oversome/index.d.ts b/types/lodash.oversome/index.d.ts index a2f48b5d3f..b0ccb5950d 100644 --- a/types/lodash.oversome/index.d.ts +++ b/types/lodash.oversome/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.pad/index.d.ts b/types/lodash.pad/index.d.ts index c7ffc0da65..cd276e2958 100644 --- a/types/lodash.pad/index.d.ts +++ b/types/lodash.pad/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.padend/index.d.ts b/types/lodash.padend/index.d.ts index 044163e4d0..d2729c4daf 100644 --- a/types/lodash.padend/index.d.ts +++ b/types/lodash.padend/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.padstart/index.d.ts b/types/lodash.padstart/index.d.ts index f5e01e7136..6a6d76247a 100644 --- a/types/lodash.padstart/index.d.ts +++ b/types/lodash.padstart/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.parseint/index.d.ts b/types/lodash.parseint/index.d.ts index 6c34469a8c..f47f64bf23 100644 --- a/types/lodash.parseint/index.d.ts +++ b/types/lodash.parseint/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.partial/index.d.ts b/types/lodash.partial/index.d.ts index 1849abe6e4..102f0e9f63 100644 --- a/types/lodash.partial/index.d.ts +++ b/types/lodash.partial/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.partialright/index.d.ts b/types/lodash.partialright/index.d.ts index c8fe88b0c0..0c340fcd04 100644 --- a/types/lodash.partialright/index.d.ts +++ b/types/lodash.partialright/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.partition/index.d.ts b/types/lodash.partition/index.d.ts index 7fbe400757..6c825236ee 100644 --- a/types/lodash.partition/index.d.ts +++ b/types/lodash.partition/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.pick/index.d.ts b/types/lodash.pick/index.d.ts index 7a71bc2c30..50b68a2861 100644 --- a/types/lodash.pick/index.d.ts +++ b/types/lodash.pick/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.pickby/index.d.ts b/types/lodash.pickby/index.d.ts index ae4e2f3581..611f6236fc 100644 --- a/types/lodash.pickby/index.d.ts +++ b/types/lodash.pickby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.property/index.d.ts b/types/lodash.property/index.d.ts index 979d95c2af..f1a42f651b 100644 --- a/types/lodash.property/index.d.ts +++ b/types/lodash.property/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.propertyof/index.d.ts b/types/lodash.propertyof/index.d.ts index 521dd2b560..2124d0d9a3 100644 --- a/types/lodash.propertyof/index.d.ts +++ b/types/lodash.propertyof/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.pull/index.d.ts b/types/lodash.pull/index.d.ts index c07b0e40c9..e39449666f 100644 --- a/types/lodash.pull/index.d.ts +++ b/types/lodash.pull/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.pullall/index.d.ts b/types/lodash.pullall/index.d.ts index 4fafdb508c..b7bff17877 100644 --- a/types/lodash.pullall/index.d.ts +++ b/types/lodash.pullall/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.pullallby/index.d.ts b/types/lodash.pullallby/index.d.ts index dc8848cfee..3a565c123a 100644 --- a/types/lodash.pullallby/index.d.ts +++ b/types/lodash.pullallby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.pullallwith/index.d.ts b/types/lodash.pullallwith/index.d.ts index c636aa8fa0..8199b47fd9 100644 --- a/types/lodash.pullallwith/index.d.ts +++ b/types/lodash.pullallwith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.pullat/index.d.ts b/types/lodash.pullat/index.d.ts index 64a9117c48..de603648e1 100644 --- a/types/lodash.pullat/index.d.ts +++ b/types/lodash.pullat/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.random/index.d.ts b/types/lodash.random/index.d.ts index 6d922d9092..f30cdd73cc 100644 --- a/types/lodash.random/index.d.ts +++ b/types/lodash.random/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.range/index.d.ts b/types/lodash.range/index.d.ts index 66dabf2396..2faa2e0de0 100644 --- a/types/lodash.range/index.d.ts +++ b/types/lodash.range/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.rangeright/index.d.ts b/types/lodash.rangeright/index.d.ts index 7340a99329..eb21ac069a 100644 --- a/types/lodash.rangeright/index.d.ts +++ b/types/lodash.rangeright/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.rearg/index.d.ts b/types/lodash.rearg/index.d.ts index 77055518df..8c1c349117 100644 --- a/types/lodash.rearg/index.d.ts +++ b/types/lodash.rearg/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.reduce/index.d.ts b/types/lodash.reduce/index.d.ts index e3be80b931..3e87301a13 100644 --- a/types/lodash.reduce/index.d.ts +++ b/types/lodash.reduce/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.reduceright/index.d.ts b/types/lodash.reduceright/index.d.ts index 94d81edcce..7143b8545a 100644 --- a/types/lodash.reduceright/index.d.ts +++ b/types/lodash.reduceright/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.reject/index.d.ts b/types/lodash.reject/index.d.ts index 32586896cd..fcf24925ee 100644 --- a/types/lodash.reject/index.d.ts +++ b/types/lodash.reject/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.remove/index.d.ts b/types/lodash.remove/index.d.ts index 2b8ccd14ab..9e1c0e7cff 100644 --- a/types/lodash.remove/index.d.ts +++ b/types/lodash.remove/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.repeat/index.d.ts b/types/lodash.repeat/index.d.ts index 3f3c7f5968..c594a58bdf 100644 --- a/types/lodash.repeat/index.d.ts +++ b/types/lodash.repeat/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.replace/index.d.ts b/types/lodash.replace/index.d.ts index 6a4f26ecf1..1a41363950 100644 --- a/types/lodash.replace/index.d.ts +++ b/types/lodash.replace/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.rest/index.d.ts b/types/lodash.rest/index.d.ts index 3990959f1e..1313395b60 100644 --- a/types/lodash.rest/index.d.ts +++ b/types/lodash.rest/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.result/index.d.ts b/types/lodash.result/index.d.ts index dd84bf8c63..aba9c14ee5 100644 --- a/types/lodash.result/index.d.ts +++ b/types/lodash.result/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.reverse/index.d.ts b/types/lodash.reverse/index.d.ts index d9dcb45151..738afb06bd 100644 --- a/types/lodash.reverse/index.d.ts +++ b/types/lodash.reverse/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.round/index.d.ts b/types/lodash.round/index.d.ts index f0b0e6265e..d105a69013 100644 --- a/types/lodash.round/index.d.ts +++ b/types/lodash.round/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.sample/index.d.ts b/types/lodash.sample/index.d.ts index 877558ce2f..9bd7983185 100644 --- a/types/lodash.sample/index.d.ts +++ b/types/lodash.sample/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.samplesize/index.d.ts b/types/lodash.samplesize/index.d.ts index 5f15be7673..8046278ed6 100644 --- a/types/lodash.samplesize/index.d.ts +++ b/types/lodash.samplesize/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.set/index.d.ts b/types/lodash.set/index.d.ts index ee2b863bc0..d2628e2f35 100644 --- a/types/lodash.set/index.d.ts +++ b/types/lodash.set/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.setwith/index.d.ts b/types/lodash.setwith/index.d.ts index c18a224f15..3c4aa25a69 100644 --- a/types/lodash.setwith/index.d.ts +++ b/types/lodash.setwith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.shuffle/index.d.ts b/types/lodash.shuffle/index.d.ts index 6f51221766..1961d9f44c 100644 --- a/types/lodash.shuffle/index.d.ts +++ b/types/lodash.shuffle/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.size/index.d.ts b/types/lodash.size/index.d.ts index 3182d16b2c..84aedf70cb 100644 --- a/types/lodash.size/index.d.ts +++ b/types/lodash.size/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.slice/index.d.ts b/types/lodash.slice/index.d.ts index 17521a280d..e17a0e5c62 100644 --- a/types/lodash.slice/index.d.ts +++ b/types/lodash.slice/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.snakecase/index.d.ts b/types/lodash.snakecase/index.d.ts index 1f60bb6ea5..5276593906 100644 --- a/types/lodash.snakecase/index.d.ts +++ b/types/lodash.snakecase/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.some/index.d.ts b/types/lodash.some/index.d.ts index 747c615db4..cad1fb59df 100644 --- a/types/lodash.some/index.d.ts +++ b/types/lodash.some/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.sortby/index.d.ts b/types/lodash.sortby/index.d.ts index cf6bccdd9b..5cef6f1b8f 100644 --- a/types/lodash.sortby/index.d.ts +++ b/types/lodash.sortby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.sortedindex/index.d.ts b/types/lodash.sortedindex/index.d.ts index d428632316..4ca2706774 100644 --- a/types/lodash.sortedindex/index.d.ts +++ b/types/lodash.sortedindex/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.sortedindexby/index.d.ts b/types/lodash.sortedindexby/index.d.ts index dc421df6fc..42abb67d25 100644 --- a/types/lodash.sortedindexby/index.d.ts +++ b/types/lodash.sortedindexby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.sortedindexof/index.d.ts b/types/lodash.sortedindexof/index.d.ts index 373c81d67f..194731d861 100644 --- a/types/lodash.sortedindexof/index.d.ts +++ b/types/lodash.sortedindexof/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.sortedlastindex/index.d.ts b/types/lodash.sortedlastindex/index.d.ts index 498ff7b018..f7781aaa66 100644 --- a/types/lodash.sortedlastindex/index.d.ts +++ b/types/lodash.sortedlastindex/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.sortedlastindexby/index.d.ts b/types/lodash.sortedlastindexby/index.d.ts index 8cc6c8a025..08fdf6553b 100644 --- a/types/lodash.sortedlastindexby/index.d.ts +++ b/types/lodash.sortedlastindexby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.sortedlastindexof/index.d.ts b/types/lodash.sortedlastindexof/index.d.ts index 4b178fd7f4..6032e69d64 100644 --- a/types/lodash.sortedlastindexof/index.d.ts +++ b/types/lodash.sortedlastindexof/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.sorteduniq/index.d.ts b/types/lodash.sorteduniq/index.d.ts index 6be5df9a27..692a046d7c 100644 --- a/types/lodash.sorteduniq/index.d.ts +++ b/types/lodash.sorteduniq/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.sorteduniqby/index.d.ts b/types/lodash.sorteduniqby/index.d.ts index 895c8a34a1..d986fe8827 100644 --- a/types/lodash.sorteduniqby/index.d.ts +++ b/types/lodash.sorteduniqby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.split/index.d.ts b/types/lodash.split/index.d.ts index 2202c761e6..361aa0e316 100644 --- a/types/lodash.split/index.d.ts +++ b/types/lodash.split/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.spread/index.d.ts b/types/lodash.spread/index.d.ts index a3113af5c9..7cc9d2ca08 100644 --- a/types/lodash.spread/index.d.ts +++ b/types/lodash.spread/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.startcase/index.d.ts b/types/lodash.startcase/index.d.ts index 8f1ab25a26..39c5dba0ba 100644 --- a/types/lodash.startcase/index.d.ts +++ b/types/lodash.startcase/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.startswith/index.d.ts b/types/lodash.startswith/index.d.ts index 4001dbe382..8604081e3c 100644 --- a/types/lodash.startswith/index.d.ts +++ b/types/lodash.startswith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.subtract/index.d.ts b/types/lodash.subtract/index.d.ts index 7d2c052c8b..ca4600978b 100644 --- a/types/lodash.subtract/index.d.ts +++ b/types/lodash.subtract/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.sum/index.d.ts b/types/lodash.sum/index.d.ts index f8affc3248..072c2250e3 100644 --- a/types/lodash.sum/index.d.ts +++ b/types/lodash.sum/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.sumby/index.d.ts b/types/lodash.sumby/index.d.ts index 6ad30c02c5..d6acf8b452 100644 --- a/types/lodash.sumby/index.d.ts +++ b/types/lodash.sumby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.tail/index.d.ts b/types/lodash.tail/index.d.ts index f6a7a4432c..424d68fc32 100644 --- a/types/lodash.tail/index.d.ts +++ b/types/lodash.tail/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.take/index.d.ts b/types/lodash.take/index.d.ts index 54c6f0aeec..6b2449057e 100644 --- a/types/lodash.take/index.d.ts +++ b/types/lodash.take/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.takeright/index.d.ts b/types/lodash.takeright/index.d.ts index 33b8e9fa89..dffd09a240 100644 --- a/types/lodash.takeright/index.d.ts +++ b/types/lodash.takeright/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.takerightwhile/index.d.ts b/types/lodash.takerightwhile/index.d.ts index 2acf63e0ed..1cd4db0751 100644 --- a/types/lodash.takerightwhile/index.d.ts +++ b/types/lodash.takerightwhile/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.takewhile/index.d.ts b/types/lodash.takewhile/index.d.ts index 0b14c3bfa7..ce92968a1d 100644 --- a/types/lodash.takewhile/index.d.ts +++ b/types/lodash.takewhile/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.template/index.d.ts b/types/lodash.template/index.d.ts index e9acd12f83..0506d0c968 100644 --- a/types/lodash.template/index.d.ts +++ b/types/lodash.template/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.throttle/index.d.ts b/types/lodash.throttle/index.d.ts index 08eaa2b832..260ec7a7c5 100644 --- a/types/lodash.throttle/index.d.ts +++ b/types/lodash.throttle/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.times/index.d.ts b/types/lodash.times/index.d.ts index 1cf2a01684..1811ac4ae2 100644 --- a/types/lodash.times/index.d.ts +++ b/types/lodash.times/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.toarray/index.d.ts b/types/lodash.toarray/index.d.ts index 49638ccaaa..2f48f2ffde 100644 --- a/types/lodash.toarray/index.d.ts +++ b/types/lodash.toarray/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.tofinite/index.d.ts b/types/lodash.tofinite/index.d.ts index 941862c1cf..86cbf6e544 100644 --- a/types/lodash.tofinite/index.d.ts +++ b/types/lodash.tofinite/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.tointeger/index.d.ts b/types/lodash.tointeger/index.d.ts index ee777f9d05..b1cabaecdd 100644 --- a/types/lodash.tointeger/index.d.ts +++ b/types/lodash.tointeger/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.tolength/index.d.ts b/types/lodash.tolength/index.d.ts index 7052ee2311..5e6277f4f2 100644 --- a/types/lodash.tolength/index.d.ts +++ b/types/lodash.tolength/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.tolower/index.d.ts b/types/lodash.tolower/index.d.ts index 70449618ca..d31706fdc7 100644 --- a/types/lodash.tolower/index.d.ts +++ b/types/lodash.tolower/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.tonumber/index.d.ts b/types/lodash.tonumber/index.d.ts index 55628f487b..5898db9932 100644 --- a/types/lodash.tonumber/index.d.ts +++ b/types/lodash.tonumber/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.topairs/index.d.ts b/types/lodash.topairs/index.d.ts index ffe09c636b..940e3107ca 100644 --- a/types/lodash.topairs/index.d.ts +++ b/types/lodash.topairs/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.topairsin/index.d.ts b/types/lodash.topairsin/index.d.ts index 204174fa67..f5a79e3da6 100644 --- a/types/lodash.topairsin/index.d.ts +++ b/types/lodash.topairsin/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.topath/index.d.ts b/types/lodash.topath/index.d.ts index 013f65f9c9..c66f4ed4aa 100644 --- a/types/lodash.topath/index.d.ts +++ b/types/lodash.topath/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.toplainobject/index.d.ts b/types/lodash.toplainobject/index.d.ts index d16b64795f..b716e2cfa4 100644 --- a/types/lodash.toplainobject/index.d.ts +++ b/types/lodash.toplainobject/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.tosafeinteger/index.d.ts b/types/lodash.tosafeinteger/index.d.ts index b9fe0a892a..7f8fb0b640 100644 --- a/types/lodash.tosafeinteger/index.d.ts +++ b/types/lodash.tosafeinteger/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.tostring/index.d.ts b/types/lodash.tostring/index.d.ts index b60288c45b..0bb36b6600 100644 --- a/types/lodash.tostring/index.d.ts +++ b/types/lodash.tostring/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.toupper/index.d.ts b/types/lodash.toupper/index.d.ts index 33838721bb..46bc736e52 100644 --- a/types/lodash.toupper/index.d.ts +++ b/types/lodash.toupper/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.transform/index.d.ts b/types/lodash.transform/index.d.ts index a7e1105053..0a0cfbfb55 100644 --- a/types/lodash.transform/index.d.ts +++ b/types/lodash.transform/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.trim/index.d.ts b/types/lodash.trim/index.d.ts index 2114ce53d6..84c1772922 100644 --- a/types/lodash.trim/index.d.ts +++ b/types/lodash.trim/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.trimend/index.d.ts b/types/lodash.trimend/index.d.ts index 68c43e43ce..f788678328 100644 --- a/types/lodash.trimend/index.d.ts +++ b/types/lodash.trimend/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.trimstart/index.d.ts b/types/lodash.trimstart/index.d.ts index e875ff46d7..d80dfde5ee 100644 --- a/types/lodash.trimstart/index.d.ts +++ b/types/lodash.trimstart/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.truncate/index.d.ts b/types/lodash.truncate/index.d.ts index cf8c3e0463..49ed223a34 100644 --- a/types/lodash.truncate/index.d.ts +++ b/types/lodash.truncate/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.unary/index.d.ts b/types/lodash.unary/index.d.ts index a378016527..2b5956b22f 100644 --- a/types/lodash.unary/index.d.ts +++ b/types/lodash.unary/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.unescape/index.d.ts b/types/lodash.unescape/index.d.ts index c14e2e9ce1..9dd615040f 100644 --- a/types/lodash.unescape/index.d.ts +++ b/types/lodash.unescape/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.union/index.d.ts b/types/lodash.union/index.d.ts index 53ad3cd971..1e5de3029e 100644 --- a/types/lodash.union/index.d.ts +++ b/types/lodash.union/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.unionby/index.d.ts b/types/lodash.unionby/index.d.ts index ee22897482..97c57d7820 100644 --- a/types/lodash.unionby/index.d.ts +++ b/types/lodash.unionby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.unionwith/index.d.ts b/types/lodash.unionwith/index.d.ts index cbbb33d10e..0951988b75 100644 --- a/types/lodash.unionwith/index.d.ts +++ b/types/lodash.unionwith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.uniq/index.d.ts b/types/lodash.uniq/index.d.ts index 46f82b7c46..a000cdc57e 100644 --- a/types/lodash.uniq/index.d.ts +++ b/types/lodash.uniq/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.uniqby/index.d.ts b/types/lodash.uniqby/index.d.ts index 7588831282..430cc78f6b 100644 --- a/types/lodash.uniqby/index.d.ts +++ b/types/lodash.uniqby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.uniqueid/index.d.ts b/types/lodash.uniqueid/index.d.ts index 57ed8587d5..13ce1ddaf5 100644 --- a/types/lodash.uniqueid/index.d.ts +++ b/types/lodash.uniqueid/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.uniqwith/index.d.ts b/types/lodash.uniqwith/index.d.ts index d312905e57..852bd06e8e 100644 --- a/types/lodash.uniqwith/index.d.ts +++ b/types/lodash.uniqwith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.unset/index.d.ts b/types/lodash.unset/index.d.ts index 654f468535..778cba5f35 100644 --- a/types/lodash.unset/index.d.ts +++ b/types/lodash.unset/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.unzip/index.d.ts b/types/lodash.unzip/index.d.ts index 4738306fe4..c82e6e4240 100644 --- a/types/lodash.unzip/index.d.ts +++ b/types/lodash.unzip/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.unzipwith/index.d.ts b/types/lodash.unzipwith/index.d.ts index 16bbed9242..de997d4c80 100644 --- a/types/lodash.unzipwith/index.d.ts +++ b/types/lodash.unzipwith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.update/index.d.ts b/types/lodash.update/index.d.ts index 42c7338066..a9dc9ae88e 100644 --- a/types/lodash.update/index.d.ts +++ b/types/lodash.update/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.updatewith/index.d.ts b/types/lodash.updatewith/index.d.ts index 45f319a1d6..578de0a19b 100644 --- a/types/lodash.updatewith/index.d.ts +++ b/types/lodash.updatewith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.uppercase/index.d.ts b/types/lodash.uppercase/index.d.ts index fcc0bd2431..0433e10190 100644 --- a/types/lodash.uppercase/index.d.ts +++ b/types/lodash.uppercase/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.upperfirst/index.d.ts b/types/lodash.upperfirst/index.d.ts index 3c10682234..a95e6a2325 100644 --- a/types/lodash.upperfirst/index.d.ts +++ b/types/lodash.upperfirst/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.values/index.d.ts b/types/lodash.values/index.d.ts index 695f2edcdc..5712010b17 100644 --- a/types/lodash.values/index.d.ts +++ b/types/lodash.values/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.valuesin/index.d.ts b/types/lodash.valuesin/index.d.ts index 3d1a489783..0168a046d0 100644 --- a/types/lodash.valuesin/index.d.ts +++ b/types/lodash.valuesin/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.without/index.d.ts b/types/lodash.without/index.d.ts index 059ad9cd74..72cb11a8d8 100644 --- a/types/lodash.without/index.d.ts +++ b/types/lodash.without/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.words/index.d.ts b/types/lodash.words/index.d.ts index d27c6304fc..d635b02bbe 100644 --- a/types/lodash.words/index.d.ts +++ b/types/lodash.words/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.wrap/index.d.ts b/types/lodash.wrap/index.d.ts index 753d51ffd3..52d0eb754e 100644 --- a/types/lodash.wrap/index.d.ts +++ b/types/lodash.wrap/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.xor/index.d.ts b/types/lodash.xor/index.d.ts index 7556c23b6e..ce8257b1be 100644 --- a/types/lodash.xor/index.d.ts +++ b/types/lodash.xor/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.xorby/index.d.ts b/types/lodash.xorby/index.d.ts index 527c871371..3d15668d8a 100644 --- a/types/lodash.xorby/index.d.ts +++ b/types/lodash.xorby/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.xorwith/index.d.ts b/types/lodash.xorwith/index.d.ts index 59f2c2c830..8120a73dea 100644 --- a/types/lodash.xorwith/index.d.ts +++ b/types/lodash.xorwith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.zip/index.d.ts b/types/lodash.zip/index.d.ts index c101c378ae..3aca9880f9 100644 --- a/types/lodash.zip/index.d.ts +++ b/types/lodash.zip/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.zipobject/index.d.ts b/types/lodash.zipobject/index.d.ts index 3fa098f79a..b76f341e3e 100644 --- a/types/lodash.zipobject/index.d.ts +++ b/types/lodash.zipobject/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.zipobjectdeep/index.d.ts b/types/lodash.zipobjectdeep/index.d.ts index 6391b92bd8..b2b3a82dd2 100644 --- a/types/lodash.zipobjectdeep/index.d.ts +++ b/types/lodash.zipobjectdeep/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash.zipwith/index.d.ts b/types/lodash.zipwith/index.d.ts index 2f123f19b1..fe58ffb360 100644 --- a/types/lodash.zipwith/index.d.ts +++ b/types/lodash.zipwith/index.d.ts @@ -2,7 +2,7 @@ // Project: https://lodash.com // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/lodash/scripts/generate-modules.ts b/types/lodash/scripts/generate-modules.ts index 523f23e6e6..6965242937 100644 --- a/types/lodash/scripts/generate-modules.ts +++ b/types/lodash/scripts/generate-modules.ts @@ -56,7 +56,7 @@ async function globalDefinitionText(moduleName: string): Promise { // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.8 +// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts diff --git a/types/office-runtime/index.d.ts b/types/office-runtime/index.d.ts index 7fb265c57e..6eb156efc5 100644 --- a/types/office-runtime/index.d.ts +++ b/types/office-runtime/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/OfficeDev/office-js // Definitions by: Michael Zlatskovsky , Michelle Scharlock // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.4 +// TypeScript Version: 2.4 /* office-runtime diff --git a/types/websocket-async/index.d.ts b/types/websocket-async/index.d.ts index 36bb12e08e..8cb73a9e93 100644 --- a/types/websocket-async/index.d.ts +++ b/types/websocket-async/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/jcao219/websocket-async // Definitions by: Ben O'Sullivan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.7 +// TypeScript Version: 2.7 /** * An asynchronous WebSocket client. From 5041e306a2f35e51eb64cf983ae8261100d20b33 Mon Sep 17 00:00:00 2001 From: Jacob Gardner Date: Thu, 14 Feb 2019 12:57:34 -0600 Subject: [PATCH 025/924] Revert some changes made during find/replace --- types/jest-image-snapshot/jest-image-snapshot-tests.ts | 2 +- types/lodash-es/index.d.ts | 2 +- types/office-runtime/index.d.ts | 2 +- types/websocket-async/index.d.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/types/jest-image-snapshot/jest-image-snapshot-tests.ts b/types/jest-image-snapshot/jest-image-snapshot-tests.ts index 402e505bb0..07f6debed7 100644 --- a/types/jest-image-snapshot/jest-image-snapshot-tests.ts +++ b/types/jest-image-snapshot/jest-image-snapshot-tests.ts @@ -1,4 +1,4 @@ -// TypeScript Version: 2.3 +// Typescript Version: 2.3 import { toMatchImageSnapshot, configureToMatchImageSnapshot, MatchImageSnapshotOptions } from 'jest-image-snapshot'; it('should be able to use toMatchImageSnapshot in a test', () => { diff --git a/types/lodash-es/index.d.ts b/types/lodash-es/index.d.ts index 3e9fcfa69c..61eb6016ee 100644 --- a/types/lodash-es/index.d.ts +++ b/types/lodash-es/index.d.ts @@ -2,7 +2,7 @@ // Project: http://lodash.com/, https://lodash.com/custom-builds // Definitions by: Stephen Lautier , e-cloud // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 2.6 export { default as add } from "./add"; export { default as after } from "./after"; diff --git a/types/office-runtime/index.d.ts b/types/office-runtime/index.d.ts index 6eb156efc5..7fb265c57e 100644 --- a/types/office-runtime/index.d.ts +++ b/types/office-runtime/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/OfficeDev/office-js // Definitions by: Michael Zlatskovsky , Michelle Scharlock // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 +// Typescript Version: 2.4 /* office-runtime diff --git a/types/websocket-async/index.d.ts b/types/websocket-async/index.d.ts index 8cb73a9e93..36bb12e08e 100644 --- a/types/websocket-async/index.d.ts +++ b/types/websocket-async/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/jcao219/websocket-async // Definitions by: Ben O'Sullivan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.7 +// Typescript Version: 2.7 /** * An asynchronous WebSocket client. From c94d9908e12ab4ceea1d7fe7b960bd3821aab802 Mon Sep 17 00:00:00 2001 From: Jacob Gardner Date: Thu, 14 Feb 2019 12:59:26 -0600 Subject: [PATCH 026/924] One more change that wasn't supposed to be added. --- types/lodash/common/object.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/lodash/common/object.d.ts b/types/lodash/common/object.d.ts index d36b603f42..29ab78bed4 100644 --- a/types/lodash/common/object.d.ts +++ b/types/lodash/common/object.d.ts @@ -1685,7 +1685,7 @@ declare module "../index" { get( object: TObject | null | undefined, path: TKey | [TKey], - defaultValue: TDefault, + defaultValue: TDefault ): Exclude | TDefault; /** From 1b08ca997e9af3ac39404e7b4457496381dc9c9e Mon Sep 17 00:00:00 2001 From: Jacob Gardner Date: Thu, 14 Feb 2019 13:32:39 -0600 Subject: [PATCH 027/924] Update adone to use TypeScript 2.8 --- types/adone/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/adone/index.d.ts b/types/adone/index.d.ts index 521bdf6e03..f7249c00b4 100644 --- a/types/adone/index.d.ts +++ b/types/adone/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/ciferox/adone // Definitions by: am , Maximus // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 /// /// From 4535063cb12d3f916ca2b1ec8fc376fb58c9cf17 Mon Sep 17 00:00:00 2001 From: Jacob Gardner Date: Thu, 14 Feb 2019 13:33:48 -0600 Subject: [PATCH 028/924] Update gulp-template --- types/gulp-template/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/gulp-template/index.d.ts b/types/gulp-template/index.d.ts index a2270eb387..f325cfb9c1 100644 --- a/types/gulp-template/index.d.ts +++ b/types/gulp-template/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/sindresorhus/gulp-template#readme // Definitions by: Peter Safranek // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 /// From b23e09d323d53a3b582df1265b7f3a5880be6888 Mon Sep 17 00:00:00 2001 From: Jacob Gardner Date: Thu, 14 Feb 2019 13:35:16 -0600 Subject: [PATCH 029/924] Bump lodash-es version to 2.8 --- types/lodash-es/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/lodash-es/index.d.ts b/types/lodash-es/index.d.ts index 61eb6016ee..3e9fcfa69c 100644 --- a/types/lodash-es/index.d.ts +++ b/types/lodash-es/index.d.ts @@ -2,7 +2,7 @@ // Project: http://lodash.com/, https://lodash.com/custom-builds // Definitions by: Stephen Lautier , e-cloud // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 export { default as add } from "./add"; export { default as after } from "./after"; From 2df6f925924d0397a22b9f7334845ffee598dc34 Mon Sep 17 00:00:00 2001 From: Jacob Gardner Date: Thu, 14 Feb 2019 13:36:53 -0600 Subject: [PATCH 030/924] Bump version for lowdb --- types/lowdb/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/lowdb/index.d.ts b/types/lowdb/index.d.ts index a8146ef8a2..3663b35823 100644 --- a/types/lowdb/index.d.ts +++ b/types/lowdb/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: typicode // Bazyli Brzóska // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 /// From 766ba9902395d29e364db10760af57694b085fcb Mon Sep 17 00:00:00 2001 From: Jacob Gardner Date: Thu, 14 Feb 2019 13:38:09 -0600 Subject: [PATCH 031/924] Bump yog2-kernel version --- types/yog2-kernel/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/yog2-kernel/index.d.ts b/types/yog2-kernel/index.d.ts index 0a6d1abc1e..dfe474b0b1 100644 --- a/types/yog2-kernel/index.d.ts +++ b/types/yog2-kernel/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/fex-team/yog2-kernel // Definitions by: ssddi456 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as express from "express"; import * as _ from "lodash"; From c281b9c020d197e7dede009cfff52a31544d7460 Mon Sep 17 00:00:00 2001 From: Jacob Gardner Date: Thu, 14 Feb 2019 14:26:51 -0600 Subject: [PATCH 032/924] Update project for sequelizejs based on travis failure --- types/sequelize/index.d.ts | 2 +- types/sequelize/v3/index.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/sequelize/index.d.ts b/types/sequelize/index.d.ts index 5d1131684c..458929e298 100644 --- a/types/sequelize/index.d.ts +++ b/types/sequelize/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for Sequelize 4.27.11 -// Project: http://sequelizejs.com +// Project: https://github.com/sequelize/sequelize // Definitions by: samuelneff // Peter Harris // Ivan Drinchev diff --git a/types/sequelize/v3/index.d.ts b/types/sequelize/v3/index.d.ts index 484edd089d..4d2ea38efc 100644 --- a/types/sequelize/v3/index.d.ts +++ b/types/sequelize/v3/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for Sequelize 3.30.4 -// Project: http://sequelizejs.com +// Project: https://github.com/sequelize/sequelize // Definitions by: samuelneff // Peter Harris // Ivan Drinchev From 5adceb834ffbfbdf8e5879e07dec5893cdac76e9 Mon Sep 17 00:00:00 2001 From: Jeff Held Date: Thu, 14 Feb 2019 16:00:53 -0600 Subject: [PATCH 033/924] [detox] use export = instead of export default for test runners --- types/detox/runners/jest/adapter/index.d.ts | 2 +- types/detox/runners/mocha/adapter/index.d.ts | 2 +- types/detox/test/detox-jest-setup-tests.ts | 3 +-- types/detox/test/detox-mocha-setup-tests.ts | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/types/detox/runners/jest/adapter/index.d.ts b/types/detox/runners/jest/adapter/index.d.ts index f479eda256..ca64f30820 100644 --- a/types/detox/runners/jest/adapter/index.d.ts +++ b/types/detox/runners/jest/adapter/index.d.ts @@ -9,4 +9,4 @@ interface DetoxJestAdapter { declare const adapter: DetoxJestAdapter; -export default adapter; +export = adapter; diff --git a/types/detox/runners/mocha/adapter/index.d.ts b/types/detox/runners/mocha/adapter/index.d.ts index 8e13b3bc01..3249031eee 100644 --- a/types/detox/runners/mocha/adapter/index.d.ts +++ b/types/detox/runners/mocha/adapter/index.d.ts @@ -6,4 +6,4 @@ interface DetoxMochaAdapter { declare const adapter: DetoxMochaAdapter; -export default adapter; +export = adapter; diff --git a/types/detox/test/detox-jest-setup-tests.ts b/types/detox/test/detox-jest-setup-tests.ts index c0b1ea2127..dbc892afd8 100644 --- a/types/detox/test/detox-jest-setup-tests.ts +++ b/types/detox/test/detox-jest-setup-tests.ts @@ -2,8 +2,7 @@ declare var beforeAll: (callback: () => void) => void; declare var beforeEach: (callback: () => void) => void; declare var afterAll: (callback: () => void) => void; -import defaultDetox from "detox"; -import adapter from "detox/runners/jest/adapter"; +import * as adapter from "detox/runners/jest/adapter"; // Normally the Detox configuration from the project's package.json like so: // const config = require("./package.json").detox; diff --git a/types/detox/test/detox-mocha-setup-tests.ts b/types/detox/test/detox-mocha-setup-tests.ts index c415eed696..9d0e9fd02f 100644 --- a/types/detox/test/detox-mocha-setup-tests.ts +++ b/types/detox/test/detox-mocha-setup-tests.ts @@ -5,7 +5,7 @@ declare var beforeEach: (callback: () => void) => void; declare var after: (callback: () => void) => void; declare var afterEach: (callback: () => void) => void; -import adapter from "detox/runners/mocha/adapter"; +import * as adapter from "detox/runners/mocha/adapter"; // Normally the Detox configuration from the project's package.json like so: // const config = require("./package.json").detox; From 7d31fcf21767920d8281cf1f762308a2eecd25cb Mon Sep 17 00:00:00 2001 From: supaiku Date: Fri, 15 Feb 2019 03:47:33 +0100 Subject: [PATCH 034/924] Revert "fix: export default" This reverts commit 0aaf38806d1838ad54bf9cc4530447650760292a. --- types/animejs/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/animejs/index.d.ts b/types/animejs/index.d.ts index bbfb21963b..069187b15e 100644 --- a/types/animejs/index.d.ts +++ b/types/animejs/index.d.ts @@ -133,4 +133,5 @@ declare namespace anime { declare function anime(params: anime.AnimeParams): anime.AnimeInstance; -export default anime; +export = anime; +export as namespace anime; From 2a263af346572a7ff4dd3a5b12d80c749e9495b2 Mon Sep 17 00:00:00 2001 From: supaiku Date: Fri, 15 Feb 2019 03:48:31 +0100 Subject: [PATCH 035/924] fix: enable allowSyntheticDefaultImports --- types/animejs/tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/types/animejs/tsconfig.json b/types/animejs/tsconfig.json index 02c5552371..9ed0aa7d69 100644 --- a/types/animejs/tsconfig.json +++ b/types/animejs/tsconfig.json @@ -14,6 +14,7 @@ "../" ], "types": [], + "allowSyntheticDefaultImports": true, "noEmit": true, "forceConsistentCasingInFileNames": true }, From 04efe5f37356157060efffd4b2aa48dd4b706535 Mon Sep 17 00:00:00 2001 From: supaiku Date: Fri, 15 Feb 2019 04:01:30 +0100 Subject: [PATCH 036/924] fix: add timelineOffset --- types/animejs/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/animejs/index.d.ts b/types/animejs/index.d.ts index 069187b15e..ad2d73fb2b 100644 --- a/types/animejs/index.d.ts +++ b/types/animejs/index.d.ts @@ -110,7 +110,7 @@ declare namespace anime { } interface AnimeTimelineInstance extends AnimeInstance { - add(params: AnimeAnimParams): AnimeTimelineInstance; + add(params: AnimeAnimParams, timelineOffset?: string | number): AnimeTimelineInstance; } // Helpers From c0b82cd8f294de928d3a180e52c518909dd33f87 Mon Sep 17 00:00:00 2001 From: supaiku Date: Fri, 15 Feb 2019 04:03:01 +0100 Subject: [PATCH 037/924] chore: add contributor --- types/animejs/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/animejs/index.d.ts b/types/animejs/index.d.ts index ad2d73fb2b..607872039f 100644 --- a/types/animejs/index.d.ts +++ b/types/animejs/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for animejs 2.0 // Project: http://animejs.com -// Definitions by: Andrew Babin +// Definitions by: Andrew Babin +// supaiku0 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 From 85f9770c78cf1dad526bc7046355710c117f5cfc Mon Sep 17 00:00:00 2001 From: supaiku Date: Fri, 15 Feb 2019 04:10:27 +0100 Subject: [PATCH 038/924] test: timelineOffset --- types/animejs/animejs-tests.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/types/animejs/animejs-tests.ts b/types/animejs/animejs-tests.ts index 926f89acc8..8ed6fccf8e 100644 --- a/types/animejs/animejs-tests.ts +++ b/types/animejs/animejs-tests.ts @@ -17,9 +17,9 @@ const test2 = anime({ }, translateY: '40px', color: [ - {value: '#FF0000', duration: 2000}, - {value: '#00FF00', duration: 2000}, - {value: '#0000FF', duration: 2000}, + { value: '#FF0000', duration: 2000 }, + { value: '#00FF00', duration: 2000 }, + { value: '#0000FF', duration: 2000 }, ], duration: () => { return 1000000000000; @@ -69,3 +69,9 @@ const bezier = anime.bezier(0, 0, 100, 100); anime.easings['hello'] = anime.bezier(0, 0, 1900, 3020); const runningAnims = anime.running; anime.remove(".tiny-divvy-div"); + +anime.timeline().add({ + targets: [], + duration: 1000, + easing: "linear", +}, 0); From 658091f2ec553677cd44d23467696f6316a03096 Mon Sep 17 00:00:00 2001 From: Jack Works Date: Fri, 15 Feb 2019 22:34:02 +0800 Subject: [PATCH 039/924] Add package: gun --- types/gun/gun-tests.ts | 56 +++++++ types/gun/index.d.ts | 318 ++++++++++++++++++++++++++++++++++++++++ types/gun/tsconfig.json | 22 +++ types/gun/tslint.json | 1 + 4 files changed, 397 insertions(+) create mode 100644 types/gun/gun-tests.ts create mode 100644 types/gun/index.d.ts create mode 100644 types/gun/tsconfig.json create mode 100644 types/gun/tslint.json diff --git a/types/gun/gun-tests.ts b/types/gun/gun-tests.ts new file mode 100644 index 0000000000..2f65781bac --- /dev/null +++ b/types/gun/gun-tests.ts @@ -0,0 +1,56 @@ +import GunServer = require('gun'); +import Gun = require('gun/gun'); +import 'gun/lib/path.js'; +import 'gun/lib/not.js'; +import 'gun/lib/open.js'; +import 'gun/lib/load.js'; +import 'gun/lib/then.js'; +import 'gun/lib/bye.js'; +import 'gun/lib/later.js'; +import 'gun/lib/unset.js'; +import 'gun/lib/time.js'; + +Gun('http://yourdomain.com/gun'); +Gun(['http://server1.com/gun', 'http://server2.com/gun']); +Gun({ + s3: { + key: '', + secret: '', + bucket: '' + }, + file: 'file/path.json', + uuid() { + return 'xxxxxx'; + } +}); + +interface AppState { + object: { + num: number; + str: string; + bool: boolean; + obj: { + arr2: Array<{ foo: number; bar: string; }> + } + }; + chatRoom: Array<{ by: string; message: string; }>; +} + +const app = new Gun(); +app.get('object').get('bool').put(true); +app.get('object').get('num').put(1); +app.get('object').get('obj').get('arr2').set({ foo: 1, bar: '2' }); + +app.get('object').on((data) => { + data.bool; +}); +app.get('object').off(); +app.get('object').once((data) => { + if (data) data.bool; +}); +async function name() { + const data = await app.get('object').promise!(); + data.put.bool; +} +app.get('chatRoom').time!({ by: 'A', message: 'Hello' }); +app.get('chatRoom').time!((msg) => { msg.by; }, 20); diff --git a/types/gun/index.d.ts b/types/gun/index.d.ts new file mode 100644 index 0000000000..0c9063b4ed --- /dev/null +++ b/types/gun/index.d.ts @@ -0,0 +1,318 @@ +// Type definitions for gun 0.9 +// Project: https://github.com/amark/gun#readme +// Definitions by: Jack Works +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module 'gun' { + const Gun: Gun.Constructor + export = Gun +} + +declare module 'gun/gun' { + const cons: typeof import('gun') + export = cons +} + +declare namespace Gun { + type ArrayOf = T extends Array ? U : never + /** Gun does not accept Array value, so we need extract to make types correct */ + type AllowArray = ArrayOf extends never ? T : ArrayOf + type DisallowArray = ArrayOf extends never ? T : never + type ArrayAsRecord = ArrayOf extends never ? DataType : Record + /** + * options['module name'] allows you to pass options to a 3rd party module. + * Their project README will likely list the exposed options + * https://github.com/amark/gun/wiki/Modules + */ + type ConstructorOptions = Partial<{ + /** Undocumented but mentioned. Write data to a JSON. */ + file: string + /** Undocumented but mentioned. Create a websocket server */ + web: any + /** Undocumented but mentioned. Amazon S3 */ + s3: { + key: any + secret: any + bucket: any + } + /** the URLs are properties, and the value is an empty object. */ + peers: Record + /** default: true, creates and persists local (nodejs) data using Radisk. */ + radisk: boolean + /** default: true, persists local (browser) data to localStorage. */ + localStorage: boolean + /** uuid allows you to override the default 24 random alphanumeric soul generator with your own function. */ + uuid(): string + /** + * allows you to pass options to a 3rd party module. Their project README will likely list the exposed options + * @see https://github.com/amark/gun/wiki/Modules + */ + [key: string]: any + }> + type Saveable = Partial | string | number | boolean | null | ChainReference + type AckCallback = (ack: { err: Error; ok: any } | { err: undefined; ok: string }) => void + interface ChainReference { + /** + * Save data into gun, syncing it with your connected peers. + * + * * You cannot save primitive values at the root level. + * + * @param data You do not need to re-save the entire object every time, + * gun will automatically merge your data into what already exists as a "partial" update. + * + * * `undefined`, `NaN`, `Infinity`, `array`, will be rejected. + * * Traditional arrays are dangerous in real-time apps. Use `gun.set` instead. + * + * @param callback invoked on each acknowledgment + */ + put(data: DisallowArray, callback?: AckCallback): ChainReference + /** + * Where to read data from. + * @param key The key is the ID or property name of the data that you saved from earlier + * (or that will be saved later). + * * Note that if you use .put at any depth after a get it first reads the data and then writes, merging the data as a partial update. + * @param callback You will usually be using gun.on or gun.once to actually retrieve your data, + * not this callback (it is intended for more low level control, for module and extensions). + * + * **Avoid use callback. The type in the document may be wrong.** + * + * **Here the type of callback respect to the actual behavior** + */ + get( + key: ArrayOf extends never ? K : never, + callback?: ( + /** the raw data. Internal node of gun. Will not typed here. */ + paramA: Record< + 'gun' | '$' | 'root' | 'id' | 'back' | 'on' | 'tag' | 'get' | 'soul' | 'ack' | 'put', + any + >, + /** the key, ID, or property name of the data. */ + paramB: Record<'off' | 'to' | 'next' | 'the' | 'on' | 'as' | 'back' | 'rid' | 'id', any> + ) => void + ): ChainReference + /** + * Change the configuration of the gun database instance. + * @param options The options argument is the same object you pass to the constructor. + * + * The options's properties replace those in the instance's configuration but options.peers are **added** to peers known to the gun instance. + * @returns No mention in the document, behavior as `ChainReference` + */ + opt(options: ConstructorOptions): ChainReference + /** + * Move up to the parent context on the chain. + * + * Every time a new chain is created, a reference to the old context is kept to go back to. + * @param amount The number of times you want to go back up the chain. + * `-1` or `Infinity` will take you to the root. + * @returns Impossible to determinate final type. You must cast it by yourself. + */ + back(amount?: number): ChainReference + + // Main API + /** + * Subscribe to updates and changes on a node or property in realtime. + * @param option Currently, the only option is to filter out old data, and just be given the changes. + * If you're listening to a node with 100 fields, and just one changes, + * you'll instead be passed a node with a single property representing that change rather than the full node every time. + * @param callback + * Once initially and whenever the property or node you're focused on changes, this callback is immediately fired with the data as it is at that point in time. + * + * Since gun streams data, the callback will probably be called multiple times as new chunk comes in. + * To remove a listener call .off() on the same property or node. + */ + on( + callback: (data: ArrayAsRecord, key: ReferenceKey) => void, + option?: { change: boolean } | boolean + ): ChainReference + /** + * Get the current data without subscribing to updates. Or `undefined` if it cannot be found. + * @returns In the document, it said the return value may change in the future. Don't rely on it. + */ + once( + callback?: (data: (ArrayAsRecord) | undefined, key: ReferenceKey) => void, + option?: { wait: number } + ): ChainReference + /** + * **.set does not means 'set data', it means a Mathematical Set** + * + * Add a unique item to an unordered list. + * `gun.set` works like a mathematical set, where each item in the list is unique. + * If the item is added twice, it will be merged. + * + * **This means only objects, for now, are supported.** + */ + set( + data: DataType extends Array + ? U extends { [key: string]: any; [key: number]: any } + ? ArrayOf + : never + : never, + callback?: AckCallback + ): ChainReference> + /** + * Map iterates over each property and item on a node, passing it down the chain, + * behaving like a forEach on your data. + * It also subscribes to every item as well and listens for newly inserted items. + */ + map( + callback?: (value: ArrayOf, key: DataType) => ArrayOf | undefined + ): ChainReference, ReferenceKey> + /** + * Undocumented, but extremely useful and mentioned in the document + * + * Remove **all** listener on this node. + */ + off(): void + + // Extended API + /** + * + * Path does the same thing as `.get` but has some conveniences built in. + * @deprecated This is not friendly with type system. + * + * **Warning**: This extension was removed from core, you probably shouldn't be using it! + * + * **Warning**: Not included by default! You must include it yourself via `require('gun/lib/path.js')` or + * ``! + */ + path?(path: string | string[]): ChainReference + /** + * Handle cases where data can't be found. + * + * **Warning**: Not included by default! You must include it yourself via `require('gun/lib/not.js')` or + * ``! + */ + not?(callback: (key: ReferenceKey) => void): ChainReference + /** + * Open behaves very similarly to gun.on, except it gives you the **full depth of a document** on every update. + * It also works with graphs, tables, or other data structures. Think of it as opening up a live connection to a document. + * + * **Warning**: Not included by default! You must include it yourself via `require('gun/lib/open.js')` or + * ``! + */ + open?(callback: (data: ArrayAsRecord) => void): ChainReference + /** + * Loads the full object once. It is the same as `open` but with the behavior of `once`. + * + * **Warning**: Not included by default! You must include it yourself via `require('gun/lib/load.js')` or + * ``! + */ + load?(callback: (data: ArrayAsRecord) => void): ChainReference + /** + * Returns a promise for you to use. + * + * **Warning**: Not included by default! You must include it yourself via `require('gun/lib/then.js')` or + * ``! + */ + then?, TResult2 = never>( + onfulfilled?: ((value: TResult1) => TResult1 | PromiseLike) | undefined | null + ): Promise + /** + * Returns a promise for you to use. + * + * **Warning**: Not included by default! You must include it yourself via `require('gun/lib/then.js')` or + * ``! + */ + promise?< + TResult1 = { put: ArrayAsRecord; key: ReferenceKey; gun: ChainReference }, + TResult2 = never + >( + onfulfilled?: ((value: TResult1) => TResult1 | PromiseLike) | undefined | null + ): Promise + /** + * bye lets you change data after that browser peer disconnects. + * This is useful for games and status messages, + * that if a player leaves you can remove them from the game or set a user's status to "away". + * + * **Warning**: Not included by default! You must include it yourself via `require('gun/lib/bye.js')` or + * ``! + */ + bye?(): { + put(data: DisallowArray>): void + } + /** + * Say you save some data, but want to do something with it later, like expire it or refresh it. + * Well, then `later` is for you! You could use this to easily implement a TTL or similar behavior. + * + * **Warning**: Not included by default! You must include it yourself via `require('gun/lib/later.js')` or + * ``! + */ + later?( + callback: ( + this: ChainReference, + data: ArrayAsRecord, + key: ReferenceKey + ) => void, + seconds: number + ): ChainReference + /** + * After you save some data in an unordered list, you may need to remove it. + * + * **Warning**: Not included by default! You must include it yourself via `require('gun/lib/unset.js')` or + * ``! + */ + unset?(data: ArrayOf): ChainReference + /** + * Subscribes to all future events that occur on the Timegraph and retrieve a specified number of old events + * + * **Warning**: The Timegraph extension isn't required by default, you would need to include at "gun/lib/time.js" + */ + time?( + callback: (data: ArrayOf, key: ReferenceKey, time: number) => void, + alsoReceiveNOldEvents?: number + ): ChainReference + /** Pushes data to a Timegraph with it's time set to Gun.state()'s time */ + time?(data: ArrayOf): void + } + + interface GunSEA { + // There is no the only content in the api document. + user: { + create(alias: string, passphrase: string, callback: (...args: any[]) => void): any + } + } + + interface Constructor { + /** + * @description + * no parameters creates a local datastore using the default persistence layer, either localStorage or Radisk. + */ + (): ChainReference & GunSEA + new (): ChainReference & GunSEA + + /** + * @param url + * passing a URL creates the above local datastore that also tries to sync with the URL. + * + * or you can pass in an array of URLs to sync with multiple peers. + */ + (url: string | string[]): ChainReference & GunSEA + new (url: string | string[]): ChainReference & GunSEA + (option: ConstructorOptions): ChainReference & GunSEA + new (option: ConstructorOptions): ChainReference & GunSEA + node: { + /** Returns true if data is a gun node, otherwise false. */ + is(anything: any): anything is ChainReference + /** Returns data's gun ID (instead of manually grabbing its metadata i.e. data["_"]["#"], which is faster but could change in the future) + * + * Returns undefined if data is not correct gun data. */ + soul(data: ChainReference): string + /** Returns a "gun-ified" variant of the json input by injecting a new gun ID into the metadata field. */ + ify(json: any): any + } + /** @see https://gun.eco/docs/SEA */ + SEA: any + } +} + +// Following modules does not export anything, but extends the gun prototype +declare module 'gun/lib/path.js' +declare module 'gun/lib/not.js' +declare module 'gun/lib/open.js' +declare module 'gun/lib/load.js' +declare module 'gun/lib/then.js' +declare module 'gun/lib/bye.js' +declare module 'gun/lib/later.js' +declare module 'gun/lib/unset.js' +declare module 'gun/lib/time.js' +declare const Gun: typeof import('gun') diff --git a/types/gun/tsconfig.json b/types/gun/tsconfig.json new file mode 100644 index 0000000000..7b7490d14c --- /dev/null +++ b/types/gun/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", + "gun-tests.ts" + ] +} diff --git a/types/gun/tslint.json b/types/gun/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/gun/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From f779a756cf874c68072427a00501f20c992eddbc Mon Sep 17 00:00:00 2001 From: Jack Works Date: Fri, 15 Feb 2019 23:18:29 +0800 Subject: [PATCH 040/924] Fix errors --- types/gun/gun-tests.ts | 36 +++++++--- types/gun/gun.d.ts | 3 + types/gun/index.d.ts | 145 +++++++++++++++++----------------------- types/gun/tsconfig.json | 1 + types/gun/tslint.json | 2 +- 5 files changed, 92 insertions(+), 95 deletions(-) create mode 100644 types/gun/gun.d.ts diff --git a/types/gun/gun-tests.ts b/types/gun/gun-tests.ts index 2f65781bac..d196fba695 100644 --- a/types/gun/gun-tests.ts +++ b/types/gun/gun-tests.ts @@ -10,7 +10,7 @@ import 'gun/lib/later.js'; import 'gun/lib/unset.js'; import 'gun/lib/time.js'; -Gun('http://yourdomain.com/gun'); +GunServer('http://yourdomain.com/gun'); Gun(['http://server1.com/gun', 'http://server2.com/gun']); Gun({ s3: { @@ -30,22 +30,34 @@ interface AppState { str: string; bool: boolean; obj: { - arr2: Array<{ foo: number; bar: string; }> - } + arr2: Array<{ foo: number; bar: string }>; + }; }; - chatRoom: Array<{ by: string; message: string; }>; + chatRoom: Array<{ by: string; message: string }>; } const app = new Gun(); -app.get('object').get('bool').put(true); -app.get('object').get('num').put(1); -app.get('object').get('obj').get('arr2').set({ foo: 1, bar: '2' }); +app.get('object') + .get('bool') + .put(true); +app.get('object') + .get('num') + .put(1); +app.get('object') + .get('obj') + .get('arr2') + .set({ foo: 1, bar: '2' }); -app.get('object').on((data) => { +app.get('object') + .get('bool') + // $ExpectError + .put(1); + +app.get('object').on(data => { data.bool; }); app.get('object').off(); -app.get('object').once((data) => { +app.get('object').once(data => { if (data) data.bool; }); async function name() { @@ -53,4 +65,8 @@ async function name() { data.put.bool; } app.get('chatRoom').time!({ by: 'A', message: 'Hello' }); -app.get('chatRoom').time!((msg) => { msg.by; }, 20); +app.get('chatRoom').time!(msg => { + msg.by; +}, 20); +// $ExpectError +app.get('object').time!({ a: 1 }); diff --git a/types/gun/gun.d.ts b/types/gun/gun.d.ts new file mode 100644 index 0000000000..841dfa34a9 --- /dev/null +++ b/types/gun/gun.d.ts @@ -0,0 +1,3 @@ + +declare const cons: typeof import('gun') +export = cons diff --git a/types/gun/index.d.ts b/types/gun/index.d.ts index 0c9063b4ed..51d02b68d5 100644 --- a/types/gun/index.d.ts +++ b/types/gun/index.d.ts @@ -2,23 +2,17 @@ // Project: https://github.com/amark/gun#readme // Definitions by: Jack Works // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.9 -declare module 'gun' { - const Gun: Gun.Constructor - export = Gun -} - -declare module 'gun/gun' { - const cons: typeof import('gun') - export = cons -} +declare const cons: Gun.Constructor; +export = cons; declare namespace Gun { - type ArrayOf = T extends Array ? U : never + type ArrayOf = T extends Array ? U : never; /** Gun does not accept Array value, so we need extract to make types correct */ - type AllowArray = ArrayOf extends never ? T : ArrayOf - type DisallowArray = ArrayOf extends never ? T : never - type ArrayAsRecord = ArrayOf extends never ? DataType : Record + type AllowArray = ArrayOf extends never ? T : ArrayOf; + type DisallowArray = ArrayOf extends never ? T : never; + type ArrayAsRecord = ArrayOf extends never ? DataType : Record; /** * options['module name'] allows you to pass options to a 3rd party module. * Their project README will likely list the exposed options @@ -26,31 +20,31 @@ declare namespace Gun { */ type ConstructorOptions = Partial<{ /** Undocumented but mentioned. Write data to a JSON. */ - file: string + file: string; /** Undocumented but mentioned. Create a websocket server */ - web: any + web: any; /** Undocumented but mentioned. Amazon S3 */ s3: { - key: any - secret: any - bucket: any - } + key: any; + secret: any; + bucket: any; + }; /** the URLs are properties, and the value is an empty object. */ - peers: Record + peers: Record; /** default: true, creates and persists local (nodejs) data using Radisk. */ - radisk: boolean + radisk: boolean; /** default: true, persists local (browser) data to localStorage. */ - localStorage: boolean + localStorage: boolean; /** uuid allows you to override the default 24 random alphanumeric soul generator with your own function. */ - uuid(): string + uuid(): string; /** * allows you to pass options to a 3rd party module. Their project README will likely list the exposed options * @see https://github.com/amark/gun/wiki/Modules */ - [key: string]: any - }> - type Saveable = Partial | string | number | boolean | null | ChainReference - type AckCallback = (ack: { err: Error; ok: any } | { err: undefined; ok: string }) => void + [key: string]: any; + }>; + type Saveable = Partial | string | number | boolean | null | ChainReference; + type AckCallback = (ack: { err: Error; ok: any } | { err: undefined; ok: string }) => void; interface ChainReference { /** * Save data into gun, syncing it with your connected peers. @@ -65,7 +59,7 @@ declare namespace Gun { * * @param callback invoked on each acknowledgment */ - put(data: DisallowArray, callback?: AckCallback): ChainReference + put(data: DisallowArray, callback?: AckCallback): ChainReference; /** * Where to read data from. * @param key The key is the ID or property name of the data that you saved from earlier @@ -89,7 +83,7 @@ declare namespace Gun { /** the key, ID, or property name of the data. */ paramB: Record<'off' | 'to' | 'next' | 'the' | 'on' | 'as' | 'back' | 'rid' | 'id', any> ) => void - ): ChainReference + ): ChainReference; /** * Change the configuration of the gun database instance. * @param options The options argument is the same object you pass to the constructor. @@ -97,7 +91,7 @@ declare namespace Gun { * The options's properties replace those in the instance's configuration but options.peers are **added** to peers known to the gun instance. * @returns No mention in the document, behavior as `ChainReference` */ - opt(options: ConstructorOptions): ChainReference + opt(options: ConstructorOptions): ChainReference; /** * Move up to the parent context on the chain. * @@ -106,7 +100,7 @@ declare namespace Gun { * `-1` or `Infinity` will take you to the root. * @returns Impossible to determinate final type. You must cast it by yourself. */ - back(amount?: number): ChainReference + back(amount?: number): ChainReference; // Main API /** @@ -123,7 +117,7 @@ declare namespace Gun { on( callback: (data: ArrayAsRecord, key: ReferenceKey) => void, option?: { change: boolean } | boolean - ): ChainReference + ): ChainReference; /** * Get the current data without subscribing to updates. Or `undefined` if it cannot be found. * @returns In the document, it said the return value may change in the future. Don't rely on it. @@ -131,7 +125,7 @@ declare namespace Gun { once( callback?: (data: (ArrayAsRecord) | undefined, key: ReferenceKey) => void, option?: { wait: number } - ): ChainReference + ): ChainReference; /** * **.set does not means 'set data', it means a Mathematical Set** * @@ -148,7 +142,7 @@ declare namespace Gun { : never : never, callback?: AckCallback - ): ChainReference> + ): ChainReference>; /** * Map iterates over each property and item on a node, passing it down the chain, * behaving like a forEach on your data. @@ -156,13 +150,13 @@ declare namespace Gun { */ map( callback?: (value: ArrayOf, key: DataType) => ArrayOf | undefined - ): ChainReference, ReferenceKey> + ): ChainReference, ReferenceKey>; /** * Undocumented, but extremely useful and mentioned in the document * * Remove **all** listener on this node. */ - off(): void + off(): void; // Extended API /** @@ -175,14 +169,14 @@ declare namespace Gun { * **Warning**: Not included by default! You must include it yourself via `require('gun/lib/path.js')` or * ``! */ - path?(path: string | string[]): ChainReference + path?(path: string | string[]): ChainReference; /** * Handle cases where data can't be found. * * **Warning**: Not included by default! You must include it yourself via `require('gun/lib/not.js')` or * ``! */ - not?(callback: (key: ReferenceKey) => void): ChainReference + not?(callback: (key: ReferenceKey) => void): ChainReference; /** * Open behaves very similarly to gun.on, except it gives you the **full depth of a document** on every update. * It also works with graphs, tables, or other data structures. Think of it as opening up a live connection to a document. @@ -190,23 +184,23 @@ declare namespace Gun { * **Warning**: Not included by default! You must include it yourself via `require('gun/lib/open.js')` or * ``! */ - open?(callback: (data: ArrayAsRecord) => void): ChainReference + open?(callback: (data: ArrayAsRecord) => void): ChainReference; /** * Loads the full object once. It is the same as `open` but with the behavior of `once`. * * **Warning**: Not included by default! You must include it yourself via `require('gun/lib/load.js')` or * ``! */ - load?(callback: (data: ArrayAsRecord) => void): ChainReference + load?(callback: (data: ArrayAsRecord) => void): ChainReference; /** * Returns a promise for you to use. * * **Warning**: Not included by default! You must include it yourself via `require('gun/lib/then.js')` or * ``! */ - then?, TResult2 = never>( - onfulfilled?: ((value: TResult1) => TResult1 | PromiseLike) | undefined | null - ): Promise + then?>( + onfulfilled?: (value: TResult1) => TResult1 | PromiseLike + ): Promise; /** * Returns a promise for you to use. * @@ -214,11 +208,10 @@ declare namespace Gun { * ``! */ promise?< - TResult1 = { put: ArrayAsRecord; key: ReferenceKey; gun: ChainReference }, - TResult2 = never + TResult1 = { put: ArrayAsRecord; key: ReferenceKey; gun: ChainReference } >( - onfulfilled?: ((value: TResult1) => TResult1 | PromiseLike) | undefined | null - ): Promise + onfulfilled?: (value: TResult1) => TResult1 | PromiseLike + ): Promise; /** * bye lets you change data after that browser peer disconnects. * This is useful for games and status messages, @@ -228,8 +221,8 @@ declare namespace Gun { * ``! */ bye?(): { - put(data: DisallowArray>): void - } + put(data: DisallowArray>): void; + }; /** * Say you save some data, but want to do something with it later, like expire it or refresh it. * Well, then `later` is for you! You could use this to easily implement a TTL or similar behavior. @@ -244,14 +237,14 @@ declare namespace Gun { key: ReferenceKey ) => void, seconds: number - ): ChainReference + ): ChainReference; /** * After you save some data in an unordered list, you may need to remove it. * * **Warning**: Not included by default! You must include it yourself via `require('gun/lib/unset.js')` or * ``! */ - unset?(data: ArrayOf): ChainReference + unset?(data: ArrayOf): ChainReference; /** * Subscribes to all future events that occur on the Timegraph and retrieve a specified number of old events * @@ -260,59 +253,43 @@ declare namespace Gun { time?( callback: (data: ArrayOf, key: ReferenceKey, time: number) => void, alsoReceiveNOldEvents?: number - ): ChainReference + ): ChainReference; /** Pushes data to a Timegraph with it's time set to Gun.state()'s time */ - time?(data: ArrayOf): void + time?(data: ArrayOf): void; } interface GunSEA { // There is no the only content in the api document. user: { - create(alias: string, passphrase: string, callback: (...args: any[]) => void): any - } + create(alias: string, passphrase: string, callback: (...args: any[]) => void): any; + }; } interface Constructor { /** * @description * no parameters creates a local datastore using the default persistence layer, either localStorage or Radisk. - */ - (): ChainReference & GunSEA - new (): ChainReference & GunSEA - - /** - * @param url + * @param options * passing a URL creates the above local datastore that also tries to sync with the URL. * * or you can pass in an array of URLs to sync with multiple peers. */ - (url: string | string[]): ChainReference & GunSEA - new (url: string | string[]): ChainReference & GunSEA - (option: ConstructorOptions): ChainReference & GunSEA - new (option: ConstructorOptions): ChainReference & GunSEA + (options?: string | string[] | ConstructorOptions): ChainReference & GunSEA; + new (options?: string | string[] | ConstructorOptions): ChainReference & GunSEA; node: { /** Returns true if data is a gun node, otherwise false. */ - is(anything: any): anything is ChainReference - /** Returns data's gun ID (instead of manually grabbing its metadata i.e. data["_"]["#"], which is faster but could change in the future) + is(anything: any): anything is ChainReference; + /** + * Returns data's gun ID (instead of manually grabbing its metadata i.e. data["_"]["#"], which is faster but could change in the future) * - * Returns undefined if data is not correct gun data. */ - soul(data: ChainReference): string + * Returns undefined if data is not correct gun data. + */ + soul(data: ChainReference): string; /** Returns a "gun-ified" variant of the json input by injecting a new gun ID into the metadata field. */ - ify(json: any): any - } + ify(json: any): any; + }; /** @see https://gun.eco/docs/SEA */ - SEA: any + SEA: any; } } - -// Following modules does not export anything, but extends the gun prototype -declare module 'gun/lib/path.js' -declare module 'gun/lib/not.js' -declare module 'gun/lib/open.js' -declare module 'gun/lib/load.js' -declare module 'gun/lib/then.js' -declare module 'gun/lib/bye.js' -declare module 'gun/lib/later.js' -declare module 'gun/lib/unset.js' -declare module 'gun/lib/time.js' -declare const Gun: typeof import('gun') +declare const Gun: Gun.Constructor; diff --git a/types/gun/tsconfig.json b/types/gun/tsconfig.json index 7b7490d14c..10fe933ba8 100644 --- a/types/gun/tsconfig.json +++ b/types/gun/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/gun/tslint.json b/types/gun/tslint.json index 3db14f85ea..982ecfcd14 100644 --- a/types/gun/tslint.json +++ b/types/gun/tslint.json @@ -1 +1 @@ -{ "extends": "dtslint/dt.json" } +{ "extends": "dtslint/dt.json", "rules": { "no-unnecessary-generics": false } } From 61dfce36a732890a0c9f5f15548b5e3d792943cd Mon Sep 17 00:00:00 2001 From: Jeff Held Date: Fri, 15 Feb 2019 17:34:26 -0600 Subject: [PATCH 041/924] [detox] add DetoxExport type for exported object --- types/detox/index.d.ts | 20 ++++++++++++-------- types/detox/test/detox-jest-setup-tests.ts | 3 ++- types/detox/test/detox-mocha-setup-tests.ts | 1 + 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/types/detox/index.d.ts b/types/detox/index.d.ts index 7ac69c1e1f..e89e73a794 100644 --- a/types/detox/index.d.ts +++ b/types/detox/index.d.ts @@ -42,6 +42,16 @@ declare global { */ cleanup(): Promise; } + + // Detox exports all methods from detox global and all of the global constants. + interface DetoxExport extends Detox { + device: Device; + element: Element; + waitFor: WaitFor; + expect: Expect>; + by: Matchers; + } + interface Device { /** * Launch the app @@ -434,12 +444,6 @@ declare global { } } -export { by, device, element, waitFor }; +declare const detoxExport: Detox.DetoxExport; -// Not exporting the global `expect` from the top of the file here -// because `expect` conflicts with the global `expect` of jest and -// therefore exporting it doesn't work. The global `expect` is kept -// for backwards compatibility though. -export const expect: Detox.Expect>; - -export = detox; +export = detoxExport; diff --git a/types/detox/test/detox-jest-setup-tests.ts b/types/detox/test/detox-jest-setup-tests.ts index dbc892afd8..94ddc3eb1e 100644 --- a/types/detox/test/detox-jest-setup-tests.ts +++ b/types/detox/test/detox-jest-setup-tests.ts @@ -2,6 +2,7 @@ declare var beforeAll: (callback: () => void) => void; declare var beforeEach: (callback: () => void) => void; declare var afterAll: (callback: () => void) => void; +import * as detox from "detox"; import * as adapter from "detox/runners/jest/adapter"; // Normally the Detox configuration from the project's package.json like so: @@ -18,7 +19,7 @@ beforeAll(async () => { initGlobals: false, launchApp: false, }; - await defaultDetox.init(config, initOptions); + await detox.init(config, initOptions); }); beforeEach(async () => { diff --git a/types/detox/test/detox-mocha-setup-tests.ts b/types/detox/test/detox-mocha-setup-tests.ts index 9d0e9fd02f..42e955ab4f 100644 --- a/types/detox/test/detox-mocha-setup-tests.ts +++ b/types/detox/test/detox-mocha-setup-tests.ts @@ -5,6 +5,7 @@ declare var beforeEach: (callback: () => void) => void; declare var after: (callback: () => void) => void; declare var afterEach: (callback: () => void) => void; +import * as detox from "detox"; import * as adapter from "detox/runners/mocha/adapter"; // Normally the Detox configuration from the project's package.json like so: From 1e890e9ef3845744399885d8a4a04f2c20d86b81 Mon Sep 17 00:00:00 2001 From: saranshkataria Date: Fri, 15 Feb 2019 17:29:11 -0800 Subject: [PATCH 042/924] fixed linewidth attribute --- types/three/index.d.ts | 75 +++++++++++++++++++------------------ types/three/three-core.d.ts | 2 +- 2 files changed, 39 insertions(+), 38 deletions(-) diff --git a/types/three/index.d.ts b/types/three/index.d.ts index 08b64250c8..21783efc40 100644 --- a/types/three/index.d.ts +++ b/types/three/index.d.ts @@ -25,46 +25,47 @@ // Zhang Hao // Konstantin Lukaschenko // Daniel Yim +// Saransh Kataria // Definitions: https://github.com//DefinitelyTyped // TypeScript Version: 2.8 -export * from "./three-core"; +export * from './three-core'; -export * from "./three-canvasrenderer"; -export * from "./three-colladaLoader"; -export * from "./three-copyshader"; -export * from "./three-css3drenderer"; -export * from "./three-ctmloader"; -export * from "./three-ddsloader"; -export * from "./three-tdsloader"; -export * from "./three-dragcontrols"; -export * from "./three-editorcontrols"; -export * from "./three-effectcomposer"; -export * from "./three-examples"; -export * from "./three-fbxloader"; -export * from "./three-FirstPersonControls"; -export * from "./three-gltfexporter"; -export * from "./three-gltfloader"; -export * from "./three-lensflare"; -export * from "./three-mapcontrols"; -export * from "./three-maskpass"; -export * from "./three-mtlloader"; -export * from "./three-objloader"; -export * from "./three-octree"; -export * from "./three-orbitcontrols"; -export * from "./three-orthographictrackballcontrols"; -export * from "./three-outlinepass"; -export * from "./three-projector"; -export * from "./three-renderpass"; -export * from "./three-shaderpass"; -export * from "./three-smaapass"; -export * from "./three-ssaapass"; -export * from "./three-filmpass"; -export * from "./three-tgaloader"; -export * from "./three-trackballcontrols"; -export * from "./three-transformcontrols"; -export * from "./three-unrealbloompass"; -export * from "./three-vrcontrols"; -export * from "./three-vreffect"; +export * from './three-canvasrenderer'; +export * from './three-colladaLoader'; +export * from './three-copyshader'; +export * from './three-css3drenderer'; +export * from './three-ctmloader'; +export * from './three-ddsloader'; +export * from './three-tdsloader'; +export * from './three-dragcontrols'; +export * from './three-editorcontrols'; +export * from './three-effectcomposer'; +export * from './three-examples'; +export * from './three-fbxloader'; +export * from './three-FirstPersonControls'; +export * from './three-gltfexporter'; +export * from './three-gltfloader'; +export * from './three-lensflare'; +export * from './three-mapcontrols'; +export * from './three-maskpass'; +export * from './three-mtlloader'; +export * from './three-objloader'; +export * from './three-octree'; +export * from './three-orbitcontrols'; +export * from './three-orthographictrackballcontrols'; +export * from './three-outlinepass'; +export * from './three-projector'; +export * from './three-renderpass'; +export * from './three-shaderpass'; +export * from './three-smaapass'; +export * from './three-ssaapass'; +export * from './three-filmpass'; +export * from './three-tgaloader'; +export * from './three-trackballcontrols'; +export * from './three-transformcontrols'; +export * from './three-unrealbloompass'; +export * from './three-vrcontrols'; +export * from './three-vreffect'; export as namespace THREE; diff --git a/types/three/three-core.d.ts b/types/three/three-core.d.ts index 7d871cae58..a70bed59ab 100755 --- a/types/three/three-core.d.ts +++ b/types/three/three-core.d.ts @@ -3115,7 +3115,7 @@ export interface ShaderMaterialParameters extends MaterialParameters { uniforms?: any; vertexShader?: string; fragmentShader?: string; - lineWidth?: number; + linewidth?: number; wireframe?: boolean; wireframeLinewidth?: number; lights?: boolean; From cc0204331ad27c1521dfe843bcbdcc7cc07ab643 Mon Sep 17 00:00:00 2001 From: Jack Works Date: Sat, 16 Feb 2019 10:23:06 +0800 Subject: [PATCH 043/924] Add a file --- types/gun/tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/types/gun/tsconfig.json b/types/gun/tsconfig.json index 10fe933ba8..0b6beab5e6 100644 --- a/types/gun/tsconfig.json +++ b/types/gun/tsconfig.json @@ -18,6 +18,7 @@ }, "files": [ "index.d.ts", + "gun.d.ts", "gun-tests.ts" ] } From 3608c2b445f0880da1dd8b5f9f1ecc6f2b9e15be Mon Sep 17 00:00:00 2001 From: Jack Works Date: Sat, 16 Feb 2019 10:53:32 +0800 Subject: [PATCH 044/924] Fix error --- types/gun/gun.d.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/types/gun/gun.d.ts b/types/gun/gun.d.ts index 841dfa34a9..47b40a68f7 100644 --- a/types/gun/gun.d.ts +++ b/types/gun/gun.d.ts @@ -1,3 +1,2 @@ - -declare const cons: typeof import('gun') -export = cons +declare const cons: typeof import('./index'); +export = cons; From 4c289f20b316db92b0cb4750ce20ebe82596dc28 Mon Sep 17 00:00:00 2001 From: Hodzic Adem Date: Sun, 17 Feb 2019 12:31:18 +0100 Subject: [PATCH 045/924] Updated definition for Tween callback property. Now tslint won't show error if I pass a function with parameteres to callback in TweenMax/TweenLite/TimelineMax/TimelineLite. --- types/gsap/Animation.d.ts | 4 ++-- types/gsap/Ease.d.ts | 2 +- types/gsap/Timeline.d.ts | 14 +++++++------- types/gsap/Tween.d.ts | 14 +++++++------- types/gsap/TweenConfig.d.ts | 12 ++++++------ types/gsap/gsap-tests.ts | 18 ++++++++++++++++-- types/gsap/index.d.ts | 1 + 7 files changed, 40 insertions(+), 25 deletions(-) diff --git a/types/gsap/Animation.d.ts b/types/gsap/Animation.d.ts index 8744e205bf..c5f4449ea3 100644 --- a/types/gsap/Animation.d.ts +++ b/types/gsap/Animation.d.ts @@ -29,8 +29,8 @@ declare namespace gsap { * 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; + eventCallback(type: string): (...args: any) => void; + eventCallback(type: string, callback: (...args: any) => 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 diff --git a/types/gsap/Ease.d.ts b/types/gsap/Ease.d.ts index 56603b5ed1..fe25a11c74 100644 --- a/types/gsap/Ease.d.ts +++ b/types/gsap/Ease.d.ts @@ -1,6 +1,6 @@ declare namespace gsap { class Ease { - constructor(func?: () => void, extraParams?: any[], type?: number, power?: number); + constructor(func?: (...args: any) => void, extraParams?: any[], type?: number, power?: number); /** Translates the tween's progress ratio into the corresponding ease ratio. */ getRatio(p: number): number; diff --git a/types/gsap/Timeline.d.ts b/types/gsap/Timeline.d.ts index 232d2ed9a3..b859a2e803 100644 --- a/types/gsap/Timeline.d.ts +++ b/types/gsap/Timeline.d.ts @@ -31,13 +31,13 @@ declare namespace gsap { 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; + addPause(position?: any, callback?: (...args: any) => 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; + call(callback: (...args: any) => 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; @@ -106,7 +106,7 @@ declare namespace gsap { vars: {}, stagger?: number, position?: any, - onCompleteAll?: () => void, + onCompleteAll?: (...args: any) => void, onCompleteAllParams?: any[], onCompleteScope?: any ): TimelineLite; @@ -122,7 +122,7 @@ declare namespace gsap { toVars: {}, stagger?: number, position?: any, - onCompleteAll?: () => void, + onCompleteAll?: (...args: any) => void, onCompleteAllParams?: any[], onCompleteAllScope?: any ): TimelineLite; @@ -137,7 +137,7 @@ declare namespace gsap { vars: {}, stagger: number, position?: any, - onCompleteAll?: () => void, + onCompleteAll?: (...args: any) => void, onCompleteAllParams?: any[], onCompleteAllScope?: any ): TimelineLite; @@ -156,14 +156,14 @@ declare namespace gsap { class TimelineMax extends TimelineLite { constructor(vars?: {}); - addCallback(callback: () => void, position: any, params?: any[], scope?: any): TimelineMax; + addCallback(callback: (...args: any) => 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; + removeCallback(callback: (...args: any) => void, timeOrLabel?: any): TimelineMax; removePause(position: any): TimelineMax; repeat(): number; repeat(value: number): TimelineMax; diff --git a/types/gsap/Tween.d.ts b/types/gsap/Tween.d.ts index 11de164f00..404daef039 100644 --- a/types/gsap/Tween.d.ts +++ b/types/gsap/Tween.d.ts @@ -22,7 +22,7 @@ declare namespace gsap { 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 delayedCall(delay: number, callback: (...args: any) => 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 @@ -49,7 +49,7 @@ declare namespace gsap { invalidate(): TweenLite; /** Immediately kills all of the delayedCalls to a particular () => void. */ - static killDelayedCallsTo(func: () => void): void; + static killDelayedCallsTo(func: (...args: any) => 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; @@ -74,7 +74,7 @@ declare namespace gsap { 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 delayedCall(delay: number, callback: (...args: any) => 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 @@ -110,7 +110,7 @@ declare namespace gsap { static killChildTweensOf(parent: any, complete?: boolean): void; /** Immediately kills all of the delayedCalls to a particular () => void. */ - static killDelayedCallsTo(func: () => void): void; + static killDelayedCallsTo(func: (...args: any) => 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; @@ -144,7 +144,7 @@ declare namespace gsap { duration: number, vars: {}, stagger: number, - onCompleteAll?: () => void, + onCompleteAll?: (...args: any) => void, onCompleteAllParams?: any[], onCompleteAllScope?: any ): any[]; @@ -159,7 +159,7 @@ declare namespace gsap { fromVars: {}, toVars: {}, stagger: number, - onCompleteAll?: () => void, + onCompleteAll?: (...args: any) => void, onCompleteAllParams?: any[], onCompleteAllScope?: any ): any[]; @@ -173,7 +173,7 @@ declare namespace gsap { duration: number, vars: {}, stagger: number, - onCompleteAll?: () => void, + onCompleteAll?: (...args: any) => void, onCompleteAllParams?: any[], onCompleteAllScope?: any ): any[]; diff --git a/types/gsap/TweenConfig.d.ts b/types/gsap/TweenConfig.d.ts index 38b00404e6..8a1698efaa 100644 --- a/types/gsap/TweenConfig.d.ts +++ b/types/gsap/TweenConfig.d.ts @@ -23,7 +23,7 @@ declare namespace gsap { overwrite?: string | number; /** A () => void that should be called when the animation has completed. */ - onComplete?: () => void; + onComplete?: (...args: any) => void; /** An Array of parameters to pass the onComplete () => void */ onCompleteParams?: any[]; @@ -39,7 +39,7 @@ declare namespace gsap { immediateRender?: boolean; /** A () => void that should be called when the tween has reached its beginning again from the reverse direction. */ - onReverseComplete?: () => void; + onReverseComplete?: (...args: any) => void; /** An Array of parameters to pass the onReverseComplete () => void. */ onReverseCompleteParams?: any[]; @@ -48,7 +48,7 @@ declare namespace gsap { 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; + onStart?: (...args: any) => void; /** An Array of parameters to pass the onStart () => void. */ onStartParams?: any[]; @@ -57,7 +57,7 @@ declare namespace gsap { onStartScope?: {}; /** A () => void that should be called every time the animation updates (on every frame while the animation is active). */ - onUpdate?: () => void; + onUpdate?: (...args: any) => void; /** An Array of parameters to pass the onUpdate () => void. */ onUpdateParams?: any[]; @@ -81,7 +81,7 @@ declare namespace gsap { lazy?: boolean; /** A () => void that should be called when the tween gets overwritten by another tween. */ - onOverwrite?: () => void; + onOverwrite?: (...args: any) => void; /** If true atuomatically populates the css property for tween on DOM elements */ autoCSS?: boolean; @@ -95,7 +95,7 @@ declare namespace gsap { repeatDelay?: number; - onRepeat?: () => void; + onRepeat?: (...args: any) => void; onRepeatScope?: {}; } diff --git a/types/gsap/gsap-tests.ts b/types/gsap/gsap-tests.ts index 36192141be..63a06e10b8 100644 --- a/types/gsap/gsap-tests.ts +++ b/types/gsap/gsap-tests.ts @@ -1,11 +1,22 @@ import { TweenLite, TweenMax } from 'gsap'; +const callbackWithoutParams = () => { + console.log('I Have No Parameters.') +} + +const callbackWithParams = (...args: any) => { + console.log('I Have Parameters.') + console.log(args); +} + + const tweenLiteExample = TweenLite .to(document.getElementById('some-div'), 1, { width: '200px', height: '200px', x: '100px', - y: '200px' + y: '200px', + onComplete: callbackWithoutParams }) .seek(0.5); @@ -14,6 +25,9 @@ const tweenMaxExample = TweenMax width: '200px', height: '200px', x: '100px', - y: '200px' + y: '200px', + onComplete: callbackWithParams, + onCompleteParams: ['foo', 'bar'] }) .seek(0.5); + diff --git a/types/gsap/index.d.ts b/types/gsap/index.d.ts index 5e3081cc6a..5f1a20a17d 100644 --- a/types/gsap/index.d.ts +++ b/types/gsap/index.d.ts @@ -5,6 +5,7 @@ // Richard Fox , // Philip Bulley , // Leonardo Melo +// Adem Hodzic // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// From 503ba49983bed8c7221d080807eba97df2864d87 Mon Sep 17 00:00:00 2001 From: Hodzic Adem Date: Sun, 17 Feb 2019 14:43:09 +0100 Subject: [PATCH 046/924] Fixed error where I declared ...args as type any instead of any[] --- types/gsap/Animation.d.ts | 4 ++-- types/gsap/Ease.d.ts | 2 +- types/gsap/Timeline.d.ts | 14 +++++++------- types/gsap/Tween.d.ts | 14 +++++++------- types/gsap/TweenConfig.d.ts | 12 ++++++------ types/gsap/gsap-tests.ts | 11 +++++------ 6 files changed, 28 insertions(+), 29 deletions(-) diff --git a/types/gsap/Animation.d.ts b/types/gsap/Animation.d.ts index c5f4449ea3..1c26798810 100644 --- a/types/gsap/Animation.d.ts +++ b/types/gsap/Animation.d.ts @@ -29,8 +29,8 @@ declare namespace gsap { * 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): (...args: any) => void; - eventCallback(type: string, callback: (...args: any) => void, params?: any[], scope?: any): Animation; + eventCallback(type: string): (...args: any[]) => void; + eventCallback(type: string, callback: (...args: any[]) => 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 diff --git a/types/gsap/Ease.d.ts b/types/gsap/Ease.d.ts index fe25a11c74..a7c594ef41 100644 --- a/types/gsap/Ease.d.ts +++ b/types/gsap/Ease.d.ts @@ -1,6 +1,6 @@ declare namespace gsap { class Ease { - constructor(func?: (...args: any) => void, extraParams?: any[], type?: number, power?: number); + constructor(func?: (...args: any[]) => void, extraParams?: any[], type?: number, power?: number); /** Translates the tween's progress ratio into the corresponding ease ratio. */ getRatio(p: number): number; diff --git a/types/gsap/Timeline.d.ts b/types/gsap/Timeline.d.ts index b859a2e803..74b9e50396 100644 --- a/types/gsap/Timeline.d.ts +++ b/types/gsap/Timeline.d.ts @@ -31,13 +31,13 @@ declare namespace gsap { 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?: (...args: any) => void, params?: any[], scope?: any): TimelineLite; + addPause(position?: any, callback?: (...args: any[]) => 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: (...args: any) => void, params?: any[], scope?: any, position?: any): TimelineLite; + call(callback: (...args: any[]) => 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; @@ -106,7 +106,7 @@ declare namespace gsap { vars: {}, stagger?: number, position?: any, - onCompleteAll?: (...args: any) => void, + onCompleteAll?: (...args: any[]) => void, onCompleteAllParams?: any[], onCompleteScope?: any ): TimelineLite; @@ -122,7 +122,7 @@ declare namespace gsap { toVars: {}, stagger?: number, position?: any, - onCompleteAll?: (...args: any) => void, + onCompleteAll?: (...args: any[]) => void, onCompleteAllParams?: any[], onCompleteAllScope?: any ): TimelineLite; @@ -137,7 +137,7 @@ declare namespace gsap { vars: {}, stagger: number, position?: any, - onCompleteAll?: (...args: any) => void, + onCompleteAll?: (...args: any[]) => void, onCompleteAllParams?: any[], onCompleteAllScope?: any ): TimelineLite; @@ -156,14 +156,14 @@ declare namespace gsap { class TimelineMax extends TimelineLite { constructor(vars?: {}); - addCallback(callback: (...args: any) => void, position: any, params?: any[], scope?: any): TimelineMax; + addCallback(callback: (...args: any[]) => 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: (...args: any) => void, timeOrLabel?: any): TimelineMax; + removeCallback(callback: (...args: any[]) => void, timeOrLabel?: any): TimelineMax; removePause(position: any): TimelineMax; repeat(): number; repeat(value: number): TimelineMax; diff --git a/types/gsap/Tween.d.ts b/types/gsap/Tween.d.ts index 404daef039..3dd15ca685 100644 --- a/types/gsap/Tween.d.ts +++ b/types/gsap/Tween.d.ts @@ -22,7 +22,7 @@ declare namespace gsap { static ticker: any; /** Provides a simple way to call a () => void after a set amount of time (or frames). */ - static delayedCall(delay: number, callback: (...args: any) => void, params?: any[], scope?: any, useFrames?: boolean): TweenLite; + static delayedCall(delay: number, callback: (...args: any[]) => 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 @@ -49,7 +49,7 @@ declare namespace gsap { invalidate(): TweenLite; /** Immediately kills all of the delayedCalls to a particular () => void. */ - static killDelayedCallsTo(func: (...args: any) => void): void; + static killDelayedCallsTo(func: (...args: any[]) => 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; @@ -74,7 +74,7 @@ declare namespace gsap { 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: (...args: any) => void, params?: any[], scope?: {}, useFrames?: boolean): TweenMax; + static delayedCall(delay: number, callback: (...args: any[]) => 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 @@ -110,7 +110,7 @@ declare namespace gsap { static killChildTweensOf(parent: any, complete?: boolean): void; /** Immediately kills all of the delayedCalls to a particular () => void. */ - static killDelayedCallsTo(func: (...args: any) => void): void; + static killDelayedCallsTo(func: (...args: any[]) => 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; @@ -144,7 +144,7 @@ declare namespace gsap { duration: number, vars: {}, stagger: number, - onCompleteAll?: (...args: any) => void, + onCompleteAll?: (...args: any[]) => void, onCompleteAllParams?: any[], onCompleteAllScope?: any ): any[]; @@ -159,7 +159,7 @@ declare namespace gsap { fromVars: {}, toVars: {}, stagger: number, - onCompleteAll?: (...args: any) => void, + onCompleteAll?: (...args: any[]) => void, onCompleteAllParams?: any[], onCompleteAllScope?: any ): any[]; @@ -173,7 +173,7 @@ declare namespace gsap { duration: number, vars: {}, stagger: number, - onCompleteAll?: (...args: any) => void, + onCompleteAll?: (...args: any[]) => void, onCompleteAllParams?: any[], onCompleteAllScope?: any ): any[]; diff --git a/types/gsap/TweenConfig.d.ts b/types/gsap/TweenConfig.d.ts index 8a1698efaa..9912613694 100644 --- a/types/gsap/TweenConfig.d.ts +++ b/types/gsap/TweenConfig.d.ts @@ -23,7 +23,7 @@ declare namespace gsap { overwrite?: string | number; /** A () => void that should be called when the animation has completed. */ - onComplete?: (...args: any) => void; + onComplete?: (...args: any[]) => void; /** An Array of parameters to pass the onComplete () => void */ onCompleteParams?: any[]; @@ -39,7 +39,7 @@ declare namespace gsap { immediateRender?: boolean; /** A () => void that should be called when the tween has reached its beginning again from the reverse direction. */ - onReverseComplete?: (...args: any) => void; + onReverseComplete?: (...args: any[]) => void; /** An Array of parameters to pass the onReverseComplete () => void. */ onReverseCompleteParams?: any[]; @@ -48,7 +48,7 @@ declare namespace gsap { 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?: (...args: any) => void; + onStart?: (...args: any[]) => void; /** An Array of parameters to pass the onStart () => void. */ onStartParams?: any[]; @@ -57,7 +57,7 @@ declare namespace gsap { onStartScope?: {}; /** A () => void that should be called every time the animation updates (on every frame while the animation is active). */ - onUpdate?: (...args: any) => void; + onUpdate?: (...args: any[]) => void; /** An Array of parameters to pass the onUpdate () => void. */ onUpdateParams?: any[]; @@ -81,7 +81,7 @@ declare namespace gsap { lazy?: boolean; /** A () => void that should be called when the tween gets overwritten by another tween. */ - onOverwrite?: (...args: any) => void; + onOverwrite?: (...args: any[]) => void; /** If true atuomatically populates the css property for tween on DOM elements */ autoCSS?: boolean; @@ -95,7 +95,7 @@ declare namespace gsap { repeatDelay?: number; - onRepeat?: (...args: any) => void; + onRepeat?: (...args: any[]) => void; onRepeatScope?: {}; } diff --git a/types/gsap/gsap-tests.ts b/types/gsap/gsap-tests.ts index 63a06e10b8..411ca19d0c 100644 --- a/types/gsap/gsap-tests.ts +++ b/types/gsap/gsap-tests.ts @@ -1,13 +1,13 @@ import { TweenLite, TweenMax } from 'gsap'; const callbackWithoutParams = () => { - console.log('I Have No Parameters.') -} + console.log('I Have No Parameters.'); +}; -const callbackWithParams = (...args: any) => { - console.log('I Have Parameters.') +const callbackWithParams = (...args: any[]) => { + console.log('I Have Parameters.'); console.log(args); -} +}; const tweenLiteExample = TweenLite @@ -30,4 +30,3 @@ const tweenMaxExample = TweenMax onCompleteParams: ['foo', 'bar'] }) .seek(0.5); - From 9a862d8342ebee85959cf03e676631171059c13a Mon Sep 17 00:00:00 2001 From: nulladdict Date: Mon, 18 Feb 2019 14:45:02 +0500 Subject: [PATCH 047/924] fix(rc-slider): add tabIndex to Handle props --- types/rc-slider/index.d.ts | 6 ++++++ types/rc-slider/rc-slider-tests.tsx | 1 + 2 files changed, 7 insertions(+) diff --git a/types/rc-slider/index.d.ts b/types/rc-slider/index.d.ts index ba40bc0d7d..1f16fbe267 100644 --- a/types/rc-slider/index.d.ts +++ b/types/rc-slider/index.d.ts @@ -6,6 +6,7 @@ // Jacob Froman // Deanna Veale // Nick Maddren +// Roman Nevolin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -204,6 +205,11 @@ export interface HandleProps extends CommonApiProps { * Styling option offset */ offset: number; + /** + * Set the tabIndex of the slider handle. + * @default 0 + */ + tabIndex?: number; } export interface WithTooltipProps { diff --git a/types/rc-slider/rc-slider-tests.tsx b/types/rc-slider/rc-slider-tests.tsx index 5b246dd7ab..15aea1ff4c 100644 --- a/types/rc-slider/rc-slider-tests.tsx +++ b/types/rc-slider/rc-slider-tests.tsx @@ -15,6 +15,7 @@ ReactDOM.render( className="bottom" vertical={true} offset={10} + tabIndex={-1} />, document.querySelector('.another-app') ); From 0dd0e94685778cf1e1c3c4e091d6bf4c8fb58dee Mon Sep 17 00:00:00 2001 From: lukostry Date: Mon, 18 Feb 2019 12:44:53 +0100 Subject: [PATCH 048/924] Do not use default export, align indentation --- types/ink-select-input/index.d.ts | 8 +++-- .../ink-select-input-tests.tsx | 33 +++++++++++-------- types/ink-select-input/tsconfig.json | 1 + 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/types/ink-select-input/index.d.ts b/types/ink-select-input/index.d.ts index 2dc38d2a86..2654084e25 100644 --- a/types/ink-select-input/index.d.ts +++ b/types/ink-select-input/index.d.ts @@ -6,12 +6,12 @@ import { Component, InkComponent } from 'ink'; -export interface ItemOfSelectInput { +interface ItemOfSelectInput { label: string; value: any; } -export interface SelectInputProps { +interface SelectInputProps { focus?: boolean; indicatorComponent?: InkComponent; itemComponent?: InkComponent; @@ -20,4 +20,6 @@ export interface SelectInputProps void; } -export default class SelectInput extends Component { } +declare class SelectInput extends Component { } + +export = SelectInput; diff --git a/types/ink-select-input/ink-select-input-tests.tsx b/types/ink-select-input/ink-select-input-tests.tsx index 4120cbf43e..da29f9918e 100644 --- a/types/ink-select-input/ink-select-input-tests.tsx +++ b/types/ink-select-input/ink-select-input-tests.tsx @@ -1,27 +1,32 @@ /** @jsx h */ import { h, InkComponent } from 'ink'; import SelectInput from 'ink-select-input'; +// NOTE: `import SelectInput = require('ink-select-input');` will work as well. +// If importing using ES6 default import as above, +// `allowSyntheticDefaultImports` flag in compiler options needs to be set to `true` interface DemoItem { - label: string; - value: string; + label: string; + value: string; } const items: ReadonlyArray = [{ - label: 'First', - value: 'first' -}, { - label: 'Second', - value: 'second' -}, { - label: 'Third', - value: 'third' + label: 'First', + value: 'first' +}, +{ + label: 'Second', + value: 'second' +}, +{ + label: 'Third', + value: 'third' }]; const Demo: InkComponent = () => { - const handleSelect = (item: DemoItem) => { - console.log(item); - }; + const handleSelect = (item: DemoItem) => { + console.log(item); + }; - return ; + return ; }; diff --git a/types/ink-select-input/tsconfig.json b/types/ink-select-input/tsconfig.json index 4ae1e800aa..a3a689e150 100644 --- a/types/ink-select-input/tsconfig.json +++ b/types/ink-select-input/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "allowSyntheticDefaultImports": true, "jsx": "react", "module": "commonjs", "lib": [ From 5da9f8e32520cc1412548d53d7232cb2df678df0 Mon Sep 17 00:00:00 2001 From: Ulrik Strid Date: Mon, 18 Feb 2019 15:13:54 +0100 Subject: [PATCH 049/924] Update to new ParameterizedContext --- types/koa-send/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/koa-send/index.d.ts b/types/koa-send/index.d.ts index a4b090e1ea..bf6ddae297 100644 --- a/types/koa-send/index.d.ts +++ b/types/koa-send/index.d.ts @@ -6,17 +6,17 @@ // TypeScript Version: 2.3 import { - Context, + ParameterizedContext, } from "koa"; import { Stats, } from "fs"; -declare function send(ctx: Context, path: string, opts?: send.SendOptions): Promise; +declare function send(ctx: ParameterizedContext, path: string, opts?: send.SendOptions): Promise; declare namespace send { - type SetHeaders = (res: Context["res"], path: string, stats: Stats) => any; + type SetHeaders = (res: ParameterizedContext["res"], path: string, stats: Stats) => any; interface SendOptions { /** Browser cache max-age in milliseconds. (defaults to 0) */ From d6f5a4028604ae5b82a0a39e6e45cd0099f937ef Mon Sep 17 00:00:00 2001 From: Ulf Jaenicke-Roessler Date: Mon, 18 Feb 2019 17:21:52 +0100 Subject: [PATCH 050/924] utils.parseKey now conforms to current API keyParser had been rewritten - see new documentation at https://github.com/mscdex/ssh2-streams#utility-methods --- types/ssh2-streams/index.d.ts | 18 ++++++------------ types/ssh2-streams/ssh2-streams-tests.ts | 4 +--- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/types/ssh2-streams/index.d.ts b/types/ssh2-streams/index.d.ts index 54d6359538..8b2530edb0 100644 --- a/types/ssh2-streams/index.d.ts +++ b/types/ssh2-streams/index.d.ts @@ -1686,23 +1686,17 @@ export interface Stats extends Attributes { } export namespace utils { - export function parseKey(keyData: string | Buffer): ParsedKey | Error; - export function genPublicKey(privKeyInfo: ParsedKey): ParsedKey; - export function decryptKey(privKeyInfo: ParsedKey, passphrase: string): void; + export function parseKey(keyData: string | Buffer, passphrase?: string): ParsedKey | {}[]; } export interface ParsedKey { - fulltype: string; type: string; - extra: string; comment: string; - encryption: string; - private: Buffer; - privateOrig: Buffer; - public: Buffer; - publicOrig: Buffer; - ppk?: boolean; - privateMAC?: string; + getPrivatePEM(): string; + getPublicPEM(): string; + getPublicSSH(): string; + sign(data: string | Buffer): Buffer | Error; + verify(data: string | Buffer, signature: Buffer): boolean | Error; } export interface ReadFileOptions { diff --git a/types/ssh2-streams/ssh2-streams-tests.ts b/types/ssh2-streams/ssh2-streams-tests.ts index 7fd73756d5..c813d4eeb4 100644 --- a/types/ssh2-streams/ssh2-streams-tests.ts +++ b/types/ssh2-streams/ssh2-streams-tests.ts @@ -87,9 +87,7 @@ server.forwardedTcpip(0, 0, 0, { bindAddr: "bindAddr", bindPort: 8080, remoteAdd server.x11(0, 0, 0, { originAddr: "originAddr", originPort: 0 }); server.openssh_forwardedStreamLocal(0, 0, 0, { socketPath: "socketPath" }); -const maybeParsedKey = ssh2.utils.parseKey("keyData"); -ssh2.utils.decryptKey(parsedKey, "passphrase"); -const publicKey = ssh2.utils.genPublicKey(parsedKey); +const maybeParsedKey = ssh2.utils.parseKey("keyData", "passphrase"); declare const attrs: ssh2.Attributes; From b1ec3f67daaa011aaeeb21cda312ed2305123ac1 Mon Sep 17 00:00:00 2001 From: Ulf Jaenicke-Roessler Date: Mon, 18 Feb 2019 17:54:38 +0100 Subject: [PATCH 051/924] Fix ssh2 tests --- types/ssh2/ssh2-tests.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/types/ssh2/ssh2-tests.ts b/types/ssh2/ssh2-tests.ts index b3364cd489..bcf31a493b 100644 --- a/types/ssh2/ssh2-tests.ts +++ b/types/ssh2/ssh2-tests.ts @@ -313,7 +313,8 @@ var buffersEqual = require('buffer-equal-constant-time'), //ssh2 = require('ssh2'), utils = ssh2.utils; -var pubKey = utils.genPublicKey(utils.parseKey(fs.readFileSync('user.pub')) as ssh2_streams.ParsedKey); +var pubKey = utils.parseKey(fs.readFileSync('user.pub')) as ssh2_streams.ParsedKey; +var pubKeySSH = Buffer.from(pubKey.getPublicSSH()); new ssh2.Server({ hostKeys: [fs.readFileSync('host.key')] @@ -326,15 +327,14 @@ new ssh2.Server({ && ctx.password === 'bar') ctx.accept(); else if (ctx.method === 'publickey' - && ctx.key.algo === pubKey.fulltype - && buffersEqual(ctx.key.data, pubKey.public)) { + && ctx.key.algo === pubKey.type + && buffersEqual(ctx.key.data, pubKeySSH)) { if (ctx.signature) { - var verifier = crypto.createVerify(ctx.sigAlgo); - verifier.update(ctx.blob); - if (verifier.verify(pubKey.publicOrig.toString("utf8"), ctx.signature)) + if (pubKey.verify(ctx.blob, ctx.signature)) { ctx.accept(); - else + } else { ctx.reject(); + } } else { // if no signature present, that means the client is just checking // the validity of the given public key From b57d44c4c9bfff531b35a9210b9d2d3a84d24aba Mon Sep 17 00:00:00 2001 From: Olga Isakova Date: Tue, 19 Feb 2019 02:02:28 +0500 Subject: [PATCH 052/924] Adjust the export to work with esModuleInterop --- types/mongo-sanitize/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/mongo-sanitize/index.d.ts b/types/mongo-sanitize/index.d.ts index 44c5d04a7d..1c5308d55c 100644 --- a/types/mongo-sanitize/index.d.ts +++ b/types/mongo-sanitize/index.d.ts @@ -1,9 +1,9 @@ // Type definitions for mongo-sanitize 1.0 // Project: https://github.com/vkarpov15/mongo-sanitize -// Definitions by: Cedric Cazin +// Definitions by: Cedric Cazin , Olga Isakova // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -export function sanitize(v: T): T; +declare function sanitize(v: T): T; -export as namespace mongoSanitize; +export = sanitize; From 5bf116d71b09273334b70f5e96a272ad5fa4c104 Mon Sep 17 00:00:00 2001 From: Olga Isakova Date: Tue, 19 Feb 2019 02:19:33 +0500 Subject: [PATCH 053/924] Tests, TS version --- types/mongo-sanitize/index.d.ts | 2 +- types/mongo-sanitize/mongo-sanitize-tests.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/types/mongo-sanitize/index.d.ts b/types/mongo-sanitize/index.d.ts index 1c5308d55c..aedff46b0b 100644 --- a/types/mongo-sanitize/index.d.ts +++ b/types/mongo-sanitize/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/vkarpov15/mongo-sanitize // Definitions by: Cedric Cazin , Olga Isakova // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 3.3 declare function sanitize(v: T): T; diff --git a/types/mongo-sanitize/mongo-sanitize-tests.ts b/types/mongo-sanitize/mongo-sanitize-tests.ts index 4d4534bbeb..3f86dc256e 100644 --- a/types/mongo-sanitize/mongo-sanitize-tests.ts +++ b/types/mongo-sanitize/mongo-sanitize-tests.ts @@ -1,11 +1,11 @@ -import * as mongoSanitize from 'mongo-sanitize'; +import sanitize from "mongo-sanitize"; -const objectSanitized = mongoSanitize.sanitize({ $gt: 5, a: 1 }); +const objectSanitized = sanitize({ $gt: 5, a: 1 }); -const arraySanitized = mongoSanitize.sanitize([1, 2, 3]); +const arraySanitized = sanitize([1, 2, 3]); class Clazz { $gt = 5; a = 1; } -const classSanitized = mongoSanitize.sanitize(new Clazz()); +const classSanitized = sanitize(new Clazz()); From 4892ced5f9f1d162d7a5de00159cfec77f9a724c Mon Sep 17 00:00:00 2001 From: Colin Doig Date: Tue, 19 Feb 2019 11:52:28 +1300 Subject: [PATCH 054/924] all fields except "name" optional in PlaceResult --- types/googlemaps/googlemaps-tests.ts | 7 ++++- types/googlemaps/index.d.ts | 45 ++++++++++++++-------------- 2 files changed, 29 insertions(+), 23 deletions(-) diff --git a/types/googlemaps/googlemaps-tests.ts b/types/googlemaps/googlemaps-tests.ts index ac7217dd17..f0d3249942 100644 --- a/types/googlemaps/googlemaps-tests.ts +++ b/types/googlemaps/googlemaps-tests.ts @@ -124,7 +124,7 @@ data.setStyle({ cursor: "pointer", fillColor: "#79B55B", fillOpacity: 1, - icon: { url: "//maps.google.com/mapfiles/ms/icons/blue.png" }, + icon: { url: "//maps.google.com/mapfiles/ms/icons/blue.png" } as google.maps.Icon, shape: { coords: [1, 2, 3], type: "circle" }, strokeColor: "#79B55B", strokeOpacity: 1, @@ -449,3 +449,8 @@ service.findPlaceFromPhoneNumber({ results[0].name; // $ExpectType string }); + +/***** google.maps.places.Autocomplete *****/ +const autocomplete = new google.maps.places.Autocomplete(document.createElement('input')); +const placeResult = autocomplete.getPlace(); +placeResult.name; // $ExpectType string diff --git a/types/googlemaps/index.d.ts b/types/googlemaps/index.d.ts index 099bb9ef68..8cefde2426 100644 --- a/types/googlemaps/index.d.ts +++ b/types/googlemaps/index.d.ts @@ -11,6 +11,7 @@ // Sven Kreiss // Umar Bolatov // Michael Gauthier +// Colin Doig // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /* @@ -2726,29 +2727,29 @@ declare namespace google.maps { } export interface PlaceResult { - address_components: GeocoderAddressComponent[]; - adr_address: string; - aspects: PlaceAspectRating[]; - formatted_address: string; - formatted_phone_number: string; - geometry: PlaceGeometry; - html_attributions: string[]; - icon: string; - id: string; - international_phone_number: string; + address_components?: GeocoderAddressComponent[]; + adr_address?: string; + aspects?: PlaceAspectRating[]; + formatted_address?: string; + formatted_phone_number?: string; + geometry?: PlaceGeometry; + html_attributions?: string[]; + icon?: string; + id?: string; + international_phone_number?: string; name: string; - opening_hours: OpeningHours; - permanently_closed: boolean; - photos: PlacePhoto[]; - place_id: string; - price_level: number; - rating: number; - reviews: PlaceReview[]; - types: string[]; - url: string; - utc_offset: number; - vicinity: string; - website: string; + opening_hours?: OpeningHours; + permanently_closed?: boolean; + photos?: PlacePhoto[]; + place_id?: string; + price_level?: number; + rating?: number; + reviews?: PlaceReview[]; + types?: string[]; + url?: string; + utc_offset?: number; + vicinity?: string; + website?: string; } export interface PlaceReview { From 6fe9d46a90802a7d69b2af5476edb96a1c77fe17 Mon Sep 17 00:00:00 2001 From: Lydie Danet Date: Tue, 19 Feb 2019 16:01:54 +1300 Subject: [PATCH 055/924] react-lazyload: Improve typing of children --- types/react-lazyload/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-lazyload/index.d.ts b/types/react-lazyload/index.d.ts index 3fd9b075e4..669169351e 100644 --- a/types/react-lazyload/index.d.ts +++ b/types/react-lazyload/index.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 -import { Component } from "react"; +import { Component, ReactNode } from "react"; export interface LazyLoadProps { once?: boolean; @@ -13,7 +13,7 @@ export interface LazyLoadProps { overflow?: boolean; resize?: boolean; scroll?: boolean; - children?: JSX.Element; + children?: ReactNode; throttle?: number | boolean; debounce?: number | boolean; placeholder?: any; From 3e98e8cdb15fceee9e4db55c47f585a9b689d4df Mon Sep 17 00:00:00 2001 From: Lydie Danet Date: Tue, 19 Feb 2019 16:14:04 +1300 Subject: [PATCH 056/924] react-lazyload: Improve typing of placeholder --- types/react-lazyload/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-lazyload/index.d.ts b/types/react-lazyload/index.d.ts index 669169351e..9d7453188a 100644 --- a/types/react-lazyload/index.d.ts +++ b/types/react-lazyload/index.d.ts @@ -16,7 +16,7 @@ export interface LazyLoadProps { children?: ReactNode; throttle?: number | boolean; debounce?: number | boolean; - placeholder?: any; + placeholder?: ReactNode; unmountIfInvisible?: boolean; } From 1d0f83bf4bcd3e4b4e7010e5590b54cf2c223f6f Mon Sep 17 00:00:00 2001 From: Flexmonster Date: Mon, 18 Feb 2019 23:43:09 -0500 Subject: [PATCH 057/924] flexmonster d.ts update --- types/flexmonster/index.d.ts | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/types/flexmonster/index.d.ts b/types/flexmonster/index.d.ts index 00a6c49bcb..a215a5ba3b 100644 --- a/types/flexmonster/index.d.ts +++ b/types/flexmonster/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for flexmonster 2.6 -// Project: https://www.flexmonster.com/ +// Project: https://flexmonster.com/ // Definitions by: Flexmonster // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -135,6 +135,7 @@ declare namespace Flexmonster { showGridAndCharts(type?: string, position?: string, multiple?: boolean): void; sortingMethod(hierarchyName: string, compareFunction: (a: string, b: string) => boolean): void; sortValues(axisName: string, type: string, tuple: number[], measure: MeasureObject): void; + toolbar: Toolbar; updateData(object: DataSource | object[]): void; version: string; fusioncharts?: { @@ -463,6 +464,34 @@ declare namespace Flexmonster { interface Toolbar { getTabs: () => ToolbarTab[]; + // Connect tab + connectLocalCSVHandler: () => void; + connectLocalJSONHandler: () => void; + connectRemoteCSV: () => void; + connectRemoteJSON: () => void; + connectOLAP: () => void; + // Open tab + openLocalReport: () => void; + openRemoteReport: () => void; + // Save tab + saveHandler: () => void; + // Export tab + printHandler: () => void; + exportHandler: (type: string) => void; + // Grid tab + gridHandler: () => void; + // Charts tab + chartsHandler: (type: string) => void; + chartsMultipleHandler: () => void; + // Format tab + formatCellsHandler: () => void; + conditionalFormattingHandler: () => void; + // Options tab + optionsHandler: () => void; + // Fields tab + fieldsHandler: () => void; + // Fullscreen tab + fullscreenHandler: () => void; } interface ToolbarTab { From 791191b8241bcf786bcbcdad5f8d477ff2226815 Mon Sep 17 00:00:00 2001 From: WalterEbbers <11156526+WalterEbbers@users.noreply.github.com> Date: Tue, 19 Feb 2019 12:23:27 +0100 Subject: [PATCH 058/924] Update to Calender.selectDates() somehow the same interface got implemented twice which are the same kendo-ui supports date selection(https://docs.telerik.com/kendo-ui/knowledge-base/calendar-select-range-of-dates) --- types/kendo-ui/index.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/kendo-ui/index.d.ts b/types/kendo-ui/index.d.ts index 7ea79365ee..17c186697e 100644 --- a/types/kendo-ui/index.d.ts +++ b/types/kendo-ui/index.d.ts @@ -1883,7 +1883,9 @@ declare namespace kendo.ui { navigateToPast(): void; navigateUp(): void; selectDates(): void; - selectDates(): void; + selectDates(datesToSelect : any): void; + //somehow the same interface got implemented twice which are the same + //kendo-ui supports date selection(https://docs.telerik.com/kendo-ui/knowledge-base/calendar-select-range-of-dates) value(): Date; value(value: Date): void; value(value: string): void; From 3298532c5b070daf567b9202498035f7ff04fd4e Mon Sep 17 00:00:00 2001 From: sucotronic Date: Tue, 19 Feb 2019 13:01:13 +0100 Subject: [PATCH 059/924] Add new property 'controlSize' --- types/googlemaps/googlemaps-tests.ts | 1 + types/googlemaps/index.d.ts | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/types/googlemaps/googlemaps-tests.ts b/types/googlemaps/googlemaps-tests.ts index ac7217dd17..410fa1a41d 100644 --- a/types/googlemaps/googlemaps-tests.ts +++ b/types/googlemaps/googlemaps-tests.ts @@ -4,6 +4,7 @@ let mapOptions: google.maps.MapOptions = { backgroundColor: "#fff", center: { lat: -25.363, lng: 131.044 }, clickableIcons: true, + controlSize: 30, draggable: true, fullscreenControl: true, fullscreenControlOptions: { diff --git a/types/googlemaps/index.d.ts b/types/googlemaps/index.d.ts index 099bb9ef68..6c4bb07fcf 100644 --- a/types/googlemaps/index.d.ts +++ b/types/googlemaps/index.d.ts @@ -93,6 +93,14 @@ declare namespace google.maps { * interest, also known as a POI. By default map icons are clickable. */ clickableIcons?: boolean + /** + * Size in pixels of the controls appearing on the map. This value must be + * supplied directly when creating the Map, updating this value later may + * bring the controls into an undefined state. Only governs the controls + * made by the Maps API itself. Does not scale developer created custom + * controls. + */ + controlSize?: number; /** Enables/disables all default UI. May be overridden individually. */ disableDefaultUI?: boolean; /** Enables/disables zoom and center on double click. Enabled by default. */ From 92ea4066e25c45856c36a107bcc707b5b0cefa29 Mon Sep 17 00:00:00 2001 From: Nils Knappmeier Date: Fri, 8 Feb 2019 13:03:42 +0100 Subject: [PATCH 060/924] [@types/handlebars]: Remove package, types are now integrated in handlebars --- notNeededPackages.json | 6 + types/ember/package.json | 6 + types/ember__string/package.json | 6 + types/handlebars-helpers/package.json | 6 + types/handlebars/handlebars-tests.ts | 87 ------- types/handlebars/index.d.ts | 349 -------------------------- types/handlebars/tsconfig.json | 23 -- types/handlebars/tslint.json | 79 ------ types/handlebars/v1/index.d.ts | 184 -------------- types/handlebars/v1/tsconfig.json | 27 -- types/handlebars/v1/tslint.json | 79 ------ types/vision/package.json | 6 + 12 files changed, 30 insertions(+), 828 deletions(-) create mode 100644 types/ember/package.json create mode 100644 types/ember__string/package.json create mode 100644 types/handlebars-helpers/package.json delete mode 100644 types/handlebars/handlebars-tests.ts delete mode 100644 types/handlebars/index.d.ts delete mode 100644 types/handlebars/tsconfig.json delete mode 100644 types/handlebars/tslint.json delete mode 100644 types/handlebars/v1/index.d.ts delete mode 100644 types/handlebars/v1/tsconfig.json delete mode 100644 types/handlebars/v1/tslint.json create mode 100644 types/vision/package.json diff --git a/notNeededPackages.json b/notNeededPackages.json index be57d76a49..2ddb69b9ed 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -702,6 +702,12 @@ "sourceRepoURL": "https://github.com/ivogabe/gulp-typescript", "asOfVersion": "2.13.0" }, + { + "libraryName": "handlebars", + "typingsPackageName": "handlebars", + "sourceRepoURL": "https://github.com/wycats/handlebars.js", + "asOfVersion": "4.1.0" + }, { "libraryName": "handsontable", "typingsPackageName": "handsontable", diff --git a/types/ember/package.json b/types/ember/package.json new file mode 100644 index 0000000000..b6f5204c9a --- /dev/null +++ b/types/ember/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "handlebars": "^4.1.0" + } +} \ No newline at end of file diff --git a/types/ember__string/package.json b/types/ember__string/package.json new file mode 100644 index 0000000000..b6f5204c9a --- /dev/null +++ b/types/ember__string/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "handlebars": "^4.1.0" + } +} \ No newline at end of file diff --git a/types/handlebars-helpers/package.json b/types/handlebars-helpers/package.json new file mode 100644 index 0000000000..b6f5204c9a --- /dev/null +++ b/types/handlebars-helpers/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "handlebars": "^4.1.0" + } +} \ No newline at end of file diff --git a/types/handlebars/handlebars-tests.ts b/types/handlebars/handlebars-tests.ts deleted file mode 100644 index 340bbde590..0000000000 --- a/types/handlebars/handlebars-tests.ts +++ /dev/null @@ -1,87 +0,0 @@ - -//import Handlebars = require('handlebars'); -import * as Handlebars from 'handlebars'; - -const context = { - author: { firstName: 'Alan', lastName: 'Johnson' }, - body: 'I Love Handlebars', - comments: [{ - author: { firstName: 'Yehuda', lastName: 'Katz' }, - body: 'Me too!' - }] -}; -Handlebars.registerHelper('fullName', (person: typeof context.author) => { - return person.firstName + ' ' + person.lastName; -}); - -Handlebars.registerHelper('agree_button', function() { - return new Handlebars.SafeString( - '' - ); -}); - -const source1 = '

Hello, my name is {{name}}. I am from {{hometown}}. I have ' + - '{{kids.length}} kids:

' + - '
    {{#kids}}
  • {{name}} is {{age}}
  • {{/kids}}
'; -const template1 = Handlebars.compile(source1); -template1({ name: "Alan", hometown: "Somewhere, TX", kids: [{name: "Jimmy", age: 12}, {name: "Sally", age: 4}]}); - -Handlebars.registerHelper('link_to', (context: typeof post) => { - return '' + context.body + ''; -}); -const post = { url: "/hello-world", body: "Hello World!" }; -const context2 = { posts: [post] }; -const source2 = '
    {{#posts}}
  • {{{link_to this}}}
  • {{/posts}}
'; -const template2: HandlebarsTemplateDelegate<{ posts: { url: string, body: string }[] }> = Handlebars.compile(source2); -template2(context2); - -Handlebars.registerHelper('link_to', (title: string, context: typeof post) => { - return '' + title + '!'; -}); -const context3 = { posts: [{url: '/hello-world', body: 'Hello World!'}] }; -const source3 = '
    {{#posts}}
  • {{{link_to "Post" this}}}
  • {{/posts}}
'; -const template3 = Handlebars.compile(source3); -template3(context3); - -const source4 = '
    {{#people}}
  • {{#link}}{{name}}{{/link}}
  • {{/people}}
'; -Handlebars.registerHelper('link', function(context: any) { - return '' + context.fn(this) + ''; -}); -const template4 = Handlebars.compile<{ people: { name: string, id: number }[] }>(source4); -const data2 = { 'people': [ - { 'name': 'Alan', 'id': 1 }, - { 'name': 'Yehuda', 'id': 2 } -]}; -template4(data2); - -const source5 = '
    {{#people}}
  • {{> link}}
  • {{/people}}
'; -Handlebars.registerPartial('link', '{{name}}'); -const template5 = Handlebars.compile(source5); -const data3 = { 'people': [ - { 'name': 'Alan', 'id': 1 }, - { 'name': 'Yehuda', 'id': 2 } -]}; -template5(data3); - -const source6 = '{{#list nav}}{{title}}{{/list}}'; -const template6 = Handlebars.compile(source6); -Handlebars.registerHelper('list', (context, options: Handlebars.HelperOptions) => { - let ret = "
    "; - for(let i=0, j=context.length; i" + options.fn(context[i]) + ""; - } - return ret + "
"; -}); -template6([{url:"", title:""}]) - - -const escapedExpression = Handlebars.Utils.escapeExpression(''); - -Handlebars.helpers !== undefined; - -const parsedTmpl = Handlebars.parse('

Hello, my name is {{name}}.

', { - srcName: "/foo/bar/baz.hbs", - ignoreStandalone: true -}); - -const parsedTmplWithoutOptions = Handlebars.parse('

Hello, my name is {{name}}.

'); diff --git a/types/handlebars/index.d.ts b/types/handlebars/index.d.ts deleted file mode 100644 index d6bebcb457..0000000000 --- a/types/handlebars/index.d.ts +++ /dev/null @@ -1,349 +0,0 @@ -// Type definitions for Handlebars v4.0.11 -// Project: http://handlebarsjs.com/ -// Definitions by: Boris Yankov , Sergei Dorogin -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -declare namespace Handlebars { - export interface TemplateDelegate { - (context: T, options?: RuntimeOptions): string; - } - - export type Template = TemplateDelegate|string; - - export interface RuntimeOptions { - partial?: boolean; - depths?: any[]; - helpers?: { [name: string]: Function }; - partials?: { [name: string]: HandlebarsTemplateDelegate }; - decorators?: { [name: string]: Function }; - data?: any; - blockParams?: any[]; - } - - export interface HelperOptions { - fn: TemplateDelegate; - inverse: TemplateDelegate; - hash: any; - data?: any; - } - - export interface HelperDelegate { - (context?: any, arg1?: any, arg2?: any, arg3?: any, arg4?: any, arg5?: any, options?: HelperOptions): any; - } - export interface HelperDeclareSpec { - [key: string]: HelperDelegate; - } - - export interface ParseOptions { - srcName?: string, - ignoreStandalone?: boolean - } - - export function registerHelper(name: string, fn: HelperDelegate): void; - export function registerHelper(name: HelperDeclareSpec): void; - export function unregisterHelper(name: string): void; - - export function registerPartial(name: string, fn: Template): void; - export function registerPartial(spec: { [name: string]: HandlebarsTemplateDelegate }): void; - export function unregisterPartial(name: string): void; - - // TODO: replace Function with actual signature - 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 blockParams(obj: any[], ids: any[]): any[]; - export function Exception(message: string): void; - export function log(level: number, obj: any): void; - export function parse(input: string, options?: ParseOptions): hbs.AST.Program; - export function compile(input: any, options?: CompileOptions): HandlebarsTemplateDelegate; - export function precompile(input: any, options?: PrecompileOptions): TemplateSpecification; - export function template(precompilation: TemplateSpecification): HandlebarsTemplateDelegate; - - export function create(): typeof Handlebars; - - export const escapeExpression: typeof Utils.escapeExpression; - //export const Utils: typeof hbs.Utils; - export const logger: Logger; - export const templates: HandlebarsTemplates; - export const helpers: { [name: string]: HelperDelegate }; - export const partials: { [name: string]: any }; - // TODO: replace Function with actual signature - export const decorators: { [name: string]: Function }; - - export function noConflict(): typeof Handlebars; - - export class SafeString { - constructor(str: string); - toString(): string; - toHTML(): string; - } - - export namespace Utils { - export function escapeExpression(str: string): string; - export function createFrame(object: any): any; - export function blockParams(obj: any[], ids: any[]): any[]; - export function isEmpty(obj: any) : boolean; - export function extend(obj: any, ...source: any[]): any; - export function toString(obj: any): string; - export function isArray(obj: any): boolean; - export function isFunction(obj: any): boolean; - } - - export namespace AST { - export const helpers: hbs.AST.helpers; - } - - interface ICompiler { - accept(node: hbs.AST.Node): void; - Program(program: hbs.AST.Program): void; - BlockStatement(block: hbs.AST.BlockStatement): void; - PartialStatement(partial: hbs.AST.PartialStatement): void; - PartialBlockStatement(partial: hbs.AST.PartialBlockStatement): void; - DecoratorBlock(decorator: hbs.AST.DecoratorBlock): void; - Decorator(decorator: hbs.AST.Decorator): void; - MustacheStatement(mustache: hbs.AST.MustacheStatement): void; - ContentStatement(content: hbs.AST.ContentStatement): void; - CommentStatement(comment?: hbs.AST.CommentStatement): void; - SubExpression(sexpr: hbs.AST.SubExpression): void; - PathExpression(path: hbs.AST.PathExpression): void; - StringLiteral(str: hbs.AST.StringLiteral): void; - NumberLiteral(num: hbs.AST.NumberLiteral): void; - BooleanLiteral(bool: hbs.AST.BooleanLiteral): void; - UndefinedLiteral(): void; - NullLiteral(): void; - Hash(hash: hbs.AST.Hash): void; - } - - export class Visitor implements ICompiler { - accept(node: hbs.AST.Node): void; - acceptKey(node: hbs.AST.Node, name: string): void; - acceptArray(arr: hbs.AST.Expression[]): void; - Program(program: hbs.AST.Program): void; - BlockStatement(block: hbs.AST.BlockStatement): void; - PartialStatement(partial: hbs.AST.PartialStatement): void; - PartialBlockStatement(partial: hbs.AST.PartialBlockStatement): void; - DecoratorBlock(decorator: hbs.AST.DecoratorBlock): void; - Decorator(decorator: hbs.AST.Decorator): void; - MustacheStatement(mustache: hbs.AST.MustacheStatement): void; - ContentStatement(content: hbs.AST.ContentStatement): void; - CommentStatement(comment?: hbs.AST.CommentStatement): void; - SubExpression(sexpr: hbs.AST.SubExpression): void; - PathExpression(path: hbs.AST.PathExpression): void; - StringLiteral(str: hbs.AST.StringLiteral): void; - NumberLiteral(num: hbs.AST.NumberLiteral): void; - BooleanLiteral(bool: hbs.AST.BooleanLiteral): void; - UndefinedLiteral(): void; - NullLiteral(): void; - Hash(hash: hbs.AST.Hash): void; - } -} - -/** -* Implement this interface on your MVW/MVVM/MVC views such as Backbone.View -**/ -interface HandlebarsTemplatable { - template: HandlebarsTemplateDelegate; -} - -// NOTE: for backward compatibility of this typing -type HandlebarsTemplateDelegate = Handlebars.TemplateDelegate; - -interface HandlebarsTemplates { - [index: string]: HandlebarsTemplateDelegate; -} - -interface TemplateSpecification { - -} - -// for backward compatibility of this typing -type RuntimeOptions = Handlebars.RuntimeOptions; - -interface CompileOptions { - data?: boolean; - compat?: boolean; - knownHelpers?: { - helperMissing?: boolean; - blockHelperMissing?: boolean; - each?: boolean; - if?: boolean; - unless?: boolean; - with?: boolean; - log?: boolean; - lookup?: boolean; - }; - knownHelpersOnly?: boolean; - noEscape?: boolean; - strict?: boolean; - assumeObjects?: boolean; - preventIndent?: boolean; - ignoreStandalone?: boolean; - explicitPartialContext?: boolean; -} - -interface PrecompileOptions extends CompileOptions { - srcName?: string; - destName?: string; -} - -declare namespace hbs { - // for backward compatibility of this typing - type SafeString = Handlebars.SafeString; - - type Utils = typeof Handlebars.Utils; -} - -interface Logger { - DEBUG: number; - INFO: number; - WARN: number; - ERROR: number; - level: number; - - methodMap: { [level: number]: string }; - - log(level: number, obj: string): void; -} - -declare namespace hbs { - namespace AST { - interface Node { - type: string; - loc: SourceLocation; - } - - interface SourceLocation { - source: string; - start: Position; - end: Position; - } - - interface Position { - line: number; - column: number; - } - - interface Program extends Node { - body: Statement[]; - blockParams: string[]; - } - - interface Statement extends Node {} - - interface MustacheStatement extends Statement { - path: PathExpression | Literal; - params: Expression[]; - hash: Hash; - escaped: boolean; - strip: StripFlags; - } - - interface Decorator extends MustacheStatement { } - - interface BlockStatement extends Statement { - path: PathExpression; - params: Expression[]; - hash: Hash; - program: Program; - inverse: Program; - openStrip: StripFlags; - inverseStrip: StripFlags; - closeStrip: StripFlags; - } - - interface DecoratorBlock extends BlockStatement { } - - interface PartialStatement extends Statement { - name: PathExpression | SubExpression; - params: Expression[]; - hash: Hash; - indent: string; - strip: StripFlags; - } - - interface PartialBlockStatement extends Statement { - name: PathExpression | SubExpression; - params: Expression[]; - hash: Hash; - program: Program; - openStrip: StripFlags; - closeStrip: StripFlags; - } - - interface ContentStatement extends Statement { - value: string; - original: StripFlags; - } - - interface CommentStatement extends Statement { - value: string; - strip: StripFlags; - } - - interface Expression extends Node {} - - interface SubExpression extends Expression { - path: PathExpression; - params: Expression[]; - hash: Hash; - } - - interface PathExpression extends Expression { - data: boolean; - depth: number; - parts: string[]; - original: string; - } - - interface Literal extends Expression {} - interface StringLiteral extends Literal { - value: string; - original: string; - } - - interface BooleanLiteral extends Literal { - value: boolean; - original: boolean; - } - - interface NumberLiteral extends Literal { - value: number; - original: number; - } - - interface UndefinedLiteral extends Literal {} - - interface NullLiteral extends Literal {} - - interface Hash extends Node { - pairs: HashPair[]; - } - - interface HashPair extends Node { - key: string; - value: Expression; - } - - interface StripFlags { - open: boolean; - close: boolean; - } - - interface helpers { - helperExpression(node: Node): boolean; - scopeId(path: PathExpression): boolean; - simpleId(path: PathExpression): boolean; - } - } -} - -declare module "handlebars" { - export = Handlebars; -} - -declare module "handlebars/runtime" { - export = Handlebars; -} diff --git a/types/handlebars/tsconfig.json b/types/handlebars/tsconfig.json deleted file mode 100644 index 0008e2154e..0000000000 --- a/types/handlebars/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "files": [ - "index.d.ts", - "handlebars-tests.ts" - ], - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": false, - "strictNullChecks": false, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - } -} diff --git a/types/handlebars/tslint.json b/types/handlebars/tslint.json deleted file mode 100644 index a41bf5d19a..0000000000 --- a/types/handlebars/tslint.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } -} diff --git a/types/handlebars/v1/index.d.ts b/types/handlebars/v1/index.d.ts deleted file mode 100644 index a66c8f7ee6..0000000000 --- a/types/handlebars/v1/index.d.ts +++ /dev/null @@ -1,184 +0,0 @@ -// Type definitions for Handlebars 1.0 -// Project: http://handlebarsjs.com/ -// Definitions by: Boris Yankov -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - -// Use either HandlebarsStatic or HandlebarsRuntimeStatic -declare var Handlebars: HandlebarsStatic; -//declare var Handlebars: HandlebarsRuntimeStatic; - -/** -* Implement this interface on your MVW/MVVM/MVC views such as Backbone.View -**/ -interface HandlebarsTemplatable { - template: HandlebarsTemplateDelegate; -} - -interface HandlebarsTemplateDelegate { - (context: any, options?: any): string; -} - -interface HandlebarsCommon { - registerHelper(name: string, fn: Function, inverse?: boolean): void; - registerPartial(name: string, str: any): void; - K(): void; - createFrame(object: any): any; - - Exception(message: string): void; - SafeString: typeof hbs.SafeString; - Utils: typeof hbs.Utils; - - logger: Logger; - log(level: number, obj: any): void; -} - -interface HandlebarsStatic extends HandlebarsCommon { - parse(input: string): hbs.AST.ProgramNode; - compile(input: any, options?: any): HandlebarsTemplateDelegate; -} - -interface HandlebarsTemplates { - [index: string]: HandlebarsTemplateDelegate; -} - -interface HandlebarsRuntimeStatic extends HandlebarsCommon { - // Handlebars.templates is the default template namespace in precompiler. - templates: HandlebarsTemplates; -} - -declare namespace hbs { - class SafeString { - constructor(str: string); - static toString(): string; - } - - namespace Utils { - function escapeExpression(str: string): string; - } -} - -interface Logger { - DEBUG: number; - INFO: number; - WARN: number; - ERROR: number; - level: number; - - methodMap: { [level: number]: string }; - - log(level: number, obj: string): void; -} - -declare namespace hbs { - namespace AST { - interface IStripInfo { - left?: boolean; - right?: boolean; - inlineStandalone?: boolean; - } - - class NodeBase { - firstColumn: number; - firstLine: number; - lastColumn: number; - lastLine: number; - type: string; - } - - class ProgramNode extends NodeBase { - statements: NodeBase[]; - } - - class IdNode extends NodeBase { - original: string; - parts: string[]; - string: string; - depth: number; - idName: string; - isSimple: boolean; - stringModeValue: string; - } - - class HashNode extends NodeBase { - pairs: {0: string; - 1: NodeBase}[]; - } - - class SexprNode extends NodeBase { - hash: HashNode; - id: NodeBase; - params: NodeBase[]; - isHelper: boolean; - eligibleHelper: boolean; - } - - class MustacheNode extends NodeBase { - strip: IStripInfo; - escaped: boolean; - sexpr: SexprNode; - - } - - class BlockNode extends NodeBase { - mustache: MustacheNode; - program: ProgramNode; - inverse: ProgramNode; - strip: IStripInfo; - isInverse: boolean; - } - - class PartialNameNode extends NodeBase { - name: string; - } - - class PartialNode extends NodeBase { - partialName: PartialNameNode; - context: NodeBase; - hash: HashNode; - strip: IStripInfo; - } - - class RawBlockNode extends NodeBase { - mustache: MustacheNode; - program: ProgramNode; - } - - class ContentNode extends NodeBase { - original: string; - string: string; - } - - class DataNode extends NodeBase { - id: IdNode; - stringModeValue: string; - idName: string; - } - - class StringNode extends NodeBase { - original: string; - string: string; - stringModeValue: string; - } - - class NumberNode extends NodeBase { - original: string; - number: string; - stringModeValue: number; - } - - class BooleanNode extends NodeBase { - bool: string; - stringModeValue: boolean; - } - - class CommentNode extends NodeBase { - comment: string; - strip: IStripInfo; - } - } -} - -declare module "handlebars" { - export = Handlebars; -} diff --git a/types/handlebars/v1/tsconfig.json b/types/handlebars/v1/tsconfig.json deleted file mode 100644 index 96818b903b..0000000000 --- a/types/handlebars/v1/tsconfig.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../../", - "typeRoots": [ - "../../" - ], - "types": [], - "paths": { - "handlebars": [ - "handlebars/v1" - ] - }, - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts" - ] -} \ No newline at end of file diff --git a/types/handlebars/v1/tslint.json b/types/handlebars/v1/tslint.json deleted file mode 100644 index a41bf5d19a..0000000000 --- a/types/handlebars/v1/tslint.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } -} diff --git a/types/vision/package.json b/types/vision/package.json new file mode 100644 index 0000000000..b6f5204c9a --- /dev/null +++ b/types/vision/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "handlebars": "^4.1.0" + } +} \ No newline at end of file From 0b75a04407a0a562bf4f46251def6c3f8e787f9f Mon Sep 17 00:00:00 2001 From: Felix Becker Date: Tue, 19 Feb 2019 17:03:30 +0100 Subject: [PATCH 061/924] Infer parameter and return types for sinon.spy() --- types/sinon/ts3.1/index.d.ts | 4 +-- types/sinon/ts3.1/sinon-tests.ts | 44 ++++++++++++++++++++++++-------- 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/types/sinon/ts3.1/index.d.ts b/types/sinon/ts3.1/index.d.ts index 7123e75d49..6b7830722c 100644 --- a/types/sinon/ts3.1/index.d.ts +++ b/types/sinon/ts3.1/index.d.ts @@ -211,7 +211,7 @@ declare namespace Sinon { returnValues: TReturnValue[]; // Methods - (...args: any[]): any; + (...args: TArgs): TReturnValue; /** * Returns true if the spy was called before @param anotherSpy * @param anotherSpy @@ -338,7 +338,7 @@ declare namespace Sinon { /** * Spies on the provided function */ - (func: Function): SinonSpy; + any>(func: F): SinonSpy, ReturnType>; /** * Creates a spy for object.method and replaces the original method with the spy. * An exception is thrown if the property is not already a function. diff --git a/types/sinon/ts3.1/sinon-tests.ts b/types/sinon/ts3.1/sinon-tests.ts index 2db25348ae..d27d03c230 100644 --- a/types/sinon/ts3.1/sinon-tests.ts +++ b/types/sinon/ts3.1/sinon-tests.ts @@ -83,8 +83,8 @@ function testSandbox() { const privateFooStubbedInstance = sb.createStubInstance(PrivateFoo); stubInstance.foo.calledWith('foo', 1); privateFooStubbedInstance.foo.calledWith(); - const clsFoo: sinon.SinonStub = stubInstance.foo; - const privateFooFoo: sinon.SinonStub = privateFooStubbedInstance.foo; + const clsFoo: sinon.SinonStub<[string, number], number> = stubInstance.foo; + const privateFooFoo: sinon.SinonStub<[], void> = privateFooStubbedInstance.foo; const clsBar: number = stubInstance.bar; const privateFooBar: number = privateFooStubbedInstance.bar; } @@ -325,7 +325,7 @@ function testTypedSpy() { } function testSpy() { - const fn = () => { }; + let fn = (arg: string, arg2: number): boolean => true; const obj = class { foo() { } set bar(val: number) { } @@ -333,12 +333,11 @@ function testSpy() { }; const instance = new obj(); - let spy = sinon.spy(); + const spy = sinon.spy(); // $ExpectType SinonSpy const spyTwo = sinon.spy().named('spyTwo'); - spy = sinon.spy(fn); - spy = sinon.spy(instance, 'foo'); - spy = sinon.spy(instance, 'bar', ['set', 'get']); + const methodSpy = sinon.spy(instance, 'foo'); + const methodSpy2 = sinon.spy(instance, 'bar', ['set', 'get']); let count = 0; count = spy.callCount; @@ -356,7 +355,12 @@ function testSpy() { arr = spy.exceptions; arr = spy.returnValues; - spy('a', 'b'); + const fnSpy = sinon.spy(fn); // $ExpectType SinonSpy<[string, number], boolean> + fn = fnSpy; // Should be assignable to original function + fnSpy('a', 1); // $ExpectType boolean + fnSpy.args; // $ExpectType [string, number][] + fnSpy.returnValues; // $ExpectType boolean[] + spy(1, 2); spy(true); @@ -420,13 +424,12 @@ function testSpy() { function testStub() { const obj = class { - foo() { } + foo(arg: string): number { return 1; } promiseFunc() { return Promise.resolve('foo'); } }; const instance = new obj(); - let stub = sinon.stub(); - stub = sinon.stub(instance, 'foo').named('namedStub'); + const stub = sinon.stub(); const spy: sinon.SinonSpy = stub; @@ -485,6 +488,25 @@ function testStub() { stub.yieldsToAsync('foo', 'a', 2); stub.yieldsToOnAsync('foo', instance, 'a', 2); stub.withArgs('a', 2).returns(true); + + // Type-safe stubs + const stub2 = sinon.stub(instance, 'foo').named('namedStub'); + instance.foo = stub2; // Should be assignable to original + stub2.returns(true); // $ExpectError + stub2.returns(5); + stub2.returns('foo'); // $ExpectError + stub2.callsFake((arg: string) => 1); + stub2.callsFake((arg: number) => 1); // $ExpectError + stub2.callsFake((arg: string) => 'a'); // $ExpectError + stub2.onCall(1).returns(2); + stub2.withArgs('a', 2).returns('true'); // $ExpectError + stub2.withArgs('a').returns(1); + stub2.withArgs('a').returns('a'); // $ExpectError + + const pStub = sinon.stub(instance, 'promiseFunc'); + pStub.resolves(); + pStub.resolves('foo'); + pStub.resolves(1); // $ExpectError } function testTypedStub() { From a5c1bdeb29beb19061a44d772e560ca702595d35 Mon Sep 17 00:00:00 2001 From: Jacob Gardner Date: Tue, 19 Feb 2019 10:40:00 -0600 Subject: [PATCH 062/924] Add old URL back to project --- types/sequelize/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/sequelize/index.d.ts b/types/sequelize/index.d.ts index 458929e298..5d1131684c 100644 --- a/types/sequelize/index.d.ts +++ b/types/sequelize/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for Sequelize 4.27.11 -// Project: https://github.com/sequelize/sequelize +// Project: http://sequelizejs.com // Definitions by: samuelneff // Peter Harris // Ivan Drinchev From 59814c662fa9f8fb8a50e862fbd7c99c01da36a8 Mon Sep 17 00:00:00 2001 From: Jacob Gardner Date: Tue, 19 Feb 2019 10:54:25 -0600 Subject: [PATCH 063/924] Add tests. Let sequelize have two project URLs --- types/lodash/lodash-tests.ts | 2 ++ types/sequelize/index.d.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index 64d445c65a..87105eaa88 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -5151,6 +5151,8 @@ fp.now(); // $ExpectType number _.get({ a: { b: true } }, "a"); // $ExpectType { b: boolean; } _.get({ a: { b: true } }, ["a"]); // $ExpectType { b: boolean; } _.get({ a: { b: true } }, ["a", "b"]); // $ExpectType any + _.get({ a: undefined }, 'a'); // $ExpectType undefined + _.get({ a: undefined }, 'a', 'default'); // $ExpectType string _("abc").get(1); // $ExpectType string _("abc").get(["0"], "_"); diff --git a/types/sequelize/index.d.ts b/types/sequelize/index.d.ts index 5d1131684c..8fb0c16503 100644 --- a/types/sequelize/index.d.ts +++ b/types/sequelize/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for Sequelize 4.27.11 -// Project: http://sequelizejs.com +// Project: http://sequelizejs.com, https://github.com/sequelize/sequelize // Definitions by: samuelneff // Peter Harris // Ivan Drinchev From 038d5e69b5bb71e87c20834def72199a6347200e Mon Sep 17 00:00:00 2001 From: Jacob Gardner Date: Tue, 19 Feb 2019 10:56:59 -0600 Subject: [PATCH 064/924] Fix failing get test --- types/lodash/lodash-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index 87105eaa88..5bac79044c 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -5152,7 +5152,7 @@ fp.now(); // $ExpectType number _.get({ a: { b: true } }, ["a"]); // $ExpectType { b: boolean; } _.get({ a: { b: true } }, ["a", "b"]); // $ExpectType any _.get({ a: undefined }, 'a'); // $ExpectType undefined - _.get({ a: undefined }, 'a', 'default'); // $ExpectType string + _.get({ a: undefined }, 'a', 'default'); // $ExpectType 'default' _("abc").get(1); // $ExpectType string _("abc").get(["0"], "_"); From 1c2e51ca7c5e0782ac0da78dec98a11e1d8c78bd Mon Sep 17 00:00:00 2001 From: Jacob Gardner Date: Tue, 19 Feb 2019 11:24:38 -0600 Subject: [PATCH 065/924] Using boolean instead since TS wants to use the literal value for string --- types/lodash/lodash-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index 5bac79044c..95f0bcff0e 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -5152,7 +5152,7 @@ fp.now(); // $ExpectType number _.get({ a: { b: true } }, ["a"]); // $ExpectType { b: boolean; } _.get({ a: { b: true } }, ["a", "b"]); // $ExpectType any _.get({ a: undefined }, 'a'); // $ExpectType undefined - _.get({ a: undefined }, 'a', 'default'); // $ExpectType 'default' + _.get({ a: undefined }, 'a', false); // $ExpectType boolean _("abc").get(1); // $ExpectType string _("abc").get(["0"], "_"); From e78b8138a57a21ad2bc25f35128de415a3bce104 Mon Sep 17 00:00:00 2001 From: Jacob Gardner Date: Tue, 19 Feb 2019 11:31:50 -0600 Subject: [PATCH 066/924] Added additional test and followed similar pattern to above --- types/lodash/lodash-tests.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index 95f0bcff0e..b8c2a53e8d 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -5142,6 +5142,9 @@ fp.now(); // $ExpectType number // _.get { + const value: string | undefined = anything; + const defValue: boolean = anything; + _.get([], Symbol.iterator); _.get([], [Symbol.iterator]); @@ -5151,8 +5154,9 @@ fp.now(); // $ExpectType number _.get({ a: { b: true } }, "a"); // $ExpectType { b: boolean; } _.get({ a: { b: true } }, ["a"]); // $ExpectType { b: boolean; } _.get({ a: { b: true } }, ["a", "b"]); // $ExpectType any - _.get({ a: undefined }, 'a'); // $ExpectType undefined - _.get({ a: undefined }, 'a', false); // $ExpectType boolean + _.get({ a: undefined }, "a"); // $ExpectType undefined + _.get({ a: value }, "a", defValue); // $ExpectType string | boolean + _.get({ a: undefined }, "a", defValue); // $ExpectType boolean _("abc").get(1); // $ExpectType string _("abc").get(["0"], "_"); From e098885ccded0f5204a28dbc2170a13251945c18 Mon Sep 17 00:00:00 2001 From: Jacob Gardner Date: Tue, 19 Feb 2019 11:42:54 -0600 Subject: [PATCH 067/924] Add to implicit and explicit wrapper --- types/lodash/common/object.d.ts | 4 ++-- types/lodash/lodash-tests.ts | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/types/lodash/common/object.d.ts b/types/lodash/common/object.d.ts index 29ab78bed4..2342a18a06 100644 --- a/types/lodash/common/object.d.ts +++ b/types/lodash/common/object.d.ts @@ -1763,7 +1763,7 @@ declare module "../index" { this: LoDashImplicitWrapper, path: TKey | [TKey], defaultValue: TDefault - ): TObject[TKey] | TDefault; + ): Exclude | TDefault; /** * @see _.get @@ -1839,7 +1839,7 @@ declare module "../index" { this: LoDashExplicitWrapper, path: TKey | [TKey], defaultValue: TDefault - ): LoDashExplicitWrapper; + ): LoDashExplicitWrapper | TDefault>; /** * @see _.get diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index b8c2a53e8d..0809cd15f3 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -5164,6 +5164,9 @@ fp.now(); // $ExpectType number _({ a: { b: true } }).get("a"); // $ExpectType { b: boolean; } _({ a: { b: true } }).get(["a"]); // $ExpectType { b: boolean; } _({ a: { b: true } }).get(["a", "b"]); // $ExpectType any + _({ a: undefined }).get("a"); // $ExpectType undefined + _({ a: value }).get("a", defValue); // $ExpectType string | boolean + _({ a: undefined }).get("a", defValue); // $ExpectType boolean _.chain("abc").get(1); // $ExpectType LoDashExplicitWrapper _.chain("abc").get(["0"], "_"); @@ -5171,6 +5174,9 @@ fp.now(); // $ExpectType number _.chain({ a: { b: true } }).get("a"); // $ExpectType LoDashExplicitWrapper<{ b: boolean; }> _.chain({ a: { b: true } }).get(["a"]); // $ExpectType LoDashExplicitWrapper<{ b: boolean; }> _.chain({ a: { b: true } }).get(["a", "b"]); // $ExpectType LoDashExplicitWrapper + _.chain({ a: undefined }).get("a"); // $ExpectType LoDashExplicitWrapper + _.chain({ a: value }).get("a", defValue); // $ExpectType LoDashExplicitWrapper + _.chain({ a: undefined }).get("a", defValue); // $ExpectType LoDashExplicitWrapper fp.get(Symbol.iterator, []); // $ExpectType any fp.get(Symbol.iterator)([]); // $ExpectType any From 3a169638946899e188e8d2dcce02c0191875dca5 Mon Sep 17 00:00:00 2001 From: Jacob Gardner Date: Tue, 19 Feb 2019 11:46:25 -0600 Subject: [PATCH 068/924] Run npm run generate --- types/lodash/fp.d.ts | 42 ++++++++++++++++++++-------------------- types/lowdb/_lodash.d.ts | 4 ++-- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/types/lodash/fp.d.ts b/types/lodash/fp.d.ts index 68084f1c8d..c26cedeb10 100644 --- a/types/lodash/fp.d.ts +++ b/types/lodash/fp.d.ts @@ -1494,7 +1494,7 @@ declare namespace _ { (defaultValue: lodash.__, path: lodash.__, object: TObject | null | undefined): LodashGetOr1x4; (defaultValue: TDefault, path: lodash.__, object: TObject | null | undefined): LodashGetOr1x5; (defaultValue: lodash.__, path: TKey | [TKey], object: TObject | null | undefined): LodashGetOr1x6; - (defaultValue: TDefault, path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | TDefault; + (defaultValue: TDefault, path: TKey | [TKey], object: TObject | null | undefined): Exclude | TDefault; (defaultValue: lodash.__, path: number): LodashGetOr2x2; (defaultValue: TDefault, path: number): LodashGetOr2x3; (defaultValue: lodash.__, path: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashGetOr2x4; @@ -1517,7 +1517,7 @@ declare namespace _ { interface LodashGetOr1x1 { (path: TKey | [TKey]): LodashGetOr1x3; (path: lodash.__, object: TObject | null | undefined): LodashGetOr1x5; - (path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | TDefault; + (path: TKey | [TKey], object: TObject | null | undefined): Exclude | TDefault; (path: number): LodashGetOr2x3; (path: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashGetOr2x5; (path: number, object: lodash.NumericDictionary | null | undefined): T | TDefault; @@ -1528,16 +1528,16 @@ declare namespace _ { interface LodashGetOr1x2 { (defaultValue: TDefault): LodashGetOr1x3; (defaultValue: lodash.__, object: TObject | null | undefined): LodashGetOr1x6; - (defaultValue: TDefault, object: TObject | null | undefined): TObject[TKey] | TDefault; + (defaultValue: TDefault, object: TObject | null | undefined): Exclude | TDefault; } - type LodashGetOr1x3 = (object: TObject | null | undefined) => TObject[TKey] | TDefault; + type LodashGetOr1x3 = (object: TObject | null | undefined) => Exclude | TDefault; interface LodashGetOr1x4 { (defaultValue: TDefault): LodashGetOr1x5; (defaultValue: lodash.__, path: TKey | [TKey]): LodashGetOr1x6; - (defaultValue: TDefault, path: TKey | [TKey]): TObject[TKey] | TDefault; + (defaultValue: TDefault, path: TKey | [TKey]): Exclude | TDefault; } - type LodashGetOr1x5 = (path: TKey | [TKey]) => TObject[TKey] | TDefault; - type LodashGetOr1x6 = (defaultValue: TDefault) => TObject[TKey] | TDefault; + type LodashGetOr1x5 = (path: TKey | [TKey]) => Exclude | TDefault; + type LodashGetOr1x6 = (defaultValue: TDefault) => Exclude | TDefault; interface LodashGetOr2x2 { (defaultValue: TDefault): LodashGetOr2x3; (defaultValue: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashGetOr2x6; @@ -2756,7 +2756,7 @@ declare namespace _ { (defaultValue: lodash.__, path: lodash.__, object: TObject | null | undefined): LodashPathOr1x4; (defaultValue: TDefault, path: lodash.__, object: TObject | null | undefined): LodashPathOr1x5; (defaultValue: lodash.__, path: TKey | [TKey], object: TObject | null | undefined): LodashPathOr1x6; - (defaultValue: TDefault, path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | TDefault; + (defaultValue: TDefault, path: TKey | [TKey], object: TObject | null | undefined): Exclude | TDefault; (defaultValue: lodash.__, path: number): LodashPathOr2x2; (defaultValue: TDefault, path: number): LodashPathOr2x3; (defaultValue: lodash.__, path: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashPathOr2x4; @@ -2779,7 +2779,7 @@ declare namespace _ { interface LodashPathOr1x1 { (path: TKey | [TKey]): LodashPathOr1x3; (path: lodash.__, object: TObject | null | undefined): LodashPathOr1x5; - (path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | TDefault; + (path: TKey | [TKey], object: TObject | null | undefined): Exclude | TDefault; (path: number): LodashPathOr2x3; (path: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashPathOr2x5; (path: number, object: lodash.NumericDictionary | null | undefined): T | TDefault; @@ -2790,16 +2790,16 @@ declare namespace _ { interface LodashPathOr1x2 { (defaultValue: TDefault): LodashPathOr1x3; (defaultValue: lodash.__, object: TObject | null | undefined): LodashPathOr1x6; - (defaultValue: TDefault, object: TObject | null | undefined): TObject[TKey] | TDefault; + (defaultValue: TDefault, object: TObject | null | undefined): Exclude | TDefault; } - type LodashPathOr1x3 = (object: TObject | null | undefined) => TObject[TKey] | TDefault; + type LodashPathOr1x3 = (object: TObject | null | undefined) => Exclude | TDefault; interface LodashPathOr1x4 { (defaultValue: TDefault): LodashPathOr1x5; (defaultValue: lodash.__, path: TKey | [TKey]): LodashPathOr1x6; - (defaultValue: TDefault, path: TKey | [TKey]): TObject[TKey] | TDefault; + (defaultValue: TDefault, path: TKey | [TKey]): Exclude | TDefault; } - type LodashPathOr1x5 = (path: TKey | [TKey]) => TObject[TKey] | TDefault; - type LodashPathOr1x6 = (defaultValue: TDefault) => TObject[TKey] | TDefault; + type LodashPathOr1x5 = (path: TKey | [TKey]) => Exclude | TDefault; + type LodashPathOr1x6 = (defaultValue: TDefault) => Exclude | TDefault; interface LodashPathOr2x2 { (defaultValue: TDefault): LodashPathOr2x3; (defaultValue: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashPathOr2x6; @@ -2996,7 +2996,7 @@ declare namespace _ { (defaultValue: lodash.__, path: lodash.__, object: TObject | null | undefined): LodashPropOr1x4; (defaultValue: TDefault, path: lodash.__, object: TObject | null | undefined): LodashPropOr1x5; (defaultValue: lodash.__, path: TKey | [TKey], object: TObject | null | undefined): LodashPropOr1x6; - (defaultValue: TDefault, path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | TDefault; + (defaultValue: TDefault, path: TKey | [TKey], object: TObject | null | undefined): Exclude | TDefault; (defaultValue: lodash.__, path: number): LodashPropOr2x2; (defaultValue: TDefault, path: number): LodashPropOr2x3; (defaultValue: lodash.__, path: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashPropOr2x4; @@ -3019,7 +3019,7 @@ declare namespace _ { interface LodashPropOr1x1 { (path: TKey | [TKey]): LodashPropOr1x3; (path: lodash.__, object: TObject | null | undefined): LodashPropOr1x5; - (path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | TDefault; + (path: TKey | [TKey], object: TObject | null | undefined): Exclude | TDefault; (path: number): LodashPropOr2x3; (path: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashPropOr2x5; (path: number, object: lodash.NumericDictionary | null | undefined): T | TDefault; @@ -3030,16 +3030,16 @@ declare namespace _ { interface LodashPropOr1x2 { (defaultValue: TDefault): LodashPropOr1x3; (defaultValue: lodash.__, object: TObject | null | undefined): LodashPropOr1x6; - (defaultValue: TDefault, object: TObject | null | undefined): TObject[TKey] | TDefault; + (defaultValue: TDefault, object: TObject | null | undefined): Exclude | TDefault; } - type LodashPropOr1x3 = (object: TObject | null | undefined) => TObject[TKey] | TDefault; + type LodashPropOr1x3 = (object: TObject | null | undefined) => Exclude | TDefault; interface LodashPropOr1x4 { (defaultValue: TDefault): LodashPropOr1x5; (defaultValue: lodash.__, path: TKey | [TKey]): LodashPropOr1x6; - (defaultValue: TDefault, path: TKey | [TKey]): TObject[TKey] | TDefault; + (defaultValue: TDefault, path: TKey | [TKey]): Exclude | TDefault; } - type LodashPropOr1x5 = (path: TKey | [TKey]) => TObject[TKey] | TDefault; - type LodashPropOr1x6 = (defaultValue: TDefault) => TObject[TKey] | TDefault; + type LodashPropOr1x5 = (path: TKey | [TKey]) => Exclude | TDefault; + type LodashPropOr1x6 = (defaultValue: TDefault) => Exclude | TDefault; interface LodashPropOr2x2 { (defaultValue: TDefault): LodashPropOr2x3; (defaultValue: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashPropOr2x6; diff --git a/types/lowdb/_lodash.d.ts b/types/lowdb/_lodash.d.ts index 7267aab0d9..c24e2f1c08 100644 --- a/types/lowdb/_lodash.d.ts +++ b/types/lowdb/_lodash.d.ts @@ -1132,7 +1132,7 @@ declare module "./index" { this: LoDashExplicitSyncWrapper, path: TKey | [TKey], defaultValue: TDefault - ): LoDashExplicitSyncWrapper; + ): LoDashExplicitSyncWrapper | TDefault>; get( this: LoDashExplicitSyncWrapper<_.NumericDictionary>, path: number @@ -2728,7 +2728,7 @@ declare module "./index" { this: LoDashExplicitAsyncWrapper, path: TKey | [TKey], defaultValue: TDefault - ): LoDashExplicitAsyncWrapper; + ): LoDashExplicitAsyncWrapper | TDefault>; get( this: LoDashExplicitAsyncWrapper<_.NumericDictionary>, path: number From 915b48e7668704604a3c93b69b4ce962d9db485b Mon Sep 17 00:00:00 2001 From: Jacob Gardner Date: Tue, 19 Feb 2019 12:35:22 -0600 Subject: [PATCH 069/924] Oops, add sequelizejs.com back to v3 project as well --- types/sequelize/v3/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/sequelize/v3/index.d.ts b/types/sequelize/v3/index.d.ts index 4d2ea38efc..6acc528bc0 100644 --- a/types/sequelize/v3/index.d.ts +++ b/types/sequelize/v3/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for Sequelize 3.30.4 -// Project: https://github.com/sequelize/sequelize +// Project: http://sequelizejs.com, https://github.com/sequelize/sequelize // Definitions by: samuelneff // Peter Harris // Ivan Drinchev From a437cfbec7735ba0c930a8a21ae20833adedb3ad Mon Sep 17 00:00:00 2001 From: Michal Miszczyszyn Date: Tue, 19 Feb 2019 19:52:34 +0100 Subject: [PATCH 070/924] Make connect-mongo compatible with newer mongodb and mongoose --- types/connect-mongo/connect-mongo-tests.ts | 4 ++-- types/connect-mongo/tsconfig.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/types/connect-mongo/connect-mongo-tests.ts b/types/connect-mongo/connect-mongo-tests.ts index 351975d84c..4e3c7f8381 100644 --- a/types/connect-mongo/connect-mongo-tests.ts +++ b/types/connect-mongo/connect-mongo-tests.ts @@ -45,8 +45,8 @@ app.use(session({ // NativeMongoPromiseOptions var Client = mongodb.MongoClient; -var mongoDbPromise = Client.connect('mongodb://localhost/test'); +var mongoDbPromise = Client.connect('mongodb://localhost/test').then(client => client.db()) app.use(session({ secret: 'secret', - store: new MongoStore({ dbPromise: mongoDbPromise}) + store: new MongoStore({ dbPromise: mongoDbPromise }) })); diff --git a/types/connect-mongo/tsconfig.json b/types/connect-mongo/tsconfig.json index c0c9ab3043..45b5d1d665 100644 --- a/types/connect-mongo/tsconfig.json +++ b/types/connect-mongo/tsconfig.json @@ -6,10 +6,10 @@ ], "paths": { "mongodb": [ - "mongodb/v2" + "mongodb" ], "mongoose": [ - "mongoose/v4" + "mongoose" ] }, "noImplicitAny": true, From 4257e8e1cd57626ee3f0e0aec1f2303cf733a8a7 Mon Sep 17 00:00:00 2001 From: Michal Miszczyszyn Date: Tue, 19 Feb 2019 20:29:52 +0100 Subject: [PATCH 071/924] Fix mappings --- types/connect-mongo/tsconfig.json | 8 -------- 1 file changed, 8 deletions(-) diff --git a/types/connect-mongo/tsconfig.json b/types/connect-mongo/tsconfig.json index 45b5d1d665..dc0b76551d 100644 --- a/types/connect-mongo/tsconfig.json +++ b/types/connect-mongo/tsconfig.json @@ -4,14 +4,6 @@ "lib": [ "es6" ], - "paths": { - "mongodb": [ - "mongodb" - ], - "mongoose": [ - "mongoose" - ] - }, "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, From e5d64542ce7dcacbdc2f55cf153d5c77c3d6aafe Mon Sep 17 00:00:00 2001 From: David Pritchard Date: Tue, 19 Feb 2019 15:40:45 -0500 Subject: [PATCH 072/924] Added definition for options type. Removed MTLLoader.materials - there is only MaterialCreator.materials, judging from the source code. --- types/three/three-mtlloader.d.ts | 46 ++++++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 8 deletions(-) diff --git a/types/three/three-mtlloader.d.ts b/types/three/three-mtlloader.d.ts index 33b4822432..e5151c66c5 100644 --- a/types/three/three-mtlloader.d.ts +++ b/types/three/three-mtlloader.d.ts @@ -5,14 +5,44 @@ import { Material } from "./three-core"; import {LoadingManager} from "./three-core"; import {EventDispatcher} from "./three-core"; import {BufferGeometry} from "./three-core"; +import {Side} from "./three-core"; import {Texture} from "./three-core"; +import {Wrapping} from "./three-core"; + +export interface MaterialCreatorOptions { + /** + * side: Which side to apply the material + * THREE.FrontSide (default), THREE.BackSide, THREE.DoubleSide + */ + side?: Side; + /* + * wrap: What type of wrapping to apply for textures + * THREE.RepeatWrapping (default), THREE.ClampToEdgeWrapping, THREE.MirroredRepeatWrapping + */ + wrap?: Wrapping; + /* + * normalizeRGB: RGBs need to be normalized to 0-1 from 0-255 + * Default: false, assumed to be already normalized + */ + normalizeRGB?: boolean; + /* + * ignoreZeroRGBs: Ignore values of RGBs (Ka,Kd,Ks) that are all 0's + * Default: false + */ + ignoreZeroRGBs?: boolean; + /* + * invertTrProperty: Use values 1 of Tr field for fully opaque. This option is useful for obj + * exported from 3ds MAX, vcglib or meshlab. + * Default: false + */ + invertTrProperty?: boolean; +} export class MTLLoader extends EventDispatcher { constructor(manager?: LoadingManager); manager: LoadingManager; - materialOptions: {}; - materials: Material[]; + materialOptions: MaterialCreatorOptions; path: string; texturePath: string; crossOrigin: boolean; @@ -23,26 +53,26 @@ export class MTLLoader extends EventDispatcher { setTexturePath(path: string) : void; setBaseUrl(path: string) : void; setCrossOrigin(value: boolean) : void; - setMaterialOptions(value: any) : void; + setMaterialOptions(value: MaterialCreatorOptions) : void; } export class MaterialCreator { - constructor(baseUrl?: string, options?: any); + constructor(baseUrl?: string, options?: MaterialCreatorOptions); baseUrl : string; - options : any; materialsInfo : any; materials : any; materialsArray : Material[]; nameLookup : any; - side : number; - wrap : number; + options : MaterialCreatorOptions; + side : Side; + wrap : Wrapping; setCrossOrigin( value: boolean ) : void; - setManager( value: any ) : void; setMaterials( materialsInfo: any ) : void; convert( materialsInfo: any ) : any; + setManager( value: LoadingManager ) : void; preload() : void; getIndex( materialName: string ) : Material; getAsArray() : Material[]; From f0f4c9fa698886c372f3e58d08d1d115854c2794 Mon Sep 17 00:00:00 2001 From: David Pritchard Date: Tue, 19 Feb 2019 15:45:50 -0500 Subject: [PATCH 073/924] Specified several "any" types within MaterialCreator; made a few loadTexture params optional. --- types/three/three-mtlloader.d.ts | 40 +++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/types/three/three-mtlloader.d.ts b/types/three/three-mtlloader.d.ts index e5151c66c5..c2dbd40c84 100644 --- a/types/three/three-mtlloader.d.ts +++ b/types/three/three-mtlloader.d.ts @@ -3,10 +3,12 @@ import { Material } from "./three-core"; import {LoadingManager} from "./three-core"; +import {Mapping} from "./three-core"; import {EventDispatcher} from "./three-core"; import {BufferGeometry} from "./three-core"; import {Side} from "./three-core"; import {Texture} from "./three-core"; +import {Vector2} from "./three-core"; import {Wrapping} from "./three-core"; export interface MaterialCreatorOptions { @@ -56,29 +58,51 @@ export class MTLLoader extends EventDispatcher { setMaterialOptions(value: MaterialCreatorOptions) : void; } +export interface MaterialInfo { + ks?: number[]; + kd?: number[]; + ke?: number[]; + map_kd?: string; + map_ks?: string; + map_ke?: string; + norm?: string; + map_bump?: string; + bump?: string; + map_d?: string; + ns?: number; + d?: number; + tr?: number; +} + +export interface TexParams { + scale: Vector2; + offset: Vector2; + url: string; +} + export class MaterialCreator { constructor(baseUrl?: string, options?: MaterialCreatorOptions); baseUrl : string; - materialsInfo : any; - materials : any; - materialsArray : Material[]; - nameLookup : any; options : MaterialCreatorOptions; + materialsInfo : {[key: string]: MaterialInfo}; + materials : {[key: string]: Material}; + private materialsArray : Material[]; + nameLookup : {[key: string]: number}; side : Side; wrap : Wrapping; setCrossOrigin( value: boolean ) : void; - setMaterials( materialsInfo: any ) : void; - convert( materialsInfo: any ) : any; setManager( value: LoadingManager ) : void; + setMaterials( materialsInfo: {[key: string]: MaterialInfo} ) : void; + convert( materialsInfo: {[key: string]: MaterialInfo} ) : {[key: string]: MaterialInfo}; preload() : void; getIndex( materialName: string ) : Material; getAsArray() : Material[]; create( materialName: string ) : Material; createMaterial_( materialName: string ) : Material; - getTextureParams( value: string, matParams: any ) : any; - loadTexture(url: string, mapping: any, onLoad: (bufferGeometry: BufferGeometry) => void, onProgress?: (event: ProgressEvent) => void, onError?: (event: ErrorEvent) => void): Texture; + getTextureParams( value: string, matParams: any ) : TexParams; + loadTexture(url: string, mapping?: Mapping, onLoad?: (bufferGeometry: BufferGeometry) => void, onProgress?: (event: ProgressEvent) => void, onError?: (event: ErrorEvent) => void): Texture; } From 34b2e5e53acf5aa3993c3fa84a912b9affd35370 Mon Sep 17 00:00:00 2001 From: Felix Becker Date: Tue, 19 Feb 2019 23:14:41 +0100 Subject: [PATCH 074/924] Fix and improve sinon.assert() with new types, add tests --- types/sinon/ts3.1/index.d.ts | 56 ++++++++++++++++---------------- types/sinon/ts3.1/sinon-tests.ts | 44 +++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 28 deletions(-) diff --git a/types/sinon/ts3.1/index.d.ts b/types/sinon/ts3.1/index.d.ts index 6b7830722c..3898097278 100644 --- a/types/sinon/ts3.1/index.d.ts +++ b/types/sinon/ts3.1/index.d.ts @@ -1155,129 +1155,129 @@ declare namespace Sinon { * Passes if spy was never called * @param spy */ - notCalled(spy: SinonSpy): void; + notCalled(spy: SinonSpy): void; /** * Passes if spy was called at least once. */ - called(spy: SinonSpy): void; + called(spy: SinonSpy): void; /** * Passes if spy was called once and only once. */ - calledOnce(spy: SinonSpy): void; + calledOnce(spy: SinonSpy): void; /** * Passes if spy was called exactly twice. */ - calledTwice(spy: SinonSpy): void; + calledTwice(spy: SinonSpy): void; /** * Passes if spy was called exactly three times. */ - calledThrice(spy: SinonSpy): void; + calledThrice(spy: SinonSpy): void; /** * Passes if spy was called exactly num times. */ - callCount(spy: SinonSpy, count: number): void; + callCount(spy: SinonSpy, count: number): void; /** * Passes if provided spies were called in the specified order. * @param spies */ - callOrder(...spies: SinonSpy[]): void; + callOrder(...spies: SinonSpy[]): void; /** * Passes if spy was ever called with obj as its this value. * It’s possible to assert on a dedicated spy call: sinon.assert.calledOn(spy.firstCall, arg1, arg2, ...);. */ - calledOn(spyOrSpyCall: SinonSpy | SinonSpyCall, obj: any): void; + calledOn(spyOrSpyCall: SinonSpy | SinonSpyCall, obj: any): void; /** * Passes if spy was always called with obj as its this value. */ - alwaysCalledOn(spy: SinonSpy, obj: any): void; + alwaysCalledOn(spy: SinonSpy, obj: any): void; /** * Passes if spy was called with the provided arguments. * It’s possible to assert on a dedicated spy call: sinon.assert.calledWith(spy.firstCall, arg1, arg2, ...);. * @param spyOrSpyCall * @param args */ - calledWith(spyOrSpyCall: SinonSpy | SinonSpyCall, ...args: any[]): void; + calledWith(spyOrSpyCall: SinonSpy | SinonSpyCall, ...args: MatchArguments): void; /** * Passes if spy was always called with the provided arguments. * @param spy * @param args */ - alwaysCalledWith(spy: SinonSpy, ...args: any[]): void; + alwaysCalledWith(spy: SinonSpy, ...args: MatchArguments): void; /** * Passes if spy was never called with the provided arguments. * @param spy * @param args */ - neverCalledWith(spy: SinonSpy, ...args: any[]): void; + neverCalledWith(spy: SinonSpy, ...args: MatchArguments): void; /** * Passes if spy was called with the provided arguments and no others. * It’s possible to assert on a dedicated spy call: sinon.assert.calledWithExactly(spy.getCall(1), arg1, arg2, ...);. * @param spyOrSpyCall * @param args */ - calledWithExactly( - spyOrSpyCall: SinonSpy | SinonSpyCall, - ...args: any[] + calledWithExactly( + spyOrSpyCall: SinonSpy | SinonSpyCall, + ...args: MatchArguments ): void; /** * Passes if spy was always called with the provided arguments and no others. */ - alwaysCalledWithExactly(spy: SinonSpy, ...args: any[]): void; + alwaysCalledWithExactly(spy: SinonSpy, ...args: MatchArguments): void; /** * Passes if spy was called with matching arguments. * This behaves the same way as sinon.assert.calledWith(spy, sinon.match(arg1), sinon.match(arg2), ...). * It’s possible to assert on a dedicated spy call: sinon.assert.calledWithMatch(spy.secondCall, arg1, arg2, ...);. */ - calledWithMatch( - spyOrSpyCall: SinonSpy | SinonSpyCall, - ...args: any[] + calledWithMatch( + spyOrSpyCall: SinonSpy | SinonSpyCall, + ...args: TArgs ): void; /** * Passes if spy was always called with matching arguments. * This behaves the same way as sinon.assert.alwaysCalledWith(spy, sinon.match(arg1), sinon.match(arg2), ...). */ - alwaysCalledWithMatch(spy: SinonSpy, ...args: any[]): void; + alwaysCalledWithMatch(spy: SinonSpy, ...args: TArgs): void; /** * Passes if spy was never called with matching arguments. * This behaves the same way as sinon.assert.neverCalledWith(spy, sinon.match(arg1), sinon.match(arg2), ...). * @param spy * @param args */ - neverCalledWithMatch(spy: SinonSpy, ...args: any[]): void; + neverCalledWithMatch(spy: SinonSpy, ...args: TArgs): void; /** * Passes if spy was called with the new operator. * It’s possible to assert on a dedicated spy call: sinon.assert.calledWithNew(spy.secondCall, arg1, arg2, ...);. * @param spyOrSpyCall */ - calledWithNew(spyOrSpyCall: SinonSpy | SinonSpyCall): void; + calledWithNew(spyOrSpyCall: SinonSpy | SinonSpyCall): void; /** * Passes if spy threw any exception. */ - threw(spyOrSpyCall: SinonSpy | SinonSpyCall): void; + threw(spyOrSpyCall: SinonSpy | SinonSpyCall): void; /** * Passes if spy threw the given exception. * The exception is an actual object. * It’s possible to assert on a dedicated spy call: sinon.assert.threw(spy.thirdCall, exception);. */ - threw(spyOrSpyCall: SinonSpy | SinonSpyCall, exception: string): void; + threw(spyOrSpyCall: SinonSpy | SinonSpyCall, exception: string): void; /** * Passes if spy threw the given exception. * The exception is a String denoting its type. * It’s possible to assert on a dedicated spy call: sinon.assert.threw(spy.thirdCall, exception);. */ - threw(spyOrSpyCall: SinonSpy | SinonSpyCall, exception: any): void; + threw(spyOrSpyCall: SinonSpy | SinonSpyCall, exception: any): void; /** * Like threw, only required for all calls to the spy. */ - alwaysThrew(spy: SinonSpy): void; + alwaysThrew(spy: SinonSpy): void; /** * Like threw, only required for all calls to the spy. */ - alwaysThrew(spy: SinonSpy, exception: string): void; + alwaysThrew(spy: SinonSpy, exception: string): void; /** * Like threw, only required for all calls to the spy. */ - alwaysThrew(spy: SinonSpy, exception: any): void; + alwaysThrew(spy: SinonSpy, exception: any): void; /** * Uses sinon.match to test if the arguments can be considered a match. */ diff --git a/types/sinon/ts3.1/sinon-tests.ts b/types/sinon/ts3.1/sinon-tests.ts index d27d03c230..3fc046eb96 100644 --- a/types/sinon/ts3.1/sinon-tests.ts +++ b/types/sinon/ts3.1/sinon-tests.ts @@ -287,6 +287,50 @@ function testAssert() { sinon.assert.expose(obj); sinon.assert.expose(obj, { prefix: 'blah' }); sinon.assert.expose(obj, { includeFail: true }); + + const typedSpy = sinon.spy((arg1: string, arg2: boolean) => 123); + sinon.assert.notCalled(typedSpy); + sinon.assert.called(typedSpy); + sinon.assert.calledOnce(typedSpy); + sinon.assert.calledTwice(typedSpy); + sinon.assert.calledThrice(typedSpy); + sinon.assert.callCount(typedSpy, 3); + sinon.assert.callOrder(typedSpy, spyTwo); + sinon.assert.calledOn(typedSpy, obj); + sinon.assert.calledOn(typedSpy.firstCall, obj); + sinon.assert.alwaysCalledOn(typedSpy, obj); + sinon.assert.alwaysCalledWith(typedSpy, 'a', 'b', 'c'); // $ExpectError + sinon.assert.alwaysCalledWith(typedSpy, 'a', true); + sinon.assert.neverCalledWith(typedSpy, 'a', false); + sinon.assert.neverCalledWith(typedSpy, 'a', 'b'); // $ExpectError + sinon.assert.calledWithExactly(typedSpy, 'a', true); + sinon.assert.calledWithExactly(typedSpy, 'a', 'b'); // $ExpectError + sinon.assert.alwaysCalledWithExactly(typedSpy, 'a', true); + sinon.assert.alwaysCalledWithExactly(typedSpy, 'a', 1); // $ExpectError + sinon.assert.calledWithMatch(typedSpy, 'a', true); + sinon.assert.calledWithMatch(typedSpy.firstCall, 'a', true); + sinon.assert.calledWithMatch(typedSpy.firstCall, 'a', 2); // $ExpectError + sinon.assert.alwaysCalledWithMatch(typedSpy, 'a', true); + sinon.assert.alwaysCalledWithMatch(typedSpy, 'a', 2); // $ExpectError + sinon.assert.neverCalledWithMatch(typedSpy, 'a', true); + sinon.assert.neverCalledWithMatch(typedSpy, 'a', 2); // $ExpectError + sinon.assert.calledWithNew(typedSpy); + sinon.assert.calledWithNew(typedSpy.firstCall); + sinon.assert.threw(typedSpy); + sinon.assert.threw(typedSpy.firstCall); + sinon.assert.threw(typedSpy, 'foo error'); + sinon.assert.threw(typedSpy.firstCall, 'foo error'); + sinon.assert.threw(typedSpy, new Error('foo')); + sinon.assert.threw(typedSpy.firstCall, new Error('foo')); + sinon.assert.alwaysThrew(typedSpy); + sinon.assert.alwaysThrew(typedSpy, 'foo error'); + sinon.assert.alwaysThrew(typedSpy, new Error('foo')); + sinon.assert.match('a', 'b'); + sinon.assert.match(1, 1 + 1); + sinon.assert.match({ a: 1 }, { b: 2, c: 'abc' }); + sinon.assert.expose(obj); + sinon.assert.expose(obj, { prefix: 'blah' }); + sinon.assert.expose(obj, { includeFail: true }); } function testTypedSpy() { From aae346fe6e88be2931eeddf03dca99aa78dc2aa5 Mon Sep 17 00:00:00 2001 From: Stephen Niedzielski Date: Tue, 19 Feb 2019 19:02:05 -0700 Subject: [PATCH 075/924] [jest-each] Update: templatize .each() - Replace `any` with templates. - Update Jest website to fix failing test. fix #33079 --- types/jest/index.d.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/types/jest/index.d.ts b/types/jest/index.d.ts index 29b3210cc2..b5ee488b2b 100644 --- a/types/jest/index.d.ts +++ b/types/jest/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for Jest 24.0 -// Project: http://facebook.github.io/jest/ +// Project: https://jestjs.io // Definitions by: Asana // Ivo Stratev // jwbay @@ -263,7 +263,20 @@ declare namespace jest { } interface Each { - (cases: any[]): (name: string, fn: (...args: any[]) => any) => void; + // Exclusively arrays. + (cases: ReadonlyArray): ( + name: string, + fn: (...args: T) => any + ) => void; + // Not arrays. + (cases: ReadonlyArray): ( + name: string, + fn: (...args: T[]) => any + ) => void; + (cases: ReadonlyArray>): ( + name: string, + fn: (...args: any[]) => any + ) => void; (strings: TemplateStringsArray, ...placeholders: any[]): ( name: string, fn: (arg: any) => any From e50e51a73ab644ca2be9783807fd199caa373521 Mon Sep 17 00:00:00 2001 From: Felix Becker Date: Wed, 20 Feb 2019 10:35:23 +0100 Subject: [PATCH 076/924] Fix TSLint --- types/sinon/ts3.1/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/sinon/ts3.1/index.d.ts b/types/sinon/ts3.1/index.d.ts index 3898097278..b491b3cf88 100644 --- a/types/sinon/ts3.1/index.d.ts +++ b/types/sinon/ts3.1/index.d.ts @@ -1180,7 +1180,7 @@ declare namespace Sinon { * Passes if provided spies were called in the specified order. * @param spies */ - callOrder(...spies: SinonSpy[]): void; + callOrder(...spies: Array>): void; /** * Passes if spy was ever called with obj as its this value. * It’s possible to assert on a dedicated spy call: sinon.assert.calledOn(spy.firstCall, arg1, arg2, ...);. From 1f9582f217990e222ae52256495b9b706f414557 Mon Sep 17 00:00:00 2001 From: Felix Becker Date: Wed, 20 Feb 2019 12:53:26 +0100 Subject: [PATCH 077/924] Remove any --- types/sinon/ts3.1/index.d.ts | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/types/sinon/ts3.1/index.d.ts b/types/sinon/ts3.1/index.d.ts index b491b3cf88..8307b9782d 100644 --- a/types/sinon/ts3.1/index.d.ts +++ b/types/sinon/ts3.1/index.d.ts @@ -1155,41 +1155,41 @@ declare namespace Sinon { * Passes if spy was never called * @param spy */ - notCalled(spy: SinonSpy): void; + notCalled(spy: SinonSpy): void; /** * Passes if spy was called at least once. */ - called(spy: SinonSpy): void; + called(spy: SinonSpy): void; /** * Passes if spy was called once and only once. */ - calledOnce(spy: SinonSpy): void; + calledOnce(spy: SinonSpy): void; /** * Passes if spy was called exactly twice. */ - calledTwice(spy: SinonSpy): void; + calledTwice(spy: SinonSpy): void; /** * Passes if spy was called exactly three times. */ - calledThrice(spy: SinonSpy): void; + calledThrice(spy: SinonSpy): void; /** * Passes if spy was called exactly num times. */ - callCount(spy: SinonSpy, count: number): void; + callCount(spy: SinonSpy, count: number): void; /** * Passes if provided spies were called in the specified order. * @param spies */ - callOrder(...spies: Array>): void; + callOrder(...spies: Array>): void; /** * Passes if spy was ever called with obj as its this value. * It’s possible to assert on a dedicated spy call: sinon.assert.calledOn(spy.firstCall, arg1, arg2, ...);. */ - calledOn(spyOrSpyCall: SinonSpy | SinonSpyCall, obj: any): void; + calledOn(spyOrSpyCall: SinonSpy | SinonSpyCall, obj: any): void; /** * Passes if spy was always called with obj as its this value. */ - alwaysCalledOn(spy: SinonSpy, obj: any): void; + alwaysCalledOn(spy: SinonSpy, obj: any): void; /** * Passes if spy was called with the provided arguments. * It’s possible to assert on a dedicated spy call: sinon.assert.calledWith(spy.firstCall, arg1, arg2, ...);. @@ -1249,35 +1249,35 @@ declare namespace Sinon { * It’s possible to assert on a dedicated spy call: sinon.assert.calledWithNew(spy.secondCall, arg1, arg2, ...);. * @param spyOrSpyCall */ - calledWithNew(spyOrSpyCall: SinonSpy | SinonSpyCall): void; + calledWithNew(spyOrSpyCall: SinonSpy | SinonSpyCall): void; /** * Passes if spy threw any exception. */ - threw(spyOrSpyCall: SinonSpy | SinonSpyCall): void; + threw(spyOrSpyCall: SinonSpy | SinonSpyCall): void; /** * Passes if spy threw the given exception. * The exception is an actual object. * It’s possible to assert on a dedicated spy call: sinon.assert.threw(spy.thirdCall, exception);. */ - threw(spyOrSpyCall: SinonSpy | SinonSpyCall, exception: string): void; + threw(spyOrSpyCall: SinonSpy | SinonSpyCall, exception: string): void; /** * Passes if spy threw the given exception. * The exception is a String denoting its type. * It’s possible to assert on a dedicated spy call: sinon.assert.threw(spy.thirdCall, exception);. */ - threw(spyOrSpyCall: SinonSpy | SinonSpyCall, exception: any): void; + threw(spyOrSpyCall: SinonSpy | SinonSpyCall, exception: any): void; /** * Like threw, only required for all calls to the spy. */ - alwaysThrew(spy: SinonSpy): void; + alwaysThrew(spy: SinonSpy): void; /** * Like threw, only required for all calls to the spy. */ - alwaysThrew(spy: SinonSpy, exception: string): void; + alwaysThrew(spy: SinonSpy, exception: string): void; /** * Like threw, only required for all calls to the spy. */ - alwaysThrew(spy: SinonSpy, exception: any): void; + alwaysThrew(spy: SinonSpy, exception: any): void; /** * Uses sinon.match to test if the arguments can be considered a match. */ From cd4db81e36a23af91718487a2cc60d133e8df44d Mon Sep 17 00:00:00 2001 From: Felix Becker Date: Wed, 20 Feb 2019 12:57:09 +0100 Subject: [PATCH 078/924] Leave any for callOrder() --- types/sinon/ts3.1/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/sinon/ts3.1/index.d.ts b/types/sinon/ts3.1/index.d.ts index 8307b9782d..aefc93f624 100644 --- a/types/sinon/ts3.1/index.d.ts +++ b/types/sinon/ts3.1/index.d.ts @@ -1180,7 +1180,7 @@ declare namespace Sinon { * Passes if provided spies were called in the specified order. * @param spies */ - callOrder(...spies: Array>): void; + callOrder(...spies: Array>): void; /** * Passes if spy was ever called with obj as its this value. * It’s possible to assert on a dedicated spy call: sinon.assert.calledOn(spy.firstCall, arg1, arg2, ...);. From efbf4f4d1dd5338f4a04877d40ccc0fba46f7ff5 Mon Sep 17 00:00:00 2001 From: Oliver Joseph Ash Date: Wed, 20 Feb 2019 12:21:34 +0000 Subject: [PATCH 079/924] Lodash: `isObject`: user-defined type guard --- types/lodash/fp.d.ts | 2 +- types/lodash/lodash-tests.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/types/lodash/fp.d.ts b/types/lodash/fp.d.ts index 68084f1c8d..c2c983ca6e 100644 --- a/types/lodash/fp.d.ts +++ b/types/lodash/fp.d.ts @@ -1984,7 +1984,7 @@ declare namespace _ { type LodashIsNil = (value: any) => value is null | undefined; type LodashIsNull = (value: any) => value is null; type LodashIsNumber = (value: any) => value is number; - type LodashIsObject = (value: any) => boolean; + type LodashIsObject = (value: any) => value is object; type LodashIsObjectLike = (value: any) => boolean; type LodashIsPlainObject = (value: any) => boolean; type LodashIsRegExp = (value: any) => value is RegExp; diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index 64d445c65a..b3b5910401 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -4291,6 +4291,10 @@ fp.now(); // $ExpectType number _(42).isObject(); // $ExpectType boolean _.chain([]).isObject(); // $ExpectType LoDashExplicitWrapper fp.isObject(anything); // $ExpectType boolean + if (fp.isObject(anything)) { + // $ExpectType object + anything + }; } // _.isObjectLike From 1603c4f4a8de0142d0d7b5be9f98f983cd8cea11 Mon Sep 17 00:00:00 2001 From: Oliver Joseph Ash Date: Wed, 20 Feb 2019 12:41:56 +0000 Subject: [PATCH 080/924] Format --- types/lodash/lodash-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index b3b5910401..fa5c0ad439 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -4293,8 +4293,8 @@ fp.now(); // $ExpectType number fp.isObject(anything); // $ExpectType boolean if (fp.isObject(anything)) { // $ExpectType object - anything - }; + anything; + } } // _.isObjectLike From e72f9cdacfa4193f92a8c3b2e116d98d52fa4851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Pudil?= Date: Wed, 20 Feb 2019 15:42:51 +0100 Subject: [PATCH 081/924] Fix a few incorrect types --- types/tinymce/index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types/tinymce/index.d.ts b/types/tinymce/index.d.ts index b38d96d45c..e50feb0b5d 100644 --- a/types/tinymce/index.d.ts +++ b/types/tinymce/index.d.ts @@ -394,7 +394,7 @@ export class Editor extends util.Observable { addCommand(name: string, callback: (ui: boolean, value: {}) => boolean, scope?: {}): void; - addContextToolbar(predicate: () => void, items: string): void; + addContextToolbar(predicate: () => boolean, items: string): void; addMenuItem(name: string, settings: {}): void; @@ -414,7 +414,7 @@ export class Editor extends util.Observable { execCallback(name: string): {}; - execCommand(cmd: string, ui: boolean, value?: any, args?: {}): void; + execCommand(cmd: string, ui?: boolean, value?: any, args?: {}): void; focus(skipFocus: boolean): void; @@ -838,7 +838,7 @@ export namespace dom { insertAfter(node: Element, referenceNode: Element): Element | T[]; - is(elm: Node, selector: string): void; + is(elm: Node, selector: string): boolean; isBlock(node: Node): boolean; @@ -1072,7 +1072,7 @@ export namespace dom { setContent(content: string, args?: {}): void; - setCursorLocation(node?: html.Node, offset?: number): void; + setCursorLocation(node?: Node, offset?: number): void; setNode(elm: Element): Element; From 49d632d31a54df67dc4747b386c64315701fd322 Mon Sep 17 00:00:00 2001 From: Thomas Stenberg Oddsund Date: Wed, 20 Feb 2019 20:51:27 +0100 Subject: [PATCH 082/924] Throttle and debounce enhance the function it wraps as of 2.1.0 --- types/throttle-debounce/index.d.ts | 30 ++++++++++++++----- .../throttle-debounce-tests.ts | 28 +++++++++++------ 2 files changed, 42 insertions(+), 16 deletions(-) diff --git a/types/throttle-debounce/index.d.ts b/types/throttle-debounce/index.d.ts index 34bfbbdb5b..5b1f197a31 100644 --- a/types/throttle-debounce/index.d.ts +++ b/types/throttle-debounce/index.d.ts @@ -1,8 +1,17 @@ // Type definitions for throttle-debounce 1.1 // Project: https://github.com/niksy/throttle-debounce -// Definitions by: Marek Buchar , Frank Li +// Definitions by: Marek Buchar , Frank Li , Thomas Oddsund // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +export {}; + +interface Cancel { + cancel: () => void; +} + +export type throttle = T & Cancel; +export type debounce = throttle; + /** * Throttle execution of a function. Especially useful for rate limiting * execution of handlers on events like resize and scroll. @@ -34,8 +43,8 @@ export function throttle any>( delay: number, noTrailing: boolean, callback: T, - debounceMode?: boolean, -): T; + debounceMode?: boolean +): throttle; /** * Throttle execution of a function. Especially useful for rate limiting @@ -60,8 +69,8 @@ export function throttle any>( export function throttle any>( delay: number, callback: T, - debounceMode?: boolean, -): T; + debounceMode?: boolean +): throttle; /** * Debounce execution of a function. Debouncing, unlike throttling, @@ -87,7 +96,11 @@ export function throttle any>( * @return * A new, debounced function. */ -export function debounce any>(delay: number, atBegin: boolean, callback: T): T; +export function debounce any>( + delay: number, + atBegin: boolean, + callback: T +): debounce; /** * Debounce execution of a function. Debouncing, unlike throttling, @@ -106,4 +119,7 @@ export function debounce any>(delay: number, atBeg * @return * A new, debounced function. */ -export function debounce any>(delay: number, callback: T): T; +export function debounce any>( + delay: number, + callback: T +): debounce; diff --git a/types/throttle-debounce/throttle-debounce-tests.ts b/types/throttle-debounce/throttle-debounce-tests.ts index 0090eb1039..506d3742ad 100644 --- a/types/throttle-debounce/throttle-debounce-tests.ts +++ b/types/throttle-debounce/throttle-debounce-tests.ts @@ -1,15 +1,25 @@ -import throttleDebounce = require('throttle-debounce'); - -const { throttle, debounce } = throttleDebounce; +import { throttle, debounce } from "throttle-debounce"; type Func = () => void; const func: Func = () => {}; -const throttle1: Func = throttle(42, true, func, true); -const throttle2: Func = throttle(42, true, func); -const throttle3: Func = throttle(42, func, true); -const throttle4: Func = throttle(42, func); +const throttleWithoutCancel1: Func = throttle(42, true, func, true); +const throttleWithoutCancel2: Func = throttle(42, true, func); +const throttleWithoutCancel3: Func = throttle(42, func, true); +const throttleWithoutCancel4: Func = throttle(42, func); +// $ExpectError +throttleWithoutCancel1.cancel(); +const throttleWithCancel1: throttle = throttle(42, true, func, true); +const throttleWithCancel2: throttle = throttle(42, true, func); +const throttleWithCancel3: throttle = throttle(42, func, true); +const throttleWithCancel4: throttle = throttle(42, func); +throttleWithCancel1.cancel(); -const debounce1: Func = debounce(42, true, func); -const debounce2: Func = debounce(42, func); +const debounceWithoutCancel1: Func = debounce(42, true, func); +const debounceWithoutCancel2: Func = debounce(42, func); +// $ExpectError +debounceWithoutCancel1.cancel(); +const debounceWithCancel1: debounce = debounce(42, true, func); +const debounceWithCancel2: debounce = debounce(42, func); +debounceWithCancel1.cancel(); From 851667c52342e5671609d5edc9859136daa310a5 Mon Sep 17 00:00:00 2001 From: Thomas Stenberg Oddsund Date: Wed, 20 Feb 2019 23:45:22 +0100 Subject: [PATCH 083/924] Added tests where the wrapped function is called. --- types/throttle-debounce/throttle-debounce-tests.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/types/throttle-debounce/throttle-debounce-tests.ts b/types/throttle-debounce/throttle-debounce-tests.ts index 506d3742ad..ff4f757dbc 100644 --- a/types/throttle-debounce/throttle-debounce-tests.ts +++ b/types/throttle-debounce/throttle-debounce-tests.ts @@ -8,18 +8,23 @@ const throttleWithoutCancel1: Func = throttle(42, true, func, true); const throttleWithoutCancel2: Func = throttle(42, true, func); const throttleWithoutCancel3: Func = throttle(42, func, true); const throttleWithoutCancel4: Func = throttle(42, func); + +throttleWithoutCancel1(); // $ExpectError throttleWithoutCancel1.cancel(); const throttleWithCancel1: throttle = throttle(42, true, func, true); const throttleWithCancel2: throttle = throttle(42, true, func); const throttleWithCancel3: throttle = throttle(42, func, true); const throttleWithCancel4: throttle = throttle(42, func); +throttleWithCancel1(); throttleWithCancel1.cancel(); const debounceWithoutCancel1: Func = debounce(42, true, func); const debounceWithoutCancel2: Func = debounce(42, func); +debounceWithoutCancel1(); // $ExpectError debounceWithoutCancel1.cancel(); const debounceWithCancel1: debounce = debounce(42, true, func); const debounceWithCancel2: debounce = debounce(42, func); +debounceWithCancel1(); debounceWithCancel1.cancel(); From 0e2352b545e4337c1cc738c7770a3259af8df700 Mon Sep 17 00:00:00 2001 From: WaiKit Date: Thu, 21 Feb 2019 12:50:06 +0800 Subject: [PATCH 084/924] Added $parent --- types/bpmn-moddle/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/bpmn-moddle/index.d.ts b/types/bpmn-moddle/index.d.ts index f4411e05fa..43a6431308 100644 --- a/types/bpmn-moddle/index.d.ts +++ b/types/bpmn-moddle/index.d.ts @@ -25,6 +25,7 @@ declare namespace BPMNModdle { interface TypeDerived { $type: ElementType; + $parent: TypeDerived; } interface BaseElement extends TypeDerived { /** From de1439e667d0def34a98c49d6cc73b7bae2309b0 Mon Sep 17 00:00:00 2001 From: Joan Karadimov Date: Wed, 20 Feb 2019 18:07:42 +0200 Subject: [PATCH 085/924] Add parameters to callbacks for bootstrap-notify --- .../bootstrap-notify-tests.ts | 19 ++++++++++++++++++- types/bootstrap-notify/index.d.ts | 10 +++++----- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/types/bootstrap-notify/bootstrap-notify-tests.ts b/types/bootstrap-notify/bootstrap-notify-tests.ts index 2977d39abf..4b288b2ca0 100644 --- a/types/bootstrap-notify/bootstrap-notify-tests.ts +++ b/types/bootstrap-notify/bootstrap-notify-tests.ts @@ -46,4 +46,21 @@ $.notify({ '' + '' + '' -}); \ No newline at end of file +}); + +const notifyResult = $.notify({ + message: 'Callbacks have the popup element as an argument', +},{ + onShow: function($ele) { + notifyResult.$ele === $ele; + }, + onShown: function($ele) { + notifyResult.$ele === $ele; + }, + onClose: function($ele) { + notifyResult.$ele === $ele; + }, + onClosed: function($ele) { + notifyResult.$ele === $ele; + }, +}); diff --git a/types/bootstrap-notify/index.d.ts b/types/bootstrap-notify/index.d.ts index 540f200d9c..75994ad365 100644 --- a/types/bootstrap-notify/index.d.ts +++ b/types/bootstrap-notify/index.d.ts @@ -48,16 +48,16 @@ interface NotifySettings { enter?: string; exit?: string; }; - onShow?: () => void; - onShown?: () => void; - onClose?: () => void; - onClosed?: () => void; + onShow?: ($ele: JQuery) => void; + onShown?: ($ele: JQuery) => void; + onClose?: ($ele: JQuery) => void; + onClosed?: ($ele: JQuery) => void; icon_type?: string; template?: string; } interface NotifyReturn { - $ele: JQueryStatic; + $ele: JQuery; close: () => void; update: (command: string, update: any) => void; } From 948ae3f83060686315277ff34c1bcc11cd3244c3 Mon Sep 17 00:00:00 2001 From: Christian Petrov Date: Thu, 21 Feb 2019 14:41:23 +0100 Subject: [PATCH 086/924] [tabris-plugin-firebase] Remove not needed package The typings are now included in the project. Change-Id: Id552650efca3566360a2d2dbd4ec6450f4dde98b --- notNeededPackages.json | 6 + types/tabris-plugin-firebase/index.d.ts | 147 ------------------ .../tabris-plugin-firebase-tests.ts | 67 -------- types/tabris-plugin-firebase/tsconfig.json | 23 --- types/tabris-plugin-firebase/tslint.json | 6 - 5 files changed, 6 insertions(+), 243 deletions(-) delete mode 100644 types/tabris-plugin-firebase/index.d.ts delete mode 100644 types/tabris-plugin-firebase/tabris-plugin-firebase-tests.ts delete mode 100644 types/tabris-plugin-firebase/tsconfig.json delete mode 100644 types/tabris-plugin-firebase/tslint.json diff --git a/notNeededPackages.json b/notNeededPackages.json index 1521fd7426..23477f0cca 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -1650,6 +1650,12 @@ "sourceRepoURL": "http://tabrisjs.com", "asOfVersion": "1.8.0" }, + { + "libraryName": "tabris-plugin-firebase", + "typingsPackageName": "tabris-plugin-firebase", + "sourceRepoURL": "https://github.com/eclipsesource/tabris-plugin-firebase", + "asOfVersion": "2.1.0" + }, { "libraryName": "tcomb", "typingsPackageName": "tcomb", diff --git a/types/tabris-plugin-firebase/index.d.ts b/types/tabris-plugin-firebase/index.d.ts deleted file mode 100644 index 0ade0c9dcf..0000000000 --- a/types/tabris-plugin-firebase/index.d.ts +++ /dev/null @@ -1,147 +0,0 @@ -// Type definitions for tabris-plugin-firebase 1.0 -// Project: https://github.com/eclipsesource/tabris-plugin-firebase/ -// Definitions by: EclipseSource -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 - -declare global { - namespace firebase { - const Analytics: Analytics; - const Messaging: Messaging; - const MessagingEvents: MessagingEvents; - const MessageEvent: MessageEvent; - type AnalyticsProperties = Partial; - - interface Analytics extends NativeObject, PropertyMixins.Analytics { - logEvent(eventName: string, parameters?: {[key: string]: string}): void; - setUserProperty(propertyName: string, value: string): void; - set(properties: AnalyticsProperties): this; - set(property: string, value: any): this; - } - - interface Messaging extends NativeObject { - readonly instanceId: string; - readonly token: string; - readonly launchData: object; - resetInstanceId(): void; - on(type: string, listener: (event: any) => void, context?: object): this; - on(listeners: MessagingEvents): this; - off(type: string, listener: (event: any) => void, context?: object): this; - off(listeners: MessagingEvents): this; - once(type: string, listener: (event: any) => void, context?: object): this; - once(listeners: MessagingEvents): this; - } - - interface MessagingEvents { - instanceIdChanged?(event: PropertyChangedEvent): void; - tokenChanged?(event: PropertyChangedEvent): void; - message?(event: MessageEvent): void; - } - - interface MessageEvent extends EventObject { - data: any; - } - - namespace PropertyMixins { - interface Analytics { - analyticsCollectionEnabled: boolean; - screenName: string; - userId: string; - } - } - } -} - -// Tabris.js interfaces - -interface EventObject { - readonly target: T; - readonly timeStamp: number; - readonly type: string; -} - -/** - * Base class for all objects with a native implementation. - */ -declare class NativeObject { - protected constructor(properties?: object); - - /** - * Gets the current value of the given *property*. - */ - get(property: string): any; - - /** - * Removes all occurrences of *listener* that are bound to *type* and *context* from this widget. - * @param type The type of events to remove listeners for. - * @param listener The listener function to remove. - * @param context The context of the bound listener to remove. - */ - off(type: string, listener: (event: any) => void, context?: object): this; - - /** - * Removes all listeners in the given object from the event type indicated by their key. - * @param listeners A key-value map where the keys are event types and the values are the listeners to deregister from these events, e.g. `{tap: onTap, scroll: onScroll}`. - */ - off(listeners: object): this; - - /** - * Registers a *listener* function to be notified of events of the given *type*. - * @param type The type of events to listen for. - * @param listener The listener function to register. This function will be called with an event object. - * @param context In the listener function, `this` will point to this object. If not present, the listener will be called in the context of this object. - */ - on(type: string, listener: (event: any) => void, context?: object): this; - - /** - * Registers all listeners in the given object for the event type indicated by their key. - * @param listeners A key-value map where the keys are event types and the values are the listeners to register for these events, e.g. `{tap: onTap, scroll: onScroll}`. - */ - on(listeners: object): this; - - /** - * Same as `on`, but removes the listener after it has been invoked by an event. - * @param type The type of the event to listen for. - * @param listener The listener function to register. This function will be called with an event object. - * @param context In the listener function, `this` will point to this object. If not present, the listener will be called in the context of this object. - */ - once(type: string, listener: (event: any) => void, context?: object): this; - - /** - * Same as `on`, but removes the listener after it has been invoked by an event. - * @param listeners A key-value map where the keys are event types and the values are the listeners to register for these events, e.g. `{tap: onTap, scroll: onScroll}`. - */ - once(listeners: object): this; - - /** - * Sets the given property. - */ - set(property: string, value: any): this; - - /** - * Sets all key-value pairs in the properties object as widget properties. - */ - set(properties: object): this; - - /** - * Notifies all registered listeners for the given *type* and passes the *event* object to the - * listeners. - * @param type The type of event to trigger - * @param event The event object to pass to listener functions. - */ - trigger(type: string, event: EventObject): this; - - /** - * An application-wide unique identifier automatically assigned to all native objects on creation. - */ - static readonly cid: string; -} - -interface PropertyChangedEvent { - readonly target: T; - readonly timeStamp: number; - readonly type: string; - readonly value: U; -} - -export {}; diff --git a/types/tabris-plugin-firebase/tabris-plugin-firebase-tests.ts b/types/tabris-plugin-firebase/tabris-plugin-firebase-tests.ts deleted file mode 100644 index 8dff4f34a8..0000000000 --- a/types/tabris-plugin-firebase/tabris-plugin-firebase-tests.ts +++ /dev/null @@ -1,67 +0,0 @@ -function testAnalytics() { - // Properties - let analyticsCollectionEnabled: boolean; - let screenName: string; - let userId: string; - - analyticsCollectionEnabled = firebase.Analytics.analyticsCollectionEnabled; - screenName = firebase.Analytics.screenName; - userId = firebase.Analytics.userId; - - firebase.Analytics.analyticsCollectionEnabled = analyticsCollectionEnabled; - firebase.Analytics.screenName = screenName; - firebase.Analytics.userId = userId; - - const properties: firebase.AnalyticsProperties = {analyticsCollectionEnabled, screenName, userId}; - const partialProperties: firebase.AnalyticsProperties = {}; - firebase.Analytics.set(properties); - firebase.Analytics.set(partialProperties); - - // Methods - let thisReturnValue: firebase.Analytics; - const name = ''; - const property = ''; - - thisReturnValue = firebase.Analytics.set({analyticsCollectionEnabled, screenName, userId}); - firebase.Analytics.logEvent(name, {foo: property}); - firebase.Analytics.logEvent(name); - firebase.Analytics.setUserProperty(name, property); -} - -function testMessaging() { - // Properties - let instanceId: string; - let token: string; - let launchData: object; - - instanceId = firebase.Messaging.instanceId; - token = firebase.Messaging.token; - launchData = firebase.Messaging.launchData; - - // Methods - firebase.Messaging.resetInstanceId(); - - // Events - const target: firebase.Messaging = firebase.Messaging; - const timeStamp = 0; - const type = 'foo'; - const value = 'bar'; - const data: any = {}; - - const instanceIdChangedEvent: PropertyChangedEvent = {target, timeStamp, type, value}; - const tokenChangedEvent: PropertyChangedEvent = {target, timeStamp, type, value}; - const messageEvent: firebase.MessageEvent = {target, timeStamp, type, data}; - - firebase.Messaging.on({ - instanceIdChanged: (event: PropertyChangedEvent) => {}, - tokenChanged: (event: PropertyChangedEvent) => {}, - message: (event: firebase.MessageEvent) => {} - }); -} - -interface PropertyChangedEvent { - readonly target: T; - readonly timeStamp: number; - readonly type: string; - readonly value: U; -} diff --git a/types/tabris-plugin-firebase/tsconfig.json b/types/tabris-plugin-firebase/tsconfig.json deleted file mode 100644 index cac6477844..0000000000 --- a/types/tabris-plugin-firebase/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "tabris-plugin-firebase-tests.ts" - ] -} \ No newline at end of file diff --git a/types/tabris-plugin-firebase/tslint.json b/types/tabris-plugin-firebase/tslint.json deleted file mode 100644 index 4c4fc86ace..0000000000 --- a/types/tabris-plugin-firebase/tslint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "strict-export-declare-modifiers": false - } -} From d9be19a2b23bdb291fd56372686241a958389164 Mon Sep 17 00:00:00 2001 From: Michael Louis Thaler Date: Thu, 21 Feb 2019 09:52:32 -0500 Subject: [PATCH 087/924] Fix Superagent 4.x Request.end() method The Superagent 4.x end() method on Request doesn't return anything, as documented on their upgrade instructions. This bit us in prod. --- types/superagent/index.d.ts | 2 +- types/supertest-as-promised/index.d.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/types/superagent/index.d.ts b/types/superagent/index.d.ts index 7915277b37..ae607c3c34 100644 --- a/types/superagent/index.d.ts +++ b/types/superagent/index.d.ts @@ -128,7 +128,7 @@ declare namespace request { ca(cert: Buffer): this; cert(cert: Buffer | string): this; clearTimeout(): this; - end(callback?: CallbackHandler): this; + end(callback?: CallbackHandler): void; field(name: string, val: MultipartValue): this; field(fields: { [fieldName: string]: MultipartValue }): this; get(field: string): string; diff --git a/types/supertest-as-promised/index.d.ts b/types/supertest-as-promised/index.d.ts index 1b12d57b0f..18047870a7 100644 --- a/types/supertest-as-promised/index.d.ts +++ b/types/supertest-as-promised/index.d.ts @@ -18,9 +18,11 @@ declare namespace supertestAsPromised { interface Response extends supertest.Response { } + type CallbackHandler = (err: any, res: Response) => void; interface Test extends supertest.Test, superagent.Request { toPromise(): PromiseBluebird; timeout(): Promise & this; + end(callback?: CallbackHandler): this; } function agent(app?: any): SuperTest; From 7ba0d48ec9bb168b7f8ffbd47ec738c509e884ba Mon Sep 17 00:00:00 2001 From: Vahid Shirvani Date: Thu, 21 Feb 2019 17:37:54 +0100 Subject: [PATCH 088/924] Case matters in linux --- types/ol/{assertionerror => AssertionError}/index.d.ts | 0 types/ol/{attribution => Attribution}/index.d.ts | 0 types/ol/{collection => Collection}/index.d.ts | 0 types/ol/{disposable => Disposable}/index.d.ts | 0 types/ol/{feature => Feature}/index.d.ts | 0 types/ol/{geolocation => Geolocation}/index.d.ts | 0 types/ol/{graticule => Graticule}/index.d.ts | 0 types/ol/{image => Image}/index.d.ts | 0 types/ol/{imagebase => ImageBase}/index.d.ts | 0 types/ol/{imagetile => ImageTile}/index.d.ts | 0 types/ol/{kinetic => Kinetic}/index.d.ts | 0 types/ol/{map => Map}/index.d.ts | 0 types/ol/{mapbrowserevent => MapBrowserEvent}/index.d.ts | 0 .../{mapbrowserpointerevent => MapBrowserPointerEvent}/index.d.ts | 0 types/ol/{mapevent => MapEvent}/index.d.ts | 0 types/ol/{object => Object}/index.d.ts | 0 types/ol/{observable => Observable}/index.d.ts | 0 types/ol/{overlay => Overlay}/index.d.ts | 0 types/ol/{tile => Tile}/index.d.ts | 0 types/ol/{vectortile => VectorTile}/index.d.ts | 0 types/ol/{view => View}/index.d.ts | 0 types/ol/control/{attribution.d.ts => Attribution.d.ts} | 0 types/ol/control/{control.d.ts => Control.d.ts} | 0 types/ol/control/{fullscreen.d.ts => Fullscreen.d.ts} | 0 types/ol/control/{mouseposition.d.ts => MousePosition.d.ts} | 0 types/ol/control/{overviewmap.d.ts => OverviewMap.d.ts} | 0 types/ol/control/{rotate.d.ts => Rotate.d.ts} | 0 types/ol/control/{scaleline.d.ts => ScaleLine.d.ts} | 0 types/ol/control/{zoom.d.ts => Zoom.d.ts} | 0 types/ol/control/{zoomslider.d.ts => ZoomSlider.d.ts} | 0 types/ol/control/{zoomtoextent.d.ts => ZoomToExtent.d.ts} | 0 types/ol/events/{event.d.ts => Event.d.ts} | 0 types/ol/events/{eventtarget.d.ts => EventTarget.d.ts} | 0 types/ol/format/{esrijson.d.ts => EsriJSON.d.ts} | 0 types/ol/format/{feature.d.ts => Feature.d.ts} | 0 types/ol/format/{gml2.d.ts => GML2.d.ts} | 0 types/ol/format/{gml3.d.ts => GML3.d.ts} | 0 types/ol/format/{gmlbase.d.ts => GMLBase.d.ts} | 0 types/ol/format/{gpx.d.ts => GPX.d.ts} | 0 types/ol/format/{geojson.d.ts => GeoJSON.d.ts} | 0 types/ol/format/{igc.d.ts => IGC.d.ts} | 0 types/ol/format/{jsonfeature.d.ts => JSONFeature.d.ts} | 0 types/ol/format/{kml.d.ts => KML.d.ts} | 0 types/ol/format/{mvt.d.ts => MVT.d.ts} | 0 types/ol/format/{osmxml.d.ts => OSMXML.d.ts} | 0 types/ol/format/{polyline.d.ts => Polyline.d.ts} | 0 types/ol/format/{textfeature.d.ts => TextFeature.d.ts} | 0 types/ol/format/{topojson.d.ts => TopoJSON.d.ts} | 0 types/ol/format/{wfs.d.ts => WFS.d.ts} | 0 types/ol/format/{wkt.d.ts => WKT.d.ts} | 0 types/ol/format/{wmscapabilities.d.ts => WMSCapabilities.d.ts} | 0 .../ol/format/{wmsgetfeatureinfo.d.ts => WMSGetFeatureInfo.d.ts} | 0 types/ol/format/{wmtscapabilities.d.ts => WMTSCapabilities.d.ts} | 0 types/ol/format/{xml.d.ts => XML.d.ts} | 0 types/ol/format/{xmlfeature.d.ts => XMLFeature.d.ts} | 0 types/ol/geom/{circle.d.ts => Circle.d.ts} | 0 types/ol/geom/{geometry.d.ts => Geometry.d.ts} | 0 .../ol/geom/{geometrycollection.d.ts => GeometryCollection.d.ts} | 0 types/ol/geom/{linestring.d.ts => LineString.d.ts} | 0 types/ol/geom/{linearring.d.ts => LinearRing.d.ts} | 0 types/ol/geom/{multipoint.d.ts => MultiPoint.d.ts} | 0 types/ol/geom/{multipolygon.d.ts => MultiPolygon.d.ts} | 0 types/ol/geom/{multilinestring.d.ts => MultilineString.d.ts} | 0 types/ol/geom/{point.d.ts => Point.d.ts} | 0 types/ol/geom/{polygon.d.ts => Polygon.d.ts} | 0 types/ol/geom/{simplegeometry.d.ts => SimpleGeometry.d.ts} | 0 .../ol/interaction/{doubleclickzoom.d.ts => DoubleClickZoom.d.ts} | 0 types/ol/interaction/{draganddrop.d.ts => DragAndDrop.d.ts} | 0 types/ol/interaction/{dragbox.d.ts => DragBox.d.ts} | 0 types/ol/interaction/{dragpan.d.ts => DragPan.d.ts} | 0 types/ol/interaction/{dragrotate.d.ts => DragRotate.d.ts} | 0 .../{dragrotateandzoom.d.ts => DragRotateAndZoom.d.ts} | 0 types/ol/interaction/{dragzoom.d.ts => DragZoom.d.ts} | 0 types/ol/interaction/{draw.d.ts => Draw.d.ts} | 0 types/ol/interaction/{extent.d.ts => Extent.d.ts} | 0 types/ol/interaction/{interaction.d.ts => Interaction.d.ts} | 0 types/ol/interaction/{keyboardpan.d.ts => KeyboardPan.d.ts} | 0 types/ol/interaction/{keyboardzoom.d.ts => KeyboardZoom.d.ts} | 0 types/ol/interaction/{modify.d.ts => Modify.d.ts} | 0 types/ol/interaction/{mousewheelzoom.d.ts => MouseWheelZoom.d.ts} | 0 types/ol/interaction/{pinchrotate.d.ts => PinchRotate.d.ts} | 0 types/ol/interaction/{pinchzoom.d.ts => PinchZoom.d.ts} | 0 types/ol/interaction/{pointer.d.ts => Pointer.d.ts} | 0 types/ol/interaction/{select.d.ts => Select.d.ts} | 0 types/ol/interaction/{snap.d.ts => Snap.d.ts} | 0 types/ol/interaction/{translate.d.ts => Translate.d.ts} | 0 types/ol/layer/{base.d.ts => Base.d.ts} | 0 types/ol/layer/{group.d.ts => Group.d.ts} | 0 types/ol/layer/{heatmap.d.ts => Heatmap.d.ts} | 0 types/ol/layer/{image.d.ts => Image.d.ts} | 0 types/ol/layer/{layer.d.ts => Layer.d.ts} | 0 types/ol/layer/{tile.d.ts => Tile.d.ts} | 0 types/ol/layer/{vector.d.ts => Vector.d.ts} | 0 types/ol/layer/{vectortile.d.ts => VectorTile.d.ts} | 0 types/ol/pointer/{pointerevent.d.ts => PointerEvent.d.ts} | 0 types/ol/proj/{projection.d.ts => Projection.d.ts} | 0 types/ol/render/{event.d.ts => Event.d.ts} | 0 types/ol/render/{feature.d.ts => Feature.d.ts} | 0 types/ol/render/{vectorcontext.d.ts => VectorContext.d.ts} | 0 types/ol/source/{bingmaps.d.ts => BingMaps.d.ts} | 0 types/ol/source/{cartodb.d.ts => CartoDB.d.ts} | 0 types/ol/source/{cluster.d.ts => Cluster.d.ts} | 0 types/ol/source/{image.d.ts => Image.d.ts} | 0 types/ol/source/{imagearcgisrest.d.ts => ImageArcGISRest.d.ts} | 0 types/ol/source/{imagecanvas.d.ts => ImageCanvas.d.ts} | 0 types/ol/source/{imagemapguide.d.ts => ImageMapGuide.d.ts} | 0 types/ol/source/{imagestatic.d.ts => ImageStatic.d.ts} | 0 types/ol/source/{imagevector.d.ts => ImageVector.d.ts} | 0 types/ol/source/{imagewms.d.ts => ImageWMS.d.ts} | 0 types/ol/source/{osm.d.ts => OSM.d.ts} | 0 types/ol/source/{raster.d.ts => Raster.d.ts} | 0 types/ol/source/{source.d.ts => Source.d.ts} | 0 types/ol/source/{stamen.d.ts => Stamen.d.ts} | 0 types/ol/source/{tile.d.ts => Tile.d.ts} | 0 types/ol/source/{tilearcgisrest.d.ts => TileArcGISRest.d.ts} | 0 types/ol/source/{tiledebug.d.ts => TileDebug.d.ts} | 0 types/ol/source/{tileimage.d.ts => TileImage.d.ts} | 0 types/ol/source/{tilejson.d.ts => TileJSON.d.ts} | 0 types/ol/source/{tileutfgrid.d.ts => TileUTFGrid.d.ts} | 0 types/ol/source/{tilewms.d.ts => TileWMS.d.ts} | 0 types/ol/source/{urltile.d.ts => UrlTile.d.ts} | 0 types/ol/source/{vector.d.ts => Vector.d.ts} | 0 types/ol/source/{vectortile.d.ts => VectorTile.d.ts} | 0 types/ol/source/{wmts.d.ts => WMTS.d.ts} | 0 types/ol/source/{xyz.d.ts => XYZ.d.ts} | 0 types/ol/source/{zoomify.d.ts => Zoomify.d.ts} | 0 types/ol/style/{atlasmanager.d.ts => AtlasManager.d.ts} | 0 types/ol/style/{circle.d.ts => Circle.d.ts} | 0 types/ol/style/{fill.d.ts => Fill.d.ts} | 0 types/ol/style/{icon.d.ts => Icon.d.ts} | 0 types/ol/style/{image.d.ts => Image.d.ts} | 0 types/ol/style/{regularshape.d.ts => RegularShape.d.ts} | 0 types/ol/style/{stroke.d.ts => Stroke.d.ts} | 0 types/ol/style/{style.d.ts => Style.d.ts} | 0 types/ol/style/{text.d.ts => Text.d.ts} | 0 types/ol/tilegrid/{tilegrid.d.ts => TileGrid.d.ts} | 0 types/ol/tilegrid/{wmts.d.ts => WMTS.d.ts} | 0 137 files changed, 0 insertions(+), 0 deletions(-) rename types/ol/{assertionerror => AssertionError}/index.d.ts (100%) rename types/ol/{attribution => Attribution}/index.d.ts (100%) rename types/ol/{collection => Collection}/index.d.ts (100%) rename types/ol/{disposable => Disposable}/index.d.ts (100%) rename types/ol/{feature => Feature}/index.d.ts (100%) rename types/ol/{geolocation => Geolocation}/index.d.ts (100%) rename types/ol/{graticule => Graticule}/index.d.ts (100%) rename types/ol/{image => Image}/index.d.ts (100%) rename types/ol/{imagebase => ImageBase}/index.d.ts (100%) rename types/ol/{imagetile => ImageTile}/index.d.ts (100%) rename types/ol/{kinetic => Kinetic}/index.d.ts (100%) rename types/ol/{map => Map}/index.d.ts (100%) rename types/ol/{mapbrowserevent => MapBrowserEvent}/index.d.ts (100%) rename types/ol/{mapbrowserpointerevent => MapBrowserPointerEvent}/index.d.ts (100%) rename types/ol/{mapevent => MapEvent}/index.d.ts (100%) rename types/ol/{object => Object}/index.d.ts (100%) rename types/ol/{observable => Observable}/index.d.ts (100%) rename types/ol/{overlay => Overlay}/index.d.ts (100%) rename types/ol/{tile => Tile}/index.d.ts (100%) rename types/ol/{vectortile => VectorTile}/index.d.ts (100%) rename types/ol/{view => View}/index.d.ts (100%) rename types/ol/control/{attribution.d.ts => Attribution.d.ts} (100%) rename types/ol/control/{control.d.ts => Control.d.ts} (100%) rename types/ol/control/{fullscreen.d.ts => Fullscreen.d.ts} (100%) rename types/ol/control/{mouseposition.d.ts => MousePosition.d.ts} (100%) rename types/ol/control/{overviewmap.d.ts => OverviewMap.d.ts} (100%) rename types/ol/control/{rotate.d.ts => Rotate.d.ts} (100%) rename types/ol/control/{scaleline.d.ts => ScaleLine.d.ts} (100%) rename types/ol/control/{zoom.d.ts => Zoom.d.ts} (100%) rename types/ol/control/{zoomslider.d.ts => ZoomSlider.d.ts} (100%) rename types/ol/control/{zoomtoextent.d.ts => ZoomToExtent.d.ts} (100%) rename types/ol/events/{event.d.ts => Event.d.ts} (100%) rename types/ol/events/{eventtarget.d.ts => EventTarget.d.ts} (100%) rename types/ol/format/{esrijson.d.ts => EsriJSON.d.ts} (100%) rename types/ol/format/{feature.d.ts => Feature.d.ts} (100%) rename types/ol/format/{gml2.d.ts => GML2.d.ts} (100%) rename types/ol/format/{gml3.d.ts => GML3.d.ts} (100%) rename types/ol/format/{gmlbase.d.ts => GMLBase.d.ts} (100%) rename types/ol/format/{gpx.d.ts => GPX.d.ts} (100%) rename types/ol/format/{geojson.d.ts => GeoJSON.d.ts} (100%) rename types/ol/format/{igc.d.ts => IGC.d.ts} (100%) rename types/ol/format/{jsonfeature.d.ts => JSONFeature.d.ts} (100%) rename types/ol/format/{kml.d.ts => KML.d.ts} (100%) rename types/ol/format/{mvt.d.ts => MVT.d.ts} (100%) rename types/ol/format/{osmxml.d.ts => OSMXML.d.ts} (100%) rename types/ol/format/{polyline.d.ts => Polyline.d.ts} (100%) rename types/ol/format/{textfeature.d.ts => TextFeature.d.ts} (100%) rename types/ol/format/{topojson.d.ts => TopoJSON.d.ts} (100%) rename types/ol/format/{wfs.d.ts => WFS.d.ts} (100%) rename types/ol/format/{wkt.d.ts => WKT.d.ts} (100%) rename types/ol/format/{wmscapabilities.d.ts => WMSCapabilities.d.ts} (100%) rename types/ol/format/{wmsgetfeatureinfo.d.ts => WMSGetFeatureInfo.d.ts} (100%) rename types/ol/format/{wmtscapabilities.d.ts => WMTSCapabilities.d.ts} (100%) rename types/ol/format/{xml.d.ts => XML.d.ts} (100%) rename types/ol/format/{xmlfeature.d.ts => XMLFeature.d.ts} (100%) rename types/ol/geom/{circle.d.ts => Circle.d.ts} (100%) rename types/ol/geom/{geometry.d.ts => Geometry.d.ts} (100%) rename types/ol/geom/{geometrycollection.d.ts => GeometryCollection.d.ts} (100%) rename types/ol/geom/{linestring.d.ts => LineString.d.ts} (100%) rename types/ol/geom/{linearring.d.ts => LinearRing.d.ts} (100%) rename types/ol/geom/{multipoint.d.ts => MultiPoint.d.ts} (100%) rename types/ol/geom/{multipolygon.d.ts => MultiPolygon.d.ts} (100%) rename types/ol/geom/{multilinestring.d.ts => MultilineString.d.ts} (100%) rename types/ol/geom/{point.d.ts => Point.d.ts} (100%) rename types/ol/geom/{polygon.d.ts => Polygon.d.ts} (100%) rename types/ol/geom/{simplegeometry.d.ts => SimpleGeometry.d.ts} (100%) rename types/ol/interaction/{doubleclickzoom.d.ts => DoubleClickZoom.d.ts} (100%) rename types/ol/interaction/{draganddrop.d.ts => DragAndDrop.d.ts} (100%) rename types/ol/interaction/{dragbox.d.ts => DragBox.d.ts} (100%) rename types/ol/interaction/{dragpan.d.ts => DragPan.d.ts} (100%) rename types/ol/interaction/{dragrotate.d.ts => DragRotate.d.ts} (100%) rename types/ol/interaction/{dragrotateandzoom.d.ts => DragRotateAndZoom.d.ts} (100%) rename types/ol/interaction/{dragzoom.d.ts => DragZoom.d.ts} (100%) rename types/ol/interaction/{draw.d.ts => Draw.d.ts} (100%) rename types/ol/interaction/{extent.d.ts => Extent.d.ts} (100%) rename types/ol/interaction/{interaction.d.ts => Interaction.d.ts} (100%) rename types/ol/interaction/{keyboardpan.d.ts => KeyboardPan.d.ts} (100%) rename types/ol/interaction/{keyboardzoom.d.ts => KeyboardZoom.d.ts} (100%) rename types/ol/interaction/{modify.d.ts => Modify.d.ts} (100%) rename types/ol/interaction/{mousewheelzoom.d.ts => MouseWheelZoom.d.ts} (100%) rename types/ol/interaction/{pinchrotate.d.ts => PinchRotate.d.ts} (100%) rename types/ol/interaction/{pinchzoom.d.ts => PinchZoom.d.ts} (100%) rename types/ol/interaction/{pointer.d.ts => Pointer.d.ts} (100%) rename types/ol/interaction/{select.d.ts => Select.d.ts} (100%) rename types/ol/interaction/{snap.d.ts => Snap.d.ts} (100%) rename types/ol/interaction/{translate.d.ts => Translate.d.ts} (100%) rename types/ol/layer/{base.d.ts => Base.d.ts} (100%) rename types/ol/layer/{group.d.ts => Group.d.ts} (100%) rename types/ol/layer/{heatmap.d.ts => Heatmap.d.ts} (100%) rename types/ol/layer/{image.d.ts => Image.d.ts} (100%) rename types/ol/layer/{layer.d.ts => Layer.d.ts} (100%) rename types/ol/layer/{tile.d.ts => Tile.d.ts} (100%) rename types/ol/layer/{vector.d.ts => Vector.d.ts} (100%) rename types/ol/layer/{vectortile.d.ts => VectorTile.d.ts} (100%) rename types/ol/pointer/{pointerevent.d.ts => PointerEvent.d.ts} (100%) rename types/ol/proj/{projection.d.ts => Projection.d.ts} (100%) rename types/ol/render/{event.d.ts => Event.d.ts} (100%) rename types/ol/render/{feature.d.ts => Feature.d.ts} (100%) rename types/ol/render/{vectorcontext.d.ts => VectorContext.d.ts} (100%) rename types/ol/source/{bingmaps.d.ts => BingMaps.d.ts} (100%) rename types/ol/source/{cartodb.d.ts => CartoDB.d.ts} (100%) rename types/ol/source/{cluster.d.ts => Cluster.d.ts} (100%) rename types/ol/source/{image.d.ts => Image.d.ts} (100%) rename types/ol/source/{imagearcgisrest.d.ts => ImageArcGISRest.d.ts} (100%) rename types/ol/source/{imagecanvas.d.ts => ImageCanvas.d.ts} (100%) rename types/ol/source/{imagemapguide.d.ts => ImageMapGuide.d.ts} (100%) rename types/ol/source/{imagestatic.d.ts => ImageStatic.d.ts} (100%) rename types/ol/source/{imagevector.d.ts => ImageVector.d.ts} (100%) rename types/ol/source/{imagewms.d.ts => ImageWMS.d.ts} (100%) rename types/ol/source/{osm.d.ts => OSM.d.ts} (100%) rename types/ol/source/{raster.d.ts => Raster.d.ts} (100%) rename types/ol/source/{source.d.ts => Source.d.ts} (100%) rename types/ol/source/{stamen.d.ts => Stamen.d.ts} (100%) rename types/ol/source/{tile.d.ts => Tile.d.ts} (100%) rename types/ol/source/{tilearcgisrest.d.ts => TileArcGISRest.d.ts} (100%) rename types/ol/source/{tiledebug.d.ts => TileDebug.d.ts} (100%) rename types/ol/source/{tileimage.d.ts => TileImage.d.ts} (100%) rename types/ol/source/{tilejson.d.ts => TileJSON.d.ts} (100%) rename types/ol/source/{tileutfgrid.d.ts => TileUTFGrid.d.ts} (100%) rename types/ol/source/{tilewms.d.ts => TileWMS.d.ts} (100%) rename types/ol/source/{urltile.d.ts => UrlTile.d.ts} (100%) rename types/ol/source/{vector.d.ts => Vector.d.ts} (100%) rename types/ol/source/{vectortile.d.ts => VectorTile.d.ts} (100%) rename types/ol/source/{wmts.d.ts => WMTS.d.ts} (100%) rename types/ol/source/{xyz.d.ts => XYZ.d.ts} (100%) rename types/ol/source/{zoomify.d.ts => Zoomify.d.ts} (100%) rename types/ol/style/{atlasmanager.d.ts => AtlasManager.d.ts} (100%) rename types/ol/style/{circle.d.ts => Circle.d.ts} (100%) rename types/ol/style/{fill.d.ts => Fill.d.ts} (100%) rename types/ol/style/{icon.d.ts => Icon.d.ts} (100%) rename types/ol/style/{image.d.ts => Image.d.ts} (100%) rename types/ol/style/{regularshape.d.ts => RegularShape.d.ts} (100%) rename types/ol/style/{stroke.d.ts => Stroke.d.ts} (100%) rename types/ol/style/{style.d.ts => Style.d.ts} (100%) rename types/ol/style/{text.d.ts => Text.d.ts} (100%) rename types/ol/tilegrid/{tilegrid.d.ts => TileGrid.d.ts} (100%) rename types/ol/tilegrid/{wmts.d.ts => WMTS.d.ts} (100%) diff --git a/types/ol/assertionerror/index.d.ts b/types/ol/AssertionError/index.d.ts similarity index 100% rename from types/ol/assertionerror/index.d.ts rename to types/ol/AssertionError/index.d.ts diff --git a/types/ol/attribution/index.d.ts b/types/ol/Attribution/index.d.ts similarity index 100% rename from types/ol/attribution/index.d.ts rename to types/ol/Attribution/index.d.ts diff --git a/types/ol/collection/index.d.ts b/types/ol/Collection/index.d.ts similarity index 100% rename from types/ol/collection/index.d.ts rename to types/ol/Collection/index.d.ts diff --git a/types/ol/disposable/index.d.ts b/types/ol/Disposable/index.d.ts similarity index 100% rename from types/ol/disposable/index.d.ts rename to types/ol/Disposable/index.d.ts diff --git a/types/ol/feature/index.d.ts b/types/ol/Feature/index.d.ts similarity index 100% rename from types/ol/feature/index.d.ts rename to types/ol/Feature/index.d.ts diff --git a/types/ol/geolocation/index.d.ts b/types/ol/Geolocation/index.d.ts similarity index 100% rename from types/ol/geolocation/index.d.ts rename to types/ol/Geolocation/index.d.ts diff --git a/types/ol/graticule/index.d.ts b/types/ol/Graticule/index.d.ts similarity index 100% rename from types/ol/graticule/index.d.ts rename to types/ol/Graticule/index.d.ts diff --git a/types/ol/image/index.d.ts b/types/ol/Image/index.d.ts similarity index 100% rename from types/ol/image/index.d.ts rename to types/ol/Image/index.d.ts diff --git a/types/ol/imagebase/index.d.ts b/types/ol/ImageBase/index.d.ts similarity index 100% rename from types/ol/imagebase/index.d.ts rename to types/ol/ImageBase/index.d.ts diff --git a/types/ol/imagetile/index.d.ts b/types/ol/ImageTile/index.d.ts similarity index 100% rename from types/ol/imagetile/index.d.ts rename to types/ol/ImageTile/index.d.ts diff --git a/types/ol/kinetic/index.d.ts b/types/ol/Kinetic/index.d.ts similarity index 100% rename from types/ol/kinetic/index.d.ts rename to types/ol/Kinetic/index.d.ts diff --git a/types/ol/map/index.d.ts b/types/ol/Map/index.d.ts similarity index 100% rename from types/ol/map/index.d.ts rename to types/ol/Map/index.d.ts diff --git a/types/ol/mapbrowserevent/index.d.ts b/types/ol/MapBrowserEvent/index.d.ts similarity index 100% rename from types/ol/mapbrowserevent/index.d.ts rename to types/ol/MapBrowserEvent/index.d.ts diff --git a/types/ol/mapbrowserpointerevent/index.d.ts b/types/ol/MapBrowserPointerEvent/index.d.ts similarity index 100% rename from types/ol/mapbrowserpointerevent/index.d.ts rename to types/ol/MapBrowserPointerEvent/index.d.ts diff --git a/types/ol/mapevent/index.d.ts b/types/ol/MapEvent/index.d.ts similarity index 100% rename from types/ol/mapevent/index.d.ts rename to types/ol/MapEvent/index.d.ts diff --git a/types/ol/object/index.d.ts b/types/ol/Object/index.d.ts similarity index 100% rename from types/ol/object/index.d.ts rename to types/ol/Object/index.d.ts diff --git a/types/ol/observable/index.d.ts b/types/ol/Observable/index.d.ts similarity index 100% rename from types/ol/observable/index.d.ts rename to types/ol/Observable/index.d.ts diff --git a/types/ol/overlay/index.d.ts b/types/ol/Overlay/index.d.ts similarity index 100% rename from types/ol/overlay/index.d.ts rename to types/ol/Overlay/index.d.ts diff --git a/types/ol/tile/index.d.ts b/types/ol/Tile/index.d.ts similarity index 100% rename from types/ol/tile/index.d.ts rename to types/ol/Tile/index.d.ts diff --git a/types/ol/vectortile/index.d.ts b/types/ol/VectorTile/index.d.ts similarity index 100% rename from types/ol/vectortile/index.d.ts rename to types/ol/VectorTile/index.d.ts diff --git a/types/ol/view/index.d.ts b/types/ol/View/index.d.ts similarity index 100% rename from types/ol/view/index.d.ts rename to types/ol/View/index.d.ts diff --git a/types/ol/control/attribution.d.ts b/types/ol/control/Attribution.d.ts similarity index 100% rename from types/ol/control/attribution.d.ts rename to types/ol/control/Attribution.d.ts diff --git a/types/ol/control/control.d.ts b/types/ol/control/Control.d.ts similarity index 100% rename from types/ol/control/control.d.ts rename to types/ol/control/Control.d.ts diff --git a/types/ol/control/fullscreen.d.ts b/types/ol/control/Fullscreen.d.ts similarity index 100% rename from types/ol/control/fullscreen.d.ts rename to types/ol/control/Fullscreen.d.ts diff --git a/types/ol/control/mouseposition.d.ts b/types/ol/control/MousePosition.d.ts similarity index 100% rename from types/ol/control/mouseposition.d.ts rename to types/ol/control/MousePosition.d.ts diff --git a/types/ol/control/overviewmap.d.ts b/types/ol/control/OverviewMap.d.ts similarity index 100% rename from types/ol/control/overviewmap.d.ts rename to types/ol/control/OverviewMap.d.ts diff --git a/types/ol/control/rotate.d.ts b/types/ol/control/Rotate.d.ts similarity index 100% rename from types/ol/control/rotate.d.ts rename to types/ol/control/Rotate.d.ts diff --git a/types/ol/control/scaleline.d.ts b/types/ol/control/ScaleLine.d.ts similarity index 100% rename from types/ol/control/scaleline.d.ts rename to types/ol/control/ScaleLine.d.ts diff --git a/types/ol/control/zoom.d.ts b/types/ol/control/Zoom.d.ts similarity index 100% rename from types/ol/control/zoom.d.ts rename to types/ol/control/Zoom.d.ts diff --git a/types/ol/control/zoomslider.d.ts b/types/ol/control/ZoomSlider.d.ts similarity index 100% rename from types/ol/control/zoomslider.d.ts rename to types/ol/control/ZoomSlider.d.ts diff --git a/types/ol/control/zoomtoextent.d.ts b/types/ol/control/ZoomToExtent.d.ts similarity index 100% rename from types/ol/control/zoomtoextent.d.ts rename to types/ol/control/ZoomToExtent.d.ts diff --git a/types/ol/events/event.d.ts b/types/ol/events/Event.d.ts similarity index 100% rename from types/ol/events/event.d.ts rename to types/ol/events/Event.d.ts diff --git a/types/ol/events/eventtarget.d.ts b/types/ol/events/EventTarget.d.ts similarity index 100% rename from types/ol/events/eventtarget.d.ts rename to types/ol/events/EventTarget.d.ts diff --git a/types/ol/format/esrijson.d.ts b/types/ol/format/EsriJSON.d.ts similarity index 100% rename from types/ol/format/esrijson.d.ts rename to types/ol/format/EsriJSON.d.ts diff --git a/types/ol/format/feature.d.ts b/types/ol/format/Feature.d.ts similarity index 100% rename from types/ol/format/feature.d.ts rename to types/ol/format/Feature.d.ts diff --git a/types/ol/format/gml2.d.ts b/types/ol/format/GML2.d.ts similarity index 100% rename from types/ol/format/gml2.d.ts rename to types/ol/format/GML2.d.ts diff --git a/types/ol/format/gml3.d.ts b/types/ol/format/GML3.d.ts similarity index 100% rename from types/ol/format/gml3.d.ts rename to types/ol/format/GML3.d.ts diff --git a/types/ol/format/gmlbase.d.ts b/types/ol/format/GMLBase.d.ts similarity index 100% rename from types/ol/format/gmlbase.d.ts rename to types/ol/format/GMLBase.d.ts diff --git a/types/ol/format/gpx.d.ts b/types/ol/format/GPX.d.ts similarity index 100% rename from types/ol/format/gpx.d.ts rename to types/ol/format/GPX.d.ts diff --git a/types/ol/format/geojson.d.ts b/types/ol/format/GeoJSON.d.ts similarity index 100% rename from types/ol/format/geojson.d.ts rename to types/ol/format/GeoJSON.d.ts diff --git a/types/ol/format/igc.d.ts b/types/ol/format/IGC.d.ts similarity index 100% rename from types/ol/format/igc.d.ts rename to types/ol/format/IGC.d.ts diff --git a/types/ol/format/jsonfeature.d.ts b/types/ol/format/JSONFeature.d.ts similarity index 100% rename from types/ol/format/jsonfeature.d.ts rename to types/ol/format/JSONFeature.d.ts diff --git a/types/ol/format/kml.d.ts b/types/ol/format/KML.d.ts similarity index 100% rename from types/ol/format/kml.d.ts rename to types/ol/format/KML.d.ts diff --git a/types/ol/format/mvt.d.ts b/types/ol/format/MVT.d.ts similarity index 100% rename from types/ol/format/mvt.d.ts rename to types/ol/format/MVT.d.ts diff --git a/types/ol/format/osmxml.d.ts b/types/ol/format/OSMXML.d.ts similarity index 100% rename from types/ol/format/osmxml.d.ts rename to types/ol/format/OSMXML.d.ts diff --git a/types/ol/format/polyline.d.ts b/types/ol/format/Polyline.d.ts similarity index 100% rename from types/ol/format/polyline.d.ts rename to types/ol/format/Polyline.d.ts diff --git a/types/ol/format/textfeature.d.ts b/types/ol/format/TextFeature.d.ts similarity index 100% rename from types/ol/format/textfeature.d.ts rename to types/ol/format/TextFeature.d.ts diff --git a/types/ol/format/topojson.d.ts b/types/ol/format/TopoJSON.d.ts similarity index 100% rename from types/ol/format/topojson.d.ts rename to types/ol/format/TopoJSON.d.ts diff --git a/types/ol/format/wfs.d.ts b/types/ol/format/WFS.d.ts similarity index 100% rename from types/ol/format/wfs.d.ts rename to types/ol/format/WFS.d.ts diff --git a/types/ol/format/wkt.d.ts b/types/ol/format/WKT.d.ts similarity index 100% rename from types/ol/format/wkt.d.ts rename to types/ol/format/WKT.d.ts diff --git a/types/ol/format/wmscapabilities.d.ts b/types/ol/format/WMSCapabilities.d.ts similarity index 100% rename from types/ol/format/wmscapabilities.d.ts rename to types/ol/format/WMSCapabilities.d.ts diff --git a/types/ol/format/wmsgetfeatureinfo.d.ts b/types/ol/format/WMSGetFeatureInfo.d.ts similarity index 100% rename from types/ol/format/wmsgetfeatureinfo.d.ts rename to types/ol/format/WMSGetFeatureInfo.d.ts diff --git a/types/ol/format/wmtscapabilities.d.ts b/types/ol/format/WMTSCapabilities.d.ts similarity index 100% rename from types/ol/format/wmtscapabilities.d.ts rename to types/ol/format/WMTSCapabilities.d.ts diff --git a/types/ol/format/xml.d.ts b/types/ol/format/XML.d.ts similarity index 100% rename from types/ol/format/xml.d.ts rename to types/ol/format/XML.d.ts diff --git a/types/ol/format/xmlfeature.d.ts b/types/ol/format/XMLFeature.d.ts similarity index 100% rename from types/ol/format/xmlfeature.d.ts rename to types/ol/format/XMLFeature.d.ts diff --git a/types/ol/geom/circle.d.ts b/types/ol/geom/Circle.d.ts similarity index 100% rename from types/ol/geom/circle.d.ts rename to types/ol/geom/Circle.d.ts diff --git a/types/ol/geom/geometry.d.ts b/types/ol/geom/Geometry.d.ts similarity index 100% rename from types/ol/geom/geometry.d.ts rename to types/ol/geom/Geometry.d.ts diff --git a/types/ol/geom/geometrycollection.d.ts b/types/ol/geom/GeometryCollection.d.ts similarity index 100% rename from types/ol/geom/geometrycollection.d.ts rename to types/ol/geom/GeometryCollection.d.ts diff --git a/types/ol/geom/linestring.d.ts b/types/ol/geom/LineString.d.ts similarity index 100% rename from types/ol/geom/linestring.d.ts rename to types/ol/geom/LineString.d.ts diff --git a/types/ol/geom/linearring.d.ts b/types/ol/geom/LinearRing.d.ts similarity index 100% rename from types/ol/geom/linearring.d.ts rename to types/ol/geom/LinearRing.d.ts diff --git a/types/ol/geom/multipoint.d.ts b/types/ol/geom/MultiPoint.d.ts similarity index 100% rename from types/ol/geom/multipoint.d.ts rename to types/ol/geom/MultiPoint.d.ts diff --git a/types/ol/geom/multipolygon.d.ts b/types/ol/geom/MultiPolygon.d.ts similarity index 100% rename from types/ol/geom/multipolygon.d.ts rename to types/ol/geom/MultiPolygon.d.ts diff --git a/types/ol/geom/multilinestring.d.ts b/types/ol/geom/MultilineString.d.ts similarity index 100% rename from types/ol/geom/multilinestring.d.ts rename to types/ol/geom/MultilineString.d.ts diff --git a/types/ol/geom/point.d.ts b/types/ol/geom/Point.d.ts similarity index 100% rename from types/ol/geom/point.d.ts rename to types/ol/geom/Point.d.ts diff --git a/types/ol/geom/polygon.d.ts b/types/ol/geom/Polygon.d.ts similarity index 100% rename from types/ol/geom/polygon.d.ts rename to types/ol/geom/Polygon.d.ts diff --git a/types/ol/geom/simplegeometry.d.ts b/types/ol/geom/SimpleGeometry.d.ts similarity index 100% rename from types/ol/geom/simplegeometry.d.ts rename to types/ol/geom/SimpleGeometry.d.ts diff --git a/types/ol/interaction/doubleclickzoom.d.ts b/types/ol/interaction/DoubleClickZoom.d.ts similarity index 100% rename from types/ol/interaction/doubleclickzoom.d.ts rename to types/ol/interaction/DoubleClickZoom.d.ts diff --git a/types/ol/interaction/draganddrop.d.ts b/types/ol/interaction/DragAndDrop.d.ts similarity index 100% rename from types/ol/interaction/draganddrop.d.ts rename to types/ol/interaction/DragAndDrop.d.ts diff --git a/types/ol/interaction/dragbox.d.ts b/types/ol/interaction/DragBox.d.ts similarity index 100% rename from types/ol/interaction/dragbox.d.ts rename to types/ol/interaction/DragBox.d.ts diff --git a/types/ol/interaction/dragpan.d.ts b/types/ol/interaction/DragPan.d.ts similarity index 100% rename from types/ol/interaction/dragpan.d.ts rename to types/ol/interaction/DragPan.d.ts diff --git a/types/ol/interaction/dragrotate.d.ts b/types/ol/interaction/DragRotate.d.ts similarity index 100% rename from types/ol/interaction/dragrotate.d.ts rename to types/ol/interaction/DragRotate.d.ts diff --git a/types/ol/interaction/dragrotateandzoom.d.ts b/types/ol/interaction/DragRotateAndZoom.d.ts similarity index 100% rename from types/ol/interaction/dragrotateandzoom.d.ts rename to types/ol/interaction/DragRotateAndZoom.d.ts diff --git a/types/ol/interaction/dragzoom.d.ts b/types/ol/interaction/DragZoom.d.ts similarity index 100% rename from types/ol/interaction/dragzoom.d.ts rename to types/ol/interaction/DragZoom.d.ts diff --git a/types/ol/interaction/draw.d.ts b/types/ol/interaction/Draw.d.ts similarity index 100% rename from types/ol/interaction/draw.d.ts rename to types/ol/interaction/Draw.d.ts diff --git a/types/ol/interaction/extent.d.ts b/types/ol/interaction/Extent.d.ts similarity index 100% rename from types/ol/interaction/extent.d.ts rename to types/ol/interaction/Extent.d.ts diff --git a/types/ol/interaction/interaction.d.ts b/types/ol/interaction/Interaction.d.ts similarity index 100% rename from types/ol/interaction/interaction.d.ts rename to types/ol/interaction/Interaction.d.ts diff --git a/types/ol/interaction/keyboardpan.d.ts b/types/ol/interaction/KeyboardPan.d.ts similarity index 100% rename from types/ol/interaction/keyboardpan.d.ts rename to types/ol/interaction/KeyboardPan.d.ts diff --git a/types/ol/interaction/keyboardzoom.d.ts b/types/ol/interaction/KeyboardZoom.d.ts similarity index 100% rename from types/ol/interaction/keyboardzoom.d.ts rename to types/ol/interaction/KeyboardZoom.d.ts diff --git a/types/ol/interaction/modify.d.ts b/types/ol/interaction/Modify.d.ts similarity index 100% rename from types/ol/interaction/modify.d.ts rename to types/ol/interaction/Modify.d.ts diff --git a/types/ol/interaction/mousewheelzoom.d.ts b/types/ol/interaction/MouseWheelZoom.d.ts similarity index 100% rename from types/ol/interaction/mousewheelzoom.d.ts rename to types/ol/interaction/MouseWheelZoom.d.ts diff --git a/types/ol/interaction/pinchrotate.d.ts b/types/ol/interaction/PinchRotate.d.ts similarity index 100% rename from types/ol/interaction/pinchrotate.d.ts rename to types/ol/interaction/PinchRotate.d.ts diff --git a/types/ol/interaction/pinchzoom.d.ts b/types/ol/interaction/PinchZoom.d.ts similarity index 100% rename from types/ol/interaction/pinchzoom.d.ts rename to types/ol/interaction/PinchZoom.d.ts diff --git a/types/ol/interaction/pointer.d.ts b/types/ol/interaction/Pointer.d.ts similarity index 100% rename from types/ol/interaction/pointer.d.ts rename to types/ol/interaction/Pointer.d.ts diff --git a/types/ol/interaction/select.d.ts b/types/ol/interaction/Select.d.ts similarity index 100% rename from types/ol/interaction/select.d.ts rename to types/ol/interaction/Select.d.ts diff --git a/types/ol/interaction/snap.d.ts b/types/ol/interaction/Snap.d.ts similarity index 100% rename from types/ol/interaction/snap.d.ts rename to types/ol/interaction/Snap.d.ts diff --git a/types/ol/interaction/translate.d.ts b/types/ol/interaction/Translate.d.ts similarity index 100% rename from types/ol/interaction/translate.d.ts rename to types/ol/interaction/Translate.d.ts diff --git a/types/ol/layer/base.d.ts b/types/ol/layer/Base.d.ts similarity index 100% rename from types/ol/layer/base.d.ts rename to types/ol/layer/Base.d.ts diff --git a/types/ol/layer/group.d.ts b/types/ol/layer/Group.d.ts similarity index 100% rename from types/ol/layer/group.d.ts rename to types/ol/layer/Group.d.ts diff --git a/types/ol/layer/heatmap.d.ts b/types/ol/layer/Heatmap.d.ts similarity index 100% rename from types/ol/layer/heatmap.d.ts rename to types/ol/layer/Heatmap.d.ts diff --git a/types/ol/layer/image.d.ts b/types/ol/layer/Image.d.ts similarity index 100% rename from types/ol/layer/image.d.ts rename to types/ol/layer/Image.d.ts diff --git a/types/ol/layer/layer.d.ts b/types/ol/layer/Layer.d.ts similarity index 100% rename from types/ol/layer/layer.d.ts rename to types/ol/layer/Layer.d.ts diff --git a/types/ol/layer/tile.d.ts b/types/ol/layer/Tile.d.ts similarity index 100% rename from types/ol/layer/tile.d.ts rename to types/ol/layer/Tile.d.ts diff --git a/types/ol/layer/vector.d.ts b/types/ol/layer/Vector.d.ts similarity index 100% rename from types/ol/layer/vector.d.ts rename to types/ol/layer/Vector.d.ts diff --git a/types/ol/layer/vectortile.d.ts b/types/ol/layer/VectorTile.d.ts similarity index 100% rename from types/ol/layer/vectortile.d.ts rename to types/ol/layer/VectorTile.d.ts diff --git a/types/ol/pointer/pointerevent.d.ts b/types/ol/pointer/PointerEvent.d.ts similarity index 100% rename from types/ol/pointer/pointerevent.d.ts rename to types/ol/pointer/PointerEvent.d.ts diff --git a/types/ol/proj/projection.d.ts b/types/ol/proj/Projection.d.ts similarity index 100% rename from types/ol/proj/projection.d.ts rename to types/ol/proj/Projection.d.ts diff --git a/types/ol/render/event.d.ts b/types/ol/render/Event.d.ts similarity index 100% rename from types/ol/render/event.d.ts rename to types/ol/render/Event.d.ts diff --git a/types/ol/render/feature.d.ts b/types/ol/render/Feature.d.ts similarity index 100% rename from types/ol/render/feature.d.ts rename to types/ol/render/Feature.d.ts diff --git a/types/ol/render/vectorcontext.d.ts b/types/ol/render/VectorContext.d.ts similarity index 100% rename from types/ol/render/vectorcontext.d.ts rename to types/ol/render/VectorContext.d.ts diff --git a/types/ol/source/bingmaps.d.ts b/types/ol/source/BingMaps.d.ts similarity index 100% rename from types/ol/source/bingmaps.d.ts rename to types/ol/source/BingMaps.d.ts diff --git a/types/ol/source/cartodb.d.ts b/types/ol/source/CartoDB.d.ts similarity index 100% rename from types/ol/source/cartodb.d.ts rename to types/ol/source/CartoDB.d.ts diff --git a/types/ol/source/cluster.d.ts b/types/ol/source/Cluster.d.ts similarity index 100% rename from types/ol/source/cluster.d.ts rename to types/ol/source/Cluster.d.ts diff --git a/types/ol/source/image.d.ts b/types/ol/source/Image.d.ts similarity index 100% rename from types/ol/source/image.d.ts rename to types/ol/source/Image.d.ts diff --git a/types/ol/source/imagearcgisrest.d.ts b/types/ol/source/ImageArcGISRest.d.ts similarity index 100% rename from types/ol/source/imagearcgisrest.d.ts rename to types/ol/source/ImageArcGISRest.d.ts diff --git a/types/ol/source/imagecanvas.d.ts b/types/ol/source/ImageCanvas.d.ts similarity index 100% rename from types/ol/source/imagecanvas.d.ts rename to types/ol/source/ImageCanvas.d.ts diff --git a/types/ol/source/imagemapguide.d.ts b/types/ol/source/ImageMapGuide.d.ts similarity index 100% rename from types/ol/source/imagemapguide.d.ts rename to types/ol/source/ImageMapGuide.d.ts diff --git a/types/ol/source/imagestatic.d.ts b/types/ol/source/ImageStatic.d.ts similarity index 100% rename from types/ol/source/imagestatic.d.ts rename to types/ol/source/ImageStatic.d.ts diff --git a/types/ol/source/imagevector.d.ts b/types/ol/source/ImageVector.d.ts similarity index 100% rename from types/ol/source/imagevector.d.ts rename to types/ol/source/ImageVector.d.ts diff --git a/types/ol/source/imagewms.d.ts b/types/ol/source/ImageWMS.d.ts similarity index 100% rename from types/ol/source/imagewms.d.ts rename to types/ol/source/ImageWMS.d.ts diff --git a/types/ol/source/osm.d.ts b/types/ol/source/OSM.d.ts similarity index 100% rename from types/ol/source/osm.d.ts rename to types/ol/source/OSM.d.ts diff --git a/types/ol/source/raster.d.ts b/types/ol/source/Raster.d.ts similarity index 100% rename from types/ol/source/raster.d.ts rename to types/ol/source/Raster.d.ts diff --git a/types/ol/source/source.d.ts b/types/ol/source/Source.d.ts similarity index 100% rename from types/ol/source/source.d.ts rename to types/ol/source/Source.d.ts diff --git a/types/ol/source/stamen.d.ts b/types/ol/source/Stamen.d.ts similarity index 100% rename from types/ol/source/stamen.d.ts rename to types/ol/source/Stamen.d.ts diff --git a/types/ol/source/tile.d.ts b/types/ol/source/Tile.d.ts similarity index 100% rename from types/ol/source/tile.d.ts rename to types/ol/source/Tile.d.ts diff --git a/types/ol/source/tilearcgisrest.d.ts b/types/ol/source/TileArcGISRest.d.ts similarity index 100% rename from types/ol/source/tilearcgisrest.d.ts rename to types/ol/source/TileArcGISRest.d.ts diff --git a/types/ol/source/tiledebug.d.ts b/types/ol/source/TileDebug.d.ts similarity index 100% rename from types/ol/source/tiledebug.d.ts rename to types/ol/source/TileDebug.d.ts diff --git a/types/ol/source/tileimage.d.ts b/types/ol/source/TileImage.d.ts similarity index 100% rename from types/ol/source/tileimage.d.ts rename to types/ol/source/TileImage.d.ts diff --git a/types/ol/source/tilejson.d.ts b/types/ol/source/TileJSON.d.ts similarity index 100% rename from types/ol/source/tilejson.d.ts rename to types/ol/source/TileJSON.d.ts diff --git a/types/ol/source/tileutfgrid.d.ts b/types/ol/source/TileUTFGrid.d.ts similarity index 100% rename from types/ol/source/tileutfgrid.d.ts rename to types/ol/source/TileUTFGrid.d.ts diff --git a/types/ol/source/tilewms.d.ts b/types/ol/source/TileWMS.d.ts similarity index 100% rename from types/ol/source/tilewms.d.ts rename to types/ol/source/TileWMS.d.ts diff --git a/types/ol/source/urltile.d.ts b/types/ol/source/UrlTile.d.ts similarity index 100% rename from types/ol/source/urltile.d.ts rename to types/ol/source/UrlTile.d.ts diff --git a/types/ol/source/vector.d.ts b/types/ol/source/Vector.d.ts similarity index 100% rename from types/ol/source/vector.d.ts rename to types/ol/source/Vector.d.ts diff --git a/types/ol/source/vectortile.d.ts b/types/ol/source/VectorTile.d.ts similarity index 100% rename from types/ol/source/vectortile.d.ts rename to types/ol/source/VectorTile.d.ts diff --git a/types/ol/source/wmts.d.ts b/types/ol/source/WMTS.d.ts similarity index 100% rename from types/ol/source/wmts.d.ts rename to types/ol/source/WMTS.d.ts diff --git a/types/ol/source/xyz.d.ts b/types/ol/source/XYZ.d.ts similarity index 100% rename from types/ol/source/xyz.d.ts rename to types/ol/source/XYZ.d.ts diff --git a/types/ol/source/zoomify.d.ts b/types/ol/source/Zoomify.d.ts similarity index 100% rename from types/ol/source/zoomify.d.ts rename to types/ol/source/Zoomify.d.ts diff --git a/types/ol/style/atlasmanager.d.ts b/types/ol/style/AtlasManager.d.ts similarity index 100% rename from types/ol/style/atlasmanager.d.ts rename to types/ol/style/AtlasManager.d.ts diff --git a/types/ol/style/circle.d.ts b/types/ol/style/Circle.d.ts similarity index 100% rename from types/ol/style/circle.d.ts rename to types/ol/style/Circle.d.ts diff --git a/types/ol/style/fill.d.ts b/types/ol/style/Fill.d.ts similarity index 100% rename from types/ol/style/fill.d.ts rename to types/ol/style/Fill.d.ts diff --git a/types/ol/style/icon.d.ts b/types/ol/style/Icon.d.ts similarity index 100% rename from types/ol/style/icon.d.ts rename to types/ol/style/Icon.d.ts diff --git a/types/ol/style/image.d.ts b/types/ol/style/Image.d.ts similarity index 100% rename from types/ol/style/image.d.ts rename to types/ol/style/Image.d.ts diff --git a/types/ol/style/regularshape.d.ts b/types/ol/style/RegularShape.d.ts similarity index 100% rename from types/ol/style/regularshape.d.ts rename to types/ol/style/RegularShape.d.ts diff --git a/types/ol/style/stroke.d.ts b/types/ol/style/Stroke.d.ts similarity index 100% rename from types/ol/style/stroke.d.ts rename to types/ol/style/Stroke.d.ts diff --git a/types/ol/style/style.d.ts b/types/ol/style/Style.d.ts similarity index 100% rename from types/ol/style/style.d.ts rename to types/ol/style/Style.d.ts diff --git a/types/ol/style/text.d.ts b/types/ol/style/Text.d.ts similarity index 100% rename from types/ol/style/text.d.ts rename to types/ol/style/Text.d.ts diff --git a/types/ol/tilegrid/tilegrid.d.ts b/types/ol/tilegrid/TileGrid.d.ts similarity index 100% rename from types/ol/tilegrid/tilegrid.d.ts rename to types/ol/tilegrid/TileGrid.d.ts diff --git a/types/ol/tilegrid/wmts.d.ts b/types/ol/tilegrid/WMTS.d.ts similarity index 100% rename from types/ol/tilegrid/wmts.d.ts rename to types/ol/tilegrid/WMTS.d.ts From bfbd1ac4fc8376bd99946db7c012234bea7b9cec Mon Sep 17 00:00:00 2001 From: Antoine Rousseau Date: Thu, 21 Feb 2019 17:48:20 +0100 Subject: [PATCH 089/924] add IndexSettings.queryLanguages to @types/algoliasearch --- types/algoliasearch/algoliasearch-tests.ts | 1 + types/algoliasearch/index.d.ts | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/types/algoliasearch/algoliasearch-tests.ts b/types/algoliasearch/algoliasearch-tests.ts index fdd0f395fe..1d588f2090 100644 --- a/types/algoliasearch/algoliasearch-tests.ts +++ b/types/algoliasearch/algoliasearch-tests.ts @@ -98,6 +98,7 @@ let _algoliaIndexSettings: IndexSettings = { placeholders: { '': [''] }, camelCaseAttributes: [''], sortFacetValuesBy: 'count', + queryLanguages: ['fr', 'es'], }; let _algoliaQueryParameters: QueryParameters = { diff --git a/types/algoliasearch/index.d.ts b/types/algoliasearch/index.d.ts index 8e3ba4c5ab..a5597bc835 100644 --- a/types/algoliasearch/index.d.ts +++ b/types/algoliasearch/index.d.ts @@ -6,6 +6,7 @@ // Samuel Vaillant // Kai Eichinger // Nery Ortez +// Antoine Rousseau // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -1778,12 +1779,20 @@ declare namespace algoliasearch { }; /** * List of attributes on which to do a decomposition of camel case words. - * - https://www.algolia.com/doc/api-reference/api-parameters/camelCaseAttributes/ + * https://www.algolia.com/doc/api-reference/api-parameters/camelCaseAttributes/ */ camelCaseAttributes?: string[]; - + /** + * Controls how facet values are sorted. + * https://www.algolia.com/doc/api-reference/api-parameters/sortFacetValuesBy/ + */ sortFacetValuesBy?: 'count' | 'alpha'; + /** + * Sets the languages to be used by language-specific settings and functionalities + * such as ignorePlurals, removeStopWords, and CJK word-detection. + * https://www.algolia.com/doc/api-reference/api-parameters/queryLanguages/ + */ + queryLanguages?: string[]; } interface Response { From 6b6f292c346e65f24b52dbeca0e00d9053d6cf44 Mon Sep 17 00:00:00 2001 From: Michael Louis Thaler Date: Thu, 21 Feb 2019 16:06:30 -0500 Subject: [PATCH 090/924] Update referenced Superagent version --- types/superagent/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/superagent/index.d.ts b/types/superagent/index.d.ts index ae607c3c34..f44f8acb85 100644 --- a/types/superagent/index.d.ts +++ b/types/superagent/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for SuperAgent 3.8 +// Type definitions for SuperAgent 4.1 // Project: https://github.com/visionmedia/superagent // Definitions by: Nico Zelaya // Michael Ledin From 0de529dbcd9e8daf7e523ffc4c3aceb58a4cbe5e Mon Sep 17 00:00:00 2001 From: Alexandre Esteves Date: Fri, 22 Feb 2019 12:12:35 +0100 Subject: [PATCH 091/924] fix(mongodb): add collation option to findOneAndReplace and FindOneAndDelete --- types/mongodb/index.d.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index a3725382e4..dac421a22a 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -879,8 +879,8 @@ export interface Collection { findOne(filter: FilterQuery, options: FindOneOptions, callback: MongoCallback): void; /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#findOneAndDelete */ findOneAndDelete(filter: FilterQuery, callback: MongoCallback>): void; - findOneAndDelete(filter: FilterQuery, options?: { projection?: Object, sort?: Object, maxTimeMS?: number, session?: ClientSession }): Promise>; - findOneAndDelete(filter: FilterQuery, options: { projection?: Object, sort?: Object, maxTimeMS?: number, session?: ClientSession }, callback: MongoCallback>): void; + findOneAndDelete(filter: FilterQuery, options?: FindOneAndDeleteOption): Promise>; + findOneAndDelete(filter: FilterQuery, options: FindOneAndDeleteOption, callback: MongoCallback>): void; /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#findOneAndReplace */ findOneAndReplace(filter: FilterQuery, replacement: Object, callback: MongoCallback>): void; findOneAndReplace(filter: FilterQuery, replacement: Object, options?: FindOneAndReplaceOption): Promise>; @@ -1292,7 +1292,7 @@ export interface CollectionAggregationOptions { * Allow driver to bypass schema validation in MongoDB 3.2 or higher. */ bypassDocumentValidation?: boolean; - hint?: string | object; + hint?: string | object; raw?: boolean; promoteLongs?: boolean; promoteValues?: boolean; @@ -1407,6 +1407,7 @@ export interface FindOneAndReplaceOption extends CommonOptions { maxTimeMS?: number; upsert?: boolean; returnOriginal?: boolean; + collation?: CollationDocument; } /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#findOneAndUpdate */ @@ -1414,6 +1415,17 @@ export interface FindOneAndUpdateOption extends FindOneAndReplaceOption { arrayFilters?: Object[]; } +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#findOneAndDelete */ +export interface FindOneAndDeleteOption { + projection?: Object; + sort?: Object; + maxTimeMS?: number; + session?: ClientSession; + collation?: CollationDocument; +} + + + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#geoHaystackSearch */ export interface GeoHaystackSearchOptions { readPreference?: ReadPreference | string; From 01eb1074ef408fd416ba4574c73a3638677d3518 Mon Sep 17 00:00:00 2001 From: Vahid Shirvani Date: Fri, 22 Feb 2019 14:21:14 +0100 Subject: [PATCH 092/924] fix files in tsconfig --- types/ol/tsconfig.json | 276 ++++++++++++++++++++--------------------- 1 file changed, 138 insertions(+), 138 deletions(-) diff --git a/types/ol/tsconfig.json b/types/ol/tsconfig.json index 186bb605e0..8751d240da 100644 --- a/types/ol/tsconfig.json +++ b/types/ol/tsconfig.json @@ -20,159 +20,159 @@ "files": [ "index.d.ts", "ol-tests.ts", - "control/attribution.d.ts", - "control/control.d.ts", - "control/fullscreen.d.ts", - "control/mouseposition.d.ts", - "control/overviewmap.d.ts", - "control/rotate.d.ts", - "control/scaleline.d.ts", - "control/zoom.d.ts", - "control/zoomslider.d.ts", - "control/zoomtoextent.d.ts", + "control/Attribution.d.ts", + "control/Control.d.ts", + "control/Fullscreen.d.ts", + "control/MousePosition.d.ts", + "control/OverviewMap.d.ts", + "control/Rotate.d.ts", + "control/ScaleLine.d.ts", + "control/Zoom.d.ts", + "control/ZoomSlider.d.ts", + "control/ZoomToExtent.d.ts", "events/condition.d.ts", - "events/event.d.ts", - "events/eventtarget.d.ts", - "format/esrijson.d.ts", - "format/feature.d.ts", + "events/Event.d.ts", + "events/EventTarget.d.ts", + "format/EsriJSON.d.ts", + "format/Feature.d.ts", "format/filter.d.ts", - "format/geojson.d.ts", - "format/gml2.d.ts", - "format/gml3.d.ts", - "format/gmlbase.d.ts", - "format/gpx.d.ts", - "format/igc.d.ts", - "format/jsonfeature.d.ts", - "format/kml.d.ts", - "format/mvt.d.ts", - "format/osmxml.d.ts", - "format/polyline.d.ts", - "format/textfeature.d.ts", - "format/topojson.d.ts", - "format/wfs.d.ts", - "format/wkt.d.ts", - "format/wmscapabilities.d.ts", - "format/wmsgetfeatureinfo.d.ts", - "format/wmtscapabilities.d.ts", - "format/xml.d.ts", - "format/xmlfeature.d.ts", - "geom/circle.d.ts", - "geom/geometry.d.ts", - "geom/geometrycollection.d.ts", - "geom/linearring.d.ts", - "geom/linestring.d.ts", - "geom/multilinestring.d.ts", - "geom/multipoint.d.ts", - "geom/multipolygon.d.ts", - "geom/point.d.ts", - "geom/polygon.d.ts", - "geom/simplegeometry.d.ts", - "interaction/doubleclickzoom.d.ts", - "interaction/draganddrop.d.ts", - "interaction/dragbox.d.ts", - "interaction/dragpan.d.ts", - "interaction/dragrotate.d.ts", - "interaction/dragrotateandzoom.d.ts", - "interaction/dragzoom.d.ts", - "interaction/draw.d.ts", - "interaction/extent.d.ts", - "interaction/interaction.d.ts", - "interaction/keyboardpan.d.ts", - "interaction/keyboardzoom.d.ts", - "interaction/modify.d.ts", - "interaction/mousewheelzoom.d.ts", - "interaction/pinchrotate.d.ts", - "interaction/pinchzoom.d.ts", - "interaction/pointer.d.ts", - "interaction/select.d.ts", - "interaction/snap.d.ts", - "interaction/translate.d.ts", - "layer/base.d.ts", - "layer/group.d.ts", - "layer/heatmap.d.ts", - "layer/image.d.ts", - "layer/layer.d.ts", - "layer/tile.d.ts", - "layer/vector.d.ts", - "layer/vectortile.d.ts", - "pointer/pointerevent.d.ts", + "format/GeoJSON.d.ts", + "format/GML2.d.ts", + "format/GML3.d.ts", + "format/GMLBase.d.ts", + "format/GPX.d.ts", + "format/IGC.d.ts", + "format/JSONFeature.d.ts", + "format/KML.d.ts", + "format/MVT.d.ts", + "format/OSMXML.d.ts", + "format/Polyline.d.ts", + "format/TextFeature.d.ts", + "format/TopoJSON.d.ts", + "format/WFS.d.ts", + "format/WKT.d.ts", + "format/WMSCapabilities.d.ts", + "format/WMSGetFeatureInfo.d.ts", + "format/WMTSCapabilities.d.ts", + "format/XML.d.ts", + "format/XMLFeature.d.ts", + "geom/Circle.d.ts", + "geom/GeometryCollection.d.ts", + "geom/Geometry.d.ts", + "geom/LinearRing.d.ts", + "geom/LineString.d.ts", + "geom/MultilineString.d.ts", + "geom/MultiPoint.d.ts", + "geom/MultiPolygon.d.ts", + "geom/Point.d.ts", + "geom/Polygon.d.ts", + "geom/SimpleGeometry.d.ts", + "interaction/DoubleClickZoom.d.ts", + "interaction/DragAndDrop.d.ts", + "interaction/DragBox.d.ts", + "interaction/DragPan.d.ts", + "interaction/DragRotateAndZoom.d.ts", + "interaction/DragRotate.d.ts", + "interaction/DragZoom.d.ts", + "interaction/Draw.d.ts", + "interaction/Extent.d.ts", + "interaction/Interaction.d.ts", + "interaction/KeyboardPan.d.ts", + "interaction/KeyboardZoom.d.ts", + "interaction/Modify.d.ts", + "interaction/MouseWheelZoom.d.ts", + "interaction/PinchRotate.d.ts", + "interaction/PinchZoom.d.ts", + "interaction/Pointer.d.ts", + "interaction/Select.d.ts", + "interaction/Snap.d.ts", + "interaction/Translate.d.ts", + "layer/Base.d.ts", + "layer/Group.d.ts", + "layer/Heatmap.d.ts", + "layer/Image.d.ts", + "layer/Layer.d.ts", + "layer/Tile.d.ts", + "layer/Vector.d.ts", + "layer/VectorTile.d.ts", + "pointer/PointerEvent.d.ts", "proj/index.d.ts", - "proj/projection.d.ts", + "proj/Projection.d.ts", "render/canvas.d.ts", - "render/event.d.ts", - "render/feature.d.ts", - "render/vectorcontext.d.ts", - "source/bingmaps.d.ts", - "source/cartodb.d.ts", - "source/cluster.d.ts", - "source/image.d.ts", - "source/imagearcgisrest.d.ts", - "source/imagecanvas.d.ts", - "source/imagemapguide.d.ts", - "source/imagestatic.d.ts", - "source/imagevector.d.ts", - "source/imagewms.d.ts", - "source/osm.d.ts", - "source/raster.d.ts", - "source/source.d.ts", - "source/stamen.d.ts", - "source/tile.d.ts", - "source/tilearcgisrest.d.ts", - "source/tiledebug.d.ts", - "source/tileimage.d.ts", - "source/tilejson.d.ts", - "source/tileutfgrid.d.ts", - "source/tilewms.d.ts", - "source/urltile.d.ts", - "source/vector.d.ts", - "source/vectortile.d.ts", - "source/wmts.d.ts", - "source/xyz.d.ts", - "source/zoomify.d.ts", - "style/atlasmanager.d.ts", - "style/circle.d.ts", - "style/fill.d.ts", - "style/icon.d.ts", - "style/image.d.ts", - "style/regularshape.d.ts", - "style/stroke.d.ts", - "style/style.d.ts", - "style/text.d.ts", - "tilegrid/tilegrid.d.ts", - "tilegrid/wmts.d.ts", - "assertionerror/index.d.ts", - "attribution/index.d.ts", - "collection/index.d.ts", + "render/Event.d.ts", + "render/Feature.d.ts", + "render/VectorContext.d.ts", + "source/BingMaps.d.ts", + "source/CartoDB.d.ts", + "source/Cluster.d.ts", + "source/ImageArcGISRest.d.ts", + "source/ImageCanvas.d.ts", + "source/Image.d.ts", + "source/ImageMapGuide.d.ts", + "source/ImageStatic.d.ts", + "source/ImageVector.d.ts", + "source/ImageWMS.d.ts", + "source/OSM.d.ts", + "source/Raster.d.ts", + "source/Source.d.ts", + "source/Stamen.d.ts", + "source/TileArcGISRest.d.ts", + "source/TileDebug.d.ts", + "source/Tile.d.ts", + "source/TileImage.d.ts", + "source/TileJSON.d.ts", + "source/TileUTFGrid.d.ts", + "source/TileWMS.d.ts", + "source/UrlTile.d.ts", + "source/Vector.d.ts", + "source/VectorTile.d.ts", + "source/WMTS.d.ts", + "source/XYZ.d.ts", + "source/Zoomify.d.ts", + "style/AtlasManager.d.ts", + "style/Circle.d.ts", + "style/Fill.d.ts", + "style/Icon.d.ts", + "style/Image.d.ts", + "style/RegularShape.d.ts", + "style/Stroke.d.ts", + "style/Style.d.ts", + "style/Text.d.ts", + "tilegrid/TileGrid.d.ts", + "tilegrid/WMTS.d.ts", + "AssertionError/index.d.ts", + "Attribution/index.d.ts", + "Collection/index.d.ts", "color/index.d.ts", "colorlike/index.d.ts", "control/index.d.ts", "coordinate/index.d.ts", "deviceorientation/index.d.ts", - "disposable/index.d.ts", + "Disposable/index.d.ts", "easing/index.d.ts", "events/index.d.ts", "extent/index.d.ts", - "feature/index.d.ts", + "Feature/index.d.ts", "featureloader/index.d.ts", - "geolocation/index.d.ts", - "graticule/index.d.ts", - "image/index.d.ts", - "imagebase/index.d.ts", - "imagetile/index.d.ts", + "Geolocation/index.d.ts", + "Graticule/index.d.ts", + "ImageBase/index.d.ts", + "Image/index.d.ts", + "ImageTile/index.d.ts", "interaction/index.d.ts", - "kinetic/index.d.ts", + "Kinetic/index.d.ts", "loadingstrategy/index.d.ts", - "map/index.d.ts", - "mapbrowserevent/index.d.ts", - "mapbrowserpointerevent/index.d.ts", - "mapevent/index.d.ts", - "object/index.d.ts", - "observable/index.d.ts", - "overlay/index.d.ts", + "MapBrowserEvent/index.d.ts", + "MapBrowserPointerEvent/index.d.ts", + "MapEvent/index.d.ts", + "Map/index.d.ts", + "Object/index.d.ts", + "Observable/index.d.ts", + "Overlay/index.d.ts", "sphere/index.d.ts", - "tile/index.d.ts", + "Tile/index.d.ts", "tilegrid/index.d.ts", - "vectortile/index.d.ts", - "view/index.d.ts" + "VectorTile/index.d.ts", + "View/index.d.ts" ] -} \ No newline at end of file +} From 401e9d47d92b0b9df04871b5bf50340a951292ff Mon Sep 17 00:00:00 2001 From: Vahid Shirvani Date: Fri, 22 Feb 2019 14:55:29 +0100 Subject: [PATCH 093/924] Fix ol-test --- types/ol/ol-tests.ts | 460 ++++++++++++++----------------------------- 1 file changed, 153 insertions(+), 307 deletions(-) diff --git a/types/ol/ol-tests.ts b/types/ol/ol-tests.ts index be19e61a2b..f8117f43ac 100644 --- a/types/ol/ol-tests.ts +++ b/types/ol/ol-tests.ts @@ -1,317 +1,163 @@ -import ControlAttribution from 'ol/control/attribution'; - -import ControlControl from 'ol/control/control'; - -import ControlFullScreen from 'ol/control/fullscreen'; - -import ControlMousePosition from 'ol/control/mouseposition'; - -import ControlOverviewMap from 'ol/control/overviewmap'; - -import ControlRotate from 'ol/control/rotate'; - -import ControlScaleLine from 'ol/control/scaleline'; - -import ControlZoom from 'ol/control/zoom'; - -import ControlZoomSlider from 'ol/control/zoomslider'; - -import ControlZoomToExtent from 'ol/control/zoomtoextent'; - -import Eventscondition from 'ol/events/condition'; - -import EventsEvent from 'ol/events/event'; - -import EventsEventTarget from 'ol/events/eventtarget'; - -import FormatEsriJSON from 'ol/format/esrijson'; - -import FormatFeature from 'ol/format/feature'; - -import Formatfilter from 'ol/format/filter'; - -import FormatGeoJSON from 'ol/format/geojson'; - -import FormatGML2 from 'ol/format/gml2'; - -import FormatGML3 from 'ol/format/gml3'; - -import FormatGMLBase from 'ol/format/gmlbase'; - -import FormatGPX from 'ol/format/gpx'; - -import FormatIGC from 'ol/format/igc'; - -import FormatJSONFeature from 'ol/format/jsonfeature'; - -import FormatKML from 'ol/format/kml'; - -import FormatMVT from 'ol/format/mvt'; - -import FormatOSMXML from 'ol/format/osmxml'; - -import FormatPolyline from 'ol/format/polyline'; - -import FormatTextFeature from 'ol/format/textfeature'; - -import FormatTopoJSON from 'ol/format/topojson'; - -import FormatWFS from 'ol/format/wfs'; - -import FormatWKT from 'ol/format/wkt'; - -import FormatWMSCapabilities from 'ol/format/wmscapabilities'; - -import FormatWMSGetFeatureInfo from 'ol/format/wmsgetfeatureinfo'; - -import FormatWMTSCapabilities from 'ol/format/wmtscapabilities'; - -import FormatXML from 'ol/format/xml'; - -import FormatXMLFeature from 'ol/format/xmlfeature'; - -import GeomCircle from 'ol/geom/circle'; - -import GeomGeometry from 'ol/geom/geometry'; - -import GeomGeometryCollection from 'ol/geom/geometrycollection'; - -import GeomLinearRing from 'ol/geom/linearring'; - -import GeomLineString from 'ol/geom/linestring'; - -import GeomMultiLineString from 'ol/geom/multilinestring'; - -import GeomMultiPoint from 'ol/geom/multipoint'; - -import GeomMultiPolygon from 'ol/geom/multipolygon'; - -import GeomPoint from 'ol/geom/point'; - -import GeomPolygon from 'ol/geom/polygon'; - -import GeomSimpleGeometry from 'ol/geom/simplegeometry'; - -import InteractionDoubleClickZoom from 'ol/interaction/doubleclickzoom'; - -import InteractionDragAndDrop from 'ol/interaction/draganddrop'; - -import InteractionDragBox from 'ol/interaction/dragbox'; - -import InteractionDragPan from 'ol/interaction/dragpan'; - -import InteractionDragRotate from 'ol/interaction/dragrotate'; - -import InteractionDragRotateAndZoom from 'ol/interaction/dragrotateandzoom'; - -import InteractionDragZoom from 'ol/interaction/dragzoom'; - -import InteractionDraw from 'ol/interaction/draw'; - -import InteractionInteraction from 'ol/interaction/interaction'; - -import InteractionKeyboardPan from 'ol/interaction/keyboardpan'; - -import InteractionKeyboardZoom from 'ol/interaction/keyboardzoom'; - -import InteractionModify from 'ol/interaction/modify'; - -import InteractionMouseWheelZoom from 'ol/interaction/mousewheelzoom'; - -import InteractionPinchRotate from 'ol/interaction/pinchrotate'; - -import InteractionPinchZoom from 'ol/interaction/pinchzoom'; - -import InteractionPointer from 'ol/interaction/pointer'; - -import InteractionSelect from 'ol/interaction/select'; - -import InteractionSnap from 'ol/interaction/snap'; - -import InteractionTranslate from 'ol/interaction/translate'; - -import LayerBase from 'ol/layer/base'; - -import LayerGroup from 'ol/layer/group'; - -import LayerHeatmap from 'ol/layer/heatmap'; - -import LayerImage from 'ol/layer/image'; - -import LayerLayer from 'ol/layer/layer'; - -import LayerTile from 'ol/layer/tile'; - -import LayerVector from 'ol/layer/vector'; - -import LayerVectorTile from 'ol/layer/vectortile'; - -import PointerPointerEvent from 'ol/pointer/pointerevent'; - -import Proj from 'ol/proj'; - -import ProjProjection from 'ol/proj/projection'; - -import Rendercanvas from 'ol/render/canvas'; - -import RenderEvent from 'ol/render/event'; - -import RenderFeature from 'ol/render/feature'; - -import RenderVectorContext from 'ol/render/vectorcontext'; - -import SourceBingMaps from 'ol/source/bingmaps'; - -import SourceCartoDB from 'ol/source/cartodb'; - -import SourceCluster from 'ol/source/cluster'; - -import SourceImage from 'ol/source/image'; - -import SourceImageArcGISRest from 'ol/source/imagearcgisrest'; - -import SourceImageCanvas from 'ol/source/imagecanvas'; - -import SourceImageMapGuide from 'ol/source/imagemapguide'; - -import SourceImageStatic from 'ol/source/imagestatic'; - -import SourceImageVector from 'ol/source/imagevector'; - -import SourceImageWMS from 'ol/source/imagewms'; - -import SourceOSM from 'ol/source/osm'; - -import SourceRaster from 'ol/source/raster'; - -import SourceSource from 'ol/source/source'; - -import SourceStamen from 'ol/source/stamen'; - -import SourceTile from 'ol/source/tile'; - -import SourceTileArcGISRest from 'ol/source/tilearcgisrest'; - -import SourceTileDebug from 'ol/source/tiledebug'; - -import SourceTileImage from 'ol/source/tileimage'; - -import SourceTileJSON from 'ol/source/tilejson'; - -import SourceTileUTFGrid from 'ol/source/tileutfgrid'; - -import SourceTileWMS from 'ol/source/tilewms'; - -import SourceUrlTile from 'ol/source/urltile'; - -import SourceVector from 'ol/source/vector'; - -import SourceVectorTile from 'ol/source/vectortile'; - -import SourceWMTS from 'ol/source/wmts'; - -import SourceXYZ from 'ol/source/xyz'; - -import SourceZoomify from 'ol/source/zoomify'; - -import StyleAtlasManager from 'ol/style/atlasmanager'; - -import StyleCircle from 'ol/style/circle'; - -import StyleFill from 'ol/style/fill'; - -import StyleIcon from 'ol/style/icon'; - -import StyleImage from 'ol/style/image'; - -import StyleRegularShape from 'ol/style/regularshape'; - -import StyleStroke from 'ol/style/stroke'; - -import StyleStyle from 'ol/style/style'; - -import StyleText from 'ol/style/text'; - -import TilegridTileGrid from 'ol/tilegrid/tilegrid'; - -import TilegridWMTS from 'ol/tilegrid/wmts'; - -import AssertionError from 'ol/assertionerror'; - -import Attribution from 'ol/attribution'; - -import Collection from 'ol/collection'; - -import Color from 'ol/color'; - -import Colorlike from 'ol/colorlike'; - -import Control from 'ol/control'; - +import AssertionError from 'ol/AssertionError'; +import AtlasManager from 'ol/style/AtlasManager'; +// import Attribution from 'ol/Attribution'; +import Attribution from 'ol/control/Attribution'; +import Base from 'ol/layer/Base'; +import BingMaps from 'ol/source/BingMaps'; +import canvas from 'ol/render/canvas'; +import CartoDB from 'ol/source/CartoDB'; +import Circle from 'ol/geom/Circle'; +// import Circle from 'ol/style/Circle'; +import Cluster from 'ol/source/Cluster'; +import Collection from 'ol/Collection'; +import color from 'ol/color'; +import colorlike from 'ol/colorlike'; +import condition from 'ol/events/condition'; +import control from 'ol/control'; +import Control from 'ol/control/Control'; +// import coordinate from 'ol/coordinate'; import DeviceOrientation from 'ol/deviceorientation'; - -import Disposable from 'ol/disposable'; - -import Easing from 'ol/easing'; - -import Events from 'ol/events'; - -import Extent from 'ol/extent'; - -import Feature from 'ol/feature'; - -import FeatureLoader from 'ol/featureloader'; - -import Geolocation from 'ol/geolocation'; - -import Graticule from 'ol/graticule'; - -import Image from 'ol/image'; - -import ImageBase from 'ol/imagebase'; - -import ImageTile from 'ol/imagetile'; - -import Interaction from 'ol/interaction'; - -import Kinetic from 'ol/kinetic'; - -import Loadingstrategy from 'ol/loadingstrategy'; - -import Map from 'ol/map'; - -import MapBrowserEvent from 'ol/mapbrowserevent'; - -import MapBrowserPointerEvent from 'ol/mapbrowserpointerevent'; - -import MapEvent from 'ol/mapevent'; - -import Object from 'ol/object'; - -import Observable from 'ol/observable'; - -import Overlay from 'ol/overlay'; - +import Disposable from 'ol/Disposable'; +import DoubleClickZoom from 'ol/interaction/DoubleClickZoom'; +import DragAndDrop from 'ol/interaction/DragAndDrop'; +import DragBox from 'ol/interaction/DragBox'; +import DragPan from 'ol/interaction/DragPan'; +import DragRotateAndZoom from 'ol/interaction/DragRotateAndZoom'; +import DragRotate from 'ol/interaction/DragRotate'; +import DragZoom from 'ol/interaction/DragZoom'; +import Draw from 'ol/interaction/Draw'; +import easing from 'ol/easing'; +import EsriJSON from 'ol/format/EsriJSON'; +// import Event from 'ol/events/Event'; +import Event from 'ol/render/Event'; +import events from 'ol/events'; +import EventTarget from 'ol/events/EventTarget'; +import extent from 'ol/extent'; +import Extent from 'ol/interaction/Extent'; +// import Feature from 'ol/Feature'; +import Feature from 'ol/format/Feature'; +// import Feature from 'ol/render/Feature'; +import featureloader from 'ol/featureloader'; +import Fill from 'ol/style/Fill'; +import filter from 'ol/format/filter'; +import FullScreen from 'ol/control/Fullscreen'; +import GeoJSON from 'ol/format/GeoJSON'; +import Geolocation from 'ol/Geolocation'; +import GeometryCollection from 'ol/geom/GeometryCollection'; +import Geometry from 'ol/geom/Geometry'; +import GML2 from 'ol/format/GML2'; +import GML3 from 'ol/format/GML3'; +import GMLBase from 'ol/format/GMLBase'; +import GPX from 'ol/format/GPX'; +import Graticule from 'ol/Graticule'; +import Group from 'ol/layer/Group'; +import Heatmap from 'ol/layer/Heatmap'; +import Icon from 'ol/style/Icon'; +import IGC from 'ol/format/IGC'; +import ImageArcGISRest from 'ol/source/ImageArcGISRest'; +import ImageBase from 'ol/ImageBase'; +import ImageCanvas from 'ol/source/ImageCanvas'; +// import Image from 'ol/Image'; +import Image from 'ol/layer/Image'; +// import Image from 'ol/source/Image'; +// import Image from 'ol/style/Image'; +import ImageMapGuide from 'ol/source/ImageMapGuide'; +import ImageStatic from 'ol/source/ImageStatic'; +import ImageTile from 'ol/ImageTile'; +import ImageVector from 'ol/source/ImageVector'; +import ImageWMS from 'ol/source/ImageWMS'; +import interaction from 'ol/interaction'; +import Interaction from 'ol/interaction/Interaction'; +import JSONFeature from 'ol/format/JSONFeature'; +import KeyboardPan from 'ol/interaction/KeyboardPan'; +import KeyboardZoom from 'ol/interaction/KeyboardZoom'; +import Kinetic from 'ol/Kinetic'; +import KML from 'ol/format/KML'; +import Layer from 'ol/layer/Layer'; +import LinearRing from 'ol/geom/LinearRing'; +import LineString from 'ol/geom/LineString'; +import loadingstrategy from 'ol/loadingstrategy'; +import MapBrowserEvent from 'ol/MapBrowserEvent'; +import MapBrowserPointerEvent from 'ol/MapBrowserPointerEvent'; +import MapEvent from 'ol/MapEvent'; +import Map from 'ol/Map'; +import Modify from 'ol/interaction/Modify'; +import MousePosition from 'ol/control/MousePosition'; +import MouseWheelZoom from 'ol/interaction/MouseWheelZoom'; +import MultiLineString from 'ol/geom/MultilineString'; +import MultiPoint from 'ol/geom/MultiPoint'; +import MultiPolygon from 'ol/geom/MultiPolygon'; +import MVT from 'ol/format/MVT'; +import Object from 'ol/Object'; +import Observable from 'ol/Observable'; +import ol from 'ol'; +import OSM from 'ol/source/OSM'; +import OSMXML from 'ol/format/OSMXML'; +import Overlay from 'ol/Overlay'; +import OverviewMap from 'ol/control/OverviewMap'; +import PinchRotate from 'ol/interaction/PinchRotate'; +import PinchZoom from 'ol/interaction/PinchZoom'; +import PointerEvent from 'ol/pointer/PointerEvent'; +import Pointer from 'ol/interaction/Pointer'; +import Point from 'ol/geom/Point'; +import Polygon from 'ol/geom/Polygon'; +import Polyline from 'ol/format/Polyline'; +import Projection from 'ol/proj/Projection'; +import proj from 'ol/proj'; +import Raster from 'ol/source/Raster'; +import RegularShape from 'ol/style/RegularShape'; +import Rotate from 'ol/control/Rotate'; +import ScaleLine from 'ol/control/ScaleLine'; +import Select from 'ol/interaction/Select'; +import SimpleGeometry from 'ol/geom/SimpleGeometry'; +import Snap from 'ol/interaction/Snap'; +import Source from 'ol/source/Source'; import Sphere from 'ol/sphere'; - -import Tile from 'ol/tile'; - -import Tilegrid from 'ol/tilegrid'; - -import VectorTile from 'ol/vectortile'; - -import View from 'ol/view'; +import Stamen from 'ol/source/Stamen'; +import Stroke from 'ol/style/Stroke'; +import Style from 'ol/style/Style'; +import TextFeature from 'ol/format/TextFeature'; +import Text from 'ol/style/Text'; +import TileArcGISRest from 'ol/source/TileArcGISRest'; +import TileDebug from 'ol/source/TileDebug'; +import Tile from 'ol/layer/Tile'; +// import Tile from 'ol/source/Tile'; +// import Tile from 'ol/Tile'; +import tilegrid from 'ol/tilegrid'; +import TileGrid from 'ol/tilegrid/TileGrid'; +import TileImage from 'ol/source/TileImage'; +import TileJSON from 'ol/source/TileJSON'; +import TileUTFGrid from 'ol/source/TileUTFGrid'; +import TileWMS from 'ol/source/TileWMS'; +import TopoJSON from 'ol/format/TopoJSON'; +import Translate from 'ol/interaction/Translate'; +import UrlTile from 'ol/source/UrlTile'; +import VectorContext from 'ol/render/VectorContext'; +import Vector from 'ol/layer/Vector'; +// import Vector from 'ol/source/Vector'; +// import VectorTile from 'ol/layer/VectorTile'; +// import VectorTile from 'ol/source/VectorTile'; +import VectorTile from 'ol/VectorTile'; +import View from 'ol/View'; +import WFS from 'ol/format/WFS'; +import WKT from 'ol/format/WKT'; +import WMSCapabilities from 'ol/format/WMSCapabilities'; +import WMSGetFeatureInfo from 'ol/format/WMSGetFeatureInfo'; +import WMTSCapabilities from 'ol/format/WMTSCapabilities'; +import WMTS from 'ol/source/WMTS'; +// import WMTS from 'ol/tilegrid/WMTS'; +import XMLFeature from 'ol/format/XMLFeature'; +import XML from 'ol/format/XML'; +import XYZ from 'ol/source/XYZ'; +import Zoom from 'ol/control/Zoom'; +import Zoomify from 'ol/source/Zoomify'; +import ZoomSlider from 'ol/control/ZoomSlider'; +import ZoomToExtent from 'ol/control/ZoomToExtent'; // Map const map: ol.Map = new Map({} as any); declare const mapView: View; -declare const layerBase: LayerBase; -declare const control: ControlControl; -declare const interaction: InteractionInteraction; map.setView(mapView); -map.addLayer(layerBase); -map.addControl(control); -map.addInteraction(interaction); // View let view: View; From 67b4fb2b9c9f3a617ab2d2d207d5bd9ad9e0241d Mon Sep 17 00:00:00 2001 From: Olivier Adam Date: Fri, 22 Feb 2019 15:32:58 +0100 Subject: [PATCH 094/924] fix ObjectColumnRender You can either pass a property name or a FunctionColumnRender --- types/datatables.net/index.d.ts | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/types/datatables.net/index.d.ts b/types/datatables.net/index.d.ts index 845fd2f2c2..f367d5bf40 100644 --- a/types/datatables.net/index.d.ts +++ b/types/datatables.net/index.d.ts @@ -1150,10 +1150,6 @@ declare namespace DataTables { ext: ExtSettings; } - interface ObjectColumnRender { - display(d?: number | string | object): string | object; - } - interface ObjectOrderFixed { /** * Two-element array: @@ -1686,15 +1682,23 @@ declare namespace DataTables { } interface ObjectColumnData { - _: string; - filter?: string; - display?: string; - type?: string; - sort?: string; + _: string | FunctionColumnData; + filter?: string | FunctionColumnData; + display?: string | FunctionColumnData; + type?: string | FunctionColumnData; + sort?: string | FunctionColumnData; } type FunctionColumnRender = (data: any, type: any, row: any, meta: CellMetaSettings) => any; + interface ObjectColumnRender { + _?: string | FunctionColumnRender; + filter?: string | FunctionColumnRender; + display?: string | FunctionColumnRender; + type?: string | FunctionColumnRender; + sort?: string | FunctionColumnRender; + } + interface CellMetaSettings { row: number; col: number; From f83f842d8608dc743408112bab948edc2c7b8122 Mon Sep 17 00:00:00 2001 From: Emil Marklund Date: Fri, 22 Feb 2019 16:47:44 +0100 Subject: [PATCH 095/924] added catchAll catchAll is a method for replying to messages which does not match any messages matched by hear or respond --- types/hubot/index.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/types/hubot/index.d.ts b/types/hubot/index.d.ts index 656c492df6..b0f465719a 100644 --- a/types/hubot/index.d.ts +++ b/types/hubot/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/hubotio/hubot // Definitions by: Dirk Gadsden // Kees C. Bakker +// Emil Marklund // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace Hubot { @@ -40,6 +41,8 @@ declare namespace Hubot { readonly adapter: A; constructor(adapterPath: string, adapter: string, httpd: boolean, name: string, alias?: string); + catchAll(callback: ListenerCallback): void; + catchAll(options: any, callback: ListenerCallback): void; hear(regex: RegExp, callback: ListenerCallback): void; hear(regex: RegExp, options: any, callback: ListenerCallback): void; helpCommands(): string[]; From a7fa1098d53d363688fd874854bb82c1daae0cc5 Mon Sep 17 00:00:00 2001 From: Sean Kelly Date: Fri, 22 Feb 2019 11:03:30 -0500 Subject: [PATCH 096/924] Added type definitions for dragscroll --- dragscroll/dragscroll-tests.ts | 3 +++ dragscroll/dragscroll.d.ts | 7 +++++++ 2 files changed, 10 insertions(+) create mode 100644 dragscroll/dragscroll-tests.ts create mode 100644 dragscroll/dragscroll.d.ts diff --git a/dragscroll/dragscroll-tests.ts b/dragscroll/dragscroll-tests.ts new file mode 100644 index 0000000000..de6b8060a4 --- /dev/null +++ b/dragscroll/dragscroll-tests.ts @@ -0,0 +1,3 @@ +import dragscroll from "dragscroll"; + +dragscroll.reset(); \ No newline at end of file diff --git a/dragscroll/dragscroll.d.ts b/dragscroll/dragscroll.d.ts new file mode 100644 index 0000000000..dbef7bf897 --- /dev/null +++ b/dragscroll/dragscroll.d.ts @@ -0,0 +1,7 @@ +// Type definitions for dragscroll v 0.0.8 +// Project: https://github.com/asvd/dragscroll +// Definitions by: Sean Kelly +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +declare module "dragscroll" { + function reset(i?: number, el?: HTMLElement[]): void +} \ No newline at end of file From dc4bfe4928669a2f45db1ba5558861e5e1334b85 Mon Sep 17 00:00:00 2001 From: Sean Kelly Date: Fri, 22 Feb 2019 11:10:21 -0500 Subject: [PATCH 097/924] Added type definitions for dragscroll --- dragscroll/tsconfig.json | 23 +++++++++++++++++++++++ dragscroll/tslint.json | 1 + types/dragscroll/tsconfig.json | 23 +++++++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 dragscroll/tsconfig.json create mode 100644 dragscroll/tslint.json create mode 100644 types/dragscroll/tsconfig.json diff --git a/dragscroll/tsconfig.json b/dragscroll/tsconfig.json new file mode 100644 index 0000000000..f43363abe3 --- /dev/null +++ b/dragscroll/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "base64-js-tests.ts" + ] +} \ No newline at end of file diff --git a/dragscroll/tslint.json b/dragscroll/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/dragscroll/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file diff --git a/types/dragscroll/tsconfig.json b/types/dragscroll/tsconfig.json new file mode 100644 index 0000000000..f43363abe3 --- /dev/null +++ b/types/dragscroll/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "base64-js-tests.ts" + ] +} \ No newline at end of file From 8ebb426b6ab2bb78eea99d9617e70d4b974ac6cf Mon Sep 17 00:00:00 2001 From: Sean Kelly Date: Fri, 22 Feb 2019 11:19:42 -0500 Subject: [PATCH 098/924] Added Dragscroll to @types --- dragscroll/dragscroll-tests.ts | 3 -- dragscroll/tsconfig.json | 23 ---------- dragscroll/tslint.json | 1 - types/dragscroll/dragscroll-tests.ts | 3 ++ .../dragscroll/index.d.ts | 6 +-- types/dragscroll/tsconfig.json | 43 +++++++++---------- types/dragscroll/tslint.json | 1 + 7 files changed, 28 insertions(+), 52 deletions(-) delete mode 100644 dragscroll/dragscroll-tests.ts delete mode 100644 dragscroll/tsconfig.json delete mode 100644 dragscroll/tslint.json create mode 100644 types/dragscroll/dragscroll-tests.ts rename dragscroll/dragscroll.d.ts => types/dragscroll/index.d.ts (65%) create mode 100644 types/dragscroll/tslint.json diff --git a/dragscroll/dragscroll-tests.ts b/dragscroll/dragscroll-tests.ts deleted file mode 100644 index de6b8060a4..0000000000 --- a/dragscroll/dragscroll-tests.ts +++ /dev/null @@ -1,3 +0,0 @@ -import dragscroll from "dragscroll"; - -dragscroll.reset(); \ No newline at end of file diff --git a/dragscroll/tsconfig.json b/dragscroll/tsconfig.json deleted file mode 100644 index f43363abe3..0000000000 --- a/dragscroll/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "base64-js-tests.ts" - ] -} \ No newline at end of file diff --git a/dragscroll/tslint.json b/dragscroll/tslint.json deleted file mode 100644 index 2750cc0197..0000000000 --- a/dragscroll/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" } \ No newline at end of file diff --git a/types/dragscroll/dragscroll-tests.ts b/types/dragscroll/dragscroll-tests.ts new file mode 100644 index 0000000000..4158b6c9da --- /dev/null +++ b/types/dragscroll/dragscroll-tests.ts @@ -0,0 +1,3 @@ +import * as dragscroll from "dragscroll"; + +dragscroll.reset(); \ No newline at end of file diff --git a/dragscroll/dragscroll.d.ts b/types/dragscroll/index.d.ts similarity index 65% rename from dragscroll/dragscroll.d.ts rename to types/dragscroll/index.d.ts index dbef7bf897..4598f31bd5 100644 --- a/dragscroll/dragscroll.d.ts +++ b/types/dragscroll/index.d.ts @@ -1,7 +1,7 @@ // Type definitions for dragscroll v 0.0.8 -// Project: https://github.com/asvd/dragscroll +// Project: https://github.com/asvd/dragscroll#readme // Definitions by: Sean Kelly // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module "dragscroll" { - function reset(i?: number, el?: HTMLElement[]): void -} \ No newline at end of file + function reset(i?: number, el?: any[]): void; +} diff --git a/types/dragscroll/tsconfig.json b/types/dragscroll/tsconfig.json index f43363abe3..14917b2a74 100644 --- a/types/dragscroll/tsconfig.json +++ b/types/dragscroll/tsconfig.json @@ -1,23 +1,22 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "base64-js-tests.ts" - ] -} \ No newline at end of file + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "dragscroll-tests.ts" + ] +} diff --git a/types/dragscroll/tslint.json b/types/dragscroll/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/dragscroll/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 63b91c6efbc87ebffa6e8355c9ca8b036466fe77 Mon Sep 17 00:00:00 2001 From: Sean Kelly Date: Fri, 22 Feb 2019 11:27:09 -0500 Subject: [PATCH 099/924] Added strictFunctionTypes to Dragscroll --- types/dragscroll/tsconfig.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/dragscroll/tsconfig.json b/types/dragscroll/tsconfig.json index 14917b2a74..bc17d2f0c7 100644 --- a/types/dragscroll/tsconfig.json +++ b/types/dragscroll/tsconfig.json @@ -13,7 +13,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": false }, "files": [ "index.d.ts", From 12d17c2b36c8f24ec11baa5e64b1552cebd3a66a Mon Sep 17 00:00:00 2001 From: Sean Kelly Date: Fri, 22 Feb 2019 11:36:12 -0500 Subject: [PATCH 100/924] lint --- types/dragscroll/dragscroll-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/dragscroll/dragscroll-tests.ts b/types/dragscroll/dragscroll-tests.ts index 4158b6c9da..fcf4818bf4 100644 --- a/types/dragscroll/dragscroll-tests.ts +++ b/types/dragscroll/dragscroll-tests.ts @@ -1,3 +1,3 @@ import * as dragscroll from "dragscroll"; -dragscroll.reset(); \ No newline at end of file +dragscroll.reset(); From e10db0f11b9a784426fb54dcff67f0119cc8ba79 Mon Sep 17 00:00:00 2001 From: Sean Kelly Date: Fri, 22 Feb 2019 12:02:36 -0500 Subject: [PATCH 101/924] lint --- types/dragscroll/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/dragscroll/index.d.ts b/types/dragscroll/index.d.ts index 4598f31bd5..5270b2e82a 100644 --- a/types/dragscroll/index.d.ts +++ b/types/dragscroll/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for dragscroll v 0.0.8 +// Type definitions for dragscroll v 0.0 // Project: https://github.com/asvd/dragscroll#readme // Definitions by: Sean Kelly // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 837128adf0f83b000e13bcc03c7862eef7e43860 Mon Sep 17 00:00:00 2001 From: Andrew Date: Fri, 22 Feb 2019 22:46:15 +0500 Subject: [PATCH 102/924] feat(unsplash-js): initialize types --- types/unsplash-js/index.d.ts | 232 +++++++++++++++++++++++++ types/unsplash-js/tsconfig.json | 22 +++ types/unsplash-js/tslint.json | 1 + types/unsplash-js/unsplash-js-tests.ts | 0 4 files changed, 255 insertions(+) create mode 100644 types/unsplash-js/index.d.ts create mode 100644 types/unsplash-js/tsconfig.json create mode 100644 types/unsplash-js/tslint.json create mode 100644 types/unsplash-js/unsplash-js-tests.ts diff --git a/types/unsplash-js/index.d.ts b/types/unsplash-js/index.d.ts new file mode 100644 index 0000000000..de2272c422 --- /dev/null +++ b/types/unsplash-js/index.d.ts @@ -0,0 +1,232 @@ +// Type definitions for unsplash-js 5.0 +// Project: https://github.com/unsplash/unsplash-js#readme +// Definitions by: My Self +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export default class Unsplash { + public auth: Auth; + public categories: CategoriesApi; + public collections: CollectionApi; + public currentUser: CurrentUserApi; + public users: UserApi; + public photos: PhotoApi; + public search: SearchApi; + public stats: StatsApi; + + constructor(options: { + apiUrl: string; + apiVersion: string; + applicationId: string; + secret: string; + callbackUrl?: string; + bearerToken?: string; + headers?: { [key: string]: string }; + }); + + private request(requestOptions: { + url: string; + method: string; + query: object; + headers: object; + body: object; + oauth: boolean; + }): Promise; +} + +export function toJson(response: any): any; + +export class PhotoApi { + public listPhotos( + page?: number, + perPage?: number, + orderBy?: string + ): Promise; + + public listCuratedPhotos( + page?: number, + perPage?: number, + orderBy?: string + ): Promise; + + public searchPhotos( + query: string, + categories: ReadonlyArray, + page: number, + perPage: number + ): Promise; + + public getPhoto( + id: string, + width?: number, + height?: number, + rectangle?: ReadonlyArray + ): Promise; + + public getPhotoStats(id: string): Promise; + + public getRandomPhoto(options: { + width?: number; + height?: number; + query?: string; + username?: string; + featured?: boolean; + collections?: ReadonlyArray; + count?: number; + }): Promise; + + public uploadPhoto(photo: object): void; + + public likePhoto(id: string): Promise; + + public unlikePhoto(id: string): Promise; + + public downloadPhoto(photo: { + links: { download_location: string }; + }): Promise; +} + +export class CollectionApi { + public listCollections( + page?: number, + perPage?: number, + orderBy?: string + ): Promise; + + public listCuratedCollections( + page?: number, + perPage?: number + ): Promise; + public listFeaturedCollections( + page?: number, + perPage?: number + ): Promise; + public getCollection(id: number): Promise; + + public getCollectionPhotos( + id: number, + page?: number, + perPage?: number, + orderBy?: string + ): Promise; + + public getCuratedCollectionPhotos( + id: number, + page?: number, + perPage?: number, + orderBy?: string + ): Promise; + + public createCollection( + title: string, + description?: string, + private?: boolean + ): Promise; + + public updateCollection( + id: number, + title?: string, + description?: string, + private?: boolean + ): Promise; + + public deleteCollection(id: number): Promise; + + public addPhotoToCollection( + collectionId: number, + photoId: string + ): Promise; + + public removePhotoFromCollection( + collectionId: number, + photoId: string + ): Promise; + + public listRelatedCollections(collectionId: number): Promise; +} + +export class SearchApi { + public photos( + keyword: string, + page?: number, + per_page?: number + ): Promise; + + public users( + keyword: string, + page?: number, + per_page?: number + ): Promise; + + public collections( + keyword: string, + page?: number, + per_page?: number + ): Promise; +} + +export class StatsApi { + public total(): Promise; +} + +export class CurrentUserApi { + public profile(): Promise; + + public updateProfile(options: { + username: string; + firstName: string; + lastName: string; + email: string; + url: string; + location: string; + bio: string; + instagramUsername: string; + }): Promise; +} + +export class UserApi { + public profile(username: string): Promise; + + public statistics( + username: string, + resolution?: string, + quantity?: string + ): Promise; + + public photos( + username: string, + page?: number, + perPage?: number, + orderBy?: string, + stats?: boolean + ): Promise; + + public likes( + username: string, + page?: number, + perPage?: number, + orderBy?: string + ): Promise; + + public collections( + username: string, + page?: number, + perPage?: number, + orderBy?: string + ): Promise; +} + +export class CategoriesApi { + public listCategories(): Promise; + public category(id: any): Promise; + public categoryPhotos( + id: any, + page?: number, + perPage?: number + ): Promise; +} + +export class Auth { + public getAuthenticationUrl(scopes?: ReadonlyArray): string; + public userAuthentication(code: string): object; + public setBearerToken(accessToken: string): void; +} diff --git a/types/unsplash-js/tsconfig.json b/types/unsplash-js/tsconfig.json new file mode 100644 index 0000000000..79f45318aa --- /dev/null +++ b/types/unsplash-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", + "unsplash-js-tests.ts" + ] +} diff --git a/types/unsplash-js/tslint.json b/types/unsplash-js/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/unsplash-js/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/unsplash-js/unsplash-js-tests.ts b/types/unsplash-js/unsplash-js-tests.ts new file mode 100644 index 0000000000..e69de29bb2 From 01227c77e87b0d9b33b235e0eaf10b55a8561644 Mon Sep 17 00:00:00 2001 From: Sean Kelly Date: Fri, 22 Feb 2019 13:09:16 -0500 Subject: [PATCH 103/924] link --- types/dragscroll/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/dragscroll/index.d.ts b/types/dragscroll/index.d.ts index 5270b2e82a..1a90b53761 100644 --- a/types/dragscroll/index.d.ts +++ b/types/dragscroll/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for dragscroll v 0.0 // Project: https://github.com/asvd/dragscroll#readme -// Definitions by: Sean Kelly +// Definitions by: Sean Kelly // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module "dragscroll" { function reset(i?: number, el?: any[]): void; From e9101940b93a76db98185299ada0cbb24dc5d213 Mon Sep 17 00:00:00 2001 From: Sean Kelly Date: Fri, 22 Feb 2019 13:13:38 -0500 Subject: [PATCH 104/924] link --- types/dragscroll/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/dragscroll/index.d.ts b/types/dragscroll/index.d.ts index 1a90b53761..5270b2e82a 100644 --- a/types/dragscroll/index.d.ts +++ b/types/dragscroll/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for dragscroll v 0.0 // Project: https://github.com/asvd/dragscroll#readme -// Definitions by: Sean Kelly +// Definitions by: Sean Kelly // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module "dragscroll" { function reset(i?: number, el?: any[]): void; From 79bde2d2a407f19afe7e41e3b4cfa54de2c478d5 Mon Sep 17 00:00:00 2001 From: Sean Kelly Date: Fri, 22 Feb 2019 13:19:24 -0500 Subject: [PATCH 105/924] link --- types/dragscroll/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/dragscroll/index.d.ts b/types/dragscroll/index.d.ts index 5270b2e82a..ebf6cb6815 100644 --- a/types/dragscroll/index.d.ts +++ b/types/dragscroll/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for dragscroll v 0.0 // Project: https://github.com/asvd/dragscroll#readme -// Definitions by: Sean Kelly +// Definitions by: Sean Kelly // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module "dragscroll" { function reset(i?: number, el?: any[]): void; From c31d394c731e00895e7f9b4486f316237b2e1763 Mon Sep 17 00:00:00 2001 From: Sean Kelly Date: Fri, 22 Feb 2019 13:26:20 -0500 Subject: [PATCH 106/924] single module --- types/dragscroll/index.d.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/types/dragscroll/index.d.ts b/types/dragscroll/index.d.ts index ebf6cb6815..cd125c6591 100644 --- a/types/dragscroll/index.d.ts +++ b/types/dragscroll/index.d.ts @@ -2,6 +2,4 @@ // Project: https://github.com/asvd/dragscroll#readme // Definitions by: Sean Kelly // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare module "dragscroll" { - function reset(i?: number, el?: any[]): void; -} +export function reset(i ?: number, el ?: any): void; From 1ea6c02b39b8ff413deb1b7c079c5266169e47cd Mon Sep 17 00:00:00 2001 From: romka Date: Fri, 22 Feb 2019 21:07:59 +0000 Subject: [PATCH 107/924] flexmonster d.ts update --- types/flexmonster/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/flexmonster/index.d.ts b/types/flexmonster/index.d.ts index a215a5ba3b..192e8f2d93 100644 --- a/types/flexmonster/index.d.ts +++ b/types/flexmonster/index.d.ts @@ -180,6 +180,7 @@ declare namespace Flexmonster { dataSourceInfo?: string; dataSourceType?: string; fieldSeparator?: string; + thousandSeparator?: string; filename?: string; ignoreQuotedLineBreaks?: boolean; proxyUrl?: string; From 8d0a6d8bbc1beac9d935e438a41c880b201272bf Mon Sep 17 00:00:00 2001 From: breeze9527 Date: Sat, 23 Feb 2019 21:39:43 +0800 Subject: [PATCH 108/924] Adding types for amap-js-api --- types/amap-js-api/array-bounds.d.ts | 10 + types/amap-js-api/bounds.d.ts | 12 + types/amap-js-api/browser.d.ts | 51 +++ types/amap-js-api/common.d.ts | 22 ++ types/amap-js-api/convert-from.d.ts | 15 + types/amap-js-api/dom-util.d.ts | 31 ++ types/amap-js-api/event.d.ts | 59 +++ types/amap-js-api/geometry-util.d.ts | 122 +++++++ types/amap-js-api/index.d.ts | 48 +++ types/amap-js-api/layer/building.d.ts | 30 ++ types/amap-js-api/layer/flexible.d.ts | 20 ++ types/amap-js-api/layer/layer.d.ts | 20 ++ types/amap-js-api/layer/layerGroup.d.ts | 21 ++ types/amap-js-api/layer/massMarks.d.ts | 47 +++ types/amap-js-api/layer/mediaLayer.d.ts | 35 ++ types/amap-js-api/layer/tileLayer.d.ts | 37 ++ types/amap-js-api/layer/wms.d.ts | 29 ++ types/amap-js-api/layer/wmts.d.ts | 25 ++ types/amap-js-api/lngLat.d.ts | 17 + types/amap-js-api/map.d.ts | 187 ++++++++++ types/amap-js-api/overlay/bezierCurve.d.ts | 22 ++ types/amap-js-api/overlay/circle.d.ts | 49 +++ types/amap-js-api/overlay/circleMarker.d.ts | 4 + types/amap-js-api/overlay/contextMenu.d.ts | 23 ++ types/amap-js-api/overlay/ellipse.d.ts | 27 ++ types/amap-js-api/overlay/geoJSON.d.ts | 43 +++ types/amap-js-api/overlay/icon.d.ts | 16 + types/amap-js-api/overlay/infoWindow.d.ts | 37 ++ types/amap-js-api/overlay/marker.d.ts | 103 ++++++ types/amap-js-api/overlay/markerShape.d.ts | 21 ++ types/amap-js-api/overlay/overlay.d.ts | 37 ++ types/amap-js-api/overlay/overlayGroup.d.ts | 30 ++ types/amap-js-api/overlay/pathOverlay.d.ts | 20 ++ types/amap-js-api/overlay/polygon.d.ts | 32 ++ types/amap-js-api/overlay/polyline.d.ts | 46 +++ types/amap-js-api/overlay/rectangle.d.ts | 21 ++ types/amap-js-api/overlay/shapeOverlay.d.ts | 30 ++ types/amap-js-api/overlay/text.d.ts | 19 + types/amap-js-api/pixel.d.ts | 17 + types/amap-js-api/size.d.ts | 10 + types/amap-js-api/test/arryBounds.ts | 18 + types/amap-js-api/test/bounds.ts | 30 ++ types/amap-js-api/test/browser.ts | 141 ++++++++ types/amap-js-api/test/convert-from.ts | 25 ++ types/amap-js-api/test/dom-util.ts | 47 +++ types/amap-js-api/test/event.ts | 75 ++++ types/amap-js-api/test/geometry-util.ts | 158 ++++++++ types/amap-js-api/test/layer/buildings.ts | 40 +++ types/amap-js-api/test/layer/canvasLayer.ts | 53 +++ types/amap-js-api/test/layer/flexible.ts | 54 +++ types/amap-js-api/test/layer/imageLayer.ts | 51 +++ types/amap-js-api/test/layer/layer.ts | 34 ++ types/amap-js-api/test/layer/layerGroup.ts | 115 ++++++ types/amap-js-api/test/layer/massMarks.ts | 83 +++++ types/amap-js-api/test/layer/tileLayer.ts | 60 ++++ types/amap-js-api/test/layer/videoLayer.ts | 51 +++ types/amap-js-api/test/layer/wms.ts | 89 +++++ types/amap-js-api/test/layer/wmts.ts | 69 ++++ types/amap-js-api/test/lnglat.ts | 48 +++ types/amap-js-api/test/map.ts | 338 ++++++++++++++++++ types/amap-js-api/test/overlay/bezierCurve.ts | 155 ++++++++ types/amap-js-api/test/overlay/circle.ts | 150 ++++++++ types/amap-js-api/test/overlay/contextMenu.ts | 48 +++ types/amap-js-api/test/overlay/ellipse.ts | 117 ++++++ types/amap-js-api/test/overlay/geoJSON.ts | 106 ++++++ types/amap-js-api/test/overlay/icon.ts | 32 ++ types/amap-js-api/test/overlay/infoWindow.ts | 81 +++++ types/amap-js-api/test/overlay/marker.ts | 195 ++++++++++ types/amap-js-api/test/overlay/markerShape.ts | 26 ++ types/amap-js-api/test/overlay/overlay.ts | 27 ++ .../amap-js-api/test/overlay/overlayGroup.ts | 108 ++++++ types/amap-js-api/test/overlay/polygon.ts | 123 +++++++ types/amap-js-api/test/overlay/polyline.ts | 139 +++++++ types/amap-js-api/test/overlay/rectangle.ts | 121 +++++++ types/amap-js-api/test/overlay/text.ts | 169 +++++++++ types/amap-js-api/test/pixel.ts | 42 +++ types/amap-js-api/test/preset.ts | 29 ++ types/amap-js-api/test/size.ts | 16 + types/amap-js-api/test/util.ts | 79 ++++ types/amap-js-api/test/view2d.ts | 22 ++ types/amap-js-api/tsconfig.json | 20 ++ types/amap-js-api/tslint.json | 10 + types/amap-js-api/type-util.d.ts | 12 + types/amap-js-api/util.d.ts | 37 ++ types/amap-js-api/view2D.d.ts | 13 + 85 files changed, 4901 insertions(+) create mode 100644 types/amap-js-api/array-bounds.d.ts create mode 100644 types/amap-js-api/bounds.d.ts create mode 100644 types/amap-js-api/browser.d.ts create mode 100644 types/amap-js-api/common.d.ts create mode 100644 types/amap-js-api/convert-from.d.ts create mode 100644 types/amap-js-api/dom-util.d.ts create mode 100644 types/amap-js-api/event.d.ts create mode 100644 types/amap-js-api/geometry-util.d.ts create mode 100644 types/amap-js-api/index.d.ts create mode 100644 types/amap-js-api/layer/building.d.ts create mode 100644 types/amap-js-api/layer/flexible.d.ts create mode 100644 types/amap-js-api/layer/layer.d.ts create mode 100644 types/amap-js-api/layer/layerGroup.d.ts create mode 100644 types/amap-js-api/layer/massMarks.d.ts create mode 100644 types/amap-js-api/layer/mediaLayer.d.ts create mode 100644 types/amap-js-api/layer/tileLayer.d.ts create mode 100644 types/amap-js-api/layer/wms.d.ts create mode 100644 types/amap-js-api/layer/wmts.d.ts create mode 100644 types/amap-js-api/lngLat.d.ts create mode 100644 types/amap-js-api/map.d.ts create mode 100644 types/amap-js-api/overlay/bezierCurve.d.ts create mode 100644 types/amap-js-api/overlay/circle.d.ts create mode 100644 types/amap-js-api/overlay/circleMarker.d.ts create mode 100644 types/amap-js-api/overlay/contextMenu.d.ts create mode 100644 types/amap-js-api/overlay/ellipse.d.ts create mode 100644 types/amap-js-api/overlay/geoJSON.d.ts create mode 100644 types/amap-js-api/overlay/icon.d.ts create mode 100644 types/amap-js-api/overlay/infoWindow.d.ts create mode 100644 types/amap-js-api/overlay/marker.d.ts create mode 100644 types/amap-js-api/overlay/markerShape.d.ts create mode 100644 types/amap-js-api/overlay/overlay.d.ts create mode 100644 types/amap-js-api/overlay/overlayGroup.d.ts create mode 100644 types/amap-js-api/overlay/pathOverlay.d.ts create mode 100644 types/amap-js-api/overlay/polygon.d.ts create mode 100644 types/amap-js-api/overlay/polyline.d.ts create mode 100644 types/amap-js-api/overlay/rectangle.d.ts create mode 100644 types/amap-js-api/overlay/shapeOverlay.d.ts create mode 100644 types/amap-js-api/overlay/text.d.ts create mode 100644 types/amap-js-api/pixel.d.ts create mode 100644 types/amap-js-api/size.d.ts create mode 100644 types/amap-js-api/test/arryBounds.ts create mode 100644 types/amap-js-api/test/bounds.ts create mode 100644 types/amap-js-api/test/browser.ts create mode 100644 types/amap-js-api/test/convert-from.ts create mode 100644 types/amap-js-api/test/dom-util.ts create mode 100644 types/amap-js-api/test/event.ts create mode 100644 types/amap-js-api/test/geometry-util.ts create mode 100644 types/amap-js-api/test/layer/buildings.ts create mode 100644 types/amap-js-api/test/layer/canvasLayer.ts create mode 100644 types/amap-js-api/test/layer/flexible.ts create mode 100644 types/amap-js-api/test/layer/imageLayer.ts create mode 100644 types/amap-js-api/test/layer/layer.ts create mode 100644 types/amap-js-api/test/layer/layerGroup.ts create mode 100644 types/amap-js-api/test/layer/massMarks.ts create mode 100644 types/amap-js-api/test/layer/tileLayer.ts create mode 100644 types/amap-js-api/test/layer/videoLayer.ts create mode 100644 types/amap-js-api/test/layer/wms.ts create mode 100644 types/amap-js-api/test/layer/wmts.ts create mode 100644 types/amap-js-api/test/lnglat.ts create mode 100644 types/amap-js-api/test/map.ts create mode 100644 types/amap-js-api/test/overlay/bezierCurve.ts create mode 100644 types/amap-js-api/test/overlay/circle.ts create mode 100644 types/amap-js-api/test/overlay/contextMenu.ts create mode 100644 types/amap-js-api/test/overlay/ellipse.ts create mode 100644 types/amap-js-api/test/overlay/geoJSON.ts create mode 100644 types/amap-js-api/test/overlay/icon.ts create mode 100644 types/amap-js-api/test/overlay/infoWindow.ts create mode 100644 types/amap-js-api/test/overlay/marker.ts create mode 100644 types/amap-js-api/test/overlay/markerShape.ts create mode 100644 types/amap-js-api/test/overlay/overlay.ts create mode 100644 types/amap-js-api/test/overlay/overlayGroup.ts create mode 100644 types/amap-js-api/test/overlay/polygon.ts create mode 100644 types/amap-js-api/test/overlay/polyline.ts create mode 100644 types/amap-js-api/test/overlay/rectangle.ts create mode 100644 types/amap-js-api/test/overlay/text.ts create mode 100644 types/amap-js-api/test/pixel.ts create mode 100644 types/amap-js-api/test/preset.ts create mode 100644 types/amap-js-api/test/size.ts create mode 100644 types/amap-js-api/test/util.ts create mode 100644 types/amap-js-api/test/view2d.ts create mode 100644 types/amap-js-api/tsconfig.json create mode 100644 types/amap-js-api/tslint.json create mode 100644 types/amap-js-api/type-util.d.ts create mode 100644 types/amap-js-api/util.d.ts create mode 100644 types/amap-js-api/view2D.d.ts diff --git a/types/amap-js-api/array-bounds.d.ts b/types/amap-js-api/array-bounds.d.ts new file mode 100644 index 0000000000..419d8e4b1d --- /dev/null +++ b/types/amap-js-api/array-bounds.d.ts @@ -0,0 +1,10 @@ +declare namespace AMap { + class ArrayBounds { + constructor(bounds: LocationValue[]); + bounds: LngLat[]; + contains(point: LocationValue): boolean; + // internal + toBounds(): Bounds; + getCenter(): LngLat; + } +} diff --git a/types/amap-js-api/bounds.d.ts b/types/amap-js-api/bounds.d.ts new file mode 100644 index 0000000000..63e880fe65 --- /dev/null +++ b/types/amap-js-api/bounds.d.ts @@ -0,0 +1,12 @@ +declare namespace AMap { + class Bounds { + constructor(southWest: LngLat, northEast: LngLat); + contains(point: LocationValue): boolean; + getCenter(): LngLat; + getSouthWest(): LngLat; + getSouthEast(): LngLat; + getNorthEast(): LngLat; + getNorthWest(): LngLat; + toString(): string; + } +} diff --git a/types/amap-js-api/browser.d.ts b/types/amap-js-api/browser.d.ts new file mode 100644 index 0000000000..71bfaa8fea --- /dev/null +++ b/types/amap-js-api/browser.d.ts @@ -0,0 +1,51 @@ +declare namespace AMap { + namespace Browser { + const ua: string; + const mobile: boolean; + const plat: 'android' | 'ios' | 'windows' | 'mac' | 'other'; + const mac: boolean; + const windows: boolean; + const ios: boolean; + const iPad: boolean; + const iPhone: boolean; + const android: boolean; + const android23: boolean; + const chrome: boolean; + const firefox: boolean; + const safari: boolean; + const wechat: boolean; + const uc: boolean; + const qq: boolean; + const ie: boolean; + const ie6: boolean; + const ie7: boolean; + const ie8: boolean; + const ie9: boolean; + const ie10: boolean; + const ie11: boolean; + const edge: boolean; + const ielt9: boolean; + const baidu: boolean; + const isLocalStorage: boolean; + const isGeolocation: boolean; + const mobileWebkit: boolean; + const mobileWebkit3d: boolean; + const mobileOpera: boolean; + const retina: boolean; + const touch: boolean; + const msPointer: boolean; + const pointer: boolean; + const webkit: boolean; + const ie3d: boolean; + const webkit3d: boolean; + const gecko3d: boolean; + const opera3d: boolean; + const any3d: boolean; + const isCanvas: boolean; + const isSvg: boolean; + const isVML: boolean; + const isWorker: boolean; + const isWebsocket: boolean; + function isWebGL(): boolean; + } +} diff --git a/types/amap-js-api/common.d.ts b/types/amap-js-api/common.d.ts new file mode 100644 index 0000000000..3d51dc719e --- /dev/null +++ b/types/amap-js-api/common.d.ts @@ -0,0 +1,22 @@ +declare namespace AMap { + type SizeValue = Size | [number, number]; + type LocationValue = LngLat | [number, number]; + type Lang = 'zh_cn' | 'en' | 'zh_en'; + + type Event = { type: N } & + (V extends HTMLElement ? { value: V } + : V extends object ? V + : V extends undefined ? {} + : { value: V }); + type MapsEvent = Event; + + type StrokeLineJoin = 'miter' | 'round' | 'bevel'; + type StrokeLineCap = 'butt' | 'round' | 'square'; + type StrokeStyle = 'dashed' | 'solid'; + + type AnimationName = 'AMAP_ANIMATION_NONE' | 'AMAP_ANIMATION_DROP' | 'AMAP_ANIMATION_BOUNCE'; +} diff --git a/types/amap-js-api/convert-from.d.ts b/types/amap-js-api/convert-from.d.ts new file mode 100644 index 0000000000..9fe1f1e76d --- /dev/null +++ b/types/amap-js-api/convert-from.d.ts @@ -0,0 +1,15 @@ +declare namespace AMap { + namespace convertFrom { + interface Result { + info: string; // 'ok' + locations: LngLat[]; + } + type Type = 'gps' | 'baidu' | 'mapbar'; + type SearchStatus = 'complete' | 'error'; + } + function convertFrom( + lnglat: LocationValue | LocationValue[], + type: convertFrom.Type | null, + callback: (status: convertFrom.SearchStatus, result: string | convertFrom.Result) => void + ): void; +} diff --git a/types/amap-js-api/dom-util.d.ts b/types/amap-js-api/dom-util.d.ts new file mode 100644 index 0000000000..d83a2ca69a --- /dev/null +++ b/types/amap-js-api/dom-util.d.ts @@ -0,0 +1,31 @@ +declare namespace AMap { + namespace DomUtil { + function getViewport(dom: HTMLElement): Size; + + function getViewportOffset(dom: HTMLElement): Pixel; + + function create( + tagName: K, + parent?: HTMLElement, + className?: string + ): HTMLElementTagNameMap[K]; + + function setClass(dom: HTMLElement, className?: string): void; + + function hasClass(dom: HTMLElement, className: string): boolean; + + function addClass(dom: HTMLElement, className: string): void; + + function removeClass(dom: HTMLElement, className: string): void; + + function setOpacity(dom: HTMLElement, opacity: number): void; + + function rotate(dom: HTMLElement, deg: number, origin?: { x: number, y: number }): void; + + function setCss(dom: HTMLElement | HTMLElement[], style: Partial): typeof DomUtil; // this + + function empty(dom: HTMLElement): void; + + function remove(dom: HTMLElement): void; + } +} diff --git a/types/amap-js-api/event.d.ts b/types/amap-js-api/event.d.ts new file mode 100644 index 0000000000..d8ff5753c9 --- /dev/null +++ b/types/amap-js-api/event.d.ts @@ -0,0 +1,59 @@ +declare namespace AMap { + abstract class EventEmitter { + on( + eventName: string, + // tslint:disable-next-line:no-unnecessary-generics + handler: (this: C, event: E) => void, + context?: C, + once?: boolean, + unshift?: boolean + ): this; + + off( + eventName: string, + // tslint:disable-next-line + handler: ((this: C, event: E) => void) | 'mv', + context?: C + ): this; + + emit(eventName: string, data?: any): this; + } + + namespace event { + interface EventListener { + type: T; + } + + function addDomListener( + // tslint:disable-next-line: no-unnecessary-generics + instance: HTMLElementTagNameMap[N], + eventName: E, + handler: (this: C, event: HTMLElementEventMap[E]) => void, + context?: C + ): EventListener<0>; + + function addListener( + // tslint:disable-next-line: no-unnecessary-generics + instance: I, + eventName: string, + // tslint:disable-next-line: no-unnecessary-generics + handler: (this: C, event: E) => void, + // tslint:disable-next-line: no-unnecessary-generics + context?: C + ): EventListener<1>; + + function addListenerOnce( + // tslint:disable-next-line: no-unnecessary-generics + instance: I, + eventName: string, + // tslint:disable-next-line: no-unnecessary-generics + handler: (this: C, event: E) => void, + // tslint:disable-next-line: no-unnecessary-generics + context?: C + ): EventListener<1>; + + function removeListener(listener: EventListener<0 | 1>): void; + + function trigger(instance: EventEmitter, eventName: string, data?: any): void; + } +} diff --git a/types/amap-js-api/geometry-util.d.ts b/types/amap-js-api/geometry-util.d.ts new file mode 100644 index 0000000000..03f6800088 --- /dev/null +++ b/types/amap-js-api/geometry-util.d.ts @@ -0,0 +1,122 @@ +declare namespace AMap { + namespace GeometryUtil { + function distance( + point1: LocationValue, + point2: LocationValue | LocationValue[] + ): number; + + function ringArea(ring: LocationValue[]): number; + + function isClockwise(path: LocationValue[]): boolean; + + function distanceOfLine(line: LocationValue[]): number; + + function ringRingClip( + ring1: LocationValue[], + ring2: LocationValue[] + ): Array<[number, number]>; + + function doesRingRingIntersect( + ring1: LocationValue[], + ring2: LocationValue[] + ): boolean; + + function doesLineRingIntersect( + line: LocationValue[], + ring: LocationValue[] + ): boolean; + + function doesLineLineIntersect( + line1: LocationValue[], + line2: LocationValue[] + ): boolean; + + function doesSegmentPolygonIntersect( + point1: LocationValue, + point2: LocationValue, + polygon: LocationValue[][] + ): boolean; + + function doesSegmentRingIntersect( + point1: LocationValue, + point2: LocationValue, + ring: LocationValue[] + ): boolean; + + function doesSegmentLineIntersect( + point1: LocationValue, + point2: LocationValue, + line: LocationValue[] + ): boolean; + + function doesSegmentsIntersect( + point1: LocationValue, + point2: LocationValue, + point3: LocationValue, + point4: LocationValue + ): boolean; + + function isPointInRing(point: LocationValue, ring: LocationValue[]): boolean; + + function isRingInRing(ring1: LocationValue[], ring2: LocationValue[]): boolean; + + function isPointInPolygon(point: LocationValue, polygon: LocationValue[][]): boolean; + + function makesureClockwise(path: Array<[number, number]>): Array<[number, number]>; + + function makesureAntiClockwise(path: Array<[number, number]>): Array<[number, number]>; + + function closestOnSegment( + point1: LocationValue, + point2: LocationValue, + point3: LocationValue + ): [number, number]; + + function closestOnLine(point: LocationValue, line: LocationValue[]): [number, number]; + + function distanceToSegment( + point1: LocationValue, + point2: LocationValue, + point3: LocationValue + ): number; + + function distanceToLine(point: LocationValue, line: LocationValue[]): number; + + function isPointOnSegment( + point1: LocationValue, + point2: LocationValue, + point3: LocationValue, + tolerance?: number + ): boolean; + + function isPointOnLine( + point: LocationValue, + line: LocationValue[], + tolerance?: number + ): boolean; + + function isPointOnRing( + point: LocationValue, + ring: LocationValue[], + tolerance?: number + ): boolean; + + function isPointOnPolygon( + point: LocationValue, + polygon: LocationValue[][], + tolerance?: number + ): boolean; + + function doesPolygonPolygonIntersect( + polygon1: LocationValue[], + polygon2: LocationValue[] + ): boolean; + + function distanceToPolygon(point: LocationValue, polygon: LocationValue[]): number; + + function triangulateShape( + shape1: LngLat[] | Pixel[] | [number, number], + shape2: LngLat[] | Pixel[] | [number, number] + ): number[]; + } +} diff --git a/types/amap-js-api/index.d.ts b/types/amap-js-api/index.d.ts new file mode 100644 index 0000000000..54f79c08ea --- /dev/null +++ b/types/amap-js-api/index.d.ts @@ -0,0 +1,48 @@ +// Type definitions for non-npm package amap-js-sdk 1.4 +// Project: https://lbs.amap.com/api/javascript-api/summary +// Definitions by: breeze9527 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// diff --git a/types/amap-js-api/layer/building.d.ts b/types/amap-js-api/layer/building.d.ts new file mode 100644 index 0000000000..30dd7c4092 --- /dev/null +++ b/types/amap-js-api/layer/building.d.ts @@ -0,0 +1,30 @@ +declare namespace AMap { + namespace Buildings { + interface Options extends Layer.Options { + zooms?: [number, number]; + opacity?: number; + heightFactor?: number; + visible?: boolean; + zIndex?: number; + // inner + merge?: boolean; + sort?: boolean; + } + interface AreaStyle { + color1: string; + path: LocationValue[]; + color2?: string; + visible?: boolean; + rejectTexture?: boolean; + } + interface Style { + hideWithoutStyle?: boolean; + areas: AreaStyle[]; + } + } + + class Buildings extends Layer { + constructor(opts?: Buildings.Options); + setStyle(style: Buildings.Style): void; + } +} diff --git a/types/amap-js-api/layer/flexible.d.ts b/types/amap-js-api/layer/flexible.d.ts new file mode 100644 index 0000000000..bdb4001a7c --- /dev/null +++ b/types/amap-js-api/layer/flexible.d.ts @@ -0,0 +1,20 @@ +declare namespace AMap { + namespace TileLayer { + namespace Flexible { + interface Options extends TileLayer.Options { + createTile?( + x: number, + y: number, + z: number, + success: (tile: HTMLImageElement | HTMLCanvasElement) => void, + fail: () => void + ): void; + cacheSize?: number; + visible?: boolean; + } + } + class Flexible extends TileLayer { + constructor(options?: Flexible.Options); + } + } +} diff --git a/types/amap-js-api/layer/layer.d.ts b/types/amap-js-api/layer/layer.d.ts new file mode 100644 index 0000000000..8f35d949fd --- /dev/null +++ b/types/amap-js-api/layer/layer.d.ts @@ -0,0 +1,20 @@ +declare namespace AMap { + namespace Layer { + interface Options { + map?: Map; + } + } + + abstract class Layer extends EventEmitter { + getContainer(): HTMLDivElement | undefined; + getZooms(): [number, number]; + setOpacity(alpha: number): void; + getOpacity(): number; + show(): void; + hide(): void; + setMap(map?: Map | null): void; + getMap(): Map | null | undefined; + setzIndex(index: number): void; + getzIndex(): number; + } +} diff --git a/types/amap-js-api/layer/layerGroup.d.ts b/types/amap-js-api/layer/layerGroup.d.ts new file mode 100644 index 0000000000..4cc463eef7 --- /dev/null +++ b/types/amap-js-api/layer/layerGroup.d.ts @@ -0,0 +1,21 @@ +declare namespace AMap { + class LayerGroup extends Layer { + constructor(layers: L | L[]); + addLayer(layer: L | L[]): this; + addLayers(layers: L | L[]): this; + getLayers(): L[]; + getLayer(finder: (this: null, item: L, index: number, list: L[]) => boolean): L | null; + hasLayer(layer: L | ((this: null, item: L, index: number, list: L[]) => boolean)): boolean; + removeLayer(layer: L | L[]): this; + removeLayers(layer: L | L[]): this; + clearLayers(): this; + eachLayer(iterator: (this: C, layer: L, index: number, list: L[]) => void, context?: C): void; + + // overwrite + setMap(map?: Map): this; + hide(): this; + show(): this; + reload(): this; + setOptions(options: any): this; + } +} diff --git a/types/amap-js-api/layer/massMarks.d.ts b/types/amap-js-api/layer/massMarks.d.ts new file mode 100644 index 0000000000..1ab5464a5b --- /dev/null +++ b/types/amap-js-api/layer/massMarks.d.ts @@ -0,0 +1,47 @@ +declare namespace AMap { + namespace MassMarks { + interface EventMap { + click: UIEvent<'click', I>; + dblclick: UIEvent<'dblclick', I>; + mousedown: UIEvent<'mousedown', I>; + mouseup: UIEvent<'mouseup', I>; + mouseover: UIEvent<'mouseover', I>; + mouseout: UIEvent<'mouseout', I>; + touchstart: UIEvent<'touchstart', I>; + touchend: UIEvent<'touchend', I>; + } + + interface Style { + anchor: Pixel; + url: string; + size: Size; + rotation?: number; + } + + type UIEvent = Event ? D : Data; + }>; + + interface Options extends Layer.Options { + zIndex?: number; + cursor?: string; + alwayRender?: boolean; + style: Style | Style[]; + // rejectMapMask + } + interface Data { + lnglat: LocationValue; + style?: number; + } + } + + class MassMarks extends Layer { + constructor(data: D[] | string, opts: MassMarks.Options); + setStyle(style: MassMarks.Style | MassMarks.Style[]): void; + getStyle(): MassMarks.Style | MassMarks.Style[]; + setData(data: D[] | string): void; + getData(): Array> & { lnglat: LngLat }>; + clear(): void; + } +} diff --git a/types/amap-js-api/layer/mediaLayer.d.ts b/types/amap-js-api/layer/mediaLayer.d.ts new file mode 100644 index 0000000000..a38f5ba025 --- /dev/null +++ b/types/amap-js-api/layer/mediaLayer.d.ts @@ -0,0 +1,35 @@ +declare namespace AMap { + namespace MediaLayer { + interface Options extends Layer.Options { + bounds?: Bounds; + visible?: boolean; + zooms?: [number, number]; + opacity?: number; + } + } + + abstract class MediaLayer extends Layer { + constructor(options?: MediaLayer.Options); + setBounds(bounds: Bounds): void; + getBounds(): Bounds; + setOptions(options: Partial): void; + getOptions(): Partial; + getElement(): E | null; + } + + class ImageLayer extends MediaLayer { + setImageUrl(url: string): void; + getImageUrl(): string | undefined; + } + + class VideoLayer extends MediaLayer { + setVideoUrl(source: string | string[]): void; + getVideoUrl(): string | string[] | undefined; + } + + class CanvasLayer extends MediaLayer { + setCanvas(canvas: HTMLCanvasElement): void; + getCanvas(): HTMLCanvasElement | undefined; + reFresh(): void; + } +} diff --git a/types/amap-js-api/layer/tileLayer.d.ts b/types/amap-js-api/layer/tileLayer.d.ts new file mode 100644 index 0000000000..7576a70664 --- /dev/null +++ b/types/amap-js-api/layer/tileLayer.d.ts @@ -0,0 +1,37 @@ +declare namespace AMap { + namespace TileLayer { + interface EventMap { + complete: Event<'complete'>; + } + + interface Options extends Layer.Options { + tileSize?: number; + tileUrl?: string; + errorUrl?: string; + getTileUrl?: string | ((x: number, y: number, level: number) => string); + zIndex?: number; + opacity?: number; + zooms?: [number, number]; + detectRetina?: boolean; + } + class Satellite extends TileLayer { } + class RoadNet extends TileLayer { } + + namespace Traffic { + interface Options extends TileLayer.Options { + autoRefresh?: boolean; + interval?: number; + } + } + class Traffic extends TileLayer { + constructor(options?: Traffic.Options); + } + } + + class TileLayer extends Layer { + constructor(options?: TileLayer.Options); + getTiles(): string[]; + reload(): void; + setTileUrl(url: string | ((x: number, y: number, level: number) => string)): void; + } +} diff --git a/types/amap-js-api/layer/wms.d.ts b/types/amap-js-api/layer/wms.d.ts new file mode 100644 index 0000000000..c4561ddf14 --- /dev/null +++ b/types/amap-js-api/layer/wms.d.ts @@ -0,0 +1,29 @@ +declare namespace AMap { + namespace TileLayer { + namespace WMS { + interface Params { + VERSION?: string; + LAYERS?: string; + STYLES?: string; + FORMAT?: string; + TRANSPARENT?: 'TRUE' | 'FALSE'; + BGCOLOR?: string; + EXCEPTIONS?: string; + TIME?: string; + ELEVATION?: string; + } + interface Options extends Flexible.Options { + url: string; + params: Params; + blend?: boolean; + } + } + class WMS extends Flexible { + constructor(options: WMS.Options); + setUrl(url: string): void; + getUrl(): string; + setParams(params: WMS.Params): void; + getParams(): WMS.Params; + } + } +} diff --git a/types/amap-js-api/layer/wmts.d.ts b/types/amap-js-api/layer/wmts.d.ts new file mode 100644 index 0000000000..5d85e5df48 --- /dev/null +++ b/types/amap-js-api/layer/wmts.d.ts @@ -0,0 +1,25 @@ +declare namespace AMap { + namespace TileLayer { + namespace WMTS { + interface Params { + Version?: string; + Layer?: string; + Style?: string; + Format?: string; + } + interface Options extends Flexible.Options { + url: string; + params: Params; + blend?: boolean; + } + } + + class WMTS extends Flexible { + constructor(options: WMTS.Options); + setUrl(url: string): void; + getUrl(): string; + setParams(params: WMTS.Params): void; + getParams(): WMTS.Params; + } + } +} diff --git a/types/amap-js-api/lngLat.d.ts b/types/amap-js-api/lngLat.d.ts new file mode 100644 index 0000000000..4247002b2b --- /dev/null +++ b/types/amap-js-api/lngLat.d.ts @@ -0,0 +1,17 @@ +declare namespace AMap { + class LngLat { + constructor(lng: number, lat: number, noAutofix?: boolean); + offset(east: number, north: number): LngLat; + distance(lnglat: LngLat | LngLat[]): number; + getLng(): number; + getLat(): number; + equals(lnglat: LngLat): boolean; + toString(): string; + + // internal + add(lnglat: LngLat, noAutofix?: boolean): LngLat; + subtract(lnglat: LngLat, noAutofix?: boolean): LngLat; + divideBy(num: number, noAutofix?: boolean): LngLat; + multiplyBy(num: number, noAutofix?: boolean): LngLat; + } +} diff --git a/types/amap-js-api/map.d.ts b/types/amap-js-api/map.d.ts new file mode 100644 index 0000000000..46edc68577 --- /dev/null +++ b/types/amap-js-api/map.d.ts @@ -0,0 +1,187 @@ +declare namespace AMap { + namespace Map { + type Feature = 'bg' | 'point' | 'road' | 'building'; + type ViewMode = '2D' | '3D'; + interface Options { + view?: View2D; + layers?: Layer[]; + zoom?: number; + center?: LocationValue; + labelzIndex?: number; + zooms?: [number, number]; + lang?: Lang; + defaultCursor?: string; + crs?: 'EPSG3857' | 'EPSG3395' | 'EPSG4326'; + animateEnable?: boolean; + isHotspot?: boolean; + defaultLayer?: TileLayer; + rotateEnable?: boolean; + resizeEnable?: boolean; + showIndoorMap?: boolean; + expandZoomRange?: boolean; + dragEnable?: boolean; + zoomEnable?: boolean; + doubleClickZoom?: boolean; + keyboardEnable?: boolean; + jogEnable?: boolean; + scrollWheel?: boolean; + touchZoom?: boolean; + touchZoomCenter?: number; + mapStyle?: string; + features?: Feature[] | 'all' | Feature; + showBuildingBlock?: boolean; + viewMode?: ViewMode; + pitch?: number; + pitchEnable?: boolean; + buildingAnimation?: boolean; + skyColor?: string; + preloadMode?: boolean; + mask?: Array<[number, number]> | Array> | Array>>; + maxPitch?: number; + rotation?: number; + forceVector?: boolean; + + // internal + baseRender?: 'vw' | 'd' | 'dv' | 'v'; + overlayRender?: 'c' | 'd'; + showLabel?: boolean; + gridMapForeign?: boolean; + logoUrl?: string; + logoUrlRetina?: string; + copyright?: string; + turboMode?: boolean; + workerMode?: boolean; + // continuousZoomEnable?: boolean; + // showFog: boolean; + // yaw: number; + // scale: number; + // detectRetina: number; + } + interface Status { + animateEnable: boolean; + doubleClickZoom: boolean; + dragEnable: boolean; + isHotspot: boolean; + jogEnable: boolean; + keyboardEnable: boolean; + pitchEnable: boolean; + resizeEnable: boolean; + rotateEnable: boolean; + scrollWheel: boolean; + touchZoom: boolean; + zoomEnable: boolean; + } + type HotspotEvent = Event; + interface EventMap { + click: MapsEvent<'click', Map>; + dblclick: MapsEvent<'dblclick', Map>; + rightclick: MapsEvent<'rightclick', Map>; + rdblclick: MapsEvent<'rdblclick', Map>; + mouseup: MapsEvent<'mouseup', Map>; + mousedown: MapsEvent<'mousedown', Map>; + mousemove: MapsEvent<'mousemove', Map>; + mousewheel: MapsEvent<'mousewheel', Map>; + mouseover: MapsEvent<'mouseover', Map>; + mouseout: MapsEvent<'mouseout', Map>; + touchstart: MapsEvent<'touchstart', Map>; + touchmove: MapsEvent<'touchmove', Map>; + touchend: MapsEvent<'touchend', Map>; + contextmenu: MapsEvent<'contextmenu', Map>; + + hotspotclick: HotspotEvent<'hotspotclick'>; + hotspotover: HotspotEvent<'hotspotover'>; + hotspotout: HotspotEvent<'hotspotout'>; + + complete: Event<'complete'>; + mapmove: Event<'mapmove'>; + movestart: Event<'movestart'>; + moveend: Event<'moveend'>; + zoomchange: Event<'zoomchange'>; + zoomstart: Event<'zoomstart'>; + zoomend: Event<'zoomend'>; + dragstart: Event<'dragstart'>; + dragging: Event<'dragging'>; + dragend: Event<'dragend'>; + resize: Event<'resize'>; + } + } + + class Map extends EventEmitter { + constructor(container: string | HTMLElement, opts?: Map.Options); + poiOnAMAP(obj: { id: string; location?: LocationValue; name?: string }): void; + detailOnAMAP(obj: { id: string; location?: LocationValue; name?: string }): void; + getZoom(): number; + getLayers(): Layer[]; + getCenter(): LngLat; + getContainer(): HTMLElement | null; + getCity(callback: (cityData: { + city: string; + citycode: string; + district: string; + province: string | never[]; // province is empty array when getCity fail + }) => void): void; + getBounds(): Bounds; + getLabelzIndex(): number; + getLimitBounds(): Bounds; + getLang(): Lang; + getSize(): Size; + getRotation(): number; + getStatus(): Map.Status; + getDefaultCursor(): string; + getResolution(point?: LocationValue): number; + getScale(dpi?: number): number; + setZoom(level: number): void; + setLabelzIndex(index: number): void; + setLayers(layers: Layer[]): void; + add(overlay: Overlay | Overlay[]): void; + remove(overlay: Overlay | Overlay[]): void; + getAllOverlays(type?: 'marker' | 'circle' | 'polyline' | 'polygon'): Overlay[]; + setCenter(center: LocationValue): void; + setZoomAndCenter(zoomLevel: number, center: LocationValue): void; + setCity(city: string, callback: (this: this, coord: [string, string], zoom: number) => void): void; + setBounds(bound: Bounds): Bounds; + setLimitBounds(bound: Bounds): void; + clearLimitBounds(): void; + setLang(lang: Lang): void; + setRotation(rotation: number): void; + setStatus(status: Partial): void; + setDefaultCursor(cursor: string): void; + zoomIn(): void; + zoomOut(): void; + panTo(position: LocationValue): void; + panBy(x: number, y: number): void; + setFitView( + overlayList?: Overlay | Overlay[], + immediately?: boolean, + avoid?: [number, number, number, number], + maxZoom?: number + ): Bounds | false | undefined; + clearMap(): void; + destroy(): void; + plugin(name: string | string[], callback: () => void): this; + addControl(control: {}): void; // TODO + removeControl(control: {}): void; // TODO + clearInfoWindow(): void; + pixelToLngLat(pixel: Pixel, level?: number): LngLat; + lnglatToPixel(lnglat: LocationValue, level?: number): Pixel; + containerToLngLat(pixel: Pixel): LngLat; + lngLatToContainer(lnglat: LocationValue): Pixel; + lnglatTocontainer(lnglat: LocationValue): Pixel; + setMapStyle(style: string): void; + getMapStyle(): string; + setFeatures(feature: Map.Feature | Map.Feature[] | 'all'): void; + getFeatures(): Map.Feature | Map.Feature[] | 'all'; + setDefaultLayer(layer: TileLayer): void; + setPitch(pitch: number): void; + getPitch(): number; + getViewMode_(): Map.ViewMode; + lngLatToGeodeticCoord(lnglat: LocationValue): Pixel; + geodeticCoordToLngLat(pixel: Pixel): LngLat; + } +} diff --git a/types/amap-js-api/overlay/bezierCurve.d.ts b/types/amap-js-api/overlay/bezierCurve.d.ts new file mode 100644 index 0000000000..5778cb72a6 --- /dev/null +++ b/types/amap-js-api/overlay/bezierCurve.d.ts @@ -0,0 +1,22 @@ +declare namespace AMap { + namespace BezierCurve { + interface EventMap extends Polyline.EventMap { } + type Options = Merge, { + // internal + path: Array>>; + tolerance?: number; + interpolateNumLimit?: [number | number]; + }>; + + interface GetOptionsResult extends Polyline.GetOptionsResult { + path: Array; + } + } + class BezierCurve extends Polyline { + constructor(options: BezierCurve.Options); + getOptions(): Partial>; + // internal + getInterpolateLngLats(): LngLat[]; + getSerializedPath(): number[][]; + } +} diff --git a/types/amap-js-api/overlay/circle.d.ts b/types/amap-js-api/overlay/circle.d.ts new file mode 100644 index 0000000000..2a1cbd9020 --- /dev/null +++ b/types/amap-js-api/overlay/circle.d.ts @@ -0,0 +1,49 @@ +declare namespace AMap { + namespace Circle { + interface EventMap extends ShapeOverlay.EventMap { + setCenter: Event<'setCenter'>; + setRadius: Event<'setRadius'>; + } + + interface Options { + map?: Map; + zIndex?: number; + center?: LocationValue; + bubble?: boolean; + cursor?: string; + radius?: number; + strokeColor?: string; + strokeOpcity?: number; + strokeWeight?: number; + fillColor?: string; + fillOpacity?: number; + strokeStyle?: StrokeStyle; + extData?: ExtraData; + strokeDasharray?: number[]; + + // internal + visible?: boolean; + unit?: 'meter' | 'px'; // 'might be typo' + } + + type GetOptionsResult = Merge, { + path: LngLat[]; + center: LngLat; + radius: number; + }>; + } + + class Circle extends ShapeOverlay { + constructor(options?: Circle.Options); + setCenter(center: LocationValue, preventEvent?: boolean): void; + getCenter(): LngLat | undefined; + getBounds(): Bounds | null; + setRadius(radius: number, preventEvent?: boolean): void; + getRadius(): number; + setOptions(options?: Circle.Options): void; + getOptions(): Partial>; + contains(point: LocationValue): boolean; + // internal + getPath(count?: number): LngLat[]; + } +} diff --git a/types/amap-js-api/overlay/circleMarker.d.ts b/types/amap-js-api/overlay/circleMarker.d.ts new file mode 100644 index 0000000000..13e4162f46 --- /dev/null +++ b/types/amap-js-api/overlay/circleMarker.d.ts @@ -0,0 +1,4 @@ +declare namespace AMap { + // tslint:disable-next-line; + class CircleMarker extends Circle {} +} diff --git a/types/amap-js-api/overlay/contextMenu.d.ts b/types/amap-js-api/overlay/contextMenu.d.ts new file mode 100644 index 0000000000..72c7fc2852 --- /dev/null +++ b/types/amap-js-api/overlay/contextMenu.d.ts @@ -0,0 +1,23 @@ +declare namespace AMap { + namespace ContextMenu { + interface Options { + content?: string | HTMLElement; + // internal + visible?: boolean; + } + + interface EventMap { + items: Event<'items'>; + open: Event<'open', { target: I }>; + close: Event<'close', { target: I }>; + } + } + + class ContextMenu extends Overlay { + constructor(options?: ContextMenu.Options); + addItem(text: string, fn: (this: HTMLLIElement) => void, num?: number): void; + removeItem(test: string, fn: (this: HTMLLIElement) => void): void; + open(map: Map, position: LocationValue): void; + close(): void; + } +} diff --git a/types/amap-js-api/overlay/ellipse.d.ts b/types/amap-js-api/overlay/ellipse.d.ts new file mode 100644 index 0000000000..55feaf3112 --- /dev/null +++ b/types/amap-js-api/overlay/ellipse.d.ts @@ -0,0 +1,27 @@ +declare namespace AMap { + namespace Ellipse { + interface EventMap extends ShapeOverlay.EventMap { + setPath: Event<'setPath'>; + setCenter: Event<'setCenter'>; + } + + interface Options extends Polygon.Options { + center?: LocationValue; + radius?: [number, number]; + } + type GetOptionsResult = Merge, { + radius: [number, number]; + }>; + } + + class Ellipse extends Polygon { + constructor(options?: Ellipse.Options); + getCenter(): LngLat | undefined; + setCenter(center: LocationValue, preventEvent?: boolean): void; + setOptions(options: Ellipse.Options): void; + + // internal + setRadius(radius: [number, number], preventEvent?: boolean): void; + getRadius(): [number, number]; + } +} diff --git a/types/amap-js-api/overlay/geoJSON.d.ts b/types/amap-js-api/overlay/geoJSON.d.ts new file mode 100644 index 0000000000..75098a59f0 --- /dev/null +++ b/types/amap-js-api/overlay/geoJSON.d.ts @@ -0,0 +1,43 @@ +declare namespace AMap { + namespace GeoJSON { + type Geometry = { + type: 'Point'; + coordinates: [number, number]; + } | { + type: 'MultiPoint' | 'LineString' | 'Polygon'; + coordinates: Array<[number, number]>; + } | { + type: 'MultiLineString' | 'MultiPolygon'; + coordinates: Array>; + } | { + type: 'GeometryCollection'; + geometries: Geometry[]; + }; + + type GeoJSONObject = { + type: 'Feature'; + properties: any; + geometry: Geometry; + } | { + type: 'FeatureCollection', + properties: any; + features: GeoJSONObject[]; + }; + interface Options { + geoJSON?: GeoJSONObject | GeoJSONObject[]; + getMarker?(obj: GeoJSONObject, lnglat: LngLat): Marker; + getPolyline?(obj: GeoJSONObject, lnglats: LngLat[]): Polyline; + getPolygon?(obj: GeoJSONObject, lnglats: LngLat[]): Polygon; + coordsToLatLng?(lnglat: LngLat): LngLat; + + // internal + coordsToLatLngs?(lnglats: LngLat[]): LngLat[]; + } + } + + class GeoJSON extends OverlayGroup { + constructor(options?: GeoJSON.Options); + importData(obj: GeoJSON.GeoJSONObject | GeoJSON.GeoJSONObject[]): void; + toGeoJSON(): GeoJSON.GeoJSONObject[]; + } +} diff --git a/types/amap-js-api/overlay/icon.d.ts b/types/amap-js-api/overlay/icon.d.ts new file mode 100644 index 0000000000..be300feef3 --- /dev/null +++ b/types/amap-js-api/overlay/icon.d.ts @@ -0,0 +1,16 @@ +declare namespace AMap { + namespace Icon { + interface Options { + size?: SizeValue; + imageOffset?: Pixel; + image?: string; + imageSize?: SizeValue; + } + } + + class Icon extends EventEmitter { + constructor(options?: Icon.Options); + setImageSize(size: SizeValue): void; + getImageSize(): Size; + } +} diff --git a/types/amap-js-api/overlay/infoWindow.d.ts b/types/amap-js-api/overlay/infoWindow.d.ts new file mode 100644 index 0000000000..54bedd95a8 --- /dev/null +++ b/types/amap-js-api/overlay/infoWindow.d.ts @@ -0,0 +1,37 @@ +declare namespace AMap { + namespace InfoWindow { + interface EventMap { + change: Event<'change', { target: I }>; + open: Event<'open', { target: I }>; + close: Event<'close', { target: I }>; + } + + interface Options extends Overlay.Options { + isCustom?: boolean; + autoMove?: boolean; + closeWhenClickMap?: boolean; + content?: string | HTMLElement; + size?: SizeValue; + offset?: Pixel; + position?: LocationValue; + showShadow?: boolean; + // internal + height?: number; + } + } + + class InfoWindow extends Overlay { + constructor(options?: InfoWindow.Options); + open(map: Map, position?: LocationValue): void; + close(): void; + getIsOpen(): boolean; + setContent(content: string | HTMLElement): void; + getContent(): string | HTMLElement | undefined; + setPosition(lnglat: LocationValue): void; + getPosition(): LngLat | undefined; + setSize(size: SizeValue): void; + getSize(): Size | undefined; + // internal + setOffset(offset: Pixel): void; + } +} diff --git a/types/amap-js-api/overlay/marker.d.ts b/types/amap-js-api/overlay/marker.d.ts new file mode 100644 index 0000000000..e24ce7be8f --- /dev/null +++ b/types/amap-js-api/overlay/marker.d.ts @@ -0,0 +1,103 @@ +declare namespace AMap { + namespace Marker { + interface EventMap { + click: MapsEvent<'click', I>; + dblclick: MapsEvent<'dblclick', I>; + rightclick: MapsEvent<'rightclick', I>; + mousemove: MapsEvent<'mousemove', I>; + mouseover: MapsEvent<'mouseover', I>; + mouseout: MapsEvent<'mouseout', I>; + mousedown: MapsEvent<'mousedown', I>; + mouseup: MapsEvent<'mouseup', I>; + dragstart: MapsEvent<'dragstart', I>; + dragging: MapsEvent<'dragging', I>; + dragend: MapsEvent<'dragend', I>; + moving: Event<'moving', { passwdPath: LngLat[]; }>; + moveend: Event<'moveend'>; + movealong: Event<'movealong'>; + touchstart: MapsEvent<'touchstart', I>; + touchmove: MapsEvent<'touchmove', I>; + touchend: MapsEvent<'touchend', I>; + } + + interface Label { + content?: string; + offset?: Pixel; + } + + interface Options extends Overlay.Options { + position?: LocationValue; + offset?: Pixel; + icon?: string | Icon; + content?: string | HTMLElement; + topWhenClick?: boolean; + bubble?: boolean; + draggable?: boolean; + raiseOnDrag?: boolean; + cursor?: string; + visible?: boolean; + zIndex?: number; + angle?: number; + autoRotation?: boolean; + animation?: AnimationName; + shadow?: Icon | string; + title?: string; + shape?: MarkerShape; + label?: Label; + zooms?: [number, number]; + + // internal + topWhenMouseOver?: boolean; + height?: number; + } + } + + class Marker extends Overlay { + constructor(options?: Marker.Options); + markOnAMAP(obj?: { name?: string, position?: LocationValue }): void; + getOffset(): Pixel; + setOffset(offset: Pixel): void; + setAnimation(animate: AnimationName, prevent?: boolean): void; + getAnimation(): AnimationName; + setClickable(cilckable: boolean): void; + getClickable(): boolean; + getPosition(): LngLat | undefined; + setPosition(position: LocationValue): void; + setAngle(angle: number): void; + setLabel(label?: Marker.Label): void; + getLabel(): Marker.Label | undefined; + getAngle(): number; + setzIndex(index: number): void; + getzIndex(): number; + setIcon(content: string | Icon): void; + getIcon(): string | Icon | undefined; + setDraggable(draggable: boolean): void; + getDraggable(): boolean; + setCursor(cursor: string): void; + setContent(content: string | HTMLElement): void; + getContent(): string | HTMLElement; + moveAlong( + path: LngLat[], + speed: number, + timingFunction?: (t: number) => number, + circleable?: boolean + ): void; + moveTo( + path: LocationValue, + speed: number, + timingFunction?: (t: number) => number + ): void; + stopMove(): void; + pauseMove(): boolean; + resumeMove(): boolean; + setMap(map: null | Map): void; + setTitle(title: string): void; + getTitle(): string | undefined; + setTop(isTop: boolean): void; + getTop(): boolean; + setShadow(icon?: Icon | string): void; + getShadow(): Icon | undefined | string; + setShape(shape?: MarkerShape): void; + getShape(): MarkerShape | undefined; + } +} diff --git a/types/amap-js-api/overlay/markerShape.d.ts b/types/amap-js-api/overlay/markerShape.d.ts new file mode 100644 index 0000000000..c8efd93850 --- /dev/null +++ b/types/amap-js-api/overlay/markerShape.d.ts @@ -0,0 +1,21 @@ +declare namespace AMap { + namespace MarkerShape { + interface CircleOptions { + type: 'circle'; + coords: [number, number, number]; + } + interface PolyOptions { + type: 'poly'; + coords: number[]; + } + interface RectOptions { + type: 'rect'; + coords: [number, number, number, number]; + } + type Options = CircleOptions | PolyOptions | RectOptions; + } + + class MarkerShape { + constructor(options: MarkerShape.Options); + } +} diff --git a/types/amap-js-api/overlay/overlay.d.ts b/types/amap-js-api/overlay/overlay.d.ts new file mode 100644 index 0000000000..1726b39c3e --- /dev/null +++ b/types/amap-js-api/overlay/overlay.d.ts @@ -0,0 +1,37 @@ +declare namespace AMap { + namespace Overlay { + interface EventMap { + touchstart: MapsEvent<'touchstart', I>; + touchmove: MapsEvent<'touchmove', I>; + touchend: MapsEvent<'touchend', I>; + click: MapsEvent<'click', I>; + rightclick: MapsEvent<'rightclick', I>; + dblclick: MapsEvent<'dblclick', I>; + mousemove: MapsEvent<'mousemove', I>; + mouseover: MapsEvent<'mouseover', I>; + mousedown: MapsEvent<'mousedown', I>; + mouseup: MapsEvent<'mouseup', I>; + } + interface Options { + map?: Map; + cursor?: string; + extData?: ExtraData; + bubble?: boolean; + clickable?: boolean; + draggable?: boolean; + } + } + abstract class Overlay extends EventEmitter { + constructor(options?: Overlay.Options); + show(): void; + hide(): void; + getMap(): Map | null | undefined; + setMap(map: Map | null): void; + setExtData(extData: ExtraData): void; + getExtData(): ExtraData | {}; + + // internal + setHeight(height?: number | string): void; + getHeight(): number | string; + } +} diff --git a/types/amap-js-api/overlay/overlayGroup.d.ts b/types/amap-js-api/overlay/overlayGroup.d.ts new file mode 100644 index 0000000000..d397505b04 --- /dev/null +++ b/types/amap-js-api/overlay/overlayGroup.d.ts @@ -0,0 +1,30 @@ +type ReferOverlayOptions = + O extends AMap.BezierCurve ? AMap.BezierCurve.Options + : O extends AMap.Polyline ? AMap.Polyline.Options + : O extends AMap.Circle ? AMap.Circle.Options + : O extends AMap.Ellipse ? AMap.Ellipse.Options + : O extends AMap.Polygon ? AMap.Polygon.Options + : O extends AMap.Text ? AMap.Text.Options + : O extends AMap.Marker ? AMap.Marker.Options + : O extends AMap.Rectangle ? AMap.Rectangle.Options + : any; + +declare namespace AMap { + class OverlayGroup extends Overlay { + constructor(overlays?: O | O[]); + addOverlay(overlay: O | O[]): this; + addOverlays(overlay: O | O[]): this; + getOverlays(): O[]; + hasOverlay(overlay: O | ((this: null, item: O, index: number, list: O[]) => boolean)): boolean; + removeOverlay(overlay: O | O[]): this; + removeOverlays(overlay: O | O[]): this; + clearOverlays(): this; + eachOverlay(iterator: (this: C, overlay: O, index: number, overlays: O[]) => void, context?: C): this; + setMap(map: null | Map): this; + setOptions(options: ReferOverlayOptions): this; + show(): this; + hide(): this; + + getOverlay(finder: ((this: null, item: O, index: number, list: O[]) => boolean) | O): O | null; + } +} diff --git a/types/amap-js-api/overlay/pathOverlay.d.ts b/types/amap-js-api/overlay/pathOverlay.d.ts new file mode 100644 index 0000000000..de21aa35a7 --- /dev/null +++ b/types/amap-js-api/overlay/pathOverlay.d.ts @@ -0,0 +1,20 @@ +declare namespace AMap { + namespace PathOverlay { + interface EventMap extends ShapeOverlay.EventMap { } + interface Options extends Overlay.Options { + visible?: boolean; + zIndex?: number; + strokeColor?: string; + strokeOpacity?: number; + strokeWeight?: number; + strokeStyle?: StrokeStyle; + strokeDasharray?: number[]; + lineJoin?: StrokeLineJoin; + lineCap?: StrokeLineCap; + } + } + abstract class PathOverlay extends ShapeOverlay { + constructor(options?: PathOverlay.Options); + getBounds(): Bounds | (this extends Rectangle ? undefined : null); + } +} diff --git a/types/amap-js-api/overlay/polygon.d.ts b/types/amap-js-api/overlay/polygon.d.ts new file mode 100644 index 0000000000..8792e0e135 --- /dev/null +++ b/types/amap-js-api/overlay/polygon.d.ts @@ -0,0 +1,32 @@ +declare namespace AMap { + namespace Polygon { + interface EventMap extends PathOverlay.EventMap { } + interface Options extends PathOverlay.Options { + path?: LocationValue[] | LocationValue[][]; + fillColor?: string; + fillOpacity?: number; + } + + interface GetOptionsResult extends ShapeOverlay.GetOptionsResult { + fillColor: string; + fillOpacity: number; + path: LngLat[] | LngLat[][]; + lineJoin: StrokeLineJoin; + texture: string; + } + } + + class Polygon extends PathOverlay { + constructor(options?: Polygon.Options); + setPath(path: LocationValue[] | LocationValue[][]): void; + getPath(): LngLat[] | LngLat[][]; + setOptions(options: Polygon.Options): void; + getOptions(): Partial< + this extends Omit ? Ellipse.GetOptionsResult : + this extends Omit ? Rectangle.GetOptionsResult : + Polygon.GetOptionsResult + >; + getArea(): number; + contains(point: LocationValue): boolean; + } +} diff --git a/types/amap-js-api/overlay/polyline.d.ts b/types/amap-js-api/overlay/polyline.d.ts new file mode 100644 index 0000000000..207279b208 --- /dev/null +++ b/types/amap-js-api/overlay/polyline.d.ts @@ -0,0 +1,46 @@ +declare namespace AMap { + namespace Polyline { + interface EventMap extends PathOverlay.EventMap { } + interface GetOptionsResult extends ShapeOverlay.GetOptionsResult { + isOutline: boolean; + outlineColor: string; + geodesic: boolean; + path: LngLat[]; + lineJoin: StrokeLineJoin; + lineCap: StrokeLineCap; + borderWeight: number; + showDir: boolean; + dirColor: string; + dirImg: string; + } + + interface Options extends PathOverlay.Options { + isOutline?: boolean; + outlineColor?: string; + geodesic?: boolean; + dirColor?: string; + borderWeight?: number; + showDir?: boolean; + // internal + path?: LocationValue[]; + } + } + + class Polyline extends PathOverlay { + constructor(options?: BezierCurve.Options | Polyline.Options); + setPath( + path: this extends Omit ? + Array>> + : LocationValue[] + ): void; + getPath(): this extends Omit ? + Array + : LngLat[]; + getLength(): number; + setOptions(options: this extends Omit ? + Partial> + : Polyline.Options + ): void; + getOptions(): Partial>; + } +} diff --git a/types/amap-js-api/overlay/rectangle.d.ts b/types/amap-js-api/overlay/rectangle.d.ts new file mode 100644 index 0000000000..259e2072de --- /dev/null +++ b/types/amap-js-api/overlay/rectangle.d.ts @@ -0,0 +1,21 @@ +declare namespace AMap { + namespace Rectangle { + interface EventMap extends Polygon.EventMap { + setBounds: Event<'setBounds'>; + } + + interface Options extends Polygon.Options { + bounds?: Bounds; + } + type GetOptionsResult = Merge, { + path: LngLat[]; + bounds: Bounds; + texture: string; + }>; + } + class Rectangle extends Polygon { + constructor(options?: Rectangle.Options); + setBounds(bounds: Bounds, preventEvent?: boolean): void; + setOptions(options: Partial): void; + } +} diff --git a/types/amap-js-api/overlay/shapeOverlay.d.ts b/types/amap-js-api/overlay/shapeOverlay.d.ts new file mode 100644 index 0000000000..b8f239aac1 --- /dev/null +++ b/types/amap-js-api/overlay/shapeOverlay.d.ts @@ -0,0 +1,30 @@ +declare namespace AMap { + namespace ShapeOverlay { + interface EventMap extends Overlay.EventMap { + show: Event<'show', { target: I }>; + hide: Event<'hide', { target: I }>; + options: Event<'options'>; + change: Event<'change', { target: I }>; + } + interface GetOptionsResult { + map: Map; + zIndex: number; + strokeColor: string; + strokeOpacity: number; + strokeWeight: number; + strokeStyle: StrokeStyle; + strokeDasharray: number[]; + extData: ExtraData | {}; + bubble: boolean; + clickable: boolean; + } + } + abstract class ShapeOverlay extends Overlay { + abstract setOptions(options: {}): void; + abstract getOptions(): {}; + getzIndex(): number; + setzIndex(zIndex: number): void; + getVisible(): boolean; + setDraggable(draggable: boolean): void; + } +} diff --git a/types/amap-js-api/overlay/text.d.ts b/types/amap-js-api/overlay/text.d.ts new file mode 100644 index 0000000000..db15ae08ce --- /dev/null +++ b/types/amap-js-api/overlay/text.d.ts @@ -0,0 +1,19 @@ +declare namespace AMap { + namespace Text { + type TextAlign = 'left' | 'right' | 'center'; + type VerticalAlign = 'top' | 'middle' | 'bottom'; + interface EventMap extends Marker.EventMap { } + interface Options extends Marker.Options { + text?: string; + textAlign?: TextAlign; + verticalAlign?: VerticalAlign; + } + } + + class Text extends Marker { + constructor(options?: Text.Options); + getText(): string; + setText(text: string): void; + setStyle(style: object): void; + } +} diff --git a/types/amap-js-api/pixel.d.ts b/types/amap-js-api/pixel.d.ts new file mode 100644 index 0000000000..fab4605b7a --- /dev/null +++ b/types/amap-js-api/pixel.d.ts @@ -0,0 +1,17 @@ +declare namespace AMap { + class Pixel { + constructor(x: number, y: number, round?: boolean); + getX(): number; + getY(): number; + equals(point: Pixel): boolean; + toString(): string; + + // internal + add(offset: {x: number; y: number}, round?: boolean): Pixel; + round(): Pixel; + floor(): Pixel; + length(): number; + direction(): null | number; + toFixed(decimals?: number): this; + } +} diff --git a/types/amap-js-api/size.d.ts b/types/amap-js-api/size.d.ts new file mode 100644 index 0000000000..12a1e25423 --- /dev/null +++ b/types/amap-js-api/size.d.ts @@ -0,0 +1,10 @@ +declare namespace AMap { + class Size { + constructor(width: number, height: number); + getWidth(): number; + getHeight(): number; + toString(): string; + // internal + contains(size: { x: number; y: number }): boolean; + } +} diff --git a/types/amap-js-api/test/arryBounds.ts b/types/amap-js-api/test/arryBounds.ts new file mode 100644 index 0000000000..1ccc4d0488 --- /dev/null +++ b/types/amap-js-api/test/arryBounds.ts @@ -0,0 +1,18 @@ +import { + lnglat +} from './preset'; + +// $ExpectType ArrayBounds +const arrayBounds = new AMap.ArrayBounds([lnglat, lnglat, lnglat]); + +// $ExpectType LngLat[] +arrayBounds.bounds; + +// $ExpectType boolean +arrayBounds.contains(lnglat); + +// $ExpectType Bounds +arrayBounds.toBounds(); + +// $ExpectType LngLat +arrayBounds.getCenter(); diff --git a/types/amap-js-api/test/bounds.ts b/types/amap-js-api/test/bounds.ts new file mode 100644 index 0000000000..d22ba697f9 --- /dev/null +++ b/types/amap-js-api/test/bounds.ts @@ -0,0 +1,30 @@ +import { + lnglat, + lnglatTuple +} from './preset'; + +// $ExpectType Bounds +const bounds = new AMap.Bounds(lnglat, lnglat); + +// $ExpectType boolean +bounds.contains(lnglat); +// $ExpectType boolean +bounds.contains(lnglatTuple); + +// $ExpectType LngLat +bounds.getCenter(); + +// $ExpectType LngLat +bounds.getSouthWest(); + +// $ExpectType LngLat +bounds.getSouthEast(); + +// $ExpectType LngLat +bounds.getNorthEast(); + +// $ExpectType LngLat +bounds.getNorthWest(); + +// $ExpectType string +bounds.toString(); diff --git a/types/amap-js-api/test/browser.ts b/types/amap-js-api/test/browser.ts new file mode 100644 index 0000000000..b80d8cd3ff --- /dev/null +++ b/types/amap-js-api/test/browser.ts @@ -0,0 +1,141 @@ +const brwoser = AMap.Browser; + +// $ExpectType string +brwoser.ua; + +// $ExpectType boolean +brwoser.mobile; + +const plat: 'android' | 'ios' | 'windows' | 'mac' | 'other' = brwoser.plat; + +// $ExpectType boolean +brwoser.mac; + +// $ExpectType boolean +brwoser.windows; + +// $ExpectType boolean +brwoser.ios; + +// $ExpectType boolean +brwoser.iPad; + +// $ExpectType boolean +brwoser.iPhone; + +// $ExpectType boolean +brwoser.android; + +// $ExpectType boolean +brwoser.android23; + +// $ExpectType boolean +brwoser.chrome; + +// $ExpectType boolean +brwoser.firefox; + +// $ExpectType boolean +brwoser.safari; + +// $ExpectType boolean +brwoser.wechat; + +// $ExpectType boolean +brwoser.uc; + +// $ExpectType boolean +brwoser.qq; + +// $ExpectType boolean +brwoser.ie; + +// $ExpectType boolean +brwoser.ie6; + +// $ExpectType boolean +brwoser.ie7; + +// $ExpectType boolean +brwoser.ie8; + +// $ExpectType boolean +brwoser.ie9; + +// $ExpectType boolean +brwoser.ie10; + +// $ExpectType boolean +brwoser.ie11; + +// $ExpectType boolean +brwoser.edge; + +// $ExpectType boolean +brwoser.ielt9; + +// $ExpectType boolean +brwoser.baidu; + +// $ExpectType boolean +brwoser.isLocalStorage; + +// $ExpectType boolean +brwoser.isGeolocation; + +// $ExpectType boolean +brwoser.mobileWebkit; + +// $ExpectType boolean +brwoser.mobileWebkit3d; + +// $ExpectType boolean +brwoser.mobileOpera; + +// $ExpectType boolean +brwoser.retina; + +// $ExpectType boolean +brwoser.touch; + +// $ExpectType boolean +brwoser.msPointer; + +// $ExpectType boolean +brwoser.pointer; + +// $ExpectType boolean +brwoser.webkit; + +// $ExpectType boolean +brwoser.ie3d; + +// $ExpectType boolean +brwoser.webkit3d; + +// $ExpectType boolean +brwoser.gecko3d; + +// $ExpectType boolean +brwoser.opera3d; + +// $ExpectType boolean +brwoser.any3d; + +// $ExpectType boolean +brwoser.isCanvas; + +// $ExpectType boolean +brwoser.isSvg; + +// $ExpectType boolean +brwoser.isVML; + +// $ExpectType boolean +brwoser.isWorker; + +// $ExpectType boolean +brwoser.isWebsocket; + +// $ExpectType boolean +brwoser.isWebGL(); diff --git a/types/amap-js-api/test/convert-from.ts b/types/amap-js-api/test/convert-from.ts new file mode 100644 index 0000000000..8cb9b8502c --- /dev/null +++ b/types/amap-js-api/test/convert-from.ts @@ -0,0 +1,25 @@ +import { + lnglat, + lnglatTuple +} from './preset'; + +declare const convertType: 'baidu' | 'mapbar' | 'gps' | null; +// $ExpectType void +AMap.convertFrom(lnglat, convertType, (status, result) => { + const temp: 'complete' | 'error' = status; + if (typeof result !== 'string') { + // $ExpectType string + result.info; + // $ExpectType LngLat[] + result.locations; + } else { + // $ExpectType string + result; + } +}); +// $ExpectType void +AMap.convertFrom([lnglat], null, () => { }); +// $ExpectType void +AMap.convertFrom(lnglatTuple, null, () => { }); +// $ExpectType void +AMap.convertFrom([lnglatTuple], null, () => { }); diff --git a/types/amap-js-api/test/dom-util.ts b/types/amap-js-api/test/dom-util.ts new file mode 100644 index 0000000000..6cb0bce511 --- /dev/null +++ b/types/amap-js-api/test/dom-util.ts @@ -0,0 +1,47 @@ +import { div } from './preset'; + +const util = AMap.DomUtil; + +// $ExpectType Size +util.getViewport(div); + +// $ExpectType Pixel +util.getViewportOffset(div); + +// $ExpectType HTMLDivElement +util.create('div'); +// $ExpectType HTMLAnchorElement +util.create('a'); +// $ExpectType HTMLDivElement +util.create('div', div); +// $ExpectType HTMLDivElement +util.create('div', div, 'className'); + +// $ExpectType void +util.setClass(div); +// $ExpectType void +util.setClass(div, 'className'); + +// $ExpectType boolean +util.hasClass(div, 'className'); + +// $ExpectType void +util.removeClass(div, 'className'); + +// $ExpectType void +util.setOpacity(div, 1); + +// $ExpectType void +util.rotate(div, 10); +// $ExpectType void +util.rotate(div, 10, { x: 10, y: 10 }); + +const util2: typeof AMap.DomUtil = util.setCss(div, { textAlign: 'left' }); +// $ExpectError +util.setCss(div, { textAlign: 10 }); + +// $ExpectType void +util.empty(div); + +// $ExpectType void +util.remove(div); diff --git a/types/amap-js-api/test/event.ts b/types/amap-js-api/test/event.ts new file mode 100644 index 0000000000..8678045158 --- /dev/null +++ b/types/amap-js-api/test/event.ts @@ -0,0 +1,75 @@ +import { + lnglat, + pixel, + map +} from './preset'; +declare var div: HTMLDivElement; +declare var input: HTMLInputElement; + +// $ExpectType Map +map.on('hotspotclick', (event: AMap.Map.EventMap['hotspotclick']) => { + // $ExpectType "hotspotclick" + event.type; + // $ExpectType string + event.id; + // $ExpectType LngLat + event.lnglat; +}); + +// $ExpectType EventListener<0> +AMap.event.addDomListener(div, 'click', event => { + // $ExpectType number + event.clientX; +}); + +// $ExpectType EventListener<1> +AMap.event.addListener(map, 'hotspotclick', function (event: AMap.Map.EventMap['hotspotclick']) { + // $ExpectType "hotspotclick" + event.type; + // $ExpectType string + event.id; + // $ExpectType LngLat + event.lnglat; + // $ExpectType number + this.test; +}, { test: 1 }); +AMap.event.addListener(map, 'click', (event: AMap.Map.EventMap['click']) => { + // $ExpectType "click" + event.type; + // $ExpectType LngLat + event.lnglat; + // $ExpectType Map + event.target; +}); + +// $ExpectType EventListener<1> +AMap.event.addListenerOnce(map, 'hotspotclick', function (event: AMap.Map.EventMap['hotspotclick']) { + // $ExpectType "hotspotclick" + event.type; + // $ExpectType string + event.id; + // $ExpectType LngLat + event.lnglat; + // $ExpectType number + this.test; +}, { test: 1 }); + +declare const eventListener: AMap.event.EventListener<0>; +// $ExpectType void +AMap.event.removeListener(eventListener); + +// $ExpectType void +AMap.event.trigger(map, 'click', { + lnglat, + pixel, + target: map +}); +// $ExpectType void +AMap.event.trigger(map, 'hotspotclick', { + lnglat, + name: 'name', + id: 'id', + isIndoorPOI: true +}); +// $ExpectType void +AMap.event.trigger(map, 'complete'); diff --git a/types/amap-js-api/test/geometry-util.ts b/types/amap-js-api/test/geometry-util.ts new file mode 100644 index 0000000000..98a8263fb0 --- /dev/null +++ b/types/amap-js-api/test/geometry-util.ts @@ -0,0 +1,158 @@ +import { + lnglat as point, + lnglatTuple as pointTuple +} from './preset'; + +const line = [point]; +const lineTuple = [pointTuple]; +const ring = [point]; +const ringTuple = [pointTuple]; +const polygon = [ring]; +const polygonTuple = [ringTuple]; +const util = AMap.GeometryUtil; + +// $ExpectType number +util.distance(point, point); +// $ExpectType number +util.distance(pointTuple, pointTuple); +// $ExpectType number +util.distance(point, line); +// $ExpectType number +util.distance(pointTuple, lineTuple); + +// $ExpectType number +util.ringArea(ring); +// $ExpectType number +util.ringArea(ringTuple); + +// $ExpectType boolean +util.isClockwise(ring); +// $ExpectType boolean +util.isClockwise(ringTuple); + +// $ExpectType number +util.distanceOfLine(line); +// $ExpectType number +util.distanceOfLine(lineTuple); + +// $ExpectType [number, number][] +util.ringRingClip(ring, ring); +// $ExpectType [number, number][] +util.ringRingClip(ringTuple, ringTuple); + +// $ExpectType boolean +util.doesRingRingIntersect(ring, ring); +// $ExpectType boolean +util.doesRingRingIntersect(ringTuple, ringTuple); + +// $ExpectType boolean +util.doesLineRingIntersect(line, ring); +// $ExpectType boolean +util.doesLineRingIntersect(lineTuple, ringTuple); + +// $ExpectType boolean +util.doesLineLineIntersect(line, line); +// $ExpectType boolean +util.doesLineLineIntersect(lineTuple, lineTuple); + +// $ExpectType boolean +util.doesSegmentPolygonIntersect(point, point, polygon); +// $ExpectType boolean +util.doesSegmentPolygonIntersect(pointTuple, pointTuple, polygonTuple); + +// $ExpectType boolean +util.doesSegmentRingIntersect(point, point, ring); +// $ExpectType boolean +util.doesSegmentRingIntersect(pointTuple, pointTuple, ringTuple); + +// $ExpectType boolean +util.doesSegmentLineIntersect(point, point, line); +// $ExpectType boolean +util.doesSegmentLineIntersect(pointTuple, pointTuple, lineTuple); + +// $ExpectType boolean +util.doesSegmentsIntersect(point, point, point, point); +// $ExpectType boolean +util.doesSegmentsIntersect(pointTuple, pointTuple, pointTuple, pointTuple); + +// $ExpectType boolean +util.isPointInRing(point, ring); +// $ExpectType boolean +util.isPointInRing(pointTuple, ringTuple); + +// $ExpectType boolean +util.isRingInRing(ring, ring); +// $ExpectType boolean +util.isRingInRing(ringTuple, ringTuple); + +// $ExpectType boolean +util.isPointInPolygon(point, polygon); +// $ExpectType boolean +util.isPointInPolygon(pointTuple, polygonTuple); + +// $ExpectType [number, number][] +util.makesureClockwise(lineTuple); + +// $ExpectType [number, number][] +util.makesureAntiClockwise(lineTuple); + +// $ExpectType [number, number] +util.closestOnSegment(point, point, point); +// $ExpectType [number, number] +util.closestOnSegment(pointTuple, pointTuple, pointTuple); + +// $ExpectType [number, number] +util.closestOnSegment(point, point, point); +// $ExpectType [number, number] +util.closestOnSegment(pointTuple, pointTuple, pointTuple); + +// $ExpectType [number, number] +util.closestOnLine(point, line); +// $ExpectType [number, number] +util.closestOnLine(pointTuple, lineTuple); + +// $ExpectType number +util.distanceToSegment(point, point, point); +// $ExpectType number +util.distanceToSegment(pointTuple, pointTuple, pointTuple); + +// $ExpectType number +util.distanceToLine(point, line); +// $ExpectType number +util.distanceToLine(pointTuple, lineTuple); + +// $ExpectType boolean +util.isPointOnSegment(point, point, point); +// $ExpectType boolean +util.isPointOnSegment(point, point, point, 1); +// $ExpectType boolean +util.isPointOnSegment(pointTuple, pointTuple, pointTuple); +// $ExpectType boolean +util.isPointOnSegment(pointTuple, pointTuple, pointTuple, 1); + +// $ExpectType boolean +util.isPointOnLine(point, line); +// $ExpectType boolean +util.isPointOnLine(point, line, 1); +// $ExpectType boolean +util.isPointOnLine(pointTuple, lineTuple); +// $ExpectType boolean +util.isPointOnLine(pointTuple, lineTuple, 1); + +// $ExpectType boolean +util.isPointOnRing(point, ring); +// $ExpectType boolean +util.isPointOnRing(point, ring, 1); +// $ExpectType boolean +util.isPointOnRing(pointTuple, ringTuple); +// $ExpectType boolean +util.isPointOnRing(pointTuple, ringTuple, 1); + +// $ExpectType boolean +util.isPointOnPolygon(point, polygon); +// $ExpectType boolean +util.isPointOnPolygon(point, polygon, 1); +// $ExpectType boolean +util.isPointOnPolygon(pointTuple, polygonTuple); +// $ExpectType boolean +util.isPointOnPolygon(pointTuple, polygonTuple, 1); diff --git a/types/amap-js-api/test/layer/buildings.ts b/types/amap-js-api/test/layer/buildings.ts new file mode 100644 index 0000000000..209b3c490b --- /dev/null +++ b/types/amap-js-api/test/layer/buildings.ts @@ -0,0 +1,40 @@ +declare var map: AMap.Map; +declare var lnglat: AMap.LngLat; + +// $ExpectType Buildings +var buildings = new AMap.Buildings(); +// $ExpectType Buildings +new AMap.Buildings(); +// $ExpectType Buildings +new AMap.Buildings({ + zooms: [1, 18], + opacity: 0.8, + heightFactor: 1, + visible: true, + zIndex: 10, + map +}); + +buildings.setStyle({ + hideWithoutStyle: false, + areas: [ + { + visible: true, + rejectTexture: true, + color1: 'ffffff00', + color2: 'ffffcc00', + path: [[1, 2]] + }, + { + visible: true, + rejectTexture: true, + color1: 'ffffff00', + color2: 'ffffcc00', + path: [lnglat] + }, + { + color1: 'ff99ff00', + path: [lnglat] + }, + ] +}); diff --git a/types/amap-js-api/test/layer/canvasLayer.ts b/types/amap-js-api/test/layer/canvasLayer.ts new file mode 100644 index 0000000000..577d032b2c --- /dev/null +++ b/types/amap-js-api/test/layer/canvasLayer.ts @@ -0,0 +1,53 @@ +import { + map, + bounds +} from '../preset'; + +declare const canvas: HTMLCanvasElement; + +// $ExpectType CanvasLayer +new AMap.CanvasLayer({ + map, + bounds, + visible: true, + zooms: [1, 2], + opacity: 1 +}); + +// $ExpectType CanvasLayer +new AMap.CanvasLayer(); +// $ExpectType CanvasLayer +new AMap.CanvasLayer({}); +// $ExpectType CanvasLayer +const canvasLayer = new AMap.CanvasLayer({ + bounds +}); + +// $ExpectType void +canvasLayer.setMap(null); +// $ExpectType void +canvasLayer.setMap(map); + +// $ExpectType Map | null | undefined +canvasLayer.getMap(); + +// $ExpectType void +canvasLayer.show(); + +// $ExpectType void +canvasLayer.hide(); + +// $ExpectType number +canvasLayer.getzIndex(); + +// $ExpectType void +canvasLayer.setzIndex(10); + +// $ExpectType HTMLCanvasElement | null +canvasLayer.getElement(); + +// $ExpectType void +canvasLayer.setCanvas(canvas); + +// $ExpectType HTMLCanvasElement | undefined +canvasLayer.getCanvas(); diff --git a/types/amap-js-api/test/layer/flexible.ts b/types/amap-js-api/test/layer/flexible.ts new file mode 100644 index 0000000000..5a0e3f7aa7 --- /dev/null +++ b/types/amap-js-api/test/layer/flexible.ts @@ -0,0 +1,54 @@ +import { + map +} from '../preset'; + +const img = document.createElement('img'); +const canvas = document.createElement('canvas'); + +// $ExpectType Flexible +new AMap.TileLayer.Flexible(); +// $ExpectType Flexible +new AMap.TileLayer.Flexible({}); +// $ExpectType Flexible +const flexible = new AMap.TileLayer.Flexible({ + createTile(x, y, z, success, fail) { + // $ExpectType number + x; + // $ExpectType number + y; + // $ExpectType number + z; + // $ExpectType void + success(img); + // $ExpectType void + success(canvas); + // $ExpectType void + fail(); + }, + cacheSize: 10, + opacity: 1, + visible: true, + map, + zIndex: 1, + zooms: [1, 2] +}); + +// $ExpectType void +flexible.setMap(null); +// $ExpectType void +flexible.setMap(map); + +// $ExpectType Map | null | undefined +flexible.getMap(); + +// $ExpectType void +flexible.show(); + +// $ExpectType void +flexible.hide(); + +// $ExpectType void +flexible.setzIndex(10); + +// $ExpectType number +flexible.getzIndex(); diff --git a/types/amap-js-api/test/layer/imageLayer.ts b/types/amap-js-api/test/layer/imageLayer.ts new file mode 100644 index 0000000000..06b9fc076e --- /dev/null +++ b/types/amap-js-api/test/layer/imageLayer.ts @@ -0,0 +1,51 @@ +import { + map, + bounds +} from '../preset'; + +// $ExpectType ImageLayer +new AMap.ImageLayer({ + map, + bounds, + visible: true, + zooms: [1, 2], + opacity: 1 +}); + +// $ExpectType ImageLayer +new AMap.ImageLayer(); +// $ExpectType ImageLayer +new AMap.ImageLayer({}); +// $ExpectType ImageLayer +const imageLayer = new AMap.ImageLayer({ + bounds +}); + +// $ExpectType void +imageLayer.setMap(null); +// $ExpectType void +imageLayer.setMap(map); + +// $ExpectType Map | null | undefined +imageLayer.getMap(); + +// $ExpectType void +imageLayer.show(); + +// $ExpectType void +imageLayer.hide(); + +// $ExpectType number +imageLayer.getzIndex(); + +// $ExpectType void +imageLayer.setzIndex(10); + +// $ExpectType HTMLImageElement | null +imageLayer.getElement(); + +// $ExpectType void +imageLayer.setImageUrl('url'); + +// $ExpectType string | undefined +imageLayer.getImageUrl(); diff --git a/types/amap-js-api/test/layer/layer.ts b/types/amap-js-api/test/layer/layer.ts new file mode 100644 index 0000000000..921c90e52d --- /dev/null +++ b/types/amap-js-api/test/layer/layer.ts @@ -0,0 +1,34 @@ +declare var layer: AMap.Layer; +declare var map: AMap.Map; + +// $ExpectError +new AMap.Layer(); + +// $ExpectType HTMLDivElement | undefined +layer.getContainer(); + +// $ExpectType [number, number] +layer.getZooms(); + +// $ExpectType void +layer.setOpacity(1); + +// $ExpectType number +layer.getOpacity(); + +// $ExpectType void +layer.show(); + +// $ExpectType void +layer.hide(); + +// $ExpectType void +layer.setMap(); +// $ExpectType void +layer.setMap(map); + +// $ExpectType void +layer.setzIndex(1); + +// $ExpectType number +layer.getzIndex(); diff --git a/types/amap-js-api/test/layer/layerGroup.ts b/types/amap-js-api/test/layer/layerGroup.ts new file mode 100644 index 0000000000..bcad7d6f50 --- /dev/null +++ b/types/amap-js-api/test/layer/layerGroup.ts @@ -0,0 +1,115 @@ +declare var map: AMap.Map; +declare var tileLayer: AMap.TileLayer; +declare var massMarksLayer: AMap.MassMarks; +declare var layer: AMap.Layer; + +// $ExpectError +new AMap.LayerGroup(); + +// $ExpectType LayerGroup +new AMap.LayerGroup(tileLayer); +// $ExpectType LayerGroup +new AMap.LayerGroup([tileLayer]); + +declare var layerGruop: AMap.LayerGroup; + +// $ExpectType LayerGroup +layerGruop.addLayer(tileLayer); +// $ExpectType LayerGroup +layerGruop.addLayer([tileLayer]); +// $ExpectError +layerGruop.addLayer(massMarksLayer); + +// $ExpectType TileLayer[] +layerGruop.getLayers(); + +// $ExpectType TileLayer | null +layerGruop.getLayer(function (item, index, list) { + // $ExpectType TileLayer + item; + // $ExpectType number + index; + // $ExpectType TileLayer[] + list; + // $ExpectType null + this; + + return true; +}); + +layerGruop.hasLayer(function (item, index, list) { + // $ExpectType TileLayer + item; + // $ExpectType number + index; + // $ExpectType TileLayer[] + list; + // $ExpectType null + this; + + return true; +}); +layerGruop.hasLayer(tileLayer); + +// $ExpectType LayerGroup +layerGruop.removeLayer(tileLayer); +// $ExpectType LayerGroup +layerGruop.removeLayer([tileLayer]); + +// $ExpectType LayerGroup +layerGruop.clearLayers(); + +layerGruop.eachLayer(function (item, index, list) { + // $ExpectType TileLayer + item; + // $ExpectType number + index; + // $ExpectType TileLayer[] + list; + // $ExpectType TileLayer + this; +}); +layerGruop.eachLayer(function (item, index, list) { + // $ExpectType TileLayer + item; + // $ExpectType number + index; + // $ExpectType TileLayer[] + list; + // $ExpectType number + this.test; +}, { test: 1 }); + +// $ExpectType LayerGroup +layerGruop.setMap(map); + +// $ExpectType LayerGroup +layerGruop.hide(); + +// $ExpectType LayerGroup +layerGruop.show(); + +// $ExpectType LayerGroup +layerGruop.reload(); + +// $ExpectType LayerGroup +layerGruop.setOptions({}); + +// $ExpectType LayerGroup +layerGruop.setOptions({ + tileSize: 256 +}); +// layerGruop.setOptions({ +// // $ExpectError +// interval: 1 +// }); + +declare var layerGroup2: AMap.LayerGroup; + +layerGroup2.addLayer(tileLayer); + +layerGroup2.addLayer(massMarksLayer); + +layerGroup2.setOptions({ + test: 1 +}); diff --git a/types/amap-js-api/test/layer/massMarks.ts b/types/amap-js-api/test/layer/massMarks.ts new file mode 100644 index 0000000000..5f4bfbf455 --- /dev/null +++ b/types/amap-js-api/test/layer/massMarks.ts @@ -0,0 +1,83 @@ +declare var pixel: AMap.Pixel; +declare var size: AMap.Size; +declare var lnglat: AMap.LngLat; +var massMarksStyle1 = { + anchor: pixel, + url: '', + size, + rotation: 1 +}; +var massMarksStyle2 = { + anchor: pixel, + url: '', + size +}; +var massMarksData1 = { + lnglat +}; + +interface CustomData extends AMap.MassMarks.Data { + name: string; + id: string; +} +var massMarksCustomData: CustomData = { + lnglat: [1, 2], + style: 1, + name: '', + id: '' +}; + +// $ExpectError +new AMap.MassMarks(); +// $ExpectError +new AMap.MassMarks([], {}); + +new AMap.MassMarks([], { + style: [massMarksStyle1, massMarksStyle2] +}); +new AMap.MassMarks([massMarksData1], { + style: [massMarksStyle1, massMarksStyle2] +}); + +// $ExpectType MassMarks +var massMarks = new AMap.MassMarks([massMarksCustomData], { + style: [massMarksStyle1, massMarksStyle2] +}); + +// $ExpectType void +massMarks.setStyle(massMarksStyle1); +// $ExpectType void +massMarks.setStyle([massMarksStyle1]); + +// $ExpectType Style | Style[] +massMarks.getStyle(); + +// $ExpectType void +massMarks.setData(''); + +// $ExpectError +massMarks.setData(massMarksData1); +// $ExpectError +massMarks.setData(massMarksCustomData); + +var _customData = massMarks.getData()[0]; +// $ExpectType string +_customData.name; +// $ExpectType string +_customData.id; +// $ExpectType LngLat +_customData.lnglat; + +// $ExpectType void +massMarks.clear(); + +massMarks.on('click', (event: AMap.MassMarks.EventMap['click']) => { + // $ExpectType "click" + event.type; + + // $ExpectType CustomData + event.data; + + // $ExpectType MassMarks + event.target; +}); diff --git a/types/amap-js-api/test/layer/tileLayer.ts b/types/amap-js-api/test/layer/tileLayer.ts new file mode 100644 index 0000000000..7e4e2dc2e4 --- /dev/null +++ b/types/amap-js-api/test/layer/tileLayer.ts @@ -0,0 +1,60 @@ +declare var map: AMap.Map; + +// $ExpectType TileLayer +var tileLayer = new AMap.TileLayer(); + +// $ExpectType TileLayer +new AMap.TileLayer({}); + +// $ExpectType TileLayer +new AMap.TileLayer({ + map, + tileSize: 256, + tileUrl: '', + errorUrl: '', + getTileUrl: (x, y, z) => '', + zIndex: 1, + opacity: 0.1, + zooms: [3, 18], + detectRetina: true +}); + +// $ExpectType string[] +tileLayer.getTiles(); + +// $ExpectType void +tileLayer.reload(); + +// $ExpectType void +tileLayer.setTileUrl(''); +// $ExpectType void +tileLayer.setTileUrl((x, y, level) => { + // $ExpectType number + x; + // $ExpectType number + y; + // $ExpectType number + level; + return ''; +}); + +// Traffic + +// $ExpectType Traffic +let trafficLayer = new AMap.TileLayer.Traffic(); +// $ExpectType Traffic +new AMap.TileLayer.Traffic({}); +// $ExpectType Traffic +new AMap.TileLayer.Traffic({ + autoRefresh: true, + interval: 180 +}); + +// $ExpectType TileLayer +tileLayer.on('complete', () => { }); + +tileLayer.off('complete', () => { }); + +tileLayer.emit('complete'); + +trafficLayer.on('complete', () => { }); diff --git a/types/amap-js-api/test/layer/videoLayer.ts b/types/amap-js-api/test/layer/videoLayer.ts new file mode 100644 index 0000000000..e34718193c --- /dev/null +++ b/types/amap-js-api/test/layer/videoLayer.ts @@ -0,0 +1,51 @@ +import { + map, + bounds +} from '../preset'; + +// $ExpectType VideoLayer +new AMap.VideoLayer({ + map, + bounds, + visible: true, + zooms: [1, 2], + opacity: 1 +}); + +// $ExpectType VideoLayer +new AMap.VideoLayer(); +// $ExpectType VideoLayer +new AMap.VideoLayer({}); +// $ExpectType VideoLayer +const videoLayer = new AMap.VideoLayer({ + bounds +}); + +// $ExpectType void +videoLayer.setMap(null); +// $ExpectType void +videoLayer.setMap(map); + +// $ExpectType Map | null | undefined +videoLayer.getMap(); + +// $ExpectType void +videoLayer.show(); + +// $ExpectType void +videoLayer.hide(); + +// $ExpectType number +videoLayer.getzIndex(); + +// $ExpectType void +videoLayer.setzIndex(10); + +// $ExpectType HTMLVideoElement | null +videoLayer.getElement(); + +// $ExpectType void +videoLayer.setVideoUrl('url'); + +// $ExpectType string | string[] | undefined +videoLayer.getVideoUrl(); diff --git a/types/amap-js-api/test/layer/wms.ts b/types/amap-js-api/test/layer/wms.ts new file mode 100644 index 0000000000..255affa216 --- /dev/null +++ b/types/amap-js-api/test/layer/wms.ts @@ -0,0 +1,89 @@ +import { + map +} from '../preset'; + +// $ExpectType WMS +new AMap.TileLayer.WMS({ + url: 'url', + params: {} +}); +// $ExpectType WMS +const wms = new AMap.TileLayer.WMS({ + url: 'url', + blend: true, + params: { + VERSION: 'version', + LAYERS: 'layers', + STYLES: 'styles', + FORMAT: 'format', + TRANSPARENT: 'TRUE', + BGCOLOR: '#000', + EXCEPTIONS: 'exceptions', + TIME: 'time', + ELEVATION: 'elevation' + }, + zooms: [1, 2], + tileSize: 256, + opacity: 1, + zIndex: 10, + visible: true +}); + +// $ExpectType void +wms.setMap(map); +// $ExpectType void +wms.setMap(null); + +// $ExpectType Map | null | undefined +wms.getMap(); + +// $ExpectType void +wms.show(); + +// $ExpectType void +wms.hide(); + +// $ExpectType void +wms.setzIndex(10); + +// $ExpectType number +wms.getzIndex(); + +// $ExpectType void +wms.setUrl('url'); + +// $ExpectType string +wms.getUrl(); + +// $ExpectType void +wms.setParams({ + VERSION: 'version', + LAYERS: 'layers', + STYLES: 'styles', + FORMAT: 'format', + TRANSPARENT: 'TRUE', + BGCOLOR: '#000', + EXCEPTIONS: 'exceptions', + TIME: 'time', + ELEVATION: 'elevation' +}); + +const params = wms.getParams(); +// $ExpectType string | undefined +params.VERSION; +// $ExpectType string | undefined +params.LAYERS; +// $ExpectType string | undefined +params.STYLES; +// $ExpectType string | undefined +params.FORMAT; +// $ExpectType "TRUE" | "FALSE" | undefined +params.TRANSPARENT; +// $ExpectType string | undefined +params.BGCOLOR; +// $ExpectType string | undefined +params.EXCEPTIONS; +// $ExpectType string | undefined +params.TIME; +// $ExpectType string | undefined +params.ELEVATION; diff --git a/types/amap-js-api/test/layer/wmts.ts b/types/amap-js-api/test/layer/wmts.ts new file mode 100644 index 0000000000..bc167c1189 --- /dev/null +++ b/types/amap-js-api/test/layer/wmts.ts @@ -0,0 +1,69 @@ +import { + map +} from '../preset'; + +// $ExpectType WMTS +new AMap.TileLayer.WMTS({ + url: 'url', + params: {} +}); +// $ExpectType WMTS +const wmts = new AMap.TileLayer.WMTS({ + url: 'url', + blend: true, + tileSize: 256, + zooms: [1, 2], + opacity: 1, + zIndex: 10, + visible: true, + params: { + Version: 'version', + Layer: 'layers', + Style: 'style', + Format: 'format' + } +}); + +// $ExpectType void +wmts.setMap(map); +// $ExpectType void +wmts.setMap(null); + +// $ExpectType Map | null | undefined +wmts.getMap(); + +// $ExpectType void +wmts.show(); + +// $ExpectType void +wmts.hide(); + +// $ExpectType void +wmts.setzIndex(10); + +// $ExpectType number +wmts.getzIndex(); + +// $ExpectType void +wmts.setUrl('url'); + +// $ExpectType string +wmts.getUrl(); + +// $ExpectType void +wmts.setParams({ + Version: 'version', + Layer: 'layers', + Style: 'style', + Format: 'format' +}); + +const params = wmts.getParams(); +// $ExpectType string | undefined +params.Version; +// $ExpectType string | undefined +params.Layer; +// $ExpectType string | undefined +params.Style; +// $ExpectType string | undefined +params.Format; diff --git a/types/amap-js-api/test/lnglat.ts b/types/amap-js-api/test/lnglat.ts new file mode 100644 index 0000000000..92057953ee --- /dev/null +++ b/types/amap-js-api/test/lnglat.ts @@ -0,0 +1,48 @@ +import { + lnglat +} from './preset'; + +// $ExpectType LngLat +new AMap.LngLat(114, 22); +// $ExpectType LngLat +new AMap.LngLat(113, 21); + +// $ExpectType LngLat +lnglat.offset(1, 2); + +// $ExpectType number +lnglat.distance(lnglat); +// $ExpectType number +lnglat.distance([lnglat]); + +// $ExpectType number +lnglat.getLng(); + +// $ExpectType number +lnglat.getLat(); + +// $ExpectType boolean +lnglat.equals(lnglat); + +// $ExpectType string +lnglat.toString(); + +// $ExpectType LngLat +lnglat.add(lnglat); +// $ExpectType LngLat +lnglat.add(lnglat, true); + +// $ExpectType LngLat +lnglat.subtract(lnglat); +// $ExpectType LngLat +lnglat.subtract(lnglat, true); + +// $ExpectType LngLat +lnglat.divideBy(1); +// $ExpectType LngLat +lnglat.divideBy(1, true); + +// $ExpectType LngLat +lnglat.multiplyBy(1); +// $ExpectType LngLat +lnglat.multiplyBy(1, true); diff --git a/types/amap-js-api/test/map.ts b/types/amap-js-api/test/map.ts new file mode 100644 index 0000000000..6f2b027e60 --- /dev/null +++ b/types/amap-js-api/test/map.ts @@ -0,0 +1,338 @@ +import { + lnglat, + bounds, + lnglatTuple, + pixel +} from './preset'; + +declare const container: HTMLDivElement; +declare const tileLayer: AMap.TileLayer; + +// declare var indoorMap: AMap.IndoorMap + +// $ExpectType Map +new AMap.Map('map'); +// $ExpectType Map +new AMap.Map(container); + +// $ExpectType Map +new AMap.Map(container, {}); + +// $ExpectType Map +const map = new AMap.Map(container, { + layers: [tileLayer], + zoom: 15, + center: [1, 2], + labelzIndex: 110, + zooms: [5, 15], + lang: 'zh_cn', + defaultCursor: 'default', + crs: 'EPSG4326', + animateEnable: true, + isHotspot: false, + defaultLayer: tileLayer, + rotateEnable: true, + resizeEnable: true, + showIndoorMap: true, + // indoorMap, // TODO + expandZoomRange: true, + dragEnable: true, + zoomEnable: true, + doubleClickZoom: true, + keyboardEnable: true, + jogEnable: true, + scrollWheel: true, + touchZoom: true, + mapStyle: '', + features: ['road'], + showBuildingBlock: true, + skyColor: '#fff', + preloadMode: true, + mask: [[1, 2], [2, 3], [3, 4]] +}); + +// $ExpectType number +map.getZoom(); + +// $ExpectType Layer[] +map.getLayers(); + +// $ExpectType LngLat +map.getCenter(); + +// $ExpectType HTMLElement | null +map.getContainer(); + +map.getCity(city => { + // $ExpectType string + city.city; + // $ExpectType string + city.citycode; + // $ExpectType string + city.district; + // $ExpectType string | never[] + city.province; +}); + +// $ExpectType Bounds +map.getBounds(); + +// $ExpectType number +map.getLabelzIndex(); + +// $ExpectType Lang +map.getLang(); + +// $ExpectType Size +map.getSize(); + +// $ExpectType number +map.getRotation(); + +// $ExpectType Status +const mapStatus = map.getStatus(); +// $ExpectType boolean +mapStatus.animateEnable; +// $ExpectType boolean +mapStatus.doubleClickZoom; +// $ExpectType boolean +mapStatus.dragEnable; +// $ExpectType boolean +mapStatus.isHotspot; +// $ExpectType boolean +mapStatus.jogEnable; +// $ExpectType boolean +mapStatus.keyboardEnable; +// $ExpectType boolean +mapStatus.pitchEnable; +// $ExpectType boolean +mapStatus.resizeEnable; +// $ExpectType boolean +mapStatus.rotateEnable; +// $ExpectType boolean +mapStatus.scrollWheel; +// $ExpectType boolean +mapStatus.touchZoom; +// $ExpectType boolean +mapStatus.zoomEnable; + +// $ExpectType string +map.getDefaultCursor(); + +// $ExpectType number +map.getResolution(); + +// $ExpectType number +map.getScale(); +// $ExpectType number +map.getScale(1); + +// $ExpectType void +map.setZoom(1); + +// $ExpectType void +map.setLabelzIndex(1); + +// $ExpectType void +map.setLayers([tileLayer]); + +// $ExpectType void +map.setCenter(lnglat); +// $ExpectType void +map.setCenter([1, 2]); + +// $ExpectType void +map.setZoomAndCenter(13, lnglat); +// $ExpectType void +map.setZoomAndCenter(13, [1, 2]); + +// $ExpectType void +map.setCity('city', (coord, zoom) => { + // $ExpectType string + coord[0]; + // $ExpectType string + coord[1]; + // $ExpectType number + zoom; +}); + +// $ExpectType Bounds +map.setBounds(bounds); + +// $ExpectType void +map.setLimitBounds(bounds); + +// $ExpectType void +map.clearLimitBounds(); + +// $ExpectType void +map.setLang('zh_cn'); + +// $ExpectType void +map.setRotation(1); + +// $ExpectType void +map.setStatus({}); +// $ExpectType void +map.setStatus({ + animateEnable: true, + doubleClickZoom: true, + dragEnable: true, + isHotspot: true, + jogEnable: true, + keyboardEnable: true, + pitchEnable: false, + resizeEnable: false, + rotateEnable: false, + scrollWheel: true, + touchZoom: true, + zoomEnable: true +}); + +// $ExpectType void +map.setDefaultCursor('default'); + +// $ExpectType void +map.zoomIn(); + +// $ExpectType void +map.zoomOut(); + +// $ExpectType void +map.panTo([1, 2]); +// $ExpectType void +map.panTo(lnglat); + +// $ExpectType void +map.panBy(1, 2); + +// $ExpectType void +map.clearMap(); + +// $ExpectType Map +map.plugin('plugin name', () => { }); +// $ExpectType Map +map.plugin(['plugin name'], () => { }); + +// $ExpectType void +map.clearInfoWindow(); + +// $ExpectType LngLat +map.pixelToLngLat(pixel); +// $ExpectType LngLat +map.pixelToLngLat(pixel, 1); + +// $ExpectType Pixel +map.lnglatToPixel(lnglat); +// $ExpectType Pixel +map.lnglatToPixel(lnglat, 1); + +// $ExpectType LngLat +map.containerToLngLat(pixel); + +// $ExpectType Pixel +map.lngLatToContainer(lnglat); +// $ExpectType Pixel +map.lnglatTocontainer(lnglat); + +// $ExpectType void +map.setMapStyle(''); +// $ExpectType string +map.getMapStyle(); + +// $ExpectType void +map.setFeatures('all'); +// $ExpectType void +map.setFeatures(['bg']); + +const feature: 'all' | 'bg' | 'point' | 'road' | 'building' | AMap.Map.Feature[] = map.getFeatures(); + +// $ExpectType void +map.setDefaultLayer(tileLayer); + +// $ExpectType void +map.setPitch(1); +// $ExpectType number +map.getPitch(); + +// $ExpectType ViewMode +map.getViewMode_(); + +// $ExpectType Pixel +map.lngLatToGeodeticCoord(lnglat); +// $ExpectType Pixel +map.lngLatToGeodeticCoord(lnglatTuple); + +// $ExpectType LngLat +map.geodeticCoordToLngLat(pixel); + +// $ExpectType void +map.destroy(); + +declare function dblClickHandler(this: AMap.Map, event: AMap.Map.EventMap['dblclick']): void; + +// $ExpectType Map +map.on('click', (event: AMap.Map.EventMap['click']) => { + // $ExpectType "click" + event.type; + // $ExpectType Pixel + event.pixel; + // $ExpectType LngLat + event.lnglat; + // $ExpectType Map + event.target; +}); +// $ExpectType Map +map.on('dblclick', dblClickHandler); +// $ExpectType Map +map.on('complete', (event: AMap.Map.EventMap['complete']) => { + // $ExpectType "complete" + event.type; + // $ExpectError + event.value; +}); +// $ExpectType Map +map.on('hotspotclick', (event: AMap.Map.EventMap['hotspotclick']) => { + // $ExpectType string + event.id; + // $ExpectType LngLat + event.lnglat; + // $ExpectType string + event.name; + // $ExpectType "hotspotclick" + event.type; +}); +// $ExpectType Map +map.on('custom', (event: AMap.Event<'custom', { test: string }>) => { + // $ExpectType "custom" + event.type; + // $ExpectType string + event.test; +}); + +// $ExpectType Map +map.off('dblclick', dblClickHandler); +// $ExpectType Map +map.off('click', 'mv'); + +// $ExpectType Map +map.emit('click', { + target: map, + lnglat, + pixel +}); + +map.emit('complete'); +// $ExpectType Map +map.emit('hotspotclick', { + lnglat, + name: '123', + id: '123', + isIndoorPOI: true +}); +// $ExpectType Map +map.emit('custom', { + test: 1 +}); +// $ExpectType Map +map.emit('custom', undefined); diff --git a/types/amap-js-api/test/overlay/bezierCurve.ts b/types/amap-js-api/test/overlay/bezierCurve.ts new file mode 100644 index 0000000000..abf0640fc9 --- /dev/null +++ b/types/amap-js-api/test/overlay/bezierCurve.ts @@ -0,0 +1,155 @@ +import { + map, + lnglat +} from '../preset'; + +interface ExtraData { + test: number; +} + +const path = [ + [1, 2, 3, 4], + [1, 2, 3], + [ + [1, 2, 3], + [1, 2] + ], + [1, 2] +]; + +// $ExpectError +new AMap.BezierCurve(); +// $ExpectError +new AMap.BezierCurve({}); +// $ExpectType BezierCurve +const bezierCurve = new AMap.BezierCurve({ + map, + path, + strokeColor: '#FF0000', + strokeOpacity: 0.6, + strokeWeight: 10, + strokeStyle: 'dashed', + strokeDasharray: [1, 5], + zIndex: 10, + bubble: false, + showDir: true, + cursor: 'pointer', + isOutline: true, + outlineColor: '#00FF00', + borderWeight: 2 +}); + +// $ExpectType void +bezierCurve.setPath(path); + +// $ExpectType void +bezierCurve.setPath(path); + +// $ExpectType void +bezierCurve.setOptions({}); +bezierCurve.setOptions({ + map, + path, + strokeColor: '#FF0000', + strokeOpacity: 0.6, + strokeWeight: 10, + strokeStyle: 'dashed', + strokeDasharray: [1, 5], + zIndex: 10, + bubble: false, + showDir: true, + cursor: 'pointer', + isOutline: true, + outlineColor: '#00FF00', + borderWeight: 2 +}); + +const options = bezierCurve.getOptions(); + +// $ExpectType number | undefined +options.borderWeight; +// $ExpectType boolean | undefined +options.bubble; +// $ExpectType boolean | undefined +options.clickable; +// $ExpectType string | undefined +options.dirColor; +// $ExpectType string | undefined +options.dirImg; +// $ExpectType {} | ExtraData | undefined +options.extData; +// $ExpectType boolean | undefined +options.geodesic; +// $ExpectType boolean | undefined +options.isOutline; +// $ExpectType "round" | "butt" | "square" | undefined +options.lineCap; +// $ExpectType "miter" | "round" | "bevel" | undefined +options.lineJoin; +// $ExpectType Map | undefined +options.map; +// $ExpectType string | undefined +options.outlineColor; +// $ExpectType (LngLat & { controlPoints: LngLat[]; })[] | undefined +options.path; +// $ExpectType boolean | undefined +options.showDir; +// $ExpectType string | undefined +options.strokeColor; +// $ExpectType number[] | undefined +options.strokeDasharray; +// $ExpectType number | undefined +options.strokeOpacity; +// $ExpectType "dashed" | "solid" | undefined +options.strokeStyle; +// $ExpectType number | undefined +options.strokeWeight; +// $ExpectType number | undefined +options.zIndex; + +// $ExpectType number +bezierCurve.getLength(); + +// $ExpectType Bounds | null +bezierCurve.getBounds(); + +// $ExpectType void +bezierCurve.show(); + +// $ExpectType void +bezierCurve.hide(); + +// $ExpectType void +bezierCurve.setMap(null); +bezierCurve.setMap(map); + +// $ExpectType void +bezierCurve.setExtData({ test: 1 }); +// $ExpectError +bezierCurve.setExtData({ test: '123' }); + +// $ExpectType {} | ExtraData +bezierCurve.getExtData(); + +bezierCurve.on('click', (event: AMap.BezierCurve.EventMap['click']) => { + // $ExpectType "click" + event.type; + // $ExpectType LngLat + event.lnglat; + // $ExpectType BezierCurve + event.target; +}); + +bezierCurve.on('show', (event: AMap.BezierCurve.EventMap['show']) => { + // $ExpectType "show" + event.type; + // $ExpectType BezierCurve + event.target; +}); + +bezierCurve.on('options', (event: AMap.BezierCurve.EventMap['options']) => { + // $ExpectType "options" + event.type; + // $ExpectError + event.target; +}); diff --git a/types/amap-js-api/test/overlay/circle.ts b/types/amap-js-api/test/overlay/circle.ts new file mode 100644 index 0000000000..28822b9ec9 --- /dev/null +++ b/types/amap-js-api/test/overlay/circle.ts @@ -0,0 +1,150 @@ +import { + map, + lnglat, + lnglatTuple +} from '../preset'; + +interface ExtraData { + test: number; +} + +// $ExpectType Circle +new AMap.Circle(); +new AMap.Circle({}); +// $ExpectType Circle +const circle = new AMap.Circle({ + map, + zIndex: 10, + center: lnglat, + bubble: true, + cursor: 'pointer', + radius: 1000, + strokeColor: '#FF0000', + strokeOpcity: 0.8, + strokeWeight: 3, + fillColor: '#00FF00', + fillOpacity: 0.5, + strokeStyle: 'dashed', + extData: { test: 1 }, + strokeDasharray: [2, 4] +}); + +// $ExpectType void +circle.setCenter(lnglat); +// $ExpectType void +circle.setCenter(lnglatTuple); + +// $ExpectType LngLat | undefined +circle.getCenter(); + +// $ExpectType Bounds | null +circle.getBounds(); + +// $ExpectType void +circle.setRadius(100); + +// $ExpectType number +circle.getRadius(); + +// $ExpectType void +circle.setOptions({}); +circle.setOptions({ + map, + zIndex: 10, + center: lnglat, + bubble: true, + cursor: 'pointer', + radius: 1000, + strokeColor: '#FF0000', + strokeOpcity: 0.8, + strokeWeight: 3, + fillColor: '#00FF00', + fillOpacity: 0.5, + strokeStyle: 'dashed', + extData: { test: 1 }, + strokeDasharray: [2, 4] +}); + +const options = circle.getOptions(); +// $ExpectType boolean | undefined +options.bubble; +// $ExpectType LngLat | undefined +options.center; +// $ExpectType boolean | undefined +options.clickable; +// $ExpectType {} | ExtraData | undefined +options.extData; +// $ExpectType string | undefined +options.fillColor; +// $ExpectType number | undefined +options.fillOpacity; +// $ExpectType "miter" | "round" | "bevel" | undefined +options.lineJoin; +// $ExpectType Map | undefined +options.map; +// $ExpectType LngLat[] | undefined +options.path; +// $ExpectType number | undefined +options.radius; +// $ExpectType string | undefined +options.strokeColor; +// $ExpectType number[] | undefined +options.strokeDasharray; +// $ExpectType number | undefined +options.strokeOpacity; +// $ExpectType "dashed" | "solid" | undefined +options.strokeStyle; +// $ExpectType number | undefined +options.strokeWeight; +// $ExpectType string | undefined +options.texture; +// $ExpectType number | undefined +options.zIndex; + +// $ExpectType Bounds | null +circle.getBounds(); + +// $ExpectType void +circle.hide(); + +// $ExpectType void +circle.show(); + +// $ExpectType void +circle.setMap(null); +// $ExpectType void +circle.setMap(map); + +// $ExpectType void +circle.setExtData({ test: 2 }); +// $ExpectError +circle.setExtData({ test: '1' }); + +// $ExpectType {} | ExtraData +circle.getExtData(); + +// $ExpectType boolean +circle.contains(lnglat); +// $ExpectType boolean +circle.contains(lnglatTuple); + +circle.on('click', (event: AMap.Circle.EventMap['click']) => { + // $ExpectType "click" + event.type; + // $ExpectType Circle + event.target; +}); + +circle.on('setCenter', (event: AMap.Circle.EventMap['setCenter']) => { + // $ExpectType "setCenter" + event.type; + // $ExpectError + event.target; +}); + +circle.on('change', (event: AMap.Circle.EventMap['change']) => { + // $ExpectType "change" + event.type; + // $ExpectType Circle + event.target; +}); diff --git a/types/amap-js-api/test/overlay/contextMenu.ts b/types/amap-js-api/test/overlay/contextMenu.ts new file mode 100644 index 0000000000..5c7173d26b --- /dev/null +++ b/types/amap-js-api/test/overlay/contextMenu.ts @@ -0,0 +1,48 @@ +import { + map, + lnglat, + lnglatTuple +} from '../preset'; + +interface ExtraData { + test: number; +} +// $ExpectType ContextMenu +new AMap.ContextMenu(); +// $ExpectType ContextMenu +new AMap.ContextMenu({}); +// $ExpectType ContextMenu +const contextMenu = new AMap.ContextMenu({ + content: '
content
', +}); + +// $ExpectType void +contextMenu.addItem('item', function () { + // $ExpectType HTMLLIElement + this; +}); +// $ExpectType void +contextMenu.addItem('item', () => { }, 1); + +// $ExpectType void +contextMenu.removeItem('item', () => {}); + +// $ExpectType void +contextMenu.open(map, lnglatTuple); +// $ExpectType void +contextMenu.open(map, lnglat); + +// $ExpectType void +contextMenu.close(); + +contextMenu.on('items', (event: AMap.ContextMenu.EventMap['items']) => { + // $ExpectType "items" + event.type; +}); + +contextMenu.on('open', (event: AMap.ContextMenu.EventMap['open']) => { + // $ExpectType "open" + event.type; + // $ExpectType ContextMenu + event.target; +}); diff --git a/types/amap-js-api/test/overlay/ellipse.ts b/types/amap-js-api/test/overlay/ellipse.ts new file mode 100644 index 0000000000..c5205d9915 --- /dev/null +++ b/types/amap-js-api/test/overlay/ellipse.ts @@ -0,0 +1,117 @@ +import { + map, + lnglat, + lnglatTuple +} from '../preset'; + +interface ExtraData { + test: number; +} +// $ExpectType Ellipse +new AMap.Ellipse(); +// $ExpectType Ellipse +new AMap.Ellipse({}); +// $ExpectType Ellipse +const ellipse = new AMap.Ellipse({ + map, + zIndex: 10, + center: lnglat, + radius: [10000, 15000], + bubble: false, + cursor: 'pointer', + strokeColor: '#FF0000', + strokeOpacity: 0.8, + strokeWeight: 2, + fillColor: '#0000FF', + fillOpacity: 0.5, + strokeStyle: 'dashed', + extData: { test: 1 }, + strokeDasharray: [1, 5] +}); + +// $ExpectType LngLat | undefined +ellipse.getCenter(); + +// $ExpectType void +ellipse.setCenter(lnglat); +// $ExpectType void +ellipse.setCenter(lnglatTuple); + +// $ExpectType Bounds | null +ellipse.getBounds(); + +// $ExpectType void +ellipse.setOptions({ + map, + zIndex: 10, + center: lnglat, + radius: [10000, 15000], + bubble: false, + cursor: 'pointer', + strokeColor: '#FF0000', + strokeOpacity: 0.8, + strokeWeight: 2, + fillColor: '#0000FF', + fillOpacity: 0.5, + strokeStyle: 'dashed', + extData: { test: 1 }, + strokeDasharray: [1, 5] +}); + +const options = ellipse.getOptions(); + +// $ExpectType boolean | undefined +options.bubble; +// $ExpectType LngLat | undefined +options.center; +// $ExpectType boolean | undefined +options.clickable; +// $ExpectType {} | ExtraData | undefined +options.extData; +// $ExpectType string | undefined +options.fillColor; +// $ExpectType number | undefined +options.fillOpacity; +// $ExpectType "miter" | "round" | "bevel" | undefined +options.lineJoin; +// $ExpectType Map | undefined +options.map; +// $ExpectType LngLat[] | undefined +options.path; +// $ExpectType [number, number] | undefined +options.radius; +// $ExpectType string | undefined +options.strokeColor; +// $ExpectType number[] | undefined +options.strokeDasharray; +// $ExpectType number | undefined +options.strokeOpacity; +// $ExpectType "dashed" | "solid" | undefined +options.strokeStyle; +// $ExpectType number | undefined +options.strokeWeight; +// $ExpectType string | undefined +options.texture; +// $ExpectType number | undefined +options.zIndex; + +// $ExpectType void +ellipse.hide(); + +// $ExpectType void +ellipse.show(); + +// $ExpectType void +ellipse.setMap(null); +// $ExpectType void +ellipse.setMap(map); + +// $ExpectType void +ellipse.setExtData({test: 2}); +// $ExpectType {} | ExtraData +ellipse.getExtData(); + +// $ExpectType boolean +ellipse.contains(lnglat); +// $ExpectType boolean +ellipse.contains(lnglatTuple); diff --git a/types/amap-js-api/test/overlay/geoJSON.ts b/types/amap-js-api/test/overlay/geoJSON.ts new file mode 100644 index 0000000000..ee8c501472 --- /dev/null +++ b/types/amap-js-api/test/overlay/geoJSON.ts @@ -0,0 +1,106 @@ +import { + map, + lnglatTuple +} from '../preset'; + +declare const marker: AMap.Marker; +declare const polyline: AMap.Polyline; +declare const polygon: AMap.Polygon; + +interface ExtraData { + test: number; +} + +const geoJSONObject: AMap.GeoJSON.GeoJSONObject[] = [ + { + type: 'Feature', + properties: {}, + geometry: { + type: 'Point', + coordinates: lnglatTuple + } + }, + { + type: 'Feature', + properties: { test: 1 }, + geometry: { + type: 'LineString', + coordinates: [lnglatTuple, lnglatTuple] + } + } +]; + +// $ExpectType GeoJSON +new AMap.GeoJSON(); +// $ExpectType GeoJSON +new AMap.GeoJSON({}); +// $ExpectType GeoJSON +const geoJSON = new AMap.GeoJSON({ + geoJSON: geoJSONObject, + getMarker(obj, lnglat) { + // $ExpectType GeoJSONObject + obj; + // $ExpectType LngLat + lnglat; + return marker; + }, + getPolyline(obj, lnglats) { + // $ExpectType GeoJSONObject + obj; + // $ExpectType LngLat[] + lnglats; + return polyline; + }, + getPolygon(obj, lnglats) { + // $ExpectType GeoJSONObject + obj; + // $ExpectType LngLat[] + lnglats; + return polygon; + }, + coordsToLatLng(coord) { + // $ExpectType LngLat + coord; + return coord; + } +}); + +// $ExpectType void +geoJSON.importData(geoJSONObject); + +// $ExpectType GeoJSON +geoJSON.removeOverlay(marker); +// $ExpectType GeoJSON +geoJSON.removeOverlay([marker]); + +// $ExpectType boolean +geoJSON.hasOverlay(marker); +// $ExpectType boolean +geoJSON.hasOverlay(m => m === marker); + +// $ExpectType GeoJSON +geoJSON.addOverlay(marker); +// $ExpectType GeoJSON +geoJSON.addOverlay([marker]); + +// $ExpectType GeoJSONObject[] +geoJSON.toGeoJSON(); + +// $ExpectType GeoJSON +geoJSON.setMap(null); +// $ExpectType GeoJSON +geoJSON.setMap(map); + +// $ExpectType GeoJSON +geoJSON.hide(); + +// $ExpectType GeoJSON +geoJSON.show(); + +type ClickEvent = AMap.MapsEvent<'click', AMap.Overlay>; +geoJSON.on('click', (event: ClickEvent) => { + // $ExpectType "click" + event.type; + // $ExpectType Overlay + event.target; +}); diff --git a/types/amap-js-api/test/overlay/icon.ts b/types/amap-js-api/test/overlay/icon.ts new file mode 100644 index 0000000000..8576685b8a --- /dev/null +++ b/types/amap-js-api/test/overlay/icon.ts @@ -0,0 +1,32 @@ +import { + size, + pixel, + icon +} from '../preset'; + +// $ExpectType Icon +new AMap.Icon(); +// $ExpectType Icon +new AMap.Icon({}); +// $ExpectType Icon +new AMap.Icon({ + size, + imageOffset: pixel, + image: 'image uri', + imageSize: size +}); +// $ExpectType Icon +new AMap.Icon({ + size: [1, 2], + imageOffset: pixel, + image: 'image uri', + imageSize: [1, 2] +}); + +// $ExpectType Size +icon.getImageSize(); + +// $ExpectType void +icon.setImageSize(size); +// $ExpectType void +icon.setImageSize([1, 2]); diff --git a/types/amap-js-api/test/overlay/infoWindow.ts b/types/amap-js-api/test/overlay/infoWindow.ts new file mode 100644 index 0000000000..3fa4b0e656 --- /dev/null +++ b/types/amap-js-api/test/overlay/infoWindow.ts @@ -0,0 +1,81 @@ +import { + map, + lnglat, + size, + pixel, + div, + lnglatTuple +} from '../preset'; + +interface ExtraData { + test: number; +} + +// $ExpectType InfoWindow +new AMap.InfoWindow(); +// $ExpectType InfoWindow +new AMap.InfoWindow({}); +// $ExpectType InfoWindow +const infoWindow = new AMap.InfoWindow({ + isCustom: false, + autoMove: false, + closeWhenClickMap: false, + content: 'content', + size: [100, 100], + offset: new AMap.Pixel(10, 10), + position: lnglat, + showShadow: true +}); + +// $ExpectType void +infoWindow.open(map); +// $ExpectType void +infoWindow.open(map, lnglat); +// $ExpectType void +infoWindow.open(map, lnglatTuple); + +// $ExpectType void +infoWindow.close(); + +// $ExpectType boolean +infoWindow.getIsOpen(); + +// $ExpectType void +infoWindow.setContent('content'); +// $ExpectType void +infoWindow.setContent(div); + +// $ExpectType string | HTMLElement | undefined +infoWindow.getContent(); + +// $ExpectType void +infoWindow.setPosition(lnglat); +// $ExpectType void +infoWindow.setPosition(lnglatTuple); + +// $ExpectType LngLat | undefined +infoWindow.getPosition(); + +// $ExpectType Size | undefined +infoWindow.getSize(); + +infoWindow.on('change', (event: AMap.InfoWindow.EventMap['change']) => { + // $ExpectType "change" + event.type; + // $ExpectType InfoWindow + event.target; +}); + +infoWindow.on('close', (event: AMap.InfoWindow.EventMap['close']) => { + // $ExpectType "close" + event.type; + // $ExpectType InfoWindow + event.target; +}); + +infoWindow.on('open', (event: AMap.InfoWindow.EventMap['open']) => { + // $ExpectType "open" + event.type; + // $ExpectType InfoWindow + event.target; +}); diff --git a/types/amap-js-api/test/overlay/marker.ts b/types/amap-js-api/test/overlay/marker.ts new file mode 100644 index 0000000000..635ce724c8 --- /dev/null +++ b/types/amap-js-api/test/overlay/marker.ts @@ -0,0 +1,195 @@ +import { + map, + lnglat +} from '../preset'; + +declare var pixel: AMap.Pixel; +declare var domEle: HTMLElement; +declare var markerShape: AMap.MarkerShape; +declare var icon: AMap.Icon; + +interface ExtraData { + test: number; +} + +// $ExpectType Marker +new AMap.Marker(); +// $ExpectType Marker +new AMap.Marker(); +// $ExpectType Marker +new AMap.Marker({}); +// $ExpectType Marker +const marker = new AMap.Marker({ + map, + position: lnglat, + offset: pixel, + icon: 'iconUrl', + content: 'htmlString', + topWhenClick: true, + raiseOnDrag: true, + cursor: 'default', + visible: true, + zIndex: 10, + angle: 10, + autoRotation: true, + animation: 'AMAP_ANIMATION_BOUNCE', + shadow: icon, + title: '123', + clickable: true, + shape: markerShape, + extData: { + test: 123 + } +}); + +// $ExpectType void +marker.markOnAMAP({ + name: '123', + position: [1, 2] +}); +// $ExpectType void +marker.markOnAMAP(); +// $ExpectType void +marker.markOnAMAP({}); +// $ExpectType void +marker.markOnAMAP({ + position: [1, 2], + name: '123' +}); + +// $ExpectType Pixel +marker.getOffset(); + +// $ExpectType void +marker.setOffset(pixel); + +// $ExpectType void +marker.setAnimation('AMAP_ANIMATION_BOUNCE'); + +// $ExpectType AnimationName +marker.getAnimation(); + +// $ExpectType void +marker.setClickable(true); + +// $ExpectType boolean +marker.getClickable(); + +// $ExpectType LngLat | undefined +marker.getPosition(); + +// $ExpectType void +marker.setPosition(lnglat); + +// $ExpectType void +marker.setAngle(0); + +// $ExpectType void +marker.setLabel(); +// $ExpectType void +marker.setLabel({}); +// $ExpectType void +marker.setLabel({ + content: 'label content', + offset: pixel +}); + +// $ExpectType Label | undefined +marker.getLabel(); + +// $ExpectType number +marker.getAngle(); + +// $ExpectType void +marker.setzIndex(100); + +// $ExpectType number +marker.getzIndex(); + +// $ExpectType void +marker.setIcon('icon uri'); +// $ExpectType void +marker.setIcon(icon); + +// $ExpectType string | Icon | undefined +marker.getIcon(); + +// $ExpectType void +marker.setDraggable(true); + +// $ExpectType boolean +marker.getDraggable(); + +// $ExpectType void +marker.setCursor('default'); + +// $ExpectType void +marker.setContent('content'); +// $ExpectType void +marker.setContent(domEle); + +// $ExpectType string | HTMLElement +marker.getContent(); + +// $ExpectType void +marker.moveAlong([lnglat], 100); +// $ExpectError +marker.moveAlong([[1, 2]], 100); +// $ExpectType void +marker.moveAlong([lnglat], 100, t => t, false); + +// $ExpectType void +marker.moveTo(lnglat, 100); +// $ExpectType void +marker.moveTo([1, 2], 100); +// $ExpectType void +marker.moveTo([1, 2], 100, t => t); + +// $ExpectType void +marker.stopMove(); + +// $ExpectType boolean +marker.pauseMove(); + +// $ExpectType boolean +marker.resumeMove(); + +// $ExpectType void +marker.setMap(map); + +// $ExpectType void +marker.setTitle('title'); +// $ExpectError +marker.setTitle(); + +// $ExpectType string | undefined +marker.getTitle(); + +// $ExpectType void +marker.setTop(true); + +// $ExpectType boolean +marker.getTop(); + +// $ExpectType void +marker.setShadow(); +// $ExpectType void +marker.setShadow(icon); +// $ExpectType void +marker.setShadow('shadow url'); + +// $ExpectType string | Icon | undefined +marker.getShadow(); + +// $ExpectType void +marker.setShape(); +// $ExpectType void +marker.setShape(markerShape); + +// $ExpectType MarkerShape | undefined +marker.getShape(); + +marker.on('click', (event: AMap.Marker.EventMap['click']) => { + // $ExpectType {} | ExtraData + event.target.getExtData(); +}); diff --git a/types/amap-js-api/test/overlay/markerShape.ts b/types/amap-js-api/test/overlay/markerShape.ts new file mode 100644 index 0000000000..259b68cf20 --- /dev/null +++ b/types/amap-js-api/test/overlay/markerShape.ts @@ -0,0 +1,26 @@ +// $ExpectType MarkerShape +new AMap.MarkerShape({ + type: 'circle', + coords: [1, 1, 1] +}); +// $ExpectType MarkerShape +new AMap.MarkerShape({ + type: 'rect', + coords: [1, 1, 1, 2] +}); +// $ExpectType MarkerShape +new AMap.MarkerShape({ + type: 'poly', + coords: [1, 2, 3, 4, 5] +}); + +// $ExpectError +new AMap.MarkerShape({ + type: 'circle', + coords: [1, 1] +}); +// $ExpectError +new AMap.MarkerShape({ + type: 'rect', + coords: [1, 1, 1, 2, 2] +}); diff --git a/types/amap-js-api/test/overlay/overlay.ts b/types/amap-js-api/test/overlay/overlay.ts new file mode 100644 index 0000000000..6a301e7091 --- /dev/null +++ b/types/amap-js-api/test/overlay/overlay.ts @@ -0,0 +1,27 @@ +import { + map +} from '../preset'; +interface ExtraData { + test: number; +} +declare const overlay: AMap.Overlay; + +// $ExpectType void +overlay.show(); + +// $ExpectType void +overlay.hide(); + +// $ExpectType Map | null | undefined +overlay.getMap(); + +// $ExpectType void +overlay.setMap(map); +// $ExpectType void +overlay.setMap(null); + +// $ExpectError +overlay.setExtData({ any: 123 }); + +// $ExpectError ExtraData +overlay.getExtData(); diff --git a/types/amap-js-api/test/overlay/overlayGroup.ts b/types/amap-js-api/test/overlay/overlayGroup.ts new file mode 100644 index 0000000000..11e04f91cf --- /dev/null +++ b/types/amap-js-api/test/overlay/overlayGroup.ts @@ -0,0 +1,108 @@ +import { + map, + lnglat, + pixel, + circle, + marker, + markerShape, + icon +} from '../preset'; + +// $ExpectType OverlayGroup, any> +const overlayGroup2 = new AMap.OverlayGroup(); +// $ExpectType OverlayGroup, any> +new AMap.OverlayGroup(marker); +// $ExpectType OverlayGroup, any> +const overlayGroup = new AMap.OverlayGroup([marker]); + +// $ExpectType OverlayGroup, any> +overlayGroup.addOverlay(marker); +// $ExpectType OverlayGroup, any> +overlayGroup.addOverlay([marker]); +// $ExpectError +overlayGroup.addOverlay([circle]); + +// $ExpectType OverlayGroup, any> +overlayGroup.addOverlays(marker); +// $ExpectType OverlayGroup, any> +overlayGroup.addOverlays([marker]); + +// $ExpectType Marker[] +overlayGroup.getOverlays(); + +// $ExpectType boolean +overlayGroup.hasOverlay(marker); +// $ExpectType boolean +overlayGroup.hasOverlay(o => o === marker); + +// $ExpectType OverlayGroup, any> +overlayGroup.removeOverlay(marker); +// $ExpectType OverlayGroup, any> +overlayGroup.removeOverlay([marker]); + +// $ExpectType OverlayGroup, any> +overlayGroup.removeOverlays(marker); +// $ExpectType OverlayGroup, any> +overlayGroup.removeOverlays([marker]); + +// $ExpectType OverlayGroup, any> +overlayGroup.clearOverlays(); + +// $ExpectType OverlayGroup, any> +overlayGroup.eachOverlay(function(overlay, index, overlays) { + // $ExpectType Marker + overlay; + // $ExpectType number + index; + // $ExpectType Marker[] + overlays; + // $ExpectType Marker + this; +}); + +// $ExpectType OverlayGroup, any> +overlayGroup.setMap(null); +// $ExpectType OverlayGroup, any> +overlayGroup.setMap(map); + +// $ExpectType OverlayGroup, any> +overlayGroup2.setOptions({ + test: 1 +}); +// $ExpectType OverlayGroup, any> +overlayGroup.setOptions({ + map, + position: lnglat, + offset: pixel, + icon: 'iconUrl', + content: 'htmlString', + topWhenClick: true, + raiseOnDrag: true, + cursor: 'default', + visible: true, + zIndex: 10, + angle: 10, + autoRotation: true, + animation: 'AMAP_ANIMATION_BOUNCE', + shadow: icon, + title: '123', + clickable: true, + shape: markerShape, + extData: { + test: 123 + } +}); + +// $ExpectType OverlayGroup, any> +overlayGroup.show(); + +// $ExpectType OverlayGroup, any> +overlayGroup.hide(); + +type ClickEvent = AMap.MapsEvent<'click', AMap.Overlay>; +overlayGroup.on('click', (event: ClickEvent) => { + // $ExpectType "click" + event.type; + // $ExpectType Overlay + event.target; +}); diff --git a/types/amap-js-api/test/overlay/polygon.ts b/types/amap-js-api/test/overlay/polygon.ts new file mode 100644 index 0000000000..d41a597d45 --- /dev/null +++ b/types/amap-js-api/test/overlay/polygon.ts @@ -0,0 +1,123 @@ +import { + map, + lnglat, + lnglatTuple +} from '../preset'; + +interface ExtraData { + test: number; +} + +const path1 = [lnglatTuple, lnglatTuple, lnglatTuple, lnglatTuple, lnglatTuple]; +const path2 = [lnglat, lnglat, lnglat, lnglat, lnglat]; + +// $ExpectType Polygon +new AMap.Polygon(); +// $ExpectType Polygon +new AMap.Polygon({}); +// $ExpectType Polygon +const polygon = new AMap.Polygon({ + map, + zIndex: 10, + bubble: true, + cursor: 'pointer', + strokeColor: '#00FF00', + strokeOpacity: 0.3, + strokeWeight: 5, + fillColor: '#0000FF', + fillOpacity: 0.5, + draggable: true, + extData: { test: 1 }, + strokeStyle: 'dashed', + strokeDasharray: [2, 4], + path: path1 +}); + +// $ExpectType void +polygon.setPath(path1); +// $ExpectType void +polygon.setPath(path2); +// $ExpectType void +polygon.setPath([path1, path2]); + +// $ExpectType LngLat[] | LngLat[][] +polygon.getPath(); + +// $ExpectType void +polygon.setOptions({ + map, + zIndex: 10, + bubble: true, + cursor: 'pointer', + strokeColor: '#00FF00', + strokeOpacity: 0.8, + strokeWeight: 5, + fillColor: '#0000FF', + fillOpacity: 0.5, + draggable: true, + extData: { test: 1 }, + strokeStyle: 'dashed', + strokeDasharray: [4, 2], + path: [path2, path1] +}); + +const options = polygon.getOptions(); +// $ExpectType boolean | undefined +options.bubble; +// $ExpectType boolean | undefined +options.clickable; +// $ExpectType {} | ExtraData | undefined +options.extData; +// $ExpectType string | undefined +options.fillColor; +// $ExpectType number | undefined +options.fillOpacity; +// $ExpectType "miter" | "round" | "bevel" | undefined +options.lineJoin; +// $ExpectType Map | undefined +options.map; +// $ExpectType LngLat[] | LngLat[][] | undefined +options.path; +// $ExpectType string | undefined +options.strokeColor; +// $ExpectType number[] | undefined +options.strokeDasharray; +// $ExpectType number | undefined +options.strokeOpacity; +// $ExpectType "dashed" | "solid" | undefined +options.strokeStyle; +// $ExpectType number | undefined +options.strokeWeight; +// $ExpectType string | undefined +options.texture; +// $ExpectType number | undefined +options.zIndex; + +// $ExpectType Bounds | null +polygon.getBounds(); + +// $ExpectType number +polygon.getArea(); + +// $ExpectType void +polygon.setMap(null); +// $ExpectType void +polygon.setMap(map); + +// $ExpectType void +polygon.setExtData({ test: 1 }); + +// $ExpectType {} | ExtraData +polygon.getExtData(); + +// $ExpectType boolean +polygon.contains(lnglat); +// $ExpectType boolean +polygon.contains(lnglatTuple); + +polygon.on('click', (event: AMap.Polygon.EventMap['click']) => { + // $ExpectType "click" + event.type; + // $ExpectType Polygon + event.target; +}); diff --git a/types/amap-js-api/test/overlay/polyline.ts b/types/amap-js-api/test/overlay/polyline.ts new file mode 100644 index 0000000000..fc8d52b058 --- /dev/null +++ b/types/amap-js-api/test/overlay/polyline.ts @@ -0,0 +1,139 @@ +import { + map, + lnglat, + lnglatTuple +} from '../preset'; + +interface ExtraData { + test: number; +} + +// $ExpectType Polyline +new AMap.Polyline(); +// $ExpectType Polyline +new AMap.Polyline({}); +// $ExpectType Polyline +const polyline = new AMap.Polyline({ + map, + zIndex: 10, + bubble: true, + cursor: 'default', + geodesic: true, + isOutline: true, + borderWeight: 1, + outlineColor: '#AA0000', + path: [lnglat], + strokeColor: '#0000AA', + strokeOpacity: 0.5, + strokeWeight: 10, + strokeStyle: 'dashed', + strokeDasharray: [20, 10, 20], + lineJoin: 'bevel', + lineCap: 'butt', + draggable: true, + extData: { test: 1 }, + showDir: true +}); +// Polyline + +// $ExpectType void +polyline.setPath([lnglat]); +// $ExpectType void +polyline.setPath([lnglatTuple]); + +// $ExpectType void +polyline.setOptions({}); +// $ExpectType void +polyline.setOptions({ + map, + zIndex: 10, + bubble: true, + cursor: 'default', + geodesic: true, + isOutline: true, + borderWeight: 1, + outlineColor: '#AA0000', + path: [lnglat, lnglat], + strokeColor: '#0000AA', + strokeOpacity: 0.5, + strokeWeight: 10, + strokeStyle: 'dashed', + strokeDasharray: [20, 10, 20], + lineJoin: 'bevel', + lineCap: 'butt', + draggable: true, + extData: { test: 1 }, + showDir: true +}); + +const options = polyline.getOptions(); +// $ExpectType number | undefined +options.borderWeight; +// $ExpectType boolean | undefined +options.bubble; +// $ExpectType boolean | undefined +options.clickable; +// $ExpectType string | undefined +options.dirColor; +// $ExpectType string | undefined +options.dirImg; +// $ExpectType {} | ExtraData | undefined +options.extData; +// $ExpectType boolean | undefined +options.geodesic; +// $ExpectType boolean | undefined +options.isOutline; +// $ExpectType "round" | "butt" | "square" | undefined +options.lineCap; +// $ExpectType "miter" | "round" | "bevel" | undefined +options.lineJoin; +// $ExpectType Map | undefined +options.map; +// $ExpectType string | undefined +options.outlineColor; +// $ExpectType LngLat[] | undefined +options.path; +// $ExpectType boolean | undefined +options.showDir; +// $ExpectType string | undefined +options.strokeColor; +// $ExpectType number[] | undefined +options.strokeDasharray; +// $ExpectType number | undefined +options.strokeOpacity; +// $ExpectType "dashed" | "solid" | undefined +options.strokeStyle; +// $ExpectType number | undefined +options.strokeWeight; +// $ExpectType number | undefined +options.zIndex; + +// $ExpectType number +polyline.getLength(); + +// $ExpectType Bounds | null +polyline.getBounds(); + +// $ExpectType void +polyline.hide(); + +// $ExpectType void +polyline.show(); + +// $ExpectType void +polyline.setMap(null); +// $ExpectType void +polyline.setMap(map); + +// $ExpectType void +polyline.setExtData({test: 1}); + +// $ExpectType {} | ExtraData +polyline.getExtData(); + +polyline.on('click', (event: AMap.Polyline.EventMap['click']) => { + // $ExpectType "click" + event.type; + // $ExpectType Polyline + event.target; +}); diff --git a/types/amap-js-api/test/overlay/rectangle.ts b/types/amap-js-api/test/overlay/rectangle.ts new file mode 100644 index 0000000000..d2cafa8f09 --- /dev/null +++ b/types/amap-js-api/test/overlay/rectangle.ts @@ -0,0 +1,121 @@ +import { + map, + lnglat, + bounds, + lnglatTuple +} from '../preset'; + +interface ExtraData { + test: number; +} + +// $ExpectType Rectangle +new AMap.Rectangle(); +// $ExpectType Rectangle +new AMap.Rectangle({}); +// $ExpectType Rectangle +const rectangle = new AMap.Rectangle({ + map, + zIndex: 10, + bounds, + bubble: false, + cursor: 'pointer', + strokeColor: '#00FF00', + strokeOpacity: 0.8, + strokeWeight: 2, + fillColor: '#0000FF', + fillOpacity: 0.5, + strokeStyle: 'solid', + extData: { test: 1 }, + strokeDasharray: [1, 5] +}); + +// $ExpectType Bounds | undefined +rectangle.getBounds(); + +// $ExpectType void +rectangle.setBounds(bounds); + +// $ExpectType void +rectangle.setOptions({}); +// $ExpectType void +rectangle.setOptions({ + map, + zIndex: 10, + bounds, + bubble: false, + cursor: 'pointer', + strokeColor: '#00FF00', + strokeOpacity: 0.8, + strokeWeight: 2, + fillColor: '#0000FF', + fillOpacity: 0.5, + strokeStyle: 'solid', + extData: { test: 1 }, + strokeDasharray: [1, 5] +}); + +const options = rectangle.getOptions(); +// $ExpectType Bounds | undefined +options.bounds; +// $ExpectType boolean | undefined +options.bubble; +// $ExpectType boolean | undefined +options.clickable; +// $ExpectType {} | ExtraData | undefined +options.extData; +// $ExpectType string | undefined +options.fillColor; +// $ExpectType number | undefined +options.fillOpacity; +// $ExpectType "miter" | "round" | "bevel" | undefined +options.lineJoin; +// $ExpectType Map | undefined +options.map; +// $ExpectType LngLat[] | undefined +options.path; +// $ExpectType string | undefined +options.strokeColor; +// $ExpectType number[] | undefined +options.strokeDasharray; +// $ExpectType number | undefined +options.strokeOpacity; +// $ExpectType "dashed" | "solid" | undefined +options.strokeStyle; +// $ExpectType number | undefined +options.strokeWeight; +// $ExpectType string | undefined +options.texture; +// $ExpectType number | undefined +options.zIndex; + +// $ExpectType void +rectangle.hide(); + +// $ExpectType void +rectangle.show(); + +// $ExpectType void +rectangle.setExtData({test: 2}); + +// $ExpectType {} | ExtraData +rectangle.getExtData(); + +// $ExpectType boolean +rectangle.contains(lnglat); +// $ExpectType boolean +rectangle.contains(lnglatTuple); + +rectangle.on('click', (event: AMap.Rectangle.EventMap['click']) => { + // $ExpectType "click" + event.type; + // $ExpectType Rectangle + event.target; +}); + +rectangle.on('setBounds', (event: AMap.Rectangle.EventMap['setBounds']) => { + // $ExpectType "setBounds" + event.type; + // $ExpectError + event.target; +}); diff --git a/types/amap-js-api/test/overlay/text.ts b/types/amap-js-api/test/overlay/text.ts new file mode 100644 index 0000000000..c4d678493c --- /dev/null +++ b/types/amap-js-api/test/overlay/text.ts @@ -0,0 +1,169 @@ +import { + map, + marker, + lnglat, + pixel, + lnglatTuple, + icon +} from '../preset'; + +interface ExtraData { + test: number; +} + +// $ExpectType Text +new AMap.Text(); +// $ExpectType Text +new AMap.Text({}); +// $ExpectType Text +const text = new AMap.Text({ + text: 'content', + textAlign: 'center', + verticalAlign: 'top', + map, + position: lnglat, + offset: pixel, + topWhenClick: true, + bubble: true, + draggable: true, + raiseOnDrag: true, + cursor: 'default', + visible: true, + zIndex: 100, + angle: 45, + autoRotation: true, + animation: 'AMAP_ANIMATION_BOUNCE', + shadow: 'https://webapi.amap.com/theme/v1.3/markers/0.png', + title: 'title', + clickable: true, + extData: { test: 1 } +}); + +// $ExpectType string +text.getText(); + +// $ExpectType void +text.setText('123'); + +// $ExpectType void +text.setStyle({ + background: 'red', + width: '200px' +}); + +// $ExpectType void +text.markOnAMAP({ + name: '123', + position: lnglatTuple +}); + +// $ExpectType Pixel +text.getOffset(); + +// $ExpectType void +text.setOffset(pixel); + +// $ExpectType void +text.setAnimation('AMAP_ANIMATION_BOUNCE'); + +// $ExpectType AnimationName +text.getAnimation(); + +// $ExpectType void +text.setClickable(true); + +// $ExpectType boolean +text.getClickable(); + +// $ExpectType LngLat | undefined +text.getPosition(); + +// $ExpectType void +text.setAngle(10); + +// $ExpectType number +text.getAngle(); + +// $ExpectType void +text.setzIndex(1); + +// $ExpectType number +text.getzIndex(); + +// $ExpectType void +text.setDraggable(true); + +// $ExpectType boolean +text.getDraggable(); + +// $ExpectType void +text.hide(); + +// $ExpectType void +text.show(); + +// $ExpectType void +text.setCursor('default'); + +// $ExpectType void +text.moveAlong([lnglat], 100); + +// $ExpectType void +text.moveAlong([lnglat], 100); +// $ExpectError +text.moveAlong([[1, 2]], 100); +// $ExpectType void +text.moveAlong([lnglat], 100, t => t, false); + +// $ExpectType void +text.moveTo(lnglat, 100); +// $ExpectType void +text.moveTo([1, 2], 100); +// $ExpectType void +text.moveTo([1, 2], 100, t => t); + +// $ExpectType void +text.stopMove(); + +// $ExpectType boolean +text.pauseMove(); + +// $ExpectType boolean +text.resumeMove(); + +// $ExpectType void +text.setMap(map); + +// $ExpectType void +text.setTitle('title'); +// $ExpectError +text.setTitle(); + +// $ExpectType string | undefined +text.getTitle(); + +// $ExpectType void +text.setTop(true); + +// $ExpectType boolean +text.getTop(); + +// $ExpectType void +text.setShadow(); +// $ExpectType void +text.setShadow(icon); +// $ExpectType void +text.setShadow('shadow url'); + +// $ExpectType void +text.setExtData({test: 1}); + +// $ExpectType {} | ExtraData +text.getExtData(); + +text.on('click', (event: AMap.Text.EventMap['click']) => { + // $ExpectType "click" + event.type; + // $ExpectType Text + event.target; +}); diff --git a/types/amap-js-api/test/pixel.ts b/types/amap-js-api/test/pixel.ts new file mode 100644 index 0000000000..bcb96e4b77 --- /dev/null +++ b/types/amap-js-api/test/pixel.ts @@ -0,0 +1,42 @@ +import { + pixel +} from './preset'; + +// $ExpectType Pixel +new AMap.Pixel(10, 20); +// $ExpectType Pixel +new AMap.Pixel(10, 20); + +// $ExpectType number +pixel.getX(); + +// $ExpectType number +pixel.getY(); + +// $ExpectType boolean +pixel.equals(pixel); + +// $ExpectType string +pixel.toString(); + +// $ExpectType Pixel +pixel.add({ x: 1, y: 2 }); +// $ExpectType Pixel +pixel.add({ x: 1, y: 2 }, false); + +// $ExpectType Pixel +pixel.round(); + +// $ExpectType Pixel +pixel.floor(); + +// $ExpectType number +pixel.length(); + +// $ExpectType number | null +pixel.direction(); + +// $ExpectType Pixel +pixel.toFixed(); +// $ExpectType Pixel +pixel.toFixed(2); diff --git a/types/amap-js-api/test/preset.ts b/types/amap-js-api/test/preset.ts new file mode 100644 index 0000000000..2c7bb37d59 --- /dev/null +++ b/types/amap-js-api/test/preset.ts @@ -0,0 +1,29 @@ +declare const map: AMap.Map; +declare const lnglat: AMap.LngLat; +declare const size: AMap.Size; +declare const lnglatTuple: [number, number]; +declare const pixel: AMap.Pixel; +declare const marker: AMap.Marker; +declare const circle: AMap.Circle; +declare const markerShape: AMap.MarkerShape; +declare const icon: AMap.Icon; +declare const bounds: AMap.Bounds; +declare const div: HTMLDivElement; +declare const polygon: AMap.Polygon; +declare const lang: AMap.Lang; + +export { + map, + lnglat, + size, + lnglatTuple, + pixel, + marker, + circle, + markerShape, + icon, + bounds, + div, + polygon, + lang +}; diff --git a/types/amap-js-api/test/size.ts b/types/amap-js-api/test/size.ts new file mode 100644 index 0000000000..bdd700f532 --- /dev/null +++ b/types/amap-js-api/test/size.ts @@ -0,0 +1,16 @@ +import { size } from './preset'; + +// $ExpectType Size +new AMap.Size(10, 20); + +// $ExpectType number +size.getHeight(); + +// $ExpectType number +size.getWidth(); + +// $ExpectType string +size.toString(); + +// $ExpectType boolean +size.contains({ x: 10, y: 10 }); diff --git a/types/amap-js-api/test/util.ts b/types/amap-js-api/test/util.ts new file mode 100644 index 0000000000..c238070e21 --- /dev/null +++ b/types/amap-js-api/test/util.ts @@ -0,0 +1,79 @@ +import * as preset from './preset'; + +const util = AMap.Util; + +// $ExpectType string +util.colorNameToHex('colorName'); + +// $ExpectType string +util.rgbHex2Rgba('rgbHex'); + +// $ExpectType string +util.argbHex2Rgba('argbHex'); + +// $ExpectType boolean +util.isEmpty({}); +// $ExpectError +util.isEmpty(1); + +// $ExpectType number[] +util.deleteItemFromArray([1], 1); + +// $ExpectType number[] +util.deleteItemFromArrayByIndex([1], 1); + +// $ExpectType number +util.indexOf([1], 1); +// $ExpectError +util.indexOf([1], '1'); + +// $ExpectType number +util.format(1); +// $ExpectType number +util.format(1, 1); + +declare const value1: number | number[]; +// $ExpectType boolean +util.isArray(value1); +if (util.isArray(value1)) { + // $ExpectType number[] + value1; +} else { + // $ExpectType number + value1; +} + +declare const value2: number | HTMLElement; +// $ExpectType boolean +util.isDOM(value2); +if (util.isDOM(value2)) { + // $ExpectType HTMLElement + value2; +} else { + // $ExpectType number + value2; +} + +// $ExpectType boolean +util.includes([1], 1); +// $ExpectError +util.includes([1], '1'); + +// $ExpectType number +util.requestIdleCallback(() => { }); +// $ExpectType number +const idleCallbackHandle = util.requestIdleCallback(() => { }, { timeout: 1 }); + +// $ExpectType void +util.cancelIdleCallback(idleCallbackHandle); + +// $ExpectType number +util.requestAnimFrame(() => { }); +// $ExpectType number +const animFrameHandle = util.requestAnimFrame(function () { + // $ExpectType number + this.test; +}, { test: 1 }); + +// $ExpectType void +util.cancelAnimFrame(animFrameHandle); diff --git a/types/amap-js-api/test/view2d.ts b/types/amap-js-api/test/view2d.ts new file mode 100644 index 0000000000..2560922a5a --- /dev/null +++ b/types/amap-js-api/test/view2d.ts @@ -0,0 +1,22 @@ +import { lnglat } from './preset'; + +// $ExpectType View2D +new AMap.View2D(); +// $ExpectType View2D +new AMap.View2D({}); + +// $ExpectType View2D +new AMap.View2D({ + center: [1, 2], + rotation: 1, + zoom: 10, + crs: 'EPGS3395' +}); + +// $ExpectType View2D +const view2d = new AMap.View2D({ + center: lnglat +}); + +// $ExpectType View2D +view2d.on('complete', () => { }); diff --git a/types/amap-js-api/tsconfig.json b/types/amap-js-api/tsconfig.json new file mode 100644 index 0000000000..3e8b8b3282 --- /dev/null +++ b/types/amap-js-api/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noEmit": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "forceConsistentCasingInFileNames": true + } +} diff --git a/types/amap-js-api/tslint.json b/types/amap-js-api/tslint.json new file mode 100644 index 0000000000..ab1e56673f --- /dev/null +++ b/types/amap-js-api/tslint.json @@ -0,0 +1,10 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "only-arrow-functions": false, + "space-before-function-paren": false, + "no-var-keyword": false, + "no-unnecessary-class": false, + "file-name-casing": false + } +} diff --git a/types/amap-js-api/type-util.d.ts b/types/amap-js-api/type-util.d.ts new file mode 100644 index 0000000000..1ced3d69c1 --- /dev/null +++ b/types/amap-js-api/type-util.d.ts @@ -0,0 +1,12 @@ +type Omit = { + [K in Exclude]: T[K] +}; + +type OptionalKey = { [K in keyof T]-?: undefined extends T[K] ? K : never }[keyof T]; +// type OmitUndefined = Omit; +// type PickUndefined = Omit>; + +type Merge = + { [K in Exclude>]-?: O[K]; } & + { [K in Extract, OptionalKey>]?: O[K]; } & + T; diff --git a/types/amap-js-api/util.d.ts b/types/amap-js-api/util.d.ts new file mode 100644 index 0000000000..70b48c31d1 --- /dev/null +++ b/types/amap-js-api/util.d.ts @@ -0,0 +1,37 @@ +declare namespace AMap { + namespace Util { + function colorNameToHex(colorName: string): string; + + function rgbHex2Rgba(hex: string): string; + + function argbHex2Rgba(hex: string): string; + + function isEmpty(obj: object): boolean; + + function deleteItemFromArray(array: T[], item: T): T[]; + + function deleteItemFromArrayByIndex(array: T[], index: number): T[]; + + function indexOf(array: T[], item: T): number; + + function format(floatNumber: number, digits?: number): number; + + function isArray(data: any): data is any[]; + + function isDOM(data: any): data is HTMLElement; + + function includes(array: T[], item: T): boolean; + + function requestIdleCallback(callback: (...args: any[]) => any, options?: { timeout?: number }): number; + + function cancelIdleCallback(handle: number): void; + + function requestAnimFrame(callback: (this: C, ...args: any[]) => any, context?: C): number; + + function cancelAnimFrame(handle: number): void; + + function color2RgbaArray(color: string | number[]): [number, number, number, number]; + + function color2Rgba(color: string | number[]): string; + } +} diff --git a/types/amap-js-api/view2D.d.ts b/types/amap-js-api/view2D.d.ts new file mode 100644 index 0000000000..d662b4c50e --- /dev/null +++ b/types/amap-js-api/view2D.d.ts @@ -0,0 +1,13 @@ +declare namespace AMap { + namespace View2D { + interface Options { + center?: LocationValue; + rotation?: number; + zoom?: number; + crs?: 'EPGS3857' | 'EPGS3395' | 'EPGS4326'; + } + } + class View2D extends EventEmitter { + constructor(options?: View2D.Options); + } +} From f13a292ddfa9f976b5310dc6f06f66d74e666108 Mon Sep 17 00:00:00 2001 From: Antoine Rousseau Date: Sat, 23 Feb 2019 14:40:54 +0100 Subject: [PATCH 109/924] update "lite" version too --- types/algoliasearch/lite/index.d.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/types/algoliasearch/lite/index.d.ts b/types/algoliasearch/lite/index.d.ts index 11e22f5ccf..0ef8cd9e8c 100644 --- a/types/algoliasearch/lite/index.d.ts +++ b/types/algoliasearch/lite/index.d.ts @@ -7,6 +7,7 @@ // Claas BrĂŒggemann // Kai Eichinger // Nery Ortez +// Antoine Rousseau // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -534,9 +535,16 @@ declare namespace algoliasearch { userData?: string | object; /** + * Controls how facet values are sorted. * https://www.algolia.com/doc/api-reference/api-parameters/sortFacetValuesBy/ */ sortFacetValuesBy?: 'count' | 'alpha'; + /** + * Sets the languages to be used by language-specific settings and functionalities + * such as ignorePlurals, removeStopWords, and CJK word-detection. + * https://www.algolia.com/doc/api-reference/api-parameters/queryLanguages/ + */ + queryLanguages?: string[]; } namespace SearchForFacetValues { From 0dd2283a1c9b9c7784c26ea5530592c120ec63ce Mon Sep 17 00:00:00 2001 From: David Ruisinger Date: Sat, 23 Feb 2019 16:14:42 +0100 Subject: [PATCH 110/924] Added interface to re-export module with theme interface --- types/styled-components/index.d.ts | 1 + types/styled-components/native.d.ts | 27 ++++++++++++++++++++++----- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/types/styled-components/index.d.ts b/types/styled-components/index.d.ts index a7dea63e06..2ade6848ec 100644 --- a/types/styled-components/index.d.ts +++ b/types/styled-components/index.d.ts @@ -5,6 +5,7 @@ // Adam Lavin // Jessica Franco // Jason Killian +// David Ruisinger /github.com/flavordaaave> // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.9 diff --git a/types/styled-components/native.d.ts b/types/styled-components/native.d.ts index 0c1c520270..71e361af26 100644 --- a/types/styled-components/native.d.ts +++ b/types/styled-components/native.d.ts @@ -2,24 +2,27 @@ import * as ReactNative from 'react-native'; import * as React from 'react'; export { - DefaultTheme, css, + DefaultTheme, isStyledComponent, - ThemeProps, - ThemeProvider, ThemeConsumer, ThemeContext, + ThemeProps, + ThemeProvider, withTheme, } from './index'; import { AnyStyledComponent, + DefaultTheme, + StyledComponentInnerAttrs, StyledComponentInnerComponent, StyledComponentInnerOtherProps, - StyledComponentInnerAttrs, + ThemedCssFunction, ThemedStyledFunction, ThemedStyledInterface, - DefaultTheme + ThemeProviderComponent, + WithThemeFnInterface } from './index'; type AnyIfEmpty = keyof T extends never ? any : T; @@ -211,6 +214,20 @@ export interface ReactNativeStyledInterface extends ReactNativ >; } +export interface ReactNativeThemedStyledComponentsModule< + T extends object, + U extends object = T +> { + default: ReactNativeStyledInterface + + css: ThemedCssFunction + + withTheme: WithThemeFnInterface + ThemeProvider: ThemeProviderComponent + ThemeConsumer: React.Consumer + ThemeContext: React.Context +} + declare const styled: ReactNativeStyledInterface; export default styled; From e652c53a432ca75776bfad9a370c93260a2ae99e Mon Sep 17 00:00:00 2001 From: David Ruisinger Date: Sat, 23 Feb 2019 21:22:56 +0100 Subject: [PATCH 111/924] Fixed typo --- types/styled-components/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/styled-components/index.d.ts b/types/styled-components/index.d.ts index 2ade6848ec..00735dd469 100644 --- a/types/styled-components/index.d.ts +++ b/types/styled-components/index.d.ts @@ -5,7 +5,7 @@ // Adam Lavin // Jessica Franco // Jason Killian -// David Ruisinger /github.com/flavordaaave> +// David Ruisinger // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.9 From 14d234420f67d83246e99a92f67b3e0f16106e29 Mon Sep 17 00:00:00 2001 From: David Ruisinger Date: Sat, 23 Feb 2019 21:36:39 +0100 Subject: [PATCH 112/924] Fix linting errors --- types/styled-components/native.d.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/types/styled-components/native.d.ts b/types/styled-components/native.d.ts index 71e361af26..c67df4d7a1 100644 --- a/types/styled-components/native.d.ts +++ b/types/styled-components/native.d.ts @@ -218,14 +218,14 @@ export interface ReactNativeThemedStyledComponentsModule< T extends object, U extends object = T > { - default: ReactNativeStyledInterface + default: ReactNativeStyledInterface; - css: ThemedCssFunction + css: ThemedCssFunction; - withTheme: WithThemeFnInterface - ThemeProvider: ThemeProviderComponent - ThemeConsumer: React.Consumer - ThemeContext: React.Context + withTheme: WithThemeFnInterface; + ThemeProvider: ThemeProviderComponent; + ThemeConsumer: React.Consumer; + ThemeContext: React.Context; } declare const styled: ReactNativeStyledInterface; From 1d6edf7767d0d01bc66aa6a0b447b0e436cb4e16 Mon Sep 17 00:00:00 2001 From: David Ruisinger Date: Sat, 23 Feb 2019 22:31:07 +0100 Subject: [PATCH 113/924] Added isStyledComponent --- types/styled-components/native.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/styled-components/native.d.ts b/types/styled-components/native.d.ts index c67df4d7a1..189e284525 100644 --- a/types/styled-components/native.d.ts +++ b/types/styled-components/native.d.ts @@ -15,6 +15,7 @@ export { import { AnyStyledComponent, DefaultTheme, + isStyledComponent, StyledComponentInnerAttrs, StyledComponentInnerComponent, StyledComponentInnerOtherProps, @@ -226,6 +227,9 @@ export interface ReactNativeThemedStyledComponentsModule< ThemeProvider: ThemeProviderComponent; ThemeConsumer: React.Consumer; ThemeContext: React.Context; + + // This could be made to assert `target is StyledComponent` instead, but that feels not type safe + isStyledComponent: typeof isStyledComponent; } declare const styled: ReactNativeStyledInterface; From 93fb2ef1ffc278fc22272ab6419576e7809ece68 Mon Sep 17 00:00:00 2001 From: David Ruisinger Date: Sat, 23 Feb 2019 22:56:48 +0100 Subject: [PATCH 114/924] Adds tests for ReactNativeThemedStyledComponentsModule --- types/styled-components/test/native.tsx | 139 ++++++++++++++++++++++++ 1 file changed, 139 insertions(+) diff --git a/types/styled-components/test/native.tsx b/types/styled-components/test/native.tsx index 66b0f975ce..da2ba83390 100644 --- a/types/styled-components/test/native.tsx +++ b/types/styled-components/test/native.tsx @@ -9,6 +9,7 @@ import styled, { ThemeProvider, withTheme, ThemeConsumer, + ReactNativeThemedStyledComponentsModule, } from "styled-components/native"; import {} from "styled-components/cssprop"; @@ -57,3 +58,141 @@ const TomatoButton = styled(MyButton)` // needs name prop, but not theme prop const tomatoElement = ; + +async function typedThemes() { + const theme = { + color: "green" + }; + + // abuse "await import(...)" to be able to reference the styled-components namespace + // without actually doing a top level namespace import + const { + default: styled, + css, + ThemeProvider, + ThemeConsumer + } = (await import("styled-components/native")) as any as ReactNativeThemedStyledComponentsModule< + typeof theme + >; + + const ThemedView = styled.View` + background: ${props => { + // $ExpectType string + props.theme.color; + // $ExpectType string | undefined + props.testID; + return props.theme.color; + }}; + `; + const ThemedView2 = styled.View(props => { + // $ExpectType string + props.theme.color; + // $ExpectType string | undefined + props.testID; + + return { + background: props.theme.color + }; + }); + const ThemedView3 = styled.View(props => { + // $ExpectType string + props.theme.color; + // $ExpectType string | undefined + props.testID; + + return css` + background: ${props.theme.color}; + `; +}); +const themedCss = css` + background: ${props => { + // $ExpectType string + props.theme.color; + // $ExpectType "theme" + type Keys = keyof typeof props; + return props.theme.color; + }}; +`; +// can't use a FlattenInterpolation as the first argument, would make broken css +// $ExpectError +const ThemedView4 = styled.View(themedCss); + +const themedCssWithNesting = css(props => ({ + color: props.theme.color, + [ThemedView3]: { + color: "green" + } +})); + +return ( + + <> + + + + + {theme => { + // $ExpectType string + theme.color; + return theme.color; + }} + + + + ); +} + +async function reexportCompatibility() { + const sc = await import("styled-components/native"); + const themed = sc as ReactNativeThemedStyledComponentsModule; + + let { ...scExports } = sc; + let { ...themedExports } = themed; + // both branches must be assignable to each other + if (Math.random()) { + scExports = themedExports; + } else { + themedExports = scExports; + } +} + +async function themeAugmentation() { + interface BaseTheme { + background: string; + } + interface ExtraTheme extends BaseTheme { + accent: string; + } + + const base = (await import("styled-components/native")) as any as ReactNativeThemedStyledComponentsModule< + BaseTheme + >; + const extra = (await import("styled-components/native")) as any as ReactNativeThemedStyledComponentsModule< + ExtraTheme, + BaseTheme + >; + + return ( + + <> + base} // $ExpectError + > + {() => null} + + ({ + ...base, + accent: "blue" + })} + > + {() => null} + + + + ); +} From 7f35e862fd54d457dcdb5e7300f4f2ab21695c8d Mon Sep 17 00:00:00 2001 From: Alcedo Nathaniel De Guzman Jr Date: Sun, 24 Feb 2019 09:16:16 +0800 Subject: [PATCH 115/924] Update source-map-support to include type definition for resetRetrieveHandlers --- types/source-map-support/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/source-map-support/index.d.ts b/types/source-map-support/index.d.ts index f92a8383b5..f6533dc1d8 100644 --- a/types/source-map-support/index.d.ts +++ b/types/source-map-support/index.d.ts @@ -37,6 +37,7 @@ export function wrapCallSite(frame: any /* StackFrame */): any /* StackFrame */; export function getErrorSource(error: Error): string | null; export function mapSourcePosition(position: Position): Position; export function retrieveSourceMap(source: string): UrlAndMap | null; +export function resetRetrieveHandlers(): void; /** * Install SourceMap support. From 0001ebd8bb91b91c59c50347cecf9cb879ade6c4 Mon Sep 17 00:00:00 2001 From: Alcedo Nathaniel De Guzman Jr Date: Sun, 24 Feb 2019 09:27:43 +0800 Subject: [PATCH 116/924] Update header version --- types/source-map-support/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/source-map-support/index.d.ts b/types/source-map-support/index.d.ts index f6533dc1d8..e1256d8ddb 100644 --- a/types/source-map-support/index.d.ts +++ b/types/source-map-support/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for source-map-support 0.4 +// Type definitions for source-map-support 0.5 // Project: https://github.com/evanw/node-source-map-support // Definitions by: Bart van der Schoor , Jason Cheatham // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 44fa413f1ec2327ed9e2b514b5ff1abd518db7d0 Mon Sep 17 00:00:00 2001 From: Alcedo Nathaniel De Guzman Jr Date: Sun, 24 Feb 2019 09:27:52 +0800 Subject: [PATCH 117/924] Add test --- types/source-map-support/source-map-support-tests.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/source-map-support/source-map-support-tests.ts b/types/source-map-support/source-map-support-tests.ts index 7b07c2970f..cb773b9958 100644 --- a/types/source-map-support/source-map-support-tests.ts +++ b/types/source-map-support/source-map-support-tests.ts @@ -41,3 +41,5 @@ p = sms.mapSourcePosition(p); let u: sms.UrlAndMap | null; u = retrieveSourceMap("foo"); + +sms.resetRetrieveHandlers(); From 257469f5ffeb7a6bb24dcd26d27b03fcfe8acc3e Mon Sep 17 00:00:00 2001 From: Alcedo Nathaniel De Guzman Jr Date: Sun, 24 Feb 2019 09:42:37 +0800 Subject: [PATCH 118/924] Add myself to definitions by --- types/source-map-support/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/source-map-support/index.d.ts b/types/source-map-support/index.d.ts index e1256d8ddb..00ad396b9e 100644 --- a/types/source-map-support/index.d.ts +++ b/types/source-map-support/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for source-map-support 0.5 // Project: https://github.com/evanw/node-source-map-support -// Definitions by: Bart van der Schoor , Jason Cheatham +// Definitions by: Bart van der Schoor , Jason Cheatham , Alcedo Nathaniel De Guzman Jr // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// From de311e73230feec314863e9a133fa843426b8caf Mon Sep 17 00:00:00 2001 From: DavidMarquezF <32216320+DavidMarquezF@users.noreply.github.com> Date: Sun, 24 Feb 2019 13:44:04 +0100 Subject: [PATCH 119/924] Added data parameter in filter Callback (Chart.js) Chart.js can pass the data parameter in the filter callback. You can see this in the source code of Chart.js: https://github.com/chartjs/Chart.js/blob/317cae11dc3358e816528229d05bea7c835c4ad3/src/core/core.tooltip.js#L616 --- types/chart.js/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts index 7745713c84..0c9726d400 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -357,7 +357,7 @@ declare namespace Chart { cornerRadius?: number; multiKeyBackground?: string; callbacks?: ChartTooltipCallback; - filter?(item: ChartTooltipItem): boolean; + filter?(item: ChartTooltipItem, data: ChartData): boolean; itemSort?(itemA: ChartTooltipItem, itemB: ChartTooltipItem): number; position?: string; caretPadding?: number; From 6fd150e94c0949c512b8454099dfd66a927ae32c Mon Sep 17 00:00:00 2001 From: Spencer Miskoviak Date: Sun, 24 Feb 2019 13:39:13 -0800 Subject: [PATCH 120/924] Deprecate @types/chokidar npm run not-needed -- chokidar 2.1.2 https://github.com/paulmillr/chokidar chokidar --- notNeededPackages.json | 6 ++ types/chokidar/chokidar-tests.ts | 57 ----------- types/chokidar/index.d.ts | 170 ------------------------------- types/chokidar/tsconfig.json | 23 ----- types/chokidar/tslint.json | 1 - 5 files changed, 6 insertions(+), 251 deletions(-) delete mode 100644 types/chokidar/chokidar-tests.ts delete mode 100644 types/chokidar/index.d.ts delete mode 100644 types/chokidar/tsconfig.json delete mode 100644 types/chokidar/tslint.json diff --git a/notNeededPackages.json b/notNeededPackages.json index d78bb569ad..22f1c44784 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -240,6 +240,12 @@ "sourceRepoURL": "https://github.com/mapbox/cheap-ruler", "asOfVersion": "2.5.0" }, + { + "libraryName": "chokidar", + "typingsPackageName": "chokidar", + "sourceRepoURL": "https://github.com/paulmillr/chokidar", + "asOfVersion": "2.1.2" + }, { "libraryName": "chunked-dc", "typingsPackageName": "chunked-dc", diff --git a/types/chokidar/chokidar-tests.ts b/types/chokidar/chokidar-tests.ts deleted file mode 100644 index 13e5fe6a90..0000000000 --- a/types/chokidar/chokidar-tests.ts +++ /dev/null @@ -1,57 +0,0 @@ -import * as fs from 'fs'; -import chokidar = require('chokidar'); - -const watcher = chokidar.watch('file, dir, or glob', { - ignored: /[\/\\]\./, persistent: true -}); - -const log = console.log.bind(console); - -watcher - .on('add', (path: string) => { - log('File', path, 'has been added'); - }) - .on('addDir', (path: string) => { - log('Directory', path, 'has been added'); - }) - .on('change', (path: string) => { - log('File', path, 'has been changed'); - }) - .on('unlink', (path: string) => { - log('File', path, 'has been removed'); - }) - .on('unlinkDir', (path: string) => { - log('Directory', path, 'has been removed'); - }) - .on('error', (error: any) => { - log('Error happened', error); - }) - .on('ready', () => { - log('Initial scan complete. Ready for changes.'); - }) - .on('raw', (event: string, path: string, details: any) => { - log('Raw event info:', event, path, details); - }); - -// 'add', 'addDir' and 'change' events also receive stat() results as second -// argument when available: http://nodejs.org/api/fs.html#fs_class_fs_stats -watcher.on('change', (path: string, stats: fs.Stats) => { - if (stats) { - console.log('File', path, 'changed size to', stats.size); - } -}); - -// Watch new files. -watcher.add('new-file'); -watcher.add(['new-file-2', 'new-file-3', '**/other-file*']); - -// Un-watch some files. -watcher.unwatch('new-file*'); - -// Only needed if watching is `persistent: true`. -watcher.close(); - -// One-liner -chokidar.watch('.', { ignored: /[\/\\]\./ }).on('all', (event: string, path: string) => { - console.log(event, path); -}); diff --git a/types/chokidar/index.d.ts b/types/chokidar/index.d.ts deleted file mode 100644 index 6acc9af265..0000000000 --- a/types/chokidar/index.d.ts +++ /dev/null @@ -1,170 +0,0 @@ -// Type definitions for chokidar 1.7 -// Project: https://github.com/paulmillr/chokidar -// Definitions by: Stefan Steinhart -// Felix Becker -// Zach Cardoza -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -import * as fs from 'fs'; -import { EventEmitter } from 'events'; - -/** - * The object's keys are all the directories (using absolute paths unless the `cwd` option was - * used), and the values are arrays of the names of the items contained in each directory. - */ -export interface WatchedPaths { - [directory: string]: string[]; -} - -export class FSWatcher extends EventEmitter implements fs.FSWatcher { - /** - * Constructs a new FSWatcher instance with optional WatchOptions parameter. - */ - constructor(options?: WatchOptions); - - /** - * Add files, directories, or glob patterns for tracking. Takes an array of strings or just one - * string. - */ - add(paths: string | string[]): void; - - /** - * Stop watching files, directories, or glob patterns. Takes an array of strings or just one - * string. - */ - unwatch(paths: string | string[]): void; - - /** - * Returns an object representing all the paths on the file system being watched by this - * `FSWatcher` instance. The object's keys are all the directories (using absolute paths unless - * the `cwd` option was used), and the values are arrays of the names of the items contained in - * each directory. - */ - getWatched(): WatchedPaths; - - /** - * Removes all listeners from watched files. - */ - close(): void; -} - -export interface WatchOptions { - /** - * Indicates whether the process should continue to run as long as files are being watched. If - * set to `false` when using `fsevents` to watch, no more events will be emitted after `ready`, - * even if the process continues to run. - */ - persistent?: boolean; - - /** - * ([anymatch](https://github.com/es128/anymatch)-compatible definition) Defines files/paths to - * be ignored. The whole relative or absolute path is tested, not just filename. If a function - * with two arguments is provided, it gets called twice per path - once with a single argument - * (the path), second time with two arguments (the path and the - * [`fs.Stats`](http://nodejs.org/api/fs.html#fs_class_fs_stats) object of that path). - */ - ignored?: any; - - /** - * If set to `false` then `add`/`addDir` events are also emitted for matching paths while - * instantiating the watching as chokidar discovers these file paths (before the `ready` event). - */ - ignoreInitial?: boolean; - - /** - * When `false`, only the symlinks themselves will be watched for changes instead of following - * the link references and bubbling events through the link's path. - */ - followSymlinks?: boolean; - - /** - * The base directory from which watch `paths` are to be derived. Paths emitted with events will - * be relative to this. - */ - cwd?: string; - - /** - * If set to true then the strings passed to .watch() and .add() are treated as literal path - * names, even if they look like globs. Default: false. - */ - disableGlobbing?: boolean; - - /** - * Whether to use fs.watchFile (backed by polling), or fs.watch. If polling leads to high CPU - * utilization, consider setting this to `false`. It is typically necessary to **set this to - * `true` to successfully watch files over a network**, and it may be necessary to successfully - * watch files in other non-standard situations. Setting to `true` explicitly on OS X overrides - * the `useFsEvents` default. - */ - usePolling?: boolean; - - /** - * Whether to use the `fsevents` watching interface if available. When set to `true` explicitly - * and `fsevents` is available this supercedes the `usePolling` setting. When set to `false` on - * OS X, `usePolling: true` becomes the default. - */ - useFsEvents?: boolean; - - /** - * If relying upon the [`fs.Stats`](http://nodejs.org/api/fs.html#fs_class_fs_stats) object that - * may get passed with `add`, `addDir`, and `change` events, set this to `true` to ensure it is - * provided even in cases where it wasn't already available from the underlying watch events. - */ - alwaysStat?: boolean; - - /** - * If set, limits how many levels of subdirectories will be traversed. - */ - depth?: number; - - /** - * Interval of file system polling. - */ - interval?: number; - - /** - * Interval of file system polling for binary files. ([see list of binary extensions](https://gi - * thub.com/sindresorhus/binary-extensions/blob/master/binary-extensions.json)) - */ - binaryInterval?: number; - - /** - * Indicates whether to watch files that don't have read permissions if possible. If watching - * fails due to `EPERM` or `EACCES` with this set to `true`, the errors will be suppressed - * silently. - */ - ignorePermissionErrors?: boolean; - - /** - * `true` if `useFsEvents` and `usePolling` are `false`). Automatically filters out artifacts - * that occur when using editors that use "atomic writes" instead of writing directly to the - * source file. If a file is re-added within 100 ms of being deleted, Chokidar emits a `change` - * event rather than `unlink` then `add`. If the default of 100 ms does not work well for you, - * you can override it by setting `atomic` to a custom value, in milliseconds. - */ - atomic?: boolean | number; - - /** - * can be set to an object in order to adjust timing params: - */ - awaitWriteFinish?: AwaitWriteFinishOptions | boolean; -} - -export interface AwaitWriteFinishOptions { - /** - * Amount of time in milliseconds for a file size to remain constant before emitting its event. - */ - stabilityThreshold?: number; - - /** - * File size polling interval. - */ - pollInterval?: number; -} - -/** - * produces an instance of `FSWatcher`. - */ -export function watch(paths: string | string[], options?: WatchOptions): FSWatcher; diff --git a/types/chokidar/tsconfig.json b/types/chokidar/tsconfig.json deleted file mode 100644 index 77a34a3964..0000000000 --- a/types/chokidar/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "chokidar-tests.ts" - ] -} \ No newline at end of file diff --git a/types/chokidar/tslint.json b/types/chokidar/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/chokidar/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" } From 243bd2d1bcec585e930c6ef50c8ec2928aae8951 Mon Sep 17 00:00:00 2001 From: Spencer Miskoviak Date: Sun, 24 Feb 2019 14:00:18 -0800 Subject: [PATCH 121/924] Add chokidar as a dependency for packages that rely on chokidar types --- types/browser-sync/index.d.ts | 1 - types/browser-sync/package.json | 6 ++++++ types/gulp/package.json | 6 ++++++ types/hexo-fs/package.json | 6 ++++++ types/sc-hot-reboot/package.json | 6 ++++++ types/watchpack/package.json | 6 ++++++ 6 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 types/browser-sync/package.json create mode 100644 types/gulp/package.json create mode 100644 types/hexo-fs/package.json create mode 100644 types/sc-hot-reboot/package.json create mode 100644 types/watchpack/package.json diff --git a/types/browser-sync/index.d.ts b/types/browser-sync/index.d.ts index 72399f1618..58b85e09f3 100644 --- a/types/browser-sync/index.d.ts +++ b/types/browser-sync/index.d.ts @@ -7,7 +7,6 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 -/// /// /// diff --git a/types/browser-sync/package.json b/types/browser-sync/package.json new file mode 100644 index 0000000000..a0e2ec3c5c --- /dev/null +++ b/types/browser-sync/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "chokidar": "^2.1.2" + } +} diff --git a/types/gulp/package.json b/types/gulp/package.json new file mode 100644 index 0000000000..a0e2ec3c5c --- /dev/null +++ b/types/gulp/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "chokidar": "^2.1.2" + } +} diff --git a/types/hexo-fs/package.json b/types/hexo-fs/package.json new file mode 100644 index 0000000000..a0e2ec3c5c --- /dev/null +++ b/types/hexo-fs/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "chokidar": "^2.1.2" + } +} diff --git a/types/sc-hot-reboot/package.json b/types/sc-hot-reboot/package.json new file mode 100644 index 0000000000..a0e2ec3c5c --- /dev/null +++ b/types/sc-hot-reboot/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "chokidar": "^2.1.2" + } +} diff --git a/types/watchpack/package.json b/types/watchpack/package.json new file mode 100644 index 0000000000..a0e2ec3c5c --- /dev/null +++ b/types/watchpack/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "chokidar": "^2.1.2" + } +} From 2551b4d500e26c18172f1e5a077f38edab4c4608 Mon Sep 17 00:00:00 2001 From: Sebastian Frysztak Date: Sun, 24 Feb 2019 22:52:38 +0100 Subject: [PATCH 122/924] Add (data, active) alternative to VictoryScatter --- types/victory/index.d.ts | 2 +- types/victory/victory-tests.tsx | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/types/victory/index.d.ts b/types/victory/index.d.ts index f5c67995da..549e3823da 100644 --- a/types/victory/index.d.ts +++ b/types/victory/index.d.ts @@ -2057,7 +2057,7 @@ declare module "victory" { /** * The size prop determines how to scale each data point */ - size?: number | { (data: any): number }; + size?: number | { (data: any): number } | { (data: any, active: boolean): number }; /** * The style prop specifies styles for your VictoryScatter. Any valid inline style properties * will be applied. Height, width, and padding should be specified via the height, diff --git a/types/victory/victory-tests.tsx b/types/victory/victory-tests.tsx index fcd18571e3..eb3b7bda40 100644 --- a/types/victory/victory-tests.tsx +++ b/types/victory/victory-tests.tsx @@ -642,6 +642,32 @@ test = ( /> ); +test = ( + 5} + /> +); + +test = ( + (a ? 5 : 3)} + /> +); + // VictoryPie test test = ( Date: Mon, 18 Feb 2019 13:25:13 +1100 Subject: [PATCH 123/924] [react-scroll-into-view-if-needed] add types --- .../index.d.ts | 21 ++++++++ ...react-scroll-into-view-if-needed-tests.tsx | 52 +++++++++++++++++++ .../tsconfig.json | 17 ++++++ .../tslint.json | 1 + 4 files changed, 91 insertions(+) create mode 100644 types/react-scroll-into-view-if-needed/index.d.ts create mode 100644 types/react-scroll-into-view-if-needed/react-scroll-into-view-if-needed-tests.tsx create mode 100644 types/react-scroll-into-view-if-needed/tsconfig.json create mode 100644 types/react-scroll-into-view-if-needed/tslint.json diff --git a/types/react-scroll-into-view-if-needed/index.d.ts b/types/react-scroll-into-view-if-needed/index.d.ts new file mode 100644 index 0000000000..2522833fbd --- /dev/null +++ b/types/react-scroll-into-view-if-needed/index.d.ts @@ -0,0 +1,21 @@ +// Type definitions for react-scroll-into-view-if-needed 2.1 +// Project: https://github.com/icd2k3/react-scroll-into-view-if-needed#readme +// Definitions by: Angus Fretwell +// Allan Pope +// Jonathan Ly +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.9 + +import * as React from 'react'; +import * as ScrollIntoViewIfNeeded from 'scroll-into-view-if-needed'; + +export interface ReactScrollIntoViewIfNeededProps + extends React.HTMLProps { + options?: ScrollIntoViewIfNeeded.Options; + active?: boolean; + elementType?: keyof JSX.IntrinsicElements; +} + +export default class ReactScrollIntoViewIfNeeded extends React.Component< + ReactScrollIntoViewIfNeededProps +> {} diff --git a/types/react-scroll-into-view-if-needed/react-scroll-into-view-if-needed-tests.tsx b/types/react-scroll-into-view-if-needed/react-scroll-into-view-if-needed-tests.tsx new file mode 100644 index 0000000000..d9845582e7 --- /dev/null +++ b/types/react-scroll-into-view-if-needed/react-scroll-into-view-if-needed-tests.tsx @@ -0,0 +1,52 @@ +import * as React from 'react'; +import ReactScrollIntoViewIfNeeded from 'react-scroll-into-view-if-needed'; + +const validOptions = { + block: 'start', + scrollMode: 'if-needed', + skipOverflowHiddenElements: true +}; + +const invalidOptions = { + invalidOption: 'foobar' +}; + +() => ( + + Children + +); + +() => ( + + Children + +); + +() => ( + + Children + +); + +() => ( + + Children + +); diff --git a/types/react-scroll-into-view-if-needed/tsconfig.json b/types/react-scroll-into-view-if-needed/tsconfig.json new file mode 100644 index 0000000000..cfa539dc78 --- /dev/null +++ b/types/react-scroll-into-view-if-needed/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6", "dom"], + "jsx": "react", + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "react-scroll-into-view-if-needed-tests.tsx"] +} diff --git a/types/react-scroll-into-view-if-needed/tslint.json b/types/react-scroll-into-view-if-needed/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-scroll-into-view-if-needed/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 81751f0f784d112ecabc0fc33518092f9dc27501 Mon Sep 17 00:00:00 2001 From: Jonathan Ly Date: Mon, 18 Feb 2019 14:15:50 +1100 Subject: [PATCH 124/924] [react-scroll-into-view-if-needed] add package.json with required dependencies listed --- types/react-scroll-into-view-if-needed/package.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 types/react-scroll-into-view-if-needed/package.json diff --git a/types/react-scroll-into-view-if-needed/package.json b/types/react-scroll-into-view-if-needed/package.json new file mode 100644 index 0000000000..7a6b32f755 --- /dev/null +++ b/types/react-scroll-into-view-if-needed/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "'scroll-into-view-if-needed'": "*" + } +} \ No newline at end of file From 288129a409f99592b928b97f9569a68a9a5bfae5 Mon Sep 17 00:00:00 2001 From: Jonathan Ly Date: Mon, 25 Feb 2019 09:30:41 +1100 Subject: [PATCH 125/924] Fix typo in package.json --- types/react-scroll-into-view-if-needed/package.json | 10 +++++----- .../react-scroll-into-view-if-needed-tests.tsx | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/types/react-scroll-into-view-if-needed/package.json b/types/react-scroll-into-view-if-needed/package.json index 7a6b32f755..bc0a926e27 100644 --- a/types/react-scroll-into-view-if-needed/package.json +++ b/types/react-scroll-into-view-if-needed/package.json @@ -1,6 +1,6 @@ { - "private": true, - "dependencies": { - "'scroll-into-view-if-needed'": "*" - } -} \ No newline at end of file + "private": true, + "dependencies": { + "scroll-into-view-if-needed": "*" + } +} diff --git a/types/react-scroll-into-view-if-needed/react-scroll-into-view-if-needed-tests.tsx b/types/react-scroll-into-view-if-needed/react-scroll-into-view-if-needed-tests.tsx index d9845582e7..7c5f15c769 100644 --- a/types/react-scroll-into-view-if-needed/react-scroll-into-view-if-needed-tests.tsx +++ b/types/react-scroll-into-view-if-needed/react-scroll-into-view-if-needed-tests.tsx @@ -24,7 +24,7 @@ const invalidOptions = { () => ( Children From a4300b74f24773ef3ef5986420097eb1c7b07d3f Mon Sep 17 00:00:00 2001 From: Jonathan Ly Date: Mon, 25 Feb 2019 13:36:32 +1100 Subject: [PATCH 126/924] [react-scroll-into-view-if-needed] Fix specs --- ...react-scroll-into-view-if-needed-tests.tsx | 22 +++++-------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/types/react-scroll-into-view-if-needed/react-scroll-into-view-if-needed-tests.tsx b/types/react-scroll-into-view-if-needed/react-scroll-into-view-if-needed-tests.tsx index 7c5f15c769..388a96fa1b 100644 --- a/types/react-scroll-into-view-if-needed/react-scroll-into-view-if-needed-tests.tsx +++ b/types/react-scroll-into-view-if-needed/react-scroll-into-view-if-needed-tests.tsx @@ -1,20 +1,14 @@ import * as React from 'react'; import ReactScrollIntoViewIfNeeded from 'react-scroll-into-view-if-needed'; -const validOptions = { - block: 'start', - scrollMode: 'if-needed', - skipOverflowHiddenElements: true -}; - -const invalidOptions = { - invalidOption: 'foobar' -}; - () => ( Children @@ -23,9 +17,7 @@ const invalidOptions = { () => ( Children @@ -34,8 +26,6 @@ const invalidOptions = { () => ( Children @@ -43,8 +33,6 @@ const invalidOptions = { () => ( Children From 5dcfc57e4f868bd24abcfbd3aee1d741c25e631e Mon Sep 17 00:00:00 2001 From: Jonathan Ly Date: Mon, 25 Feb 2019 13:45:35 +1100 Subject: [PATCH 127/924] [react-scroll-into-view-if-needed] Write better failing options test --- .../react-scroll-into-view-if-needed-tests.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/types/react-scroll-into-view-if-needed/react-scroll-into-view-if-needed-tests.tsx b/types/react-scroll-into-view-if-needed/react-scroll-into-view-if-needed-tests.tsx index 388a96fa1b..562615e74c 100644 --- a/types/react-scroll-into-view-if-needed/react-scroll-into-view-if-needed-tests.tsx +++ b/types/react-scroll-into-view-if-needed/react-scroll-into-view-if-needed-tests.tsx @@ -1,6 +1,16 @@ import * as React from 'react'; import ReactScrollIntoViewIfNeeded from 'react-scroll-into-view-if-needed'; +const validOptions = { + block: 'start', + scrollMode: 'if-needed', + skipOverflowHiddenElements: true +}; + +const invalidOptions = { + invalidOption: 'foobar' +}; + () => ( ( Children From 4024ad1b37fe5b8839e8151b6b1d703ae4d8da5f Mon Sep 17 00:00:00 2001 From: "Adam A. Zerella" Date: Mon, 25 Feb 2019 14:40:45 +1100 Subject: [PATCH 128/924] Added type defs for CipherBase --- types/cipher-base/cipher-base-tests.ts | 17 +++++++++++++++++ types/cipher-base/index.d.ts | 14 ++++++++++++++ types/cipher-base/tsconfig.json | 25 +++++++++++++++++++++++++ types/cipher-base/tslint.json | 3 +++ 4 files changed, 59 insertions(+) create mode 100644 types/cipher-base/cipher-base-tests.ts create mode 100644 types/cipher-base/index.d.ts create mode 100644 types/cipher-base/tsconfig.json create mode 100644 types/cipher-base/tslint.json diff --git a/types/cipher-base/cipher-base-tests.ts b/types/cipher-base/cipher-base-tests.ts new file mode 100644 index 0000000000..173a72b7f6 --- /dev/null +++ b/types/cipher-base/cipher-base-tests.ts @@ -0,0 +1,17 @@ +import CipherBase from "cipher-base"; + +const buf = new Buffer(1); + +class CipherTest extends CipherBase { + constructor() { + super(); + } + + final() { + return buf; + } + + update(testBuffer: Buffer) { + return testBuffer; + } +} diff --git a/types/cipher-base/index.d.ts b/types/cipher-base/index.d.ts new file mode 100644 index 0000000000..228920ac91 --- /dev/null +++ b/types/cipher-base/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for cipher-base 1.0 +// Project: https://github.com/crypto-browserify/cipher-base +// Definitions by: Adam Zerella +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare abstract class CipherBase { + constructor(hashMode?: string); + abstract final(): Buffer; + abstract update(value: Buffer, inputEnc?: string, outputEnc?: string): Buffer; +} + +export default CipherBase; diff --git a/types/cipher-base/tsconfig.json b/types/cipher-base/tsconfig.json new file mode 100644 index 0000000000..217193ea64 --- /dev/null +++ b/types/cipher-base/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [ + + ], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "cipher-base-tests.ts" + ] +} diff --git a/types/cipher-base/tslint.json b/types/cipher-base/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/cipher-base/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file From 4a5ac1ec5722b64c65137c6d864c1199d7222462 Mon Sep 17 00:00:00 2001 From: VincentBel Date: Mon, 25 Feb 2019 12:01:33 +0800 Subject: [PATCH 129/924] [redux-form] copy files to v7 directory --- types/redux-form/v7/immutable/index.d.ts | 30 ++ types/redux-form/v7/index.d.ts | 62 +++ types/redux-form/v7/lib/Field.d.ts | 103 ++++ types/redux-form/v7/lib/FieldArray.d.ts | 61 +++ types/redux-form/v7/lib/Fields.d.ts | 31 ++ types/redux-form/v7/lib/Form.d.ts | 12 + types/redux-form/v7/lib/FormName.d.ts | 9 + types/redux-form/v7/lib/FormSection.d.ts | 10 + types/redux-form/v7/lib/SubmissionError.d.ts | 7 + types/redux-form/v7/lib/actionTypes.d.ts | 39 ++ types/redux-form/v7/lib/actions.d.ts | 92 ++++ .../redux-form/v7/lib/formValueSelector.d.ts | 8 + types/redux-form/v7/lib/formValues.d.ts | 13 + types/redux-form/v7/lib/reducer.d.ts | 42 ++ types/redux-form/v7/lib/reduxForm.d.ts | 164 +++++++ types/redux-form/v7/lib/selectors.d.ts | 25 + types/redux-form/v7/package.json | 6 + types/redux-form/v7/redux-form-tests.tsx | 464 ++++++++++++++++++ types/redux-form/v7/tsconfig.json | 40 ++ types/redux-form/v7/tslint.json | 7 + 20 files changed, 1225 insertions(+) create mode 100644 types/redux-form/v7/immutable/index.d.ts create mode 100644 types/redux-form/v7/index.d.ts create mode 100644 types/redux-form/v7/lib/Field.d.ts create mode 100644 types/redux-form/v7/lib/FieldArray.d.ts create mode 100644 types/redux-form/v7/lib/Fields.d.ts create mode 100644 types/redux-form/v7/lib/Form.d.ts create mode 100644 types/redux-form/v7/lib/FormName.d.ts create mode 100644 types/redux-form/v7/lib/FormSection.d.ts create mode 100644 types/redux-form/v7/lib/SubmissionError.d.ts create mode 100644 types/redux-form/v7/lib/actionTypes.d.ts create mode 100644 types/redux-form/v7/lib/actions.d.ts create mode 100644 types/redux-form/v7/lib/formValueSelector.d.ts create mode 100644 types/redux-form/v7/lib/formValues.d.ts create mode 100644 types/redux-form/v7/lib/reducer.d.ts create mode 100644 types/redux-form/v7/lib/reduxForm.d.ts create mode 100644 types/redux-form/v7/lib/selectors.d.ts create mode 100644 types/redux-form/v7/package.json create mode 100644 types/redux-form/v7/redux-form-tests.tsx create mode 100644 types/redux-form/v7/tsconfig.json create mode 100644 types/redux-form/v7/tslint.json diff --git a/types/redux-form/v7/immutable/index.d.ts b/types/redux-form/v7/immutable/index.d.ts new file mode 100644 index 0000000000..2ce6164232 --- /dev/null +++ b/types/redux-form/v7/immutable/index.d.ts @@ -0,0 +1,30 @@ +export { + Field, + FieldArray, + Fields, + Form, + FormName, + FormSection, + reduxForm, + reducer, + formValueSelector, + getFormAsyncErrors, + getFormInitialValues, + getFormMeta, + getFormNames, + getFormSubmitErrors, + getFormSyncErrors, + getFormSyncWarnings, + getFormValues, + hasSubmitFailed, + hasSubmitSucceeded, + isDirty, + isInvalid, + isPristine, + isSubmitting, + isAsyncValidating, + isValid, + SubmissionError, + startSubmit, + stopSubmit, +} from '../'; diff --git a/types/redux-form/v7/index.d.ts b/types/redux-form/v7/index.d.ts new file mode 100644 index 0000000000..08d077875a --- /dev/null +++ b/types/redux-form/v7/index.d.ts @@ -0,0 +1,62 @@ +// Type definitions for redux-form 7.5 +// Project: https://github.com/erikras/redux-form, https://redux-form.com +// Definitions by: Carson Full +// Daniel Lytkin +// Karol Janyst +// Luka Zakrajsek +// Alex Young +// Anton Novik +// Huw Martin +// Ethan Resnick +// Tim de Koning +// Maddi Joyce +// Kamil Wojcik +// Mohamed Shaaban +// Ethan Setnik +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.0 +import { + ComponentClass, + StatelessComponent, + ReactElement +} from "react"; + +export type FieldType = "Field" | "FieldArray"; + +export interface ErrorOther { + _error?: T; +} + +export type FormErrors = { + [P in keyof FormData]?: ReactElement | T; +} & ErrorOther; + +export interface WarningOther { + _warning?: T; +} + +export type FormWarnings = { + [P in keyof FormData]?: ReactElement | string | WarningOther; +}; + +export interface RegisteredFieldState { + name: string; + type: FieldType; +} + +export type Omit = Pick; + +export * from "./lib/reduxForm"; +export * from "./lib/Field"; +export * from "./lib/Fields"; +export * from "./lib/FieldArray"; +export * from "./lib/Form"; +export * from "./lib/FormName"; +export * from "./lib/FormSection"; +export * from "./lib/formValues"; +export * from "./lib/formValueSelector"; +export * from "./lib/reducer"; +export * from "./lib/SubmissionError"; +export * from "./lib/actions"; +export * from "./lib/actionTypes"; +export * from "./lib/selectors"; diff --git a/types/redux-form/v7/lib/Field.d.ts b/types/redux-form/v7/lib/Field.d.ts new file mode 100644 index 0000000000..194a322408 --- /dev/null +++ b/types/redux-form/v7/lib/Field.d.ts @@ -0,0 +1,103 @@ +import { + Component, + ComponentType, + ReactElement, + ChangeEvent, + DragEvent, + FocusEvent, + InputHTMLAttributes, + SelectHTMLAttributes, + TextareaHTMLAttributes +} from "react"; +import { Dispatch } from "redux"; + +export type Normalizer = (value: any, previousValue?: any, allValues?: any, previousAllValues?: any) => any; +export type Formatter = (value: any, name: string) => any; +export type Parser = (value: any, name: string) => any; +export type Validator = (value: any, allValues?: any, props?: any, name?: any) => any; + +export type EventHandler = (event: Event, name?: string) => void; +export type EventWithDataHandler = (event?: Event, newValue?: any, previousValue?: any, name?: string) => void; + +export interface EventOrValueHandler extends EventHandler { + (value: any): void; +} + +export interface CommonFieldInputProps { + name: string; + onDragStart: EventHandler>; + onDrop: EventHandler>; + onFocus: EventHandler>; +} + +export interface CommonFieldProps extends CommonFieldInputProps { + onBlur: EventWithDataHandler>; + onChange: EventWithDataHandler>; +} + +export interface BaseFieldProps

extends Partial { + name: string; + component?: ComponentType | "input" | "select" | "textarea"; + format?: Formatter | null; + normalize?: Normalizer; + props?: P; + parse?: Parser; + validate?: Validator | Validator[]; + warn?: Validator | Validator[]; + withRef?: boolean; + immutableProps?: string[]; +} + +export interface GenericField

extends Component & P> { + dirty: boolean; + name: string; + pristine: boolean; + value: any; + getRenderedComponent(): Component; +} + +export type GenericFieldHTMLAttributes = + InputHTMLAttributes | + SelectHTMLAttributes | + TextareaHTMLAttributes; + +export class Field

extends Component

{ + dirty: boolean; + name: string; + pristine: boolean; + value: any; + getRenderedComponent(): Component; +} + +export interface WrappedFieldProps { + input: WrappedFieldInputProps; + meta: WrappedFieldMetaProps; +} + +export interface WrappedFieldInputProps extends CommonFieldInputProps { + checked?: boolean; + value: any; + onBlur: EventOrValueHandler>; + onChange: EventOrValueHandler>; +} + +export interface WrappedFieldMetaProps { + active?: boolean; + autofilled: boolean; + asyncValidating: boolean; + dirty: boolean; + dispatch: Dispatch; + error?: any; + form: string; + initial: any; + invalid: boolean; + pristine: boolean; + submitting: boolean; + submitFailed: boolean; + touched: boolean; + valid: boolean; + visited: boolean; + warning?: any; +} + +export default Field; diff --git a/types/redux-form/v7/lib/FieldArray.d.ts b/types/redux-form/v7/lib/FieldArray.d.ts new file mode 100644 index 0000000000..a4599b5e97 --- /dev/null +++ b/types/redux-form/v7/lib/FieldArray.d.ts @@ -0,0 +1,61 @@ +import { Component, ComponentType } from "react"; +import { Validator } from "../index"; + +export interface BaseFieldArrayProps

{ + name: string; + component: ComponentType

; + validate?: Validator | Validator[]; + warn?: Validator | Validator[]; + withRef?: boolean; + props?: P; + rerenderOnEveryChange?: boolean; +} + +export interface GenericFieldArray extends Component & Partial

> { + name: string; + valid: boolean; + getRenderedComponent(): Component & P>; +} + +export class FieldArray

extends Component & Partial

> implements GenericFieldArray { + name: string; + valid: boolean; + getRenderedComponent(): Component & P>; +} + +export interface WrappedFieldArrayProps { + fields: FieldArrayFieldsProps; + meta: FieldArrayMetaProps; +} + +export type FieldIterate = (name: string, index: number, fields: FieldArrayFieldsProps) => R; + +export interface FieldArrayFieldsProps { + forEach(callback: FieldIterate): void; + get(index: number): FieldValue; + getAll(): FieldValue[]; + removeAll(): void; + insert(index: number, value: FieldValue): void; + name: string; + length: number; + map(callback: FieldIterate): R[]; + pop(): FieldValue; + push(value: FieldValue): void; + remove(index: number): void; + shift(): FieldValue; + swap(indexA: number, indexB: number): void; + move(from: number, to: number): void; + unshift(value: FieldValue): void; +} + +export interface FieldArrayMetaProps { + dirty: boolean; + error?: any; + form: string; + invalid: boolean; + pristine: boolean; + submitFailed: boolean; + submitting: boolean; + valid: boolean; + warning?: any; +} diff --git a/types/redux-form/v7/lib/Fields.d.ts b/types/redux-form/v7/lib/Fields.d.ts new file mode 100644 index 0000000000..f5ec106852 --- /dev/null +++ b/types/redux-form/v7/lib/Fields.d.ts @@ -0,0 +1,31 @@ +import { Component, ComponentType } from "react"; +import { Formatter, Parser, WrappedFieldProps } from "../index"; + +interface BaseFieldsProps

{ + names: string[]; + component?: ComponentType; + format?: Formatter | null; + props?: P; + parse?: Parser; + withRef?: boolean; +} + +export interface GenericFields

extends Component & P> { + dirty: boolean; + names: string[]; + pristine: boolean; + values: { [name: string]: any }; + getRenderedComponent(): Component; +} + +export class Fields

extends Component & P> implements GenericFields

{ + dirty: boolean; + names: string[]; + pristine: boolean; + values: { [name: string]: any }; + getRenderedComponent(): Component; +} + +interface WrappedFieldsProps { + [name: string]: WrappedFieldsProps & WrappedFieldProps; +} diff --git a/types/redux-form/v7/lib/Form.d.ts b/types/redux-form/v7/lib/Form.d.ts new file mode 100644 index 0000000000..0eee944be5 --- /dev/null +++ b/types/redux-form/v7/lib/Form.d.ts @@ -0,0 +1,12 @@ +import { Component, FormHTMLAttributes, FormEvent, FormEventHandler } from "react"; +import { FormProps, FormErrors, FormSubmitHandler, Omit } from "../index"; + +interface FormSubmitProp { + onSubmit?: FormSubmitHandler; +} + +export type FormProps = Omit, "onSubmit"> & FormSubmitProp; + +export class GenericForm extends Component> {} + +export class Form extends Component> implements GenericForm {} diff --git a/types/redux-form/v7/lib/FormName.d.ts b/types/redux-form/v7/lib/FormName.d.ts new file mode 100644 index 0000000000..6cfc6f3708 --- /dev/null +++ b/types/redux-form/v7/lib/FormName.d.ts @@ -0,0 +1,9 @@ +import { ReactNode, StatelessComponent } from "react"; + +export interface FormNameProps { + children: (props: { form: string }) => ReactNode; +} + +export const FormName: StatelessComponent; + +export default FormName; diff --git a/types/redux-form/v7/lib/FormSection.d.ts b/types/redux-form/v7/lib/FormSection.d.ts new file mode 100644 index 0000000000..bed9ba765b --- /dev/null +++ b/types/redux-form/v7/lib/FormSection.d.ts @@ -0,0 +1,10 @@ +import { Component, ComponentType } from "react"; + +export interface FormSectionProps

{ + name: string; + component?: ComponentType

; +} + +export declare class FormSection

extends Component & P> {} + +export default FormSection; diff --git a/types/redux-form/v7/lib/SubmissionError.d.ts b/types/redux-form/v7/lib/SubmissionError.d.ts new file mode 100644 index 0000000000..50695f34d0 --- /dev/null +++ b/types/redux-form/v7/lib/SubmissionError.d.ts @@ -0,0 +1,7 @@ +import { FormErrors } from "../index"; + +export declare class SubmissionError extends Error { + constructor(errors?: FormErrors); +} + +export default SubmissionError; diff --git a/types/redux-form/v7/lib/actionTypes.d.ts b/types/redux-form/v7/lib/actionTypes.d.ts new file mode 100644 index 0000000000..7718ba74ab --- /dev/null +++ b/types/redux-form/v7/lib/actionTypes.d.ts @@ -0,0 +1,39 @@ +export interface ActionTypes { + ARRAY_INSERT: string; + ARRAY_MOVE: string; + ARRAY_POP: string; + ARRAY_PUSH: string; + ARRAY_REMOVE: string; + ARRAY_REMOVE_ALL: string; + ARRAY_SHIFT: string; + ARRAY_SPLICE: string; + ARRAY_UNSHIFT: string; + ARRAY_SWAP: string; + AUTOFILL: string; + BLUR: string; + CHANGE: string; + CLEAR_SUBMIT: string; + CLEAR_SUBMIT_ERRORS: string; + CLEAR_ASYNC_ERROR: string; + CLEAR_FIELDS: string; + DESTROY: string; + FOCUS: string; + INITIALIZE: string; + REGISTER_FIELD: string; + RESET: string; + RESET_SECTION: string; + SET_SUBMIT_FAILED: string; + SET_SUBMIT_SUCCEEDED: string; + START_ASYNC_VALIDATION: string; + START_SUBMIT: string; + STOP_ASYNC_VALIDATION: string; + STOP_SUBMIT: string; + SUBMIT: string; + TOUCH: string; + UNREGISTER_FIELD: string; + UNTOUCH: string; + UPDATE_SYNC_ERRORS: string; + UPDATE_SYNC_WARNINGS: string; +} + +export const actionTypes: ActionTypes; diff --git a/types/redux-form/v7/lib/actions.d.ts b/types/redux-form/v7/lib/actions.d.ts new file mode 100644 index 0000000000..955d3d3f5e --- /dev/null +++ b/types/redux-form/v7/lib/actions.d.ts @@ -0,0 +1,92 @@ +import { Action } from "redux"; +import { FormErrors, FormWarnings, FieldType } from "../index"; + +export interface FormAction extends Action { + meta?: any; + payload?: any; + error?: any; +} + +export declare function arrayInsert(form: string, field: string, index: number, value: any): FormAction; +export declare function arrayMove(form: string, field: string, from: number, to: number): FormAction; +export declare function arrayPop(form: string, field: string): FormAction; +export declare function arrayPush(form: string, field: string, value: any): FormAction; +export declare function arrayRemove(form: string, field: string, index: number): FormAction; +export declare function arrayRemoveAll(form: string, field: string): FormAction; +export declare function arrayShift(form: string, field: string): FormAction; +export declare function arraySplice(form: string, field: string, index: number, removeNum: number, value: any): FormAction; +export declare function arraySwap(form: string, field: string, indexA: number, indexB: number): FormAction; +export declare function arrayUnshift(form: string, field: string, value: any): FormAction; +export declare function autofill(form: string, field: string, value: any): FormAction; +export declare function blur(form: string, field: string, value: any, touch?: boolean): FormAction; +export declare function change(form: string, field: string, value: any, touch?: boolean, persistentSubmitErrors?: boolean): FormAction; +export declare function destroy(...form: string[]): FormAction; +export declare function focus(form: string, field: string): FormAction; + +export interface InitializeOptions { + keepDirty: boolean; + keepSubmitSucceeded: boolean; + updateUnregisteredFields: boolean; + keepValues: boolean; +} + +export declare function initialize(form: string, data: any, keepDirty?: boolean, options?: Partial): FormAction; +export declare function initialize(form: string, data: any, options?: Partial): FormAction; +export declare function registerField(form: string, name: string, type: FieldType): FormAction; +export declare function reset(form: string): FormAction; +export declare function resetSection(form: string, ...sections: string[]): FormAction; +export declare function startAsyncValidation(form: string): FormAction; +export declare function stopAsyncValidation(form: string, errors?: FormErrors): FormAction; +export declare function setSubmitFailed(form: string, ...fields: string[]): FormAction; +export declare function setSubmitSucceeded(form: string, ...fields: string[]): FormAction; +export declare function startSubmit(form: string): FormAction; +export declare function stopSubmit(form: string, errors?: FormErrors): FormAction; +export declare function submit(form: string): FormAction; +export declare function clearSubmit(form: string): FormAction; +export declare function clearSubmitErrors(form: string): FormAction; +export declare function clearAsyncError(form: string, field: string): FormAction; +export declare function clearFields(form: string, keepTouched: boolean, persistentSubmitErrors: boolean, ...fields: string[]): FormAction; +export declare function touch(form: string, ...fields: string[]): FormAction; +export declare function unregisterField(form: string, name: string): FormAction; +export declare function untouch(form: string, ...fields: string[]): FormAction; +export declare function updateSyncErrors(from: string, syncErrors: FormErrors, error: T): FormAction; +export declare function updateSyncWarnings(form: string, syncWarnings: FormWarnings, warning: T): FormAction; + +declare const actions: { + arrayInsert: typeof arrayInsert, + arrayMove: typeof arrayMove, + arrayPop: typeof arrayPop, + arrayPush: typeof arrayPush, + arrayRemove: typeof arrayRemove, + arrayRemoveAll: typeof arrayRemoveAll, + arrayShift: typeof arrayShift, + arraySplice: typeof arraySplice, + arraySwap: typeof arraySwap, + arrayUnshift: typeof arrayUnshift, + autofill: typeof autofill, + blur: typeof blur, + change: typeof change, + clearSubmit: typeof clearSubmit, + clearSubmitErrors: typeof clearSubmitErrors, + clearAsyncError: typeof clearAsyncError, + clearFields: typeof clearFields, + destroy: typeof destroy, + focus: typeof focus, + initialize: typeof initialize, + registerField: typeof registerField, + reset: typeof reset, + startAsyncValidation: typeof startAsyncValidation, + startSubmit: typeof startSubmit, + stopAsyncValidation: typeof stopAsyncValidation, + stopSubmit: typeof stopSubmit, + submit: typeof submit, + setSubmitFailed: typeof setSubmitFailed, + setSubmitSucceeded: typeof setSubmitSucceeded, + touch: typeof touch, + unregisterField: typeof unregisterField, + untouch: typeof untouch, + updateSyncErrors: typeof updateSyncErrors, + updateSyncWarnings: typeof updateSyncWarnings +}; + +export default actions; diff --git a/types/redux-form/v7/lib/formValueSelector.d.ts b/types/redux-form/v7/lib/formValueSelector.d.ts new file mode 100644 index 0000000000..e13ffd3c5d --- /dev/null +++ b/types/redux-form/v7/lib/formValueSelector.d.ts @@ -0,0 +1,8 @@ +import { FormStateMap } from "../index"; + +export function formValueSelector( + form: string, + getFormState?: (state: State) => FormStateMap +): (state: State, ...field: string[]) => any; + +export default formValueSelector; diff --git a/types/redux-form/v7/lib/formValues.d.ts b/types/redux-form/v7/lib/formValues.d.ts new file mode 100644 index 0000000000..1052f8533e --- /dev/null +++ b/types/redux-form/v7/lib/formValues.d.ts @@ -0,0 +1,13 @@ +import { ComponentClass, ComponentType } from "react"; +import { InjectedFormProps } from "../index"; + +export function formValues< + Values, + P = {} +>(obj: Values): (component: ComponentType

) => ComponentClass

; + +export function formValues< + FormData = {}, + K extends keyof FormData = keyof FormData, + P = {} +>(...names: K[]): (component: ComponentType

>) => ComponentClass

>; diff --git a/types/redux-form/v7/lib/reducer.d.ts b/types/redux-form/v7/lib/reducer.d.ts new file mode 100644 index 0000000000..f2ee374cf2 --- /dev/null +++ b/types/redux-form/v7/lib/reducer.d.ts @@ -0,0 +1,42 @@ +import { Reducer } from "redux"; +import { FieldType } from "../index"; + +export interface FormReducer extends Reducer { + plugin(reducers: FormReducerMapObject): Reducer; +} + +export const reducer: FormReducer; + +export interface FormReducerMapObject { + // and `` to make it compatible with redux@3 + // tslint:disable-next-line use-default-type-parameter + [formName: string]: Reducer; +} + +export interface FormStateMap { + [formName: string]: FormState; +} + +export interface FormState { + registeredFields: RegisteredFieldState[]; + fields?: {[name: string]: FieldState}; + values?: { [fieldName: string]: any }; + active?: string; + anyTouched?: boolean; + submitting?: boolean; + submitErrors?: { [fieldName: string]: string }; + submitFailed?: boolean; +} + +export interface RegisteredFieldState { + name: string; + type: FieldType; +} + +export interface FieldState { + active?: boolean; + touched?: boolean; + visited?: boolean; +} + +export default reducer; diff --git a/types/redux-form/v7/lib/reduxForm.d.ts b/types/redux-form/v7/lib/reduxForm.d.ts new file mode 100644 index 0000000000..e37214f5d0 --- /dev/null +++ b/types/redux-form/v7/lib/reduxForm.d.ts @@ -0,0 +1,164 @@ +import { + Component, + ComponentClass, + ComponentType, + ReactElement, + SyntheticEvent, + StatelessComponent, + FormEventHandler +} from "react"; +import { Dispatch } from "redux"; +import { + FormErrors, + ErrorOther, + FormWarnings, + WarningOther, + RegisteredFieldState, + FormStateMap +} from "../index"; + +export type FormSubmitHandler = + (values: FormData, dispatch: Dispatch, props: P) => void | FormErrors | Promise; + +export type GetFormState = (state: any) => FormStateMap; +export interface SubmitHandler { + ( + submit: FormSubmitHandler, + props?: InjectedFormProps, + valid?: boolean, + asyncValidate?: any, + fields?: string[] + ): any; + (event: SyntheticEvent): void; +} + +export interface ValidateCallback { + values: FormData; + nextProps: P & InjectedFormProps; + props: P & InjectedFormProps; + initialRender: boolean; + structure: any; +} + +export interface AsyncValidateCallback { + asyncErrors?: FormErrors; + initialized: boolean; + trigger: "blur" | "submit"; + blurredField?: string; + pristine: boolean; + syncValidationPasses: boolean; +} + +export interface InjectedArrayProps { + insert(field: string, index: number, value: any): void; + move(field: string, from: number, to: number): void; + pop(field: string): void; + push(field: string, value: any): void; + remove(field: string, index: number): void; + removeAll(field: string): void; + shift(field: string): void; + splice(field: string, index: number, removeNum: number, value: any): void; + swap(field: string, indexA: number, indexB: number): void; + unshift(field: string, value: any): void; +} + +export interface RegisteredField { + count: number; + name: string; + type: "Field" | "FieldArray"; +} + +export interface InjectedFormProps { + anyTouched: boolean; + array: InjectedArrayProps; + asyncValidate(): void; + asyncValidating: string | boolean; + autofill(field: string, value: any): void; + blur(field: string, value: any): void; + change(field: string, value: any): void; + clearAsyncError(field: string): void; + destroy(): void; + dirty: boolean; + error: ErrorType; + form: string; + handleSubmit: SubmitHandler; + initialize(data: Partial): void; + initialized: boolean; + initialValues: Partial; + invalid: boolean; + pristine: boolean; + reset(): void; + submitFailed: boolean; + submitSucceeded: boolean; + submitting: boolean; + touch(...field: string[]): void; + untouch(...field: string[]): void; + valid: boolean; + warning: any; + registeredFields: { [name: string]: RegisteredField }; +} + +export interface ConfigProps { + form: string; + asyncBlurFields?: string[]; + asyncChangeFields?: string[]; + asyncValidate?(values: FormData, dispatch: Dispatch, props: P & InjectedFormProps, blurredField: string): Promise; + destroyOnUnmount?: boolean; + enableReinitialize?: boolean; + forceUnregisterOnUnmount?: boolean; + getFormState?: GetFormState; + immutableProps?: string[]; + initialValues?: Partial; + keepDirtyOnReinitialize?: boolean; + updateUnregisteredFields?: boolean; + onChange?(values: Partial, dispatch: Dispatch, props: P & InjectedFormProps, previousValues: Partial): void; + onSubmit?: FormSubmitHandler, ErrorType> | SubmitHandler, ErrorType>; + onSubmitFail?( + errors: FormErrors | undefined, + dispatch: Dispatch, + submitError: any, + props: P & InjectedFormProps + ): void; + onSubmitSuccess?(result: any, dispatch: Dispatch, props: P & InjectedFormProps): void; + propNamespace?: string; + pure?: boolean; + shouldValidate?(params: ValidateCallback): boolean; + shouldError?(params: ValidateCallback): boolean; + shouldWarn?(params: ValidateCallback): boolean; + shouldAsyncValidate?(params: AsyncValidateCallback): boolean; + touchOnBlur?: boolean; + touchOnChange?: boolean; + persistentSubmitErrors?: boolean; + validate?(values: FormData, props: P & InjectedFormProps): FormErrors; + warn?(values: FormData, props: P & InjectedFormProps): FormWarnings; +} + +export interface FormInstance extends Component

{ + dirty: boolean; + invalid: boolean; + pristine: boolean; + registeredFields: RegisteredFieldState[]; + reset(): void; + resetSection(...sections: string[]): void; + submit(): Promise; + valid: boolean; + values: Partial; + wrappedInstance: ReactElement

>; +} + +export interface DecoratedComponentClass { + new(props?: P, context?: any): FormInstance; +} + +export type FormDecorator = + (component: ComponentType

>) => DecoratedComponentClass; + +export declare function reduxForm( + config: ConfigProps +): FormDecorator>, ErrorType>; + +export declare function reduxForm( + config: Partial> +): FormDecorator, ErrorType>; + +export default reduxForm; diff --git a/types/redux-form/v7/lib/selectors.d.ts b/types/redux-form/v7/lib/selectors.d.ts new file mode 100644 index 0000000000..c97d99859b --- /dev/null +++ b/types/redux-form/v7/lib/selectors.d.ts @@ -0,0 +1,25 @@ +import { FormErrors, GetFormState } from "../index"; + +export type DataSelector = (formName: string, getFormState?: GetFormState) => (state: State) => FormData; +export type ErrorSelector = (formName: string, getFormState?: GetFormState) => (state: State) => FormErrors; +export type BooleanSelector = (formName: string, getFormState?: GetFormState) => (state: State) => boolean; +export type NamesSelector = (getFormState?: GetFormState) => (state: State) => string[]; +export type FormOrFieldsBooleanSelector = (formName: string, getFormState?: GetFormState) => (state: State, ...fields: string[]) => boolean; + +export const getFormValues: DataSelector; +export const getFormInitialValues: DataSelector; +export const getFormSyncErrors: ErrorSelector; +export const getFormMeta: DataSelector; +export const getFormAsyncErrors: ErrorSelector; +export const getFormSyncWarnings: ErrorSelector; +export const getFormSubmitErrors: ErrorSelector; +export const getFormError: ErrorSelector; +export const getFormNames: NamesSelector; +export const isDirty: FormOrFieldsBooleanSelector; +export const isPristine: FormOrFieldsBooleanSelector; +export const isValid: BooleanSelector; +export const isInvalid: BooleanSelector; +export const isSubmitting: BooleanSelector; +export const isAsyncValidating: BooleanSelector; +export const hasSubmitSucceeded: BooleanSelector; +export const hasSubmitFailed: BooleanSelector; diff --git a/types/redux-form/v7/package.json b/types/redux-form/v7/package.json new file mode 100644 index 0000000000..998f8e9b38 --- /dev/null +++ b/types/redux-form/v7/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "redux": "^3.6.0 || ^4.0.0" + } +} diff --git a/types/redux-form/v7/redux-form-tests.tsx b/types/redux-form/v7/redux-form-tests.tsx new file mode 100644 index 0000000000..8ad71bbc42 --- /dev/null +++ b/types/redux-form/v7/redux-form-tests.tsx @@ -0,0 +1,464 @@ +import * as React from 'react'; +import { Action, Dispatch } from "redux"; +import { + reduxForm, + InjectedFormProps, + Form, + FormName, + GenericForm, + FormSection, + formValues, + formValueSelector, + Field, + GenericField, + WrappedFieldProps, + Fields, + GenericFields, + WrappedFieldsProps, + FieldArray, + GenericFieldArray, + WrappedFieldArrayProps, + BaseFieldProps, + reducer, + FormAction, + actionTypes, + submit, + SubmissionError, + FieldArrayFieldsProps +} from "redux-form"; + +import { + Field as ImmutableField, + reduxForm as immutableReduxForm, + startSubmit as immutableStartSubmit, + stopSubmit as immutableStopSubmit +} from "redux-form/immutable"; + +import LibField, { + WrappedFieldProps as LibWrappedFieldProps +} from "redux-form/lib/Field"; +import libReducer from "redux-form/lib/reducer"; +import LibFormSection from "redux-form/lib/FormSection"; +import libFormValueSelector from "redux-form/lib/formValueSelector"; +import libReduxForm from "redux-form/lib/reduxForm"; +import libActions from "redux-form/lib/actions"; +import LibSubmissionError from "redux-form/lib/SubmissionError"; + +/* Decorated components */ +interface TestFormData { + foo: string; +} + +/* Some tests only make sense with multiple values */ +interface MultivalueFormData { + foo: string; + bar?: string; + fizz: string; +} + +interface TestFormComponentProps { + baz: string; +} + +type InjectedProps = InjectedFormProps; + +class TestFormComponent extends React.Component { + render() { + const { form, initialValues, error } = this.props; + const foo = initialValues.foo; + const errorIsString = error + 'test'; + return null; + } +} + +const TestFormRequired = reduxForm({})(TestFormComponent); +const TestForm = reduxForm({ form : "test" })(TestFormComponent); +const TestFormImmRequired = immutableReduxForm({})(TestFormComponent); +const TestFormImm = immutableReduxForm({ form : "test" })(TestFormComponent); + +const TestFormStatelessComponent: React.StatelessComponent = ({ form, initialValues }) => { + const foo = initialValues.foo; + return null; +}; + +const TestFormStatelessRequired = reduxForm({})(TestFormStatelessComponent); +const TestFormStateless = reduxForm({ form : "test" })(TestFormStatelessComponent); + +/* formValues decorator */ + +const ItemList = formValues("foo")( + ({ foo }) => { + return null; + } +); + +const ItemListObj = formValues({ fooBar : "foo" })( + ({ fooBar }) => { + return null; + } +); + +/* Custom FormSection */ + +interface MyFormSectionProps { + foo: string; +} + +const MyFormSection: React.StatelessComponent = ({ children, foo }) => null; + +/* Custom Field */ + +interface MyFieldCustomProps { + foo: string; +} +type MyFieldProps = MyFieldCustomProps & WrappedFieldProps; +const MyField: React.StatelessComponent = ({ + children, + input, + meta, + foo +}) => { + input.onBlur("value"); + input.onBlur({} as React.SyntheticEvent); + + input.onChange("value"); + input.onChange({} as React.SyntheticEvent); + + input.onDragStart({} as React.DragEvent); + + input.onDrop({} as React.DragEvent); + + input.onFocus({} as React.FocusEvent); + return null; +}; +const FieldCustom = Field as new () => GenericField; + +type FieldProps = BaseFieldProps & MyFieldCustomProps; +const FieldCustomComp: React.StatelessComponent = props => ( + +); + +const MyFieldImm: React.StatelessComponent = ({ + children, + input, + meta, + foo +}) => null; +const FieldImmutableCustom = ImmutableField as new () => GenericField; + +/* Custom Fields */ + +interface MyFieldsCustomProps { + foo: string; +} +type MyFieldsProps = MyFieldsCustomProps & WrappedFieldsProps; +const MyFields: React.StatelessComponent = ({ + children, + foo +}) => null; +const FieldsCustom = Fields as new () => GenericFields; + +/* FieldArray */ + +const MyArrayField: React.StatelessComponent = ({ + children +}) => null; + +/* Custom FieldArray */ + +interface MyFieldValue { + num: number; +} +interface MyFieldArrayCustomProps { + foo: string; +} + +const MyCustomArrayField: React.StatelessComponent = ({ + children, + foo +}) => null; + +type MyFieldArrayProps = MyFieldArrayCustomProps & WrappedFieldArrayProps; +const MyFieldArray: React.StatelessComponent = ({ + children, + fields +}) => null; +const FieldArrayCustom = FieldArray as new () => GenericFieldArray; + +/* Tests */ +const TestForms: React.StatelessComponent = () => { + return ( +

+ + + + + + + + +
+ ); +}; + +// Specifying form data type is not required here, but is recommended to avoid confusion +const testFormWithValidationDecorator = reduxForm({ + form: "testWithValidation", + validate: (values, props) => { + return { + foo: "Bad foo" + }; + } +}); + +// Specifying form data type is not required here, but is recommended to avoid confusion +const testFormWithInitialValuesDecorator = reduxForm({ + form: "testWithValidation", + initialValues: { + foo: "A Foo is here" + } +}); + +// Specifying form data type *is* required here, because type inference will guess the type of +// the form data type parameter to be {foo: string}. The result of validate does not contain "foo" +const testFormWithInitialValuesAndValidationDecorator = reduxForm({ + form: "testWithValidation", + initialValues: { + foo: "A Foo is here" + }, + validate: (values, props) => { + return { + bar: "Bad foo" + }; + } +}); + +const testFormWithChangeFunctionDecorator = reduxForm({ + form: "testWithValidation", + onChange: (values: Partial, + dispatch: Dispatch, + props: TestFormComponentProps & InjectedFormProps, + previousValues: Partial) => {} +}); + +type TestProps = {} & InjectedFormProps; +const Test = reduxForm({ + form : "test" +})( + class Test extends React.Component { + handleSubmitForm = (values: Partial, dispatch: Dispatch, props: {}) => {}; + + render() { + const { handleSubmit } = this.props; + const FormCustom = Form as new () => GenericForm; + + return ( +
+ + + name="my-section" + component={MyFormSection} + foo="hello" + /> + + + + + + + + + {}} + onBlur={(event, newValue, previousValue, fieldName) => {}} + /> + + + + + + + + + + + + null } + /> + + null } + foo="bar" + /> + + + name="field9" + component={ MyArrayField } + /> + + + + +
+ ); + } + } +); + +reducer({}, { + type: "ACTION" +}); + +reducer.plugin({ + myForm: (state: any, action: FormAction) => { + if (action.type === actionTypes.CHANGE && action.meta.form === "securitySettings") { + return { + ...state, + values: { + ...state.values, + downloadLinkAutoPassword: true, + }, + }; + } else { + return state; + } + } +}); + +try { + throw new SubmissionError({_error: "Submission failed."}); +} catch (error) { + if (!(error instanceof SubmissionError)) { + throw new Error("SubmissionError not imported correctly"); + } +} + +/* Test using versions imported directly/as defaults from lib */ +const DefaultField = ( + +); + +libReducer({}, { + type: "ACTION" +}); + +const DefaultFormSection = ( + +); + +const TestLibFormRequired = libReduxForm({})(TestFormComponent); +const TestLibForm = libReduxForm({ form : "test" })(TestFormComponent); + +const testSubmit = submit("test"); +const testLibSubmit = libActions.submit("test"); + +try { + throw new LibSubmissionError({_error: "Submission failed."}); +} catch (error) { + if (!(error instanceof LibSubmissionError)) { + throw new Error("SubmissionError from lib not imported correctly"); + } +} + +/* Test handleSubmit prop using as onSubmit handler */ +type HandleSubmitTestProps = {} & InjectedFormProps; +const HandleSubmitTestForm = reduxForm({ + form : "test" +})( + (props: HandleSubmitTestProps) =>
+); + +class HandleSubmitTest extends React.Component { + handleSubmit = (values: Partial, dispatch: Dispatch, props: {}) => {}; + render() { + return ; + } +} + +class FormNameTest extends React.Component { + render() { + return ( + + {({ form }) => Form Name is: {form}} + + ); + } +} + +// Test SubmissionError with custom error format +// See https://github.com/DefinitelyTyped/DefinitelyTyped/pull/26494 +// Note: explicit parameters not needed in TS 2.7 +new LibSubmissionError<{ myField: any }, string[]>({ + _error: ["First form-level error", "Second form-level error"], + myField: ["Field-level error"] +}); + +new SubmissionError({ + _error: ["First form-level error", "Second form-level error"] +}); + +// Test forms with custom error format. +const HandleSubmitTestForm2 = reduxForm({ form : "test" })( + (props: InjectedFormProps) => +); + +class HandleSubmitTest2 extends React.Component { + handleSubmit = (values: Partial, dispatch: Dispatch, props: {}) => {}; + render() { + return ; + } +} + +type InjectedProps2 = InjectedFormProps; +class TestFormComponent2 extends React.Component { + render() { + const { error, initialValues, handleSubmit } = this.props; + error.concat(['error is a string array']); + + handleSubmit((values) => ({ foo: ['string'], _error: [] })); + return null; + } +} diff --git a/types/redux-form/v7/tsconfig.json b/types/redux-form/v7/tsconfig.json new file mode 100644 index 0000000000..f106f20d16 --- /dev/null +++ b/types/redux-form/v7/tsconfig.json @@ -0,0 +1,40 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "experimentalDecorators": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "jsx": "react", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "redux-form-tests.tsx", + "immutable/index.d.ts", + "lib/actions.d.ts", + "lib/actionTypes.d.ts", + "lib/Field.d.ts", + "lib/Fields.d.ts", + "lib/FieldArray.d.ts", + "lib/Form.d.ts", + "lib/FormSection.d.ts", + "lib/formValues.d.ts", + "lib/formValueSelector.d.ts", + "lib/reducer.d.ts", + "lib/reduxForm.d.ts", + "lib/selectors.d.ts", + "lib/SubmissionError.d.ts" + ] +} diff --git a/types/redux-form/v7/tslint.json b/types/redux-form/v7/tslint.json new file mode 100644 index 0000000000..f3568a0139 --- /dev/null +++ b/types/redux-form/v7/tslint.json @@ -0,0 +1,7 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "no-object-literal-type-assertion": false, + "strict-export-declare-modifiers": false + } +} From ba755ce6a7b8bc72e05301757cb66c2d73ae14e6 Mon Sep 17 00:00:00 2001 From: breeze9527 Date: Mon, 25 Feb 2019 13:31:45 +0800 Subject: [PATCH 130/924] [amap-js-api] list files in tsconfig.json --- types/amap-js-api/tsconfig.json | 89 ++++++++++++++++++++++++++++++++- 1 file changed, 88 insertions(+), 1 deletion(-) diff --git a/types/amap-js-api/tsconfig.json b/types/amap-js-api/tsconfig.json index 3e8b8b3282..8d2306a1a6 100644 --- a/types/amap-js-api/tsconfig.json +++ b/types/amap-js-api/tsconfig.json @@ -16,5 +16,92 @@ ], "types": [], "forceConsistentCasingInFileNames": true - } + }, + "files": [ + "array-bounds.d.ts", + "bounds.d.ts", + "browser.d.ts", + "common.d.ts", + "convert-from.d.ts", + "dom-util.d.ts", + "event.d.ts", + "geometry-util.d.ts", + "index.d.ts", + "layer/building.d.ts", + "layer/flexible.d.ts", + "layer/layer.d.ts", + "layer/layerGroup.d.ts", + "layer/massMarks.d.ts", + "layer/mediaLayer.d.ts", + "layer/tileLayer.d.ts", + "layer/wms.d.ts", + "layer/wmts.d.ts", + "lngLat.d.ts", + "map.d.ts", + "overlay/bezierCurve.d.ts", + "overlay/circle.d.ts", + "overlay/circleMarker.d.ts", + "overlay/contextMenu.d.ts", + "overlay/ellipse.d.ts", + "overlay/geoJSON.d.ts", + "overlay/icon.d.ts", + "overlay/infoWindow.d.ts", + "overlay/marker.d.ts", + "overlay/markerShape.d.ts", + "overlay/overlay.d.ts", + "overlay/overlayGroup.d.ts", + "overlay/pathOverlay.d.ts", + "overlay/polygon.d.ts", + "overlay/polyline.d.ts", + "overlay/rectangle.d.ts", + "overlay/shapeOverlay.d.ts", + "overlay/text.d.ts", + "pixel.d.ts", + "size.d.ts", + "test/arryBounds.ts", + "test/bounds.ts", + "test/browser.ts", + "test/convert-from.ts", + "test/dom-util.ts", + "test/event.ts", + "test/geometry-util.ts", + "test/layer/buildings.ts", + "test/layer/canvasLayer.ts", + "test/layer/flexible.ts", + "test/layer/imageLayer.ts", + "test/layer/layer.ts", + "test/layer/layerGroup.ts", + "test/layer/massMarks.ts", + "test/layer/tileLayer.ts", + "test/layer/videoLayer.ts", + "test/layer/wms.ts", + "test/layer/wmts.ts", + "test/lnglat.ts", + "test/map.ts", + "test/overlay/bezierCurve.ts", + "test/overlay/circle.ts", + "test/overlay/contextMenu.ts", + "test/overlay/ellipse.ts", + "test/overlay/geoJSON.ts", + "test/overlay/icon.ts", + "test/overlay/infoWindow.ts", + "test/overlay/marker.ts", + "test/overlay/markerShape.ts", + "test/overlay/overlay.ts", + "test/overlay/overlayGroup.ts", + "test/overlay/polygon.ts", + "test/overlay/polyline.ts", + "test/overlay/rectangle.ts", + "test/overlay/text.ts", + "test/pixel.ts", + "test/preset.ts", + "test/size.ts", + "test/util.ts", + "test/view2d.ts", + "tsconfig.json", + "tslint.json", + "type-util.d.ts", + "util.d.ts", + "view2D.d.ts" + ] } From 264b33318697a9c2269c0ae1bd690d161995f6d6 Mon Sep 17 00:00:00 2001 From: breeze9527 Date: Mon, 25 Feb 2019 13:44:27 +0800 Subject: [PATCH 131/924] [amap-js-api] remove .json in files in tsconfig.json --- types/amap-js-api/tsconfig.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/types/amap-js-api/tsconfig.json b/types/amap-js-api/tsconfig.json index 8d2306a1a6..e63a35d326 100644 --- a/types/amap-js-api/tsconfig.json +++ b/types/amap-js-api/tsconfig.json @@ -98,8 +98,6 @@ "test/size.ts", "test/util.ts", "test/view2d.ts", - "tsconfig.json", - "tslint.json", "type-util.d.ts", "util.d.ts", "view2D.d.ts" From b39156db9fb2a4ae5fb9b8a2b4c2aaa706b2e414 Mon Sep 17 00:00:00 2001 From: breeze9527 Date: Mon, 25 Feb 2019 14:49:36 +0800 Subject: [PATCH 132/924] [amap-js-api] no-restricted-globals --- types/amap-js-api/test/event.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/types/amap-js-api/test/event.ts b/types/amap-js-api/test/event.ts index 8678045158..8061b0d747 100644 --- a/types/amap-js-api/test/event.ts +++ b/types/amap-js-api/test/event.ts @@ -43,7 +43,7 @@ AMap.event.addListener(map, 'click', (event: AMap.Map.EventMap['click']) => { }); // $ExpectType EventListener<1> -AMap.event.addListenerOnce(map, 'hotspotclick', function (event: AMap.Map.EventMap['hotspotclick']) { +const eventListener = AMap.event.addListenerOnce(map, 'hotspotclick', function (event: AMap.Map.EventMap['hotspotclick']) { // $ExpectType "hotspotclick" event.type; // $ExpectType string @@ -54,7 +54,6 @@ AMap.event.addListenerOnce(map, 'hotspotclick', function (event: AMap.Map.EventM this.test; }, { test: 1 }); -declare const eventListener: AMap.event.EventListener<0>; // $ExpectType void AMap.event.removeListener(eventListener); From fa8122b0709e3aba144c3af2a5ab5befed9c0dae Mon Sep 17 00:00:00 2001 From: JGeppert Date: Mon, 25 Feb 2019 09:22:04 +0100 Subject: [PATCH 133/924] Add missing doFetch type to react-request RenderProps --- types/react-request/index.d.ts | 1 + types/react-request/react-request-tests.tsx | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/types/react-request/index.d.ts b/types/react-request/index.d.ts index 0806dda260..3134825fbe 100644 --- a/types/react-request/index.d.ts +++ b/types/react-request/index.d.ts @@ -15,6 +15,7 @@ export interface RenderProps { response: Response | null; url: string; data: T | null; + doFetch: (options?: FetchRequestProps) => Promise; } export interface FetchRequestProps extends RequestInit { diff --git a/types/react-request/react-request-tests.tsx b/types/react-request/react-request-tests.tsx index 6a4ff71212..5e5edf31d2 100644 --- a/types/react-request/react-request-tests.tsx +++ b/types/react-request/react-request-tests.tsx @@ -8,13 +8,16 @@ interface ServerResponse { export default class BasicReactRequest extends React.Component { render() { return url='/api/server'> - {({ fetching, failed, data, response }) => { + {({ fetching, failed, data, response, doFetch }) => { if (fetching || !response) { return

Loading...

; } if (failed) { return

Failed to load

; } + if (!data) { + doFetch(); + } return

{data ? data.foo : 'data was null'}

; }} ; From 39de9c1f8407279e80cdaadde5b44a10a0186283 Mon Sep 17 00:00:00 2001 From: Oliver Joseph Ash Date: Mon, 25 Feb 2019 08:35:45 +0000 Subject: [PATCH 134/924] Fix style nit --- types/lodash/lodash-tests.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index fa5c0ad439..f3089b4289 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -4292,8 +4292,7 @@ fp.now(); // $ExpectType number _.chain([]).isObject(); // $ExpectType LoDashExplicitWrapper fp.isObject(anything); // $ExpectType boolean if (fp.isObject(anything)) { - // $ExpectType object - anything; + anything; // $ExpectType object } } From d055d9a889640fdc839a0b703632bd49ac41067a Mon Sep 17 00:00:00 2001 From: Alexandre Esteves Date: Mon, 25 Feb 2019 09:38:10 +0100 Subject: [PATCH 135/924] fix(mongo): change Object in object --- types/mongodb/index.d.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index dac421a22a..9fb58dbfc4 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -1424,8 +1424,6 @@ export interface FindOneAndDeleteOption { collation?: CollationDocument; } - - /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#geoHaystackSearch */ export interface GeoHaystackSearchOptions { readPreference?: ReadPreference | string; From c8b56a0ca413a0bb6991dbbfc9bcb2c5eec6d2ce Mon Sep 17 00:00:00 2001 From: Oliver Joseph Ash Date: Mon, 25 Feb 2019 08:40:29 +0000 Subject: [PATCH 136/924] Update source, not compiled --- types/lodash/common/lang.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/lodash/common/lang.d.ts b/types/lodash/common/lang.d.ts index 723388c9cc..cbfe0e56bb 100644 --- a/types/lodash/common/lang.d.ts +++ b/types/lodash/common/lang.d.ts @@ -1224,7 +1224,7 @@ declare module "../index" { * @param value The value to check. * @return Returns true if value is an object, else false. */ - isObject(value?: any): boolean; + isObject(value?: any): value is object; } interface LoDashImplicitWrapper { From 21ca8c60dde00b71b711b88147a20e56ec23da56 Mon Sep 17 00:00:00 2001 From: Oliver Joseph Ash Date: Mon, 25 Feb 2019 08:40:37 +0000 Subject: [PATCH 137/924] Add remaining tests --- types/lodash/lodash-tests.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index f3089b4289..bef3f510f3 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -4294,6 +4294,15 @@ fp.now(); // $ExpectType number if (fp.isObject(anything)) { anything; // $ExpectType object } + if (_.isObject(anything)) { + anything; // $ExpectType object + } + if (_(anything).isObject()) { + anything; // $ExpectType any + } + if (_.chain(anything).isObject()) { + anything; // $ExpectType any + } } // _.isObjectLike From 3bd113c6b8af103d53112faa320543b290ec4102 Mon Sep 17 00:00:00 2001 From: Alexandre Esteves Date: Mon, 25 Feb 2019 09:41:54 +0100 Subject: [PATCH 138/924] fix(mongodb): change Object in object --- types/mongodb/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index 9fb58dbfc4..51393a8d25 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -1417,8 +1417,8 @@ export interface FindOneAndUpdateOption extends FindOneAndReplaceOption { /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#findOneAndDelete */ export interface FindOneAndDeleteOption { - projection?: Object; - sort?: Object; + projection?: object; + sort?: object; maxTimeMS?: number; session?: ClientSession; collation?: CollationDocument; From 0caff1966ba7dbc0f62ef19f999d3db78e5f2a77 Mon Sep 17 00:00:00 2001 From: VincentBel Date: Mon, 25 Feb 2019 12:03:18 +0800 Subject: [PATCH 139/924] [redux-form] update v7 relative paths & path mapping --- types/redux-form/v7/tsconfig.json | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/types/redux-form/v7/tsconfig.json b/types/redux-form/v7/tsconfig.json index f106f20d16..19b1709823 100644 --- a/types/redux-form/v7/tsconfig.json +++ b/types/redux-form/v7/tsconfig.json @@ -10,12 +10,20 @@ "noImplicitThis": true, "strictNullChecks": true, "strictFunctionTypes": true, - "baseUrl": "../", + "baseUrl": "../../", "jsx": "react", "typeRoots": [ - "../" + "../../" ], "types": [], + "paths": { + "redux-form": [ + "redux-form/v7" + ], + "redux-form/*": [ + "redux-form/v7/*" + ] + }, "noEmit": true, "forceConsistentCasingInFileNames": true }, From e7f0f8216ea71443219999a10159313cc0b68f49 Mon Sep 17 00:00:00 2001 From: VincentBel Date: Mon, 25 Feb 2019 14:10:26 +0800 Subject: [PATCH 140/924] [redux-form] add v8 typings --- types/redux-form/index.d.ts | 2 +- types/redux-form/lib/Field.d.ts | 2 +- types/redux-form/lib/FieldArray.d.ts | 2 +- types/redux-form/lib/Fields.d.ts | 11 +++++++++-- types/redux-form/lib/FormName.d.ts | 2 +- types/redux-form/redux-form-tests.tsx | 6 +++++- 6 files changed, 18 insertions(+), 7 deletions(-) diff --git a/types/redux-form/index.d.ts b/types/redux-form/index.d.ts index 08d077875a..9f62354a8e 100644 --- a/types/redux-form/index.d.ts +++ b/types/redux-form/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for redux-form 7.5 +// Type definitions for redux-form 8.1 // Project: https://github.com/erikras/redux-form, https://redux-form.com // Definitions by: Carson Full // Daniel Lytkin diff --git a/types/redux-form/lib/Field.d.ts b/types/redux-form/lib/Field.d.ts index 194a322408..f0e1c0a6cc 100644 --- a/types/redux-form/lib/Field.d.ts +++ b/types/redux-form/lib/Field.d.ts @@ -44,7 +44,7 @@ export interface BaseFieldProps

extends Partial { parse?: Parser; validate?: Validator | Validator[]; warn?: Validator | Validator[]; - withRef?: boolean; + forwardRef?: boolean; immutableProps?: string[]; } diff --git a/types/redux-form/lib/FieldArray.d.ts b/types/redux-form/lib/FieldArray.d.ts index a4599b5e97..b84d04ad5a 100644 --- a/types/redux-form/lib/FieldArray.d.ts +++ b/types/redux-form/lib/FieldArray.d.ts @@ -6,7 +6,7 @@ export interface BaseFieldArrayProps

{ component: ComponentType

; validate?: Validator | Validator[]; warn?: Validator | Validator[]; - withRef?: boolean; + forwardRef?: boolean; props?: P; rerenderOnEveryChange?: boolean; } diff --git a/types/redux-form/lib/Fields.d.ts b/types/redux-form/lib/Fields.d.ts index f5ec106852..93b7fbcc74 100644 --- a/types/redux-form/lib/Fields.d.ts +++ b/types/redux-form/lib/Fields.d.ts @@ -1,5 +1,10 @@ import { Component, ComponentType } from "react"; -import { Formatter, Parser, WrappedFieldProps } from "../index"; +import { Formatter, Parser, WrappedFieldProps, Validator } from "../index"; + +export type FieldsWarnerOrValidator = + | Validator + | Validator[] + | { [name: string]: Validator | Validator[] }; interface BaseFieldsProps

{ names: string[]; @@ -7,7 +12,9 @@ interface BaseFieldsProps

{ format?: Formatter | null; props?: P; parse?: Parser; - withRef?: boolean; + forwardRef?: boolean; + validate?: FieldsWarnerOrValidator; + warn?: FieldsWarnerOrValidator; } export interface GenericFields

extends Component & P> { diff --git a/types/redux-form/lib/FormName.d.ts b/types/redux-form/lib/FormName.d.ts index 6cfc6f3708..501035fdf4 100644 --- a/types/redux-form/lib/FormName.d.ts +++ b/types/redux-form/lib/FormName.d.ts @@ -1,7 +1,7 @@ import { ReactNode, StatelessComponent } from "react"; export interface FormNameProps { - children: (props: { form: string }) => ReactNode; + children: (props: { form: string, sectionPrefix?: string }) => ReactNode; } export const FormName: StatelessComponent; diff --git a/types/redux-form/redux-form-tests.tsx b/types/redux-form/redux-form-tests.tsx index 8ad71bbc42..2fa2e8efa1 100644 --- a/types/redux-form/redux-form-tests.tsx +++ b/types/redux-form/redux-form-tests.tsx @@ -422,7 +422,11 @@ class FormNameTest extends React.Component { render() { return ( - {({ form }) => Form Name is: {form}} + {({ form, sectionPrefix }) => ( + + Form name is {form} and section prefix is {sectionPrefix} + + )} ); } From d3a647e3d8dc89a6e7612ae428066b3b0d7505fb Mon Sep 17 00:00:00 2001 From: VincentBel Date: Mon, 25 Feb 2019 14:24:16 +0800 Subject: [PATCH 141/924] add `FormName.d.ts` to `files` of `tsconfig.json` --- types/redux-form/tsconfig.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/redux-form/tsconfig.json b/types/redux-form/tsconfig.json index ea57d2a38a..a7c3f2ede4 100644 --- a/types/redux-form/tsconfig.json +++ b/types/redux-form/tsconfig.json @@ -29,6 +29,7 @@ "lib/Fields.d.ts", "lib/FieldArray.d.ts", "lib/Form.d.ts", + "lib/FormName.d.ts", "lib/FormSection.d.ts", "lib/formValues.d.ts", "lib/formValueSelector.d.ts", @@ -37,4 +38,4 @@ "lib/selectors.d.ts", "lib/SubmissionError.d.ts" ] -} \ No newline at end of file +} From f108386f078f6777f9022d4d56f05d8cf1be2f7f Mon Sep 17 00:00:00 2001 From: Oliver Joseph Ash Date: Mon, 25 Feb 2019 12:14:57 +0000 Subject: [PATCH 142/924] Fix tests --- types/lodash/lodash-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index bef3f510f3..9435ab16da 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -4300,7 +4300,7 @@ fp.now(); // $ExpectType number if (_(anything).isObject()) { anything; // $ExpectType any } - if (_.chain(anything).isObject()) { + if (_.chain(anything).isObject().value()) { anything; // $ExpectType any } } From 8318525edb8ddb232f0f309c8107536dd71ff3e5 Mon Sep 17 00:00:00 2001 From: Oliver Joseph Ash Date: Mon, 25 Feb 2019 12:15:24 +0000 Subject: [PATCH 143/924] Apply to implicit wrapper --- types/lodash/common/lang.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/lodash/common/lang.d.ts b/types/lodash/common/lang.d.ts index cbfe0e56bb..14b00747a0 100644 --- a/types/lodash/common/lang.d.ts +++ b/types/lodash/common/lang.d.ts @@ -1231,7 +1231,7 @@ declare module "../index" { /** * see _.isObject */ - isObject(): boolean; + isObject(): this is LoDashImplicitWrapper; } interface LoDashExplicitWrapper { From ee2c0d0d07561ebede56ae0b43e7ad4d0a30a524 Mon Sep 17 00:00:00 2001 From: Oliver Joseph Ash Date: Mon, 25 Feb 2019 12:45:58 +0000 Subject: [PATCH 144/924] Remove redundant tests --- types/lodash/lodash-tests.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index 9435ab16da..05c1a20215 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -4297,12 +4297,6 @@ fp.now(); // $ExpectType number if (_.isObject(anything)) { anything; // $ExpectType object } - if (_(anything).isObject()) { - anything; // $ExpectType any - } - if (_.chain(anything).isObject().value()) { - anything; // $ExpectType any - } } // _.isObjectLike From 5cf2cac315357c424d79eb89c0fcb1a601cfcb57 Mon Sep 17 00:00:00 2001 From: Antoine Rousseau Date: Mon, 25 Feb 2019 15:10:07 +0100 Subject: [PATCH 145/924] set languages list --- types/algoliasearch/index.d.ts | 2 +- types/algoliasearch/lite/index.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/algoliasearch/index.d.ts b/types/algoliasearch/index.d.ts index a5597bc835..1dc50603c7 100644 --- a/types/algoliasearch/index.d.ts +++ b/types/algoliasearch/index.d.ts @@ -1792,7 +1792,7 @@ declare namespace algoliasearch { * such as ignorePlurals, removeStopWords, and CJK word-detection. * https://www.algolia.com/doc/api-reference/api-parameters/queryLanguages/ */ - queryLanguages?: string[]; + queryLanguages?: Array<'af' | 'ar' | 'az' | 'bg' | 'bn' | 'ca' | 'cs' | 'cy' | 'da' | 'de' | 'el' | 'en' | 'eo' | 'es' | 'et' | 'eu' | 'fa' | 'fi' | 'fo' | 'fr' | 'ga' | 'gl' | 'he' | 'hi' | 'hu' | 'hy' | 'id' | 'is' | 'it' | 'ja' | 'ka' | 'kk' | 'ko' | 'ku' | 'ky' | 'lt' | 'lv' | 'mi' | 'mn' | 'mr' | 'ms' | 'mt' | 'nb' | 'nl' | 'no' | 'ns' | 'pl' | 'ps' | 'pt' | 'pt-br' | 'qu' | 'ro' | 'ru' | 'sk' | 'sq' | 'sv' | 'sw' | 'ta' | 'te' | 'th' | 'tl' | 'tn' | 'tr' | 'tt' | 'uk' | 'ur' | 'uz' | 'zh'>; } interface Response { diff --git a/types/algoliasearch/lite/index.d.ts b/types/algoliasearch/lite/index.d.ts index 0ef8cd9e8c..74c4b1bf15 100644 --- a/types/algoliasearch/lite/index.d.ts +++ b/types/algoliasearch/lite/index.d.ts @@ -544,7 +544,7 @@ declare namespace algoliasearch { * such as ignorePlurals, removeStopWords, and CJK word-detection. * https://www.algolia.com/doc/api-reference/api-parameters/queryLanguages/ */ - queryLanguages?: string[]; + queryLanguages?: Array<'af' | 'ar' | 'az' | 'bg' | 'bn' | 'ca' | 'cs' | 'cy' | 'da' | 'de' | 'el' | 'en' | 'eo' | 'es' | 'et' | 'eu' | 'fa' | 'fi' | 'fo' | 'fr' | 'ga' | 'gl' | 'he' | 'hi' | 'hu' | 'hy' | 'id' | 'is' | 'it' | 'ja' | 'ka' | 'kk' | 'ko' | 'ku' | 'ky' | 'lt' | 'lv' | 'mi' | 'mn' | 'mr' | 'ms' | 'mt' | 'nb' | 'nl' | 'no' | 'ns' | 'pl' | 'ps' | 'pt' | 'pt-br' | 'qu' | 'ro' | 'ru' | 'sk' | 'sq' | 'sv' | 'sw' | 'ta' | 'te' | 'th' | 'tl' | 'tn' | 'tr' | 'tt' | 'uk' | 'ur' | 'uz' | 'zh'>; } namespace SearchForFacetValues { From ee7c5c62ee95fe245bae4ed3e95668cc7e457837 Mon Sep 17 00:00:00 2001 From: Asaf Algawi Date: Mon, 25 Feb 2019 21:31:44 +0200 Subject: [PATCH 146/924] changed DocumentArray discriminator to allow recieving both document and model templates --- types/mongoose/index.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index fde5e91372..d09ba19079 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -2409,6 +2409,13 @@ declare module "mongoose" { */ discriminator(name: string, schema: Schema): Model; + /** + * Adds a discriminator type. + * @param name discriminator model name + * @param schema discriminator model schema + */ + discriminator>(name: string, schema: Schema): M; + } /* From f82f720bb3c47859a3f2ff53546ee69ebec3f120 Mon Sep 17 00:00:00 2001 From: Michael Heasell Date: Fri, 15 Feb 2019 11:31:52 +0000 Subject: [PATCH 147/924] Fix wrongly-defined return type for _.matches, _.matcher --- types/underscore/index.d.ts | 8 ++++++-- types/underscore/underscore-tests.ts | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/types/underscore/index.d.ts b/types/underscore/index.d.ts index 72498e3591..1b89408ab3 100644 --- a/types/underscore/index.d.ts +++ b/types/underscore/index.d.ts @@ -69,6 +69,10 @@ declare module _ { [index: string]: T; } + interface Predicate { + (value: T): boolean; + } + interface ListIterator { (value: T, index: number, list: List): TResult; } @@ -3782,7 +3786,7 @@ declare module _ { * @param attrs Object with key values pair * @return Predicate function **/ - matches(attrs: T): _.ListIterator; + matches(attrs: T): _.Predicate; /** * Returns a predicate function that will tell you if a passed in object contains all of the key/value properties present in attrs. @@ -3790,7 +3794,7 @@ declare module _ { * @param attrs Object with key values pair * @return Predicate function **/ - matcher(attrs: T): _.ListIterator; + matcher(attrs: T): _.Predicate; /** * Returns a function that will itself return the key property of any passed-in object. diff --git a/types/underscore/underscore-tests.ts b/types/underscore/underscore-tests.ts index 6175c1874b..13bc542b28 100644 --- a/types/underscore/underscore-tests.ts +++ b/types/underscore/underscore-tests.ts @@ -216,6 +216,8 @@ interface Family { } var isUncleMoe = _.matches({ name: 'moe', relation: 'uncle' }); _.filter([{ name: 'larry', relation: 'father' }, { name: 'moe', relation: 'uncle' }], isUncleMoe); +var uncleMoe: Family = { name: 'moe', relation: 'uncle' }; +isUncleMoe(uncleMoe); From 8f38b13a4c99dcf185b48cf0e88fa58114508444 Mon Sep 17 00:00:00 2001 From: Brian Putnam Date: Mon, 25 Feb 2019 19:05:15 -0700 Subject: [PATCH 148/924] sqlite3: Add constants for file open These were added in https://github.com/mapbox/node-sqlite3/pull/1078 --- types/sqlite3/index.d.ts | 6 ++++++ types/sqlite3/sqlite3-tests.ts | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/types/sqlite3/index.d.ts b/types/sqlite3/index.d.ts index 3ed7c96a51..531d49a3b3 100644 --- a/types/sqlite3/index.d.ts +++ b/types/sqlite3/index.d.ts @@ -12,6 +12,9 @@ import events = require("events"); export const OPEN_READONLY: number; export const OPEN_READWRITE: number; export const OPEN_CREATE: number; +export const OPEN_SHAREDCACHE: number; +export const OPEN_PRIVATECACHE: number; +export const OPEN_URI: number; export const cached: { Database(filename: string, callback?: (this: Database, err: Error | null) => void): Database; @@ -94,6 +97,9 @@ export interface sqlite3 { OPEN_READONLY: number; OPEN_READWRITE: number; OPEN_CREATE: number; + OPEN_SHAREDCACHE: number; + OPEN_PRIVATECACHE: number; + OPEN_URI: number; cached: typeof cached; RunResult: RunResult; Statement: typeof Statement; diff --git a/types/sqlite3/sqlite3-tests.ts b/types/sqlite3/sqlite3-tests.ts index 19a7edae66..f364158fc6 100644 --- a/types/sqlite3/sqlite3-tests.ts +++ b/types/sqlite3/sqlite3-tests.ts @@ -53,6 +53,17 @@ function runChainExample() { runChainExample(); +function runMemoryChainExample() { + console.log(`createDb chain - in-memory database`); + db = new sqlite3.Database( + ':memory:', + sqlite3. OPEN_CREATE | sqlite3.OPEN_READWRITE | sqlite3.OPEN_SHAREDCACHE, + createTable); + db.configure("busyTimeout", 1000); +} + +runMemoryChainExample(); + db.serialize(() => { db.run("CREATE TABLE lorem (info TEXT)"); From 7ab7f2ace5ae9254f95056071e73d18f84c53533 Mon Sep 17 00:00:00 2001 From: 4c656f6e Date: Tue, 26 Feb 2019 14:31:56 +1000 Subject: [PATCH 149/924] Update recharts/index.d.ts Update BarProps label to include LabelProps Change instances of React.ReactElement to React.ReactElement for backwards compatibility --- types/recharts/index.d.ts | 81 ++++++++++++++++++++------------------- 1 file changed, 41 insertions(+), 40 deletions(-) diff --git a/types/recharts/index.d.ts b/types/recharts/index.d.ts index 44f97c933b..ac42b06667 100644 --- a/types/recharts/index.d.ts +++ b/types/recharts/index.d.ts @@ -13,6 +13,7 @@ // Andrew Palugniok // Robert Stigsson // Kosaku Kurino +// Leon Ng // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -171,9 +172,9 @@ export interface AreaProps extends EventAttributes, Partial; - dot?: boolean | object | React.ReactElement | ContentRenderer; - label?: boolean | object | ContentRenderer | React.ReactElement; + activeDot?: boolean | object | React.ReactElement | ContentRenderer; + dot?: boolean | object | React.ReactElement | ContentRenderer; + label?: boolean | object | ContentRenderer | React.ReactElement; hide?: boolean; layout?: LayoutType; baseLine?: number | any[]; @@ -215,11 +216,11 @@ export interface BarProps extends EventAttributes, Partial; + shape?: React.ReactElement | ContentRenderer; data?: BarData[]; - background?: boolean | React.ReactElement | ContentRenderer | object; + background?: boolean | React.ReactElement | ContentRenderer | object; // see label section at http://recharts.org/#/en-US/api/Bar - label?: boolean | Label | React.SFC | React.ReactElement | ContentRenderer; + label?: boolean | Label | LabelProps | React.SFC | React.ReactElement | ContentRenderer; } export class Bar extends React.Component { } @@ -259,7 +260,7 @@ export interface CartesianAxisProps extends EventAttributes, Partial | object | React.ReactElement; + tick?: boolean | ContentRenderer | object | React.ReactElement; axisLine?: boolean | object; tickLine?: boolean | object; mirror?: boolean; @@ -285,8 +286,8 @@ export interface CartesianGridProps extends Partial { y?: number; width?: number; height?: number; - horizontal?: object | React.ReactElement | ContentRenderer | boolean; - vertical?: object | React.ReactElement | ContentRenderer | boolean; + horizontal?: object | React.ReactElement | ContentRenderer | boolean; + vertical?: object | React.ReactElement | ContentRenderer | boolean; horizontalPoints?: number[]; verticalPoints?: number[]; horizontalCoordinatesGenerator?: CoordinatesGenerator; @@ -376,7 +377,7 @@ export interface LegendPayload { export type BBoxUpdateCallback = (box: { width: number; height: number; }) => void; export interface LegendProps { - content?: React.ReactElement | ContentRenderer; + content?: React.ReactElement | ContentRenderer; wrapperStyle?: object; chartWidth?: number; chartHeight?: number; @@ -411,15 +412,15 @@ export interface LineProps extends EventAttributes, Partial | boolean; - dot?: object | React.ReactElement | ContentRenderer | boolean; + activeDot?: object | React.ReactElement | ContentRenderer | boolean; + dot?: object | React.ReactElement | ContentRenderer | boolean; top?: number; left?: number; width?: number; height?: number; data?: object[]; dataKey: DataKey; // As the source code states, dataKey will replace valueKey in 1.1.0 and it'll be required (it's already required in current implementation). - label?: boolean | object | React.ReactElement | ContentRenderer; + label?: boolean | object | React.ReactElement | ContentRenderer; points?: Point[]; } @@ -450,11 +451,11 @@ export interface PieProps extends EventAttributes, Partial | React.ReactElement | boolean; + labelLine?: object | ContentRenderer | React.ReactElement | boolean; label?: { offsetRadius: number; - } | React.ReactElement | ContentRenderer | boolean; - activeShape?: object | ContentRenderer | React.ReactElement; + } | React.ReactElement | ContentRenderer | boolean; + activeShape?: object | ContentRenderer | React.ReactElement; activeIndex?: number | number[]; blendStroke?: boolean; } @@ -501,7 +502,7 @@ export interface PolarAngleAxisProps extends EventAttributes, Partial | object | React.ReactElement; + tick?: boolean | ContentRenderer | object | React.ReactElement; ticks?: PolarAngleAxisTick[]; stroke?: string; orientation?: 'inner' | 'outer'; @@ -540,7 +541,7 @@ export interface PolarRadiusAxisProps extends EventAttributes, Partial; + tick?: boolean | object | React.ReactElement | ContentRenderer; stroke?: string; tickFormatter?: TickFormatterFunction; domain?: [PolarRadiusAxisDomain, PolarRadiusAxisDomain]; @@ -577,10 +578,10 @@ export interface RadarProps extends EventAttributes, Partial; - activeDot?: object | React.ReactElement | ContentRenderer | boolean; - dot?: object | React.ReactElement | ContentRenderer | boolean; - label?: object | React.ReactElement | ContentRenderer | boolean; + shape?: React.ReactElement | ContentRenderer; + activeDot?: object | React.ReactElement | ContentRenderer | boolean; + dot?: object | React.ReactElement | ContentRenderer | boolean; + label?: object | React.ReactElement | ContentRenderer | boolean; legendType?: LegendType; hide?: boolean; } @@ -612,15 +613,15 @@ export interface RadialBarProps extends EventAttributes, Partial | React.ReactElement; - activeShape?: object | ContentRenderer | React.ReactElement; + shape?: ContentRenderer | React.ReactElement; + activeShape?: object | ContentRenderer | React.ReactElement; cornerRadius?: number | string; minPointSize?: number; maxBarSize?: number; data?: RadialBarData[]; legendType?: LegendType; - label?: boolean | React.ReactElement | ContentRenderer | object; - background?: boolean | React.ReactElement | ContentRenderer | object; + label?: boolean | React.ReactElement | ContentRenderer | object; + background?: boolean | React.ReactElement | ContentRenderer | object; hide?: boolean; } @@ -662,7 +663,7 @@ export interface ReferenceAreaProps extends Partial { y2?: number | string; xAxisId?: string | number; yAxisId?: string | number; - shape?: ContentRenderer | React.ReactElement; + shape?: ContentRenderer | React.ReactElement; } export class ReferenceArea extends React.Component { } @@ -688,7 +689,7 @@ export interface ReferenceDotProps extends EventAttributes, Partial> & { cx: number; cy: number; } - > | React.ReactElement; + > | React.ReactElement; } export class ReferenceDot extends React.Component { } @@ -703,14 +704,14 @@ export interface ReferenceLineProps extends Partial | React.ReactElement; + label?: string | number | ContentRenderer | React.ReactElement; xAxisId?: string | number; yAxisId?: string | number; shape?: ContentRenderer< EventAttributes & Partial> & { x1: number; y1: number; x2: number; y2: number; } - > | React.ReactElement; + > | React.ReactElement; } export class ReferenceLine extends React.Component { } @@ -746,13 +747,13 @@ export interface ScatterProps extends EventAttributes, Partial; lineType?: 'joint' | 'fitting'; lineJointType?: LineType; legendType?: LegendType; activeIndex?: number; - activeShape?: object | RechartsFunction | React.ReactElement; - shape?: 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | React.ReactElement | ContentRenderer; + activeShape?: object | RechartsFunction | React.ReactElement; + shape?: 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | React.ReactElement | ContentRenderer; points?: ScatterPoint[]; hide?: boolean; data?: object[]; @@ -824,7 +825,7 @@ export interface TooltipPayload { } export interface TooltipProps extends Animatable { - content?: React.ReactElement | React.StatelessComponent | ContentRenderer; + content?: React.ReactElement | React.StatelessComponent | ContentRenderer; viewBox?: ViewBox; active?: boolean; separator?: string; @@ -833,7 +834,7 @@ export interface TooltipProps extends Animatable { itemStyle?: object; labelStyle?: object; wrapperStyle?: object; - cursor?: boolean | object | React.ReactElement | React.StatelessComponent; + cursor?: boolean | object | React.ReactElement | React.StatelessComponent; coordinate?: Coordinate; position?: Coordinate; label?: string | number; @@ -852,7 +853,7 @@ export interface TreemapProps extends EventAttributes, Animatable { data?: any[]; style?: object; aspectRatio?: number; - content?: React.ReactElement | ContentRenderer; + content?: React.ReactElement | ContentRenderer; fill?: string; stroke?: string; className?: string; @@ -874,7 +875,7 @@ export interface LabelProps extends Partial { position?: PositionType; children?: React.ReactNode[] | React.ReactNode; className?: string; - content?: React.ReactElement | ContentRenderer; + content?: React.ReactElement | ContentRenderer; } export class LabelList extends React.Component { } @@ -884,7 +885,7 @@ export interface LabelListProps { children?: React.ReactNode[] | React.ReactNode; className?: string; clockWise?: boolean; - content?: React.ReactElement | ContentRenderer; + content?: React.ReactElement | ContentRenderer; data?: number; dataKey: string | number | RechartsFunction; formatter?: LabelFormatter; @@ -935,7 +936,7 @@ export interface XAxisProps extends EventAttributes { padding?: XPadding; allowDataOverflow?: boolean; scale?: ScaleType | RechartsFunction; - tick?: boolean | ContentRenderer | object | React.ReactElement; + tick?: boolean | ContentRenderer | object | React.ReactElement; axisLine?: boolean | object; tickLine?: boolean | object; minTickGap?: number; @@ -989,7 +990,7 @@ export interface YAxisProps extends EventAttributes { padding?: YPadding; allowDataOverflow?: boolean; scale?: ScaleType | RechartsFunction; - tick?: boolean | ContentRenderer | object | React.ReactElement; + tick?: boolean | ContentRenderer | object | React.ReactElement; axisLine?: boolean | object; tickLine?: boolean | object; minTickGap?: number; From 698c95aed6dca4c300eb1d19f0e62da2ccec2a57 Mon Sep 17 00:00:00 2001 From: Carles Capellas Date: Tue, 26 Feb 2019 12:57:56 +0100 Subject: [PATCH 150/924] Add draft-js missing ReactElement generic type argument --- types/draft-js/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/draft-js/index.d.ts b/types/draft-js/index.d.ts index 2f58d64a52..1a3eb0e39a 100644 --- a/types/draft-js/index.d.ts +++ b/types/draft-js/index.d.ts @@ -623,7 +623,7 @@ declare namespace Draft { interface DraftBlockRenderConfig { element: string; - wrapper?: React.ReactElement; + wrapper?: React.ReactNode; } class EditorState extends Record { From 0727cf8474f5a449b43b75ce29cf3bae457a1ed5 Mon Sep 17 00:00:00 2001 From: Errietta Kostala Date: Tue, 26 Feb 2019 13:28:49 +0000 Subject: [PATCH 151/924] HKP types --- types/openpgp/common/index.d.ts | 5 +++++ types/openpgp/common/tsconfig.json | 22 ++++++++++++++++++++++ types/openpgp/index.d.ts | 2 ++ types/openpgp/openpgp-tests.ts | 17 +++++++++++++++++ types/openpgp/ts3.2/index.d.ts | 2 ++ 5 files changed, 48 insertions(+) create mode 100644 types/openpgp/common/index.d.ts create mode 100644 types/openpgp/common/tsconfig.json diff --git a/types/openpgp/common/index.d.ts b/types/openpgp/common/index.d.ts new file mode 100644 index 0000000000..88796dea9d --- /dev/null +++ b/types/openpgp/common/index.d.ts @@ -0,0 +1,5 @@ +export class HKP { + constructor(keyServerUrl?: string); + lookup(options: {keyId?: string, query?: string }): Promise; + upload(publicKeyArmored: string): Promise; +} diff --git a/types/openpgp/common/tsconfig.json b/types/openpgp/common/tsconfig.json new file mode 100644 index 0000000000..f7e7d1970b --- /dev/null +++ b/types/openpgp/common/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts" + ] +} diff --git a/types/openpgp/index.d.ts b/types/openpgp/index.d.ts index d564c6df6d..6558e26eb2 100644 --- a/types/openpgp/index.d.ts +++ b/types/openpgp/index.d.ts @@ -10,6 +10,8 @@ export as namespace openpgp; +export * from './common'; + export interface UserId { name?: string, email?: string, diff --git a/types/openpgp/openpgp-tests.ts b/types/openpgp/openpgp-tests.ts index 19e305cb26..3c8f19681f 100644 --- a/types/openpgp/openpgp-tests.ts +++ b/types/openpgp/openpgp-tests.ts @@ -193,3 +193,20 @@ openpgp.util.shiftRight("", 1); openpgp.util.str2bin(""); openpgp.util.str2Uint8Array(""); openpgp.util.Uint8Array2str(openpgp.util.str2Uint8Array("")); + +async () => { + let hkp = new openpgp.HKP(); // Defaults to https://keyserver.ubuntu.com, or pass another keyserver URL as a string + + let hkpOptions = { + query: 'alice@example.com' + }; + + let armoredPubkey = await hkp.lookup(hkpOptions); + await openpgp.key.readArmored(armoredPubkey); + + hkp = new openpgp.HKP('https://pgp.mit.edu'); + + let pubkey = '-----BEGIN PGP PUBLIC KEY BLOCK ... END PGP PUBLIC KEY BLOCK-----'; + + await hkp.upload(pubkey); +} diff --git a/types/openpgp/ts3.2/index.d.ts b/types/openpgp/ts3.2/index.d.ts index 428f785dbe..7342f5f928 100644 --- a/types/openpgp/ts3.2/index.d.ts +++ b/types/openpgp/ts3.2/index.d.ts @@ -9,6 +9,8 @@ export as namespace openpgp; +export * from '../common'; + export interface UserId { name?: string, email?: string, From f3c884d79d4291a20090609c7cc92955f66db395 Mon Sep 17 00:00:00 2001 From: Errietta Kostala Date: Tue, 26 Feb 2019 13:59:40 +0000 Subject: [PATCH 152/924] move definitions --- types/openpgp/index.d.ts | 2 +- types/openpgp/openpgp-tests.ts | 34 +++++++++++++++++----------------- types/openpgp/ts3.2/index.d.ts | 2 +- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/types/openpgp/index.d.ts b/types/openpgp/index.d.ts index 6558e26eb2..628663a9ec 100644 --- a/types/openpgp/index.d.ts +++ b/types/openpgp/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for openpgp 4.0.1 +// Type definitions for openpgp 4.4.8 // Project: http://openpgpjs.org/ // Definitions by: Guillaume Lacasa // Errietta Kostala diff --git a/types/openpgp/openpgp-tests.ts b/types/openpgp/openpgp-tests.ts index 3c8f19681f..09795ce630 100644 --- a/types/openpgp/openpgp-tests.ts +++ b/types/openpgp/openpgp-tests.ts @@ -135,6 +135,23 @@ openpgp.initWorker({ path:'openpgp.worker.js' }); return verified.signatures[0].valid; })(); +async () => { + let hkp = new openpgp.HKP(); // Defaults to https://keyserver.ubuntu.com, or pass another keyserver URL as a string + + let hkpOptions = { + query: 'alice@example.com' + }; + + let armoredPubkey = await hkp.lookup(hkpOptions); + await openpgp.key.readArmored(armoredPubkey); + + hkp = new openpgp.HKP('https://pgp.mit.edu'); + + let pubkey = '-----BEGIN PGP PUBLIC KEY BLOCK ... END PGP PUBLIC KEY BLOCK-----'; + + await hkp.upload(pubkey); +} + // Open PGP Tests @@ -193,20 +210,3 @@ openpgp.util.shiftRight("", 1); openpgp.util.str2bin(""); openpgp.util.str2Uint8Array(""); openpgp.util.Uint8Array2str(openpgp.util.str2Uint8Array("")); - -async () => { - let hkp = new openpgp.HKP(); // Defaults to https://keyserver.ubuntu.com, or pass another keyserver URL as a string - - let hkpOptions = { - query: 'alice@example.com' - }; - - let armoredPubkey = await hkp.lookup(hkpOptions); - await openpgp.key.readArmored(armoredPubkey); - - hkp = new openpgp.HKP('https://pgp.mit.edu'); - - let pubkey = '-----BEGIN PGP PUBLIC KEY BLOCK ... END PGP PUBLIC KEY BLOCK-----'; - - await hkp.upload(pubkey); -} diff --git a/types/openpgp/ts3.2/index.d.ts b/types/openpgp/ts3.2/index.d.ts index 7342f5f928..e7f8cdd714 100644 --- a/types/openpgp/ts3.2/index.d.ts +++ b/types/openpgp/ts3.2/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for openpgp 4.0.1 +// Type definitions for openpgp 4.4.8 // Project: http://openpgpjs.org/ // Definitions by: Guillaume Lacasa // Errietta Kostala From e6787c6405df266fe49d94bf8330a519c016a70d Mon Sep 17 00:00:00 2001 From: Errietta Kostala Date: Tue, 26 Feb 2019 14:02:06 +0000 Subject: [PATCH 153/924] unused file --- types/openpgp/common/tsconfig.json | 22 ---------------------- types/openpgp/openpgp-tests.ts | 2 +- 2 files changed, 1 insertion(+), 23 deletions(-) delete mode 100644 types/openpgp/common/tsconfig.json diff --git a/types/openpgp/common/tsconfig.json b/types/openpgp/common/tsconfig.json deleted file mode 100644 index f7e7d1970b..0000000000 --- a/types/openpgp/common/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": true, - "baseUrl": "../../", - "typeRoots": [ - "../../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts" - ] -} diff --git a/types/openpgp/openpgp-tests.ts b/types/openpgp/openpgp-tests.ts index 09795ce630..98e326b876 100644 --- a/types/openpgp/openpgp-tests.ts +++ b/types/openpgp/openpgp-tests.ts @@ -136,7 +136,7 @@ openpgp.initWorker({ path:'openpgp.worker.js' }); })(); async () => { - let hkp = new openpgp.HKP(); // Defaults to https://keyserver.ubuntu.com, or pass another keyserver URL as a string + let hkp = new openpgp.HKP(); let hkpOptions = { query: 'alice@example.com' From 31a924b4f32f5dd6842d24d866df46241596fc59 Mon Sep 17 00:00:00 2001 From: Errietta Kostala Date: Tue, 26 Feb 2019 18:54:37 +0000 Subject: [PATCH 154/924] use const --- types/openpgp/openpgp-tests.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/openpgp/openpgp-tests.ts b/types/openpgp/openpgp-tests.ts index 98e326b876..100941074a 100644 --- a/types/openpgp/openpgp-tests.ts +++ b/types/openpgp/openpgp-tests.ts @@ -138,16 +138,16 @@ openpgp.initWorker({ path:'openpgp.worker.js' }); async () => { let hkp = new openpgp.HKP(); - let hkpOptions = { + const hkpOptions = { query: 'alice@example.com' }; - let armoredPubkey = await hkp.lookup(hkpOptions); + const armoredPubkey = await hkp.lookup(hkpOptions); await openpgp.key.readArmored(armoredPubkey); hkp = new openpgp.HKP('https://pgp.mit.edu'); - let pubkey = '-----BEGIN PGP PUBLIC KEY BLOCK ... END PGP PUBLIC KEY BLOCK-----'; + const pubkey = '-----BEGIN PGP PUBLIC KEY BLOCK ... END PGP PUBLIC KEY BLOCK-----'; await hkp.upload(pubkey); } From 1f1aefb128fb69e8c4e08f04147fe16adc3e2e4e Mon Sep 17 00:00:00 2001 From: Jacob Gardner Date: Tue, 26 Feb 2019 13:09:22 -0600 Subject: [PATCH 155/924] Add server properties to connection object --- types/amqplib/callback_api.d.ts | 106 ++++++++++++++++++++++++++------ 1 file changed, 88 insertions(+), 18 deletions(-) diff --git a/types/amqplib/callback_api.d.ts b/types/amqplib/callback_api.d.ts index 9fca3972e4..5d92376606 100644 --- a/types/amqplib/callback_api.d.ts +++ b/types/amqplib/callback_api.d.ts @@ -2,36 +2,92 @@ import events = require('events'); import { Replies, Options, Message } from './properties'; export * from './properties'; +export interface ServerProperties { + host: string; + product: string; + version: string; + platform?: string; + copyright?: string; + information?: string; +} + export interface Connection extends events.EventEmitter { close(callback?: (err: any) => void): void; createChannel(callback: (err: any, channel: Channel) => void): void; createConfirmChannel(callback: (err: any, confirmChannel: ConfirmChannel) => void): void; + serverProperties: ServerProperties; } export interface Channel extends events.EventEmitter { close(callback: (err: any) => void): void; - assertQueue(queue?: string, options?: Options.AssertQueue, callback?: (err: any, ok: Replies.AssertQueue) => void): void; + assertQueue( + queue?: string, + options?: Options.AssertQueue, + callback?: (err: any, ok: Replies.AssertQueue) => void + ): void; checkQueue(queue: string, callback?: (err: any, ok: Replies.AssertQueue) => void): void; - deleteQueue(queue: string, options?: Options.DeleteQueue, callback?: (err: any, ok: Replies.DeleteQueue) => void): void; + deleteQueue( + queue: string, + options?: Options.DeleteQueue, + callback?: (err: any, ok: Replies.DeleteQueue) => void + ): void; purgeQueue(queue: string, callback?: (err: any, ok: Replies.PurgeQueue) => void): void; - bindQueue(queue: string, source: string, pattern: string, args?: any, callback?: (err: any, ok: Replies.Empty) => void): void; - unbindQueue(queue: string, source: string, pattern: string, args?: any, callback?: (err: any, ok: Replies.Empty) => void): void; + bindQueue( + queue: string, + source: string, + pattern: string, + args?: any, + callback?: (err: any, ok: Replies.Empty) => void + ): void; + unbindQueue( + queue: string, + source: string, + pattern: string, + args?: any, + callback?: (err: any, ok: Replies.Empty) => void + ): void; - assertExchange(exchange: string, type: string, options?: Options.AssertExchange, callback?: (err: any, ok: Replies.AssertExchange) => void): void; + assertExchange( + exchange: string, + type: string, + options?: Options.AssertExchange, + callback?: (err: any, ok: Replies.AssertExchange) => void + ): void; checkExchange(exchange: string, callback?: (err: any, ok: Replies.Empty) => void): void; - deleteExchange(exchange: string, options?: Options.DeleteExchange, callback?: (err: any, ok: Replies.Empty) => void): void; + deleteExchange( + exchange: string, + options?: Options.DeleteExchange, + callback?: (err: any, ok: Replies.Empty) => void + ): void; - bindExchange(destination: string, source: string, pattern: string, args?: any, callback?: (err: any, ok: Replies.Empty) => void): void; - unbindExchange(destination: string, source: string, pattern: string, args?: any, callback?: (err: any, ok: Replies.Empty) => void): void; + bindExchange( + destination: string, + source: string, + pattern: string, + args?: any, + callback?: (err: any, ok: Replies.Empty) => void + ): void; + unbindExchange( + destination: string, + source: string, + pattern: string, + args?: any, + callback?: (err: any, ok: Replies.Empty) => void + ): void; publish(exchange: string, routingKey: string, content: Buffer, options?: Options.Publish): boolean; sendToQueue(queue: string, content: Buffer, options?: Options.Publish): boolean; - consume(queue: string, onMessage: (msg: Message | null) => any, options?: Options.Consume, callback?: (err: any, ok: Replies.Consume) => void): void; + consume( + queue: string, + onMessage: (msg: Message | null) => any, + options?: Options.Consume, + callback?: (err: any, ok: Replies.Consume) => void + ): void; cancel(consumerTag: string, callback?: (err: any, ok: Replies.Empty) => void): void; get(queue: string, options?: Options.Get, callback?: (err: any, ok: Message | false) => void): void; @@ -48,22 +104,36 @@ export interface Channel extends events.EventEmitter { } export interface ConfirmChannel extends Channel { - publish(exchange: string, routingKey: string, content: Buffer, options?: Options.Publish, callback?: (err: any, ok: Replies.Empty) => void): boolean; - sendToQueue(queue: string, content: Buffer, options?: Options.Publish, callback?: (err: any, ok: Replies.Empty) => void): boolean; + publish( + exchange: string, + routingKey: string, + content: Buffer, + options?: Options.Publish, + callback?: (err: any, ok: Replies.Empty) => void + ): boolean; + sendToQueue( + queue: string, + content: Buffer, + options?: Options.Publish, + callback?: (err: any, ok: Replies.Empty) => void + ): boolean; waitForConfirms(callback?: (err: any) => void): void; } export const credentials: { external(): { - mechanism: string; - response(): Buffer; + mechanism: string; + response(): Buffer; }; - plain(username: string, password: string): { - mechanism: string; - response(): Buffer; - username: string; - password: string; + plain( + username: string, + password: string + ): { + mechanism: string; + response(): Buffer; + username: string; + password: string; }; }; From 219fd7573e818f3b54030c92ec13a1ec342a5c04 Mon Sep 17 00:00:00 2001 From: Jacob Gardner Date: Tue, 26 Feb 2019 13:27:55 -0600 Subject: [PATCH 156/924] Make sure both callback and promise Connection have serverProperties field. Add test. --- types/amqplib/amqplib-tests.ts | 14 ++++++++++++++ types/amqplib/callback_api.d.ts | 11 +---------- types/amqplib/index.d.ts | 3 ++- types/amqplib/properties.d.ts | 9 +++++++++ 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/types/amqplib/amqplib-tests.ts b/types/amqplib/amqplib-tests.ts index ef448d5b36..97844f3b50 100644 --- a/types/amqplib/amqplib-tests.ts +++ b/types/amqplib/amqplib-tests.ts @@ -14,6 +14,13 @@ amqp.connect('amqp://localhost') amqp.connect('amqp://localhost') .then(connection => { + connection.serverProperties.copyright; // $ExpectType string | undefined + connection.serverProperties.platform; // $ExpectType string | undefined + connection.serverProperties.information; // $ExpectType string | undefined + connection.serverProperties.host; // $ExpectType string + connection.serverProperties.product; // $ExpectType string + connection.serverProperties.version; // $ExpectType string + return connection.createChannel() .tap(channel => channel.checkQueue('myQueue')) .then(channel => { @@ -37,6 +44,13 @@ import amqpcb = require('amqplib/callback_api'); amqpcb.connect('amqp://localhost', (err, connection) => { if (!err) { + connection.serverProperties.copyright; // $ExpectType string | undefined + connection.serverProperties.platform; // $ExpectType string | undefined + connection.serverProperties.information; // $ExpectType string | undefined + connection.serverProperties.host; // $ExpectType string + connection.serverProperties.product; // $ExpectType string + connection.serverProperties.version; // $ExpectType string + connection.createChannel((err, channel) => { if (!err) { channel.assertQueue('myQueue', {}, (err, ok) => { diff --git a/types/amqplib/callback_api.d.ts b/types/amqplib/callback_api.d.ts index 5d92376606..4fcc0b5309 100644 --- a/types/amqplib/callback_api.d.ts +++ b/types/amqplib/callback_api.d.ts @@ -1,16 +1,7 @@ import events = require('events'); -import { Replies, Options, Message } from './properties'; +import { Replies, Options, Message, ServerProperties } from './properties'; export * from './properties'; -export interface ServerProperties { - host: string; - product: string; - version: string; - platform?: string; - copyright?: string; - information?: string; -} - export interface Connection extends events.EventEmitter { close(callback?: (err: any) => void): void; createChannel(callback: (err: any, channel: Channel) => void): void; diff --git a/types/amqplib/index.d.ts b/types/amqplib/index.d.ts index 7087d74edc..77e5d19ca9 100644 --- a/types/amqplib/index.d.ts +++ b/types/amqplib/index.d.ts @@ -8,13 +8,14 @@ import * as Promise from 'bluebird'; import * as events from 'events'; -import { Replies, Options, Message, GetMessage, ConsumeMessage } from './properties'; +import { Replies, Options, Message, GetMessage, ConsumeMessage, ServerProperties } from './properties'; export * from './properties'; export interface Connection extends events.EventEmitter { close(): Promise; createChannel(): Promise; createConfirmChannel(): Promise; + serverProperties: ServerProperties; } export interface Channel extends events.EventEmitter { diff --git a/types/amqplib/properties.d.ts b/types/amqplib/properties.d.ts index 97dc8ac393..7e9198ac7a 100644 --- a/types/amqplib/properties.d.ts +++ b/types/amqplib/properties.d.ts @@ -210,3 +210,12 @@ export interface XDeath { "original-expiration"?: any; "routing-keys": string[]; } + +export interface ServerProperties { + host: string; + product: string; + version: string; + platform?: string; + copyright?: string; + information?: string; +} From 6fde3e12581a1e0861c8d013e5c56df143841a23 Mon Sep 17 00:00:00 2001 From: Jacob Gardner Date: Tue, 26 Feb 2019 13:34:27 -0600 Subject: [PATCH 157/924] I read the original spec incorrectly. Updated it accordingly. --- types/amqplib/amqplib-tests.ts | 10 ++++++---- types/amqplib/properties.d.ts | 5 +++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/types/amqplib/amqplib-tests.ts b/types/amqplib/amqplib-tests.ts index 97844f3b50..a42d2f717d 100644 --- a/types/amqplib/amqplib-tests.ts +++ b/types/amqplib/amqplib-tests.ts @@ -15,11 +15,12 @@ amqp.connect('amqp://localhost') amqp.connect('amqp://localhost') .then(connection => { connection.serverProperties.copyright; // $ExpectType string | undefined - connection.serverProperties.platform; // $ExpectType string | undefined - connection.serverProperties.information; // $ExpectType string | undefined + connection.serverProperties.platform; // $ExpectType string + connection.serverProperties.information; // $ExpectType string connection.serverProperties.host; // $ExpectType string connection.serverProperties.product; // $ExpectType string connection.serverProperties.version; // $ExpectType string + connection.serverProperties.customField; // $ExpectType string | undefined return connection.createChannel() .tap(channel => channel.checkQueue('myQueue')) @@ -45,11 +46,12 @@ import amqpcb = require('amqplib/callback_api'); amqpcb.connect('amqp://localhost', (err, connection) => { if (!err) { connection.serverProperties.copyright; // $ExpectType string | undefined - connection.serverProperties.platform; // $ExpectType string | undefined - connection.serverProperties.information; // $ExpectType string | undefined + connection.serverProperties.platform; // $ExpectType string + connection.serverProperties.information; // $ExpectType string connection.serverProperties.host; // $ExpectType string connection.serverProperties.product; // $ExpectType string connection.serverProperties.version; // $ExpectType string + connection.serverProperties.customField; // $ExpectType string | undefined connection.createChannel((err, channel) => { if (!err) { diff --git a/types/amqplib/properties.d.ts b/types/amqplib/properties.d.ts index 7e9198ac7a..4c7a210c6f 100644 --- a/types/amqplib/properties.d.ts +++ b/types/amqplib/properties.d.ts @@ -215,7 +215,8 @@ export interface ServerProperties { host: string; product: string; version: string; - platform?: string; + platform: string; copyright?: string; - information?: string; + information: string; + [key: string]: string | undefined; } From 3649fccf5794e24b502df0e96731f8c2957f67db Mon Sep 17 00:00:00 2001 From: Jacob Gardner Date: Tue, 26 Feb 2019 13:37:13 -0600 Subject: [PATCH 158/924] Remove prettier formatting --- types/amqplib/callback_api.d.ts | 96 +++++++-------------------------- 1 file changed, 18 insertions(+), 78 deletions(-) diff --git a/types/amqplib/callback_api.d.ts b/types/amqplib/callback_api.d.ts index 4fcc0b5309..56842abc26 100644 --- a/types/amqplib/callback_api.d.ts +++ b/types/amqplib/callback_api.d.ts @@ -12,73 +12,27 @@ export interface Connection extends events.EventEmitter { export interface Channel extends events.EventEmitter { close(callback: (err: any) => void): void; - assertQueue( - queue?: string, - options?: Options.AssertQueue, - callback?: (err: any, ok: Replies.AssertQueue) => void - ): void; + assertQueue(queue?: string, options?: Options.AssertQueue, callback?: (err: any, ok: Replies.AssertQueue) => void): void; checkQueue(queue: string, callback?: (err: any, ok: Replies.AssertQueue) => void): void; - deleteQueue( - queue: string, - options?: Options.DeleteQueue, - callback?: (err: any, ok: Replies.DeleteQueue) => void - ): void; + deleteQueue(queue: string, options?: Options.DeleteQueue, callback?: (err: any, ok: Replies.DeleteQueue) => void): void; purgeQueue(queue: string, callback?: (err: any, ok: Replies.PurgeQueue) => void): void; - bindQueue( - queue: string, - source: string, - pattern: string, - args?: any, - callback?: (err: any, ok: Replies.Empty) => void - ): void; - unbindQueue( - queue: string, - source: string, - pattern: string, - args?: any, - callback?: (err: any, ok: Replies.Empty) => void - ): void; + bindQueue(queue: string, source: string, pattern: string, args?: any, callback?: (err: any, ok: Replies.Empty) => void): void; + unbindQueue(queue: string, source: string, pattern: string, args?: any, callback?: (err: any, ok: Replies.Empty) => void): void; - assertExchange( - exchange: string, - type: string, - options?: Options.AssertExchange, - callback?: (err: any, ok: Replies.AssertExchange) => void - ): void; + assertExchange(exchange: string, type: string, options?: Options.AssertExchange, callback?: (err: any, ok: Replies.AssertExchange) => void): void; checkExchange(exchange: string, callback?: (err: any, ok: Replies.Empty) => void): void; - deleteExchange( - exchange: string, - options?: Options.DeleteExchange, - callback?: (err: any, ok: Replies.Empty) => void - ): void; + deleteExchange(exchange: string, options?: Options.DeleteExchange, callback?: (err: any, ok: Replies.Empty) => void): void; - bindExchange( - destination: string, - source: string, - pattern: string, - args?: any, - callback?: (err: any, ok: Replies.Empty) => void - ): void; - unbindExchange( - destination: string, - source: string, - pattern: string, - args?: any, - callback?: (err: any, ok: Replies.Empty) => void - ): void; + bindExchange(destination: string, source: string, pattern: string, args?: any, callback?: (err: any, ok: Replies.Empty) => void): void; + unbindExchange(destination: string, source: string, pattern: string, args?: any, callback?: (err: any, ok: Replies.Empty) => void): void; publish(exchange: string, routingKey: string, content: Buffer, options?: Options.Publish): boolean; sendToQueue(queue: string, content: Buffer, options?: Options.Publish): boolean; - consume( - queue: string, - onMessage: (msg: Message | null) => any, - options?: Options.Consume, - callback?: (err: any, ok: Replies.Consume) => void - ): void; + consume(queue: string, onMessage: (msg: Message | null) => any, options?: Options.Consume, callback?: (err: any, ok: Replies.Consume) => void): void; cancel(consumerTag: string, callback?: (err: any, ok: Replies.Empty) => void): void; get(queue: string, options?: Options.Get, callback?: (err: any, ok: Message | false) => void): void; @@ -95,36 +49,22 @@ export interface Channel extends events.EventEmitter { } export interface ConfirmChannel extends Channel { - publish( - exchange: string, - routingKey: string, - content: Buffer, - options?: Options.Publish, - callback?: (err: any, ok: Replies.Empty) => void - ): boolean; - sendToQueue( - queue: string, - content: Buffer, - options?: Options.Publish, - callback?: (err: any, ok: Replies.Empty) => void - ): boolean; + publish(exchange: string, routingKey: string, content: Buffer, options?: Options.Publish, callback?: (err: any, ok: Replies.Empty) => void): boolean; + sendToQueue(queue: string, content: Buffer, options?: Options.Publish, callback?: (err: any, ok: Replies.Empty) => void): boolean; waitForConfirms(callback?: (err: any) => void): void; } export const credentials: { external(): { - mechanism: string; - response(): Buffer; + mechanism: string; + response(): Buffer; }; - plain( - username: string, - password: string - ): { - mechanism: string; - response(): Buffer; - username: string; - password: string; + plain(username: string, password: string): { + mechanism: string; + response(): Buffer; + username: string; + password: string; }; }; From b05a9c505287d197568eee0558cf87f0f22e7821 Mon Sep 17 00:00:00 2001 From: Lucas Garron Date: Fri, 15 Feb 2019 16:11:38 -0800 Subject: [PATCH 159/924] Allow `FederatedCredential` to be passed to `fetch()` Per MDN, either `PasswordCredential` *or* `FederatedCredential` can be passed as the `credentials` field in the fetch `init` argument: https://developer.mozilla.org/en-US/docs/Web/API/FederatedCredential Note: I actually can't find anywhere in the `fetch` or credential management API that says you can pass `PasswordCredential` (or `FederatedCredential`) instead a string. I've asked at https://github.com/w3c/webappsec-credential-management/issues/133 for clarification. --- types/webappsec-credential-management/index.d.ts | 2 +- .../webappsec-credential-management-tests.ts | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/types/webappsec-credential-management/index.d.ts b/types/webappsec-credential-management/index.d.ts index 580f86facb..7fc8c73d37 100644 --- a/types/webappsec-credential-management/index.d.ts +++ b/types/webappsec-credential-management/index.d.ts @@ -42,7 +42,7 @@ interface CMRequestInit { referrer?: string; referrerPolicy?: string; mode?: string; - credentials?: PasswordCredential|string; + credentials?: PasswordCredential|FederatedCredential|string; cache?: string; redirect?: string; integrity?: string; diff --git a/types/webappsec-credential-management/webappsec-credential-management-tests.ts b/types/webappsec-credential-management/webappsec-credential-management-tests.ts index 15ae1c6b9e..e9d8540e4f 100644 --- a/types/webappsec-credential-management/webappsec-credential-management-tests.ts +++ b/types/webappsec-credential-management/webappsec-credential-management-tests.ts @@ -135,6 +135,9 @@ function federatedSignIn() { // ... any other providers you care about ... default: + fetch( + 'https://example.com/loginEndpoint', + { credentials: credential, method: 'POST' }); break; } } else { @@ -206,6 +209,12 @@ function formEncodedPost(credential: PasswordCredential, token: string) { { credentials: credential, method: 'POST' }); } +function federatedCredentialPost(credential: FederatedCredential) { + fetch( + 'https://example.com/loginEndpoint', + { credentials: credential, method: 'POST' }); +} + // requireUserMediation example: not included in the spec, but included here // to ensure it typechecks correctly. function signOutDeprecated() { From 43e056c43e460793ba9f517696bd220b619f0f46 Mon Sep 17 00:00:00 2001 From: 4c656f6e Date: Wed, 27 Feb 2019 14:37:16 +1000 Subject: [PATCH 160/924] Update recharts/index.d.ts --- types/recharts/index.d.ts | 78 +++++++++++++++++++-------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/types/recharts/index.d.ts b/types/recharts/index.d.ts index ac42b06667..56ffd20265 100644 --- a/types/recharts/index.d.ts +++ b/types/recharts/index.d.ts @@ -172,9 +172,9 @@ export interface AreaProps extends EventAttributes, Partial | ContentRenderer; - dot?: boolean | object | React.ReactElement | ContentRenderer; - label?: boolean | object | ContentRenderer | React.ReactElement; + activeDot?: boolean | object | React.ReactElement | ContentRenderer; + dot?: boolean | object | React.ReactElement | ContentRenderer; + label?: boolean | object | ContentRenderer | React.ReactElement; hide?: boolean; layout?: LayoutType; baseLine?: number | any[]; @@ -216,9 +216,9 @@ export interface BarProps extends EventAttributes, Partial | ContentRenderer; + shape?: React.ReactElement | ContentRenderer; data?: BarData[]; - background?: boolean | React.ReactElement | ContentRenderer | object; + background?: boolean | React.ReactElement | ContentRenderer | object; // see label section at http://recharts.org/#/en-US/api/Bar label?: boolean | Label | LabelProps | React.SFC | React.ReactElement | ContentRenderer; } @@ -260,7 +260,7 @@ export interface CartesianAxisProps extends EventAttributes, Partial | object | React.ReactElement; + tick?: boolean | ContentRenderer | object | React.ReactElement; axisLine?: boolean | object; tickLine?: boolean | object; mirror?: boolean; @@ -286,8 +286,8 @@ export interface CartesianGridProps extends Partial { y?: number; width?: number; height?: number; - horizontal?: object | React.ReactElement | ContentRenderer | boolean; - vertical?: object | React.ReactElement | ContentRenderer | boolean; + horizontal?: object | React.ReactElement | ContentRenderer | boolean; + vertical?: object | React.ReactElement | ContentRenderer | boolean; horizontalPoints?: number[]; verticalPoints?: number[]; horizontalCoordinatesGenerator?: CoordinatesGenerator; @@ -377,7 +377,7 @@ export interface LegendPayload { export type BBoxUpdateCallback = (box: { width: number; height: number; }) => void; export interface LegendProps { - content?: React.ReactElement | ContentRenderer; + content?: React.ReactElement | ContentRenderer; wrapperStyle?: object; chartWidth?: number; chartHeight?: number; @@ -412,15 +412,15 @@ export interface LineProps extends EventAttributes, Partial | ContentRenderer | boolean; - dot?: object | React.ReactElement | ContentRenderer | boolean; + activeDot?: object | React.ReactElement | ContentRenderer | boolean; + dot?: object | React.ReactElement | ContentRenderer | boolean; top?: number; left?: number; width?: number; height?: number; data?: object[]; dataKey: DataKey; // As the source code states, dataKey will replace valueKey in 1.1.0 and it'll be required (it's already required in current implementation). - label?: boolean | object | React.ReactElement | ContentRenderer; + label?: boolean | object | React.ReactElement | ContentRenderer; points?: Point[]; } @@ -451,11 +451,11 @@ export interface PieProps extends EventAttributes, Partial | React.ReactElement | boolean; + labelLine?: object | ContentRenderer | React.ReactElement | boolean; label?: { offsetRadius: number; - } | React.ReactElement | ContentRenderer | boolean; - activeShape?: object | ContentRenderer | React.ReactElement; + } | React.ReactElement | ContentRenderer | boolean; + activeShape?: object | ContentRenderer | React.ReactElement; activeIndex?: number | number[]; blendStroke?: boolean; } @@ -502,7 +502,7 @@ export interface PolarAngleAxisProps extends EventAttributes, Partial | object | React.ReactElement; + tick?: boolean | ContentRenderer | object | React.ReactElement; ticks?: PolarAngleAxisTick[]; stroke?: string; orientation?: 'inner' | 'outer'; @@ -541,7 +541,7 @@ export interface PolarRadiusAxisProps extends EventAttributes, Partial | ContentRenderer; + tick?: boolean | object | React.ReactElement | ContentRenderer; stroke?: string; tickFormatter?: TickFormatterFunction; domain?: [PolarRadiusAxisDomain, PolarRadiusAxisDomain]; @@ -578,10 +578,10 @@ export interface RadarProps extends EventAttributes, Partial | ContentRenderer; - activeDot?: object | React.ReactElement | ContentRenderer | boolean; - dot?: object | React.ReactElement | ContentRenderer | boolean; - label?: object | React.ReactElement | ContentRenderer | boolean; + shape?: React.ReactElement | ContentRenderer; + activeDot?: object | React.ReactElement | ContentRenderer | boolean; + dot?: object | React.ReactElement | ContentRenderer | boolean; + label?: object | React.ReactElement | ContentRenderer | boolean; legendType?: LegendType; hide?: boolean; } @@ -613,15 +613,15 @@ export interface RadialBarProps extends EventAttributes, Partial | React.ReactElement; - activeShape?: object | ContentRenderer | React.ReactElement; + shape?: ContentRenderer | React.ReactElement; + activeShape?: object | ContentRenderer | React.ReactElement; cornerRadius?: number | string; minPointSize?: number; maxBarSize?: number; data?: RadialBarData[]; legendType?: LegendType; - label?: boolean | React.ReactElement | ContentRenderer | object; - background?: boolean | React.ReactElement | ContentRenderer | object; + label?: boolean | React.ReactElement | ContentRenderer | object; + background?: boolean | React.ReactElement | ContentRenderer | object; hide?: boolean; } @@ -663,7 +663,7 @@ export interface ReferenceAreaProps extends Partial { y2?: number | string; xAxisId?: string | number; yAxisId?: string | number; - shape?: ContentRenderer | React.ReactElement; + shape?: ContentRenderer | React.ReactElement; } export class ReferenceArea extends React.Component { } @@ -689,7 +689,7 @@ export interface ReferenceDotProps extends EventAttributes, Partial> & { cx: number; cy: number; } - > | React.ReactElement; + > | React.ReactElement; } export class ReferenceDot extends React.Component { } @@ -704,14 +704,14 @@ export interface ReferenceLineProps extends Partial | React.ReactElement; + label?: string | number | ContentRenderer | React.ReactElement; xAxisId?: string | number; yAxisId?: string | number; shape?: ContentRenderer< EventAttributes & Partial> & { x1: number; y1: number; x2: number; y2: number; } - > | React.ReactElement; + > | React.ReactElement; } export class ReferenceLine extends React.Component { } @@ -747,13 +747,13 @@ export interface ScatterProps extends EventAttributes, Partial; + line?: boolean | object | RechartsFunction | React.ReactElement; lineType?: 'joint' | 'fitting'; lineJointType?: LineType; legendType?: LegendType; activeIndex?: number; - activeShape?: object | RechartsFunction | React.ReactElement; - shape?: 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | React.ReactElement | ContentRenderer; + activeShape?: object | RechartsFunction | React.ReactElement; + shape?: 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | React.ReactElement | ContentRenderer; points?: ScatterPoint[]; hide?: boolean; data?: object[]; @@ -825,7 +825,7 @@ export interface TooltipPayload { } export interface TooltipProps extends Animatable { - content?: React.ReactElement | React.StatelessComponent | ContentRenderer; + content?: React.ReactElement | React.StatelessComponent | ContentRenderer; viewBox?: ViewBox; active?: boolean; separator?: string; @@ -834,7 +834,7 @@ export interface TooltipProps extends Animatable { itemStyle?: object; labelStyle?: object; wrapperStyle?: object; - cursor?: boolean | object | React.ReactElement | React.StatelessComponent; + cursor?: boolean | object | React.ReactElement | React.StatelessComponent; coordinate?: Coordinate; position?: Coordinate; label?: string | number; @@ -853,7 +853,7 @@ export interface TreemapProps extends EventAttributes, Animatable { data?: any[]; style?: object; aspectRatio?: number; - content?: React.ReactElement | ContentRenderer; + content?: React.ReactElement | ContentRenderer; fill?: string; stroke?: string; className?: string; @@ -875,7 +875,7 @@ export interface LabelProps extends Partial { position?: PositionType; children?: React.ReactNode[] | React.ReactNode; className?: string; - content?: React.ReactElement | ContentRenderer; + content?: React.ReactElement | ContentRenderer; } export class LabelList extends React.Component { } @@ -885,7 +885,7 @@ export interface LabelListProps { children?: React.ReactNode[] | React.ReactNode; className?: string; clockWise?: boolean; - content?: React.ReactElement | ContentRenderer; + content?: React.ReactElement | ContentRenderer; data?: number; dataKey: string | number | RechartsFunction; formatter?: LabelFormatter; @@ -936,7 +936,7 @@ export interface XAxisProps extends EventAttributes { padding?: XPadding; allowDataOverflow?: boolean; scale?: ScaleType | RechartsFunction; - tick?: boolean | ContentRenderer | object | React.ReactElement; + tick?: boolean | ContentRenderer | object | React.ReactElement; axisLine?: boolean | object; tickLine?: boolean | object; minTickGap?: number; @@ -990,7 +990,7 @@ export interface YAxisProps extends EventAttributes { padding?: YPadding; allowDataOverflow?: boolean; scale?: ScaleType | RechartsFunction; - tick?: boolean | ContentRenderer | object | React.ReactElement; + tick?: boolean | ContentRenderer | object | React.ReactElement; axisLine?: boolean | object; tickLine?: boolean | object; minTickGap?: number; From 97a5249a59ea5b0994f73fbcb5066bb5828a882f Mon Sep 17 00:00:00 2001 From: Jacob Gardner Date: Wed, 27 Feb 2019 10:13:13 -0600 Subject: [PATCH 161/924] defValue => defaultValue --- types/lodash/lodash-tests.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index 0809cd15f3..befe845f94 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -5143,7 +5143,7 @@ fp.now(); // $ExpectType number // _.get { const value: string | undefined = anything; - const defValue: boolean = anything; + const defaultValue: boolean = anything; _.get([], Symbol.iterator); _.get([], [Symbol.iterator]); @@ -5155,8 +5155,8 @@ fp.now(); // $ExpectType number _.get({ a: { b: true } }, ["a"]); // $ExpectType { b: boolean; } _.get({ a: { b: true } }, ["a", "b"]); // $ExpectType any _.get({ a: undefined }, "a"); // $ExpectType undefined - _.get({ a: value }, "a", defValue); // $ExpectType string | boolean - _.get({ a: undefined }, "a", defValue); // $ExpectType boolean + _.get({ a: value }, "a", defaultValue); // $ExpectType string | boolean + _.get({ a: undefined }, "a", defaultValue); // $ExpectType boolean _("abc").get(1); // $ExpectType string _("abc").get(["0"], "_"); @@ -5165,8 +5165,8 @@ fp.now(); // $ExpectType number _({ a: { b: true } }).get(["a"]); // $ExpectType { b: boolean; } _({ a: { b: true } }).get(["a", "b"]); // $ExpectType any _({ a: undefined }).get("a"); // $ExpectType undefined - _({ a: value }).get("a", defValue); // $ExpectType string | boolean - _({ a: undefined }).get("a", defValue); // $ExpectType boolean + _({ a: value }).get("a", defaultValue); // $ExpectType string | boolean + _({ a: undefined }).get("a", defaultValue); // $ExpectType boolean _.chain("abc").get(1); // $ExpectType LoDashExplicitWrapper _.chain("abc").get(["0"], "_"); @@ -5175,8 +5175,8 @@ fp.now(); // $ExpectType number _.chain({ a: { b: true } }).get(["a"]); // $ExpectType LoDashExplicitWrapper<{ b: boolean; }> _.chain({ a: { b: true } }).get(["a", "b"]); // $ExpectType LoDashExplicitWrapper _.chain({ a: undefined }).get("a"); // $ExpectType LoDashExplicitWrapper - _.chain({ a: value }).get("a", defValue); // $ExpectType LoDashExplicitWrapper - _.chain({ a: undefined }).get("a", defValue); // $ExpectType LoDashExplicitWrapper + _.chain({ a: value }).get("a", defaultValue); // $ExpectType LoDashExplicitWrapper + _.chain({ a: undefined }).get("a", defaultValue); // $ExpectType LoDashExplicitWrapper fp.get(Symbol.iterator, []); // $ExpectType any fp.get(Symbol.iterator)([]); // $ExpectType any From 75b239e424d82b77331eab99aa0cb2e67cac8f0a Mon Sep 17 00:00:00 2001 From: Josh Gachnang Date: Wed, 27 Feb 2019 08:30:07 -0800 Subject: [PATCH 162/924] [gestalt] Fix SegmentedControlProps SegmentedControl was pointed at the wrong interface. --- types/gestalt/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/gestalt/index.d.ts b/types/gestalt/index.d.ts index 77c88b6d35..a38b1d94d1 100644 --- a/types/gestalt/index.d.ts +++ b/types/gestalt/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for gestalt 0.75 // Project: https://github.com/pinterest/gestalt, https://pinterest.github.io/gestalt // Definitions by: Nicolås Serrano Arévalo +// Josh Gachnang // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -938,7 +939,7 @@ export class Pog extends React.Component {} export class Pulsar extends React.Component {} export class RadioButton extends React.Component {} export class SearchField extends React.Component {} -export class SegmentedControl extends React.Component {} +export class SegmentedControl extends React.Component {} export class SelectList extends React.Component {} export class Spinner extends React.Component {} export class Sticky extends React.Component {} From 83f5cbe1e56d0c1fc8edb6fa2350c9eac26881aa Mon Sep 17 00:00:00 2001 From: Jeff Held Date: Wed, 27 Feb 2019 10:50:22 -0600 Subject: [PATCH 163/924] [detox] Use `import = require` in jest setup tests --- types/detox/test/detox-jest-setup-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/detox/test/detox-jest-setup-tests.ts b/types/detox/test/detox-jest-setup-tests.ts index 94ddc3eb1e..1c38c3658f 100644 --- a/types/detox/test/detox-jest-setup-tests.ts +++ b/types/detox/test/detox-jest-setup-tests.ts @@ -2,8 +2,8 @@ declare var beforeAll: (callback: () => void) => void; declare var beforeEach: (callback: () => void) => void; declare var afterAll: (callback: () => void) => void; -import * as detox from "detox"; -import * as adapter from "detox/runners/jest/adapter"; +import detox = require("detox"); +import adapter = require("detox/runners/jest/adapter"); // Normally the Detox configuration from the project's package.json like so: // const config = require("./package.json").detox; From d593bf739a2448ca9be6061887d657bc26cebec8 Mon Sep 17 00:00:00 2001 From: Jacob Gardner Date: Wed, 27 Feb 2019 11:21:55 -0600 Subject: [PATCH 164/924] Disable no-restricted-globals for adone as adone has 'event' as part of its API --- types/adone/tslint.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/types/adone/tslint.json b/types/adone/tslint.json index 8c265eebb4..177bd33372 100644 --- a/types/adone/tslint.json +++ b/types/adone/tslint.json @@ -13,6 +13,7 @@ "no-unnecessary-qualifier": false, "unified-signatures": false, "space-before-function-paren": false, - "await-promise": false + "await-promise": false, + "no-restricted-globals": false } -} \ No newline at end of file +} From 9f6f861222d2fc5fc2bf3ff9299af15b14100202 Mon Sep 17 00:00:00 2001 From: Andrew Haines Date: Tue, 26 Feb 2019 10:59:04 +0000 Subject: [PATCH 165/924] jsonwebtoken: Allow audience to be verified with regular expressions See https://github.com/auth0/node-jsonwebtoken/pull/398 --- types/jsonwebtoken/index.d.ts | 2 +- types/jsonwebtoken/jsonwebtoken-tests.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/types/jsonwebtoken/index.d.ts b/types/jsonwebtoken/index.d.ts index d1c3aeee5f..33d4f7b999 100644 --- a/types/jsonwebtoken/index.d.ts +++ b/types/jsonwebtoken/index.d.ts @@ -59,7 +59,7 @@ export interface SignOptions { export interface VerifyOptions { algorithms?: string[]; - audience?: string | string[]; + audience?: string | RegExp | Array; clockTimestamp?: number; clockTolerance?: number; issuer?: string | string[]; diff --git a/types/jsonwebtoken/jsonwebtoken-tests.ts b/types/jsonwebtoken/jsonwebtoken-tests.ts index 5884ff6d63..924f95e2d4 100644 --- a/types/jsonwebtoken/jsonwebtoken-tests.ts +++ b/types/jsonwebtoken/jsonwebtoken-tests.ts @@ -101,6 +101,12 @@ cert = fs.readFileSync("public.pem"); // get public key jwt.verify(token, cert, { audience: "urn:foo" }, (err, decoded) => { // if audience mismatch, err == invalid audience }); +jwt.verify(token, cert, { audience: /urn:f[o]{2}/ }, (err, decoded) => { + // if audience mismatch, err == invalid audience +}); +jwt.verify(token, cert, { audience: [/urn:f[o]{2}/, "urn:bar"] }, (err, decoded) => { + // if audience mismatch, err == invalid audience +}); // verify issuer cert = fs.readFileSync("public.pem"); // get public key From bd7e00b17a500dcf1bc38b288a65111195e9aeb6 Mon Sep 17 00:00:00 2001 From: James Reggio Date: Wed, 27 Feb 2019 11:06:33 -0800 Subject: [PATCH 166/924] [hoist-non-react-statics] Expose NonReactStatics type alias --- .../hoist-non-react-statics-tests.tsx | 16 +++++++++++++ types/hoist-non-react-statics/index.d.ts | 24 ++++++++++++------- 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/types/hoist-non-react-statics/hoist-non-react-statics-tests.tsx b/types/hoist-non-react-statics/hoist-non-react-statics-tests.tsx index 0e1beed2e9..05f282cc0c 100644 --- a/types/hoist-non-react-statics/hoist-non-react-statics-tests.tsx +++ b/types/hoist-non-react-statics/hoist-non-react-statics-tests.tsx @@ -23,6 +23,10 @@ class B extends React.Component { n: PropTypes.number.isRequired, }; + static defaultProps = { + n: 42, + }; + getB() { return B.b; } @@ -36,11 +40,23 @@ C.propTypes.x; C.prototype.getA(); C.propTypes.n; // $ExpectError +C.defaultProps; // $ExpectError C.prototype.getB(); // $ExpectError ; +const CWithType: hoistNonReactStatics.NonReactStatics = C; + +CWithType.propTypes; // $ExpectError +CWithType.defaultProps; // $ExpectError +CWithType.prototype.getB(); // $ExpectError + const D = hoistNonReactStatics(A, B, { a: true, b: true }); D.a; D.b; // $ExpectError + +const DWithType: hoistNonReactStatics.NonReactStatics = D; +const DWithTypeError: hoistNonReactStatics.NonReactStatics = D; // $ExpectError + +DWithType.b; // $ExpectError diff --git a/types/hoist-non-react-statics/index.d.ts b/types/hoist-non-react-statics/index.d.ts index 414c4c41f0..8c874483ac 100644 --- a/types/hoist-non-react-statics/index.d.ts +++ b/types/hoist-non-react-statics/index.d.ts @@ -28,6 +28,21 @@ interface KNOWN_STATICS { arity: true; } +declare namespace hoistNonReactStatics { + type NonReactStatics< + S extends React.ComponentType, + C extends { + [key: string]: true + } = {} + > = { + [key in Exclude< + keyof S, + // only extends static properties, exclude instance properties and known react statics + keyof REACT_STATICS | keyof KNOWN_STATICS | keyof C + >]: S[key] + }; +} + declare function hoistNonReactStatics< T extends React.ComponentType, S extends React.ComponentType, @@ -38,13 +53,6 @@ declare function hoistNonReactStatics< TargetComponent: T, SourceComponent: S, customStatic?: C, -): T & - { - [key in Exclude< - keyof S, - // only extends static properties, exclude instance properties and known react statics - keyof REACT_STATICS | keyof KNOWN_STATICS | keyof C - >]: S[key] - }; +): T & hoistNonReactStatics.NonReactStatics; export = hoistNonReactStatics; From 825dfd2e0835e35526043462e7e80d7da2057825 Mon Sep 17 00:00:00 2001 From: Sagie Maoz Date: Wed, 27 Feb 2019 17:05:29 -0500 Subject: [PATCH 167/924] fix(@types/select2): Add missing $.fn.select2 typing As per bottom of docs at http://select2.github.io/select2/ --- types/select2/v3/index.d.ts | 8 ++++++++ types/select2/v3/select2-tests.ts | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/types/select2/v3/index.d.ts b/types/select2/v3/index.d.ts index f4a0c01efb..a74c294906 100644 --- a/types/select2/v3/index.d.ts +++ b/types/select2/v3/index.d.ts @@ -168,6 +168,14 @@ interface Select2Plugin { (method: 'search'): JQuery; (options: Select2Options): JQuery; + + /** + * Select2 exposes its default options via the $.fn.select2.defaults + * object. Properties changed in this object (same properties configurable + * through the constructor) will take effect for every instance created + * after the change. + */ + defaults: Partial; } interface JQuery { diff --git a/types/select2/v3/select2-tests.ts b/types/select2/v3/select2-tests.ts index 4a0a496e13..af2bdfd583 100644 --- a/types/select2/v3/select2-tests.ts +++ b/types/select2/v3/select2-tests.ts @@ -1,3 +1,8 @@ +$.extend($.fn.select2.defaults, { + width: 'copy', + minimumInputLength: 12 +}); + $("#e9").select2(); $("#e2").select2({ placeholder: "Select a State", From c2b2ef863e96f0072b8883a089c25e726dcf0a3e Mon Sep 17 00:00:00 2001 From: Wpapsco Date: Wed, 27 Feb 2019 21:36:24 -0800 Subject: [PATCH 168/924] added declaration for tmi.js --- types/tmi.js/index.d.ts | 299 ++++++++++++++++++++++++++++++++++++ types/tmi.js/package.json | 6 + types/tmi.js/tmijs-tests.ts | 110 +++++++++++++ types/tmi.js/tsconfig.json | 14 ++ types/tmi.js/tslint.json | 1 + 5 files changed, 430 insertions(+) create mode 100644 types/tmi.js/index.d.ts create mode 100644 types/tmi.js/package.json create mode 100644 types/tmi.js/tmijs-tests.ts create mode 100644 types/tmi.js/tsconfig.json create mode 100644 types/tmi.js/tslint.json diff --git a/types/tmi.js/index.d.ts b/types/tmi.js/index.d.ts new file mode 100644 index 0000000000..dab0ce635b --- /dev/null +++ b/types/tmi.js/index.d.ts @@ -0,0 +1,299 @@ +// Type definitions for tmi.js v1.3.1 +// Project: https://docs.tmijs.org/v1.3.0/index.html +// Definitions by: William Papsco +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// Twitch IRC docs: https://dev.twitch.tv/docs/irc/ +// Last updated: 2019/2/27 + +declare module 'tmi.js' { + import { StrictEventEmitter } from "strict-event-emitter-types" + + interface Actions { + action(channel: string, message: string): Promise<[string]>, + ban(channel: string, username: string, reason?: string): Promise<[string, string, string]>, + clear(channel: string): Promise<[string]>, + color(color: string): Promise<[string]>, + commercial(channel: string, seconds: number): Promise<[string, number]>, + connect(): Promise<[string, number]>, + disconnect(): Promise<[string, number]>, + emoteonly(channel: string): Promise<[string]>, + emoteonlyoff(channel: string): Promise<[string]>, + followersonly(channel: string, length?: number): Promise<[string, number]>, + followersonlyoff(channel: string): Promise<[string]>, + host(channel: string, target: string): Promise<[string, string]>, + join(channel: string): Promise<[string]>, + mod(channel: string, username: string): Promise<[string, string]>, + mods(channel: string): Promise, + part(channel: string): Promise<[string]>, + ping(): Promise<[number]>, + r9kbeta(channel: string): Promise<[string]>, + r9kbetaoff(channel: string): Promise<[string]>, + raw(message: string): Promise<[string]>, + say(channel: string, message: string): Promise<[string]>, + slow(channel: string, length?: number): Promise<[string]>, + slowoff(channel: string): Promise<[string]>, + subscribers(channel: string): Promise<[string]>, + subscribersoff(channel: string): Promise<[string]>, + timeout(channel: string, username: string, length?: number, reason?: string): Promise<[string, string, number, string]> + unban(channel: string, username: string): Promise<[string, string]>, + unhost(channel: string): Promise<[string]>, + unmod(channel: string, username: string): Promise<[string, string]>, + whisper(username: string, message: string): Promise<[string, string]> + } + + interface Events { + action(channel: string, userstate: ChatUserstate, message: string, self: boolean): void + ban(channel: string, username: string, reason: string): void, + chat(channel: string, userstate: ChatUserstate, message: string, self: boolean): void, + cheer(channel: string, userstate: ChatUserstate, message: string): void, + clearchat(channel: string): void, + connected(address: string, port: number): void, + connecting(address: string, port: number): void, + disconnected(reason: string): void, + emoteonly(channel: string, enabled: boolean): void, + emotesets(sets: string, obj: EmoteObj): void, + followersonly(channel: string, enabled: boolean, length: number): void, + hosted(channel: string, username: string, viewers: number, autohost: boolean): void, + hosting(channel: string, target: string, viewers: number): void, + join(channel: string, username: string, self: boolean): void, + logon(): void, + message(channel: string, userstate: ChatUserstate, message: string, self: boolean): void, + mod(channel: string, username: string): void, + mods(channel: string, mods: string[]): void, + notice(channel: string, msgid: MsgID, message: string): void, + part(channel: string, username: string, self: boolean): void, + ping(): void, + pong(latency: number): void, + r9kbeta(channel: string, enabled: boolean): void, + reconnect(): void, + resub(channel: string, username: string, months: number, message: string, userstate: SubUserstate, methods: ResubMethod): void, + roomstate(channel: string, state: RoomState): void, + serverchange(channel: string): void, + slowmode(channel: string, enabled: boolean, length: number): void, + subscribers(channel: string, enabled: boolean): void, + subscription(channel: string, username: string, method: ResubMethod, message: string, userstate: SubUserstate): void, + timeout(channel: string, username: string, reason: string, duration: number): void, + unhost(channel: string, viewers: number): void, + unmod(channel: string, username: string): void, + whisper(from: string, userstate: ChatUserstate, message: string, self: boolean): void + } + + interface ClientBase { + getChannels(): string[], + getOptions(): Options, + getUsername(): string, + isMod(channel: string, username: string): boolean, + readyState(): "CONNECTING" | "OPEN" | "CLOSING" | "CLOSED", + on(event: any, listener: any): Client, + addListener(event: any, listener: any): Client, + removeListener(event: any, listener: any): Client, + removeAllListeners

(event?: P): Client, + setMaxListeners(n: number): Client, + emits(events: (keyof Events)[], values: any[][]): void, //wish this could work better but either I'm just not smart enough or it's not possible + emit: (event: any) => boolean, + once(event: any, listener: any): Client, + listenerCount

(event: P): number, + } + + interface Badges { + admin?: string, + bits?: string, + broadcaster?: string, + global_mod?: string, + moderator?: string, + subscriber?: string, + staff?: string, + turbo?: string, + premium?: string + } + + interface CommonUserstate { + badges?: Badges, + color?: string, + "display-name"?: string, + emotes?: { [emoteid: string]: string[] }, + id?: string, + mod?: boolean, + turbo?: boolean, + 'emotes-raw'?: string, + 'badges-raw'?: string, + "room-id"?: string, + subscriber?: boolean, + 'user-type'?: "" | "mod" | "global_mod" | "admin" | "staff", + "user-id"?: string, + "tmi-sent-ts"?: string, + flags?: string, + } + + interface UserNoticeState extends CommonUserstate { + login?: string, + message?: string, + "system-msg"?: string, + } + + interface CommonSubUserstate extends UserNoticeState { + "msg-param-sub-plan"?: ResubMethod, + "msg-param-sub-plan-name"?: string + } + + interface ChatUserstate extends CommonUserstate { + 'message-type'?: "chat" | "action" | "whisper", + username?: string, + bits?: string, + } + + interface SubUserstate extends CommonSubUserstate { + 'message-type'?: "sub" | "resub", + "msg-param-cumulative-months"?: string | boolean, + "msg-param-should-share-streak"?: boolean, + "msg-param-streak-months"?: string | boolean, + } + + interface SubGiftUserstate extends CommonSubUserstate { + 'message-type'?: "subgift" | "anonsubgift", + "msg-param-recipient-display-name"?: string, + "msg-param-recipient-id"?: string, + "msg-param-recipient-user-name"?: string, + } + + interface RaidUserstate extends UserNoticeState { + "message-type"?: "raid" + "msg-param-displayName"?: string, + "msg-param-login"?: string, + "msg-param-viewerCount"?: string, + } + + interface RitualUserstate extends UserNoticeState { + "message-type"?: "ritual" + "msg-param-ritual-name"?: "new_chatter" + } + + type Userstate = ChatUserstate | SubGiftUserstate | SubUserstate | RaidUserstate | RitualUserstate + + interface EmoteObj { + [id: string]: [{ + code: string, + id: number + }] + } + + type MsgID = "already_banned" | + "already_emote_only_on" | + "already_emote_only_off" | + "already_subs_on" | + "already_subs_off" | + "bad_ban_admin" | + "bad_ban_broadcaster" | + "bad_ban_global_mod" | + "bad_ban_self" | + "bad_ban_staff" | + "bad_commercial_error" | + "bad_host_hosting" | + "bad_host_rate_exceeded" | + "bad_mod_mod" | + "bad_mod_banned" | + "bad_timeout_admin" | + "bad_timeout_global_mod" | + "bad_timeout_self" | + "bad_timeout_staff" | + "bad_unban_no_ban" | + "bad_unmod_mod" | + "ban_success" | + "cmds_available" | + "color_changed" | + "commercial_success" | + "emote_only_on" | + "emote_only_off" | + "hosts_remaining" | + "host_target_went_offline" | + "mod_success" | + "msg_banned" | + "msg_censored_broadcaster" | + "msg_channel_suspended" | + "msg_duplicate" | + "msg_emoteonly" | + "msg_ratelimit" | + "msg_subsonly" | + "msg_timedout" | + "msg_verified_email" | + "no_help" | + "no_permission" | + "not_hosting" | + "timeout_success" | + "unban_success" | + "unmod_success" | + "unrecognized_cmd" | + "usage_ban" | + "usage_clear" | + "usage_color" | + "usage_commercial" | + "usage_disconnect" | + "usage_emote_only_on" | + "usage_emote_only_off" | + "usage_help" | + "usage_host" | + "usage_me" | + "usage_mod" | + "usage_mods" | + "usage_r9k_on" | + "usage_r9k_off" | + "usage_slow_on" | + "usage_slow_off" | + "usage_subs_on" | + "usage_subs_off" | + "usage_timeout" | + "usage_unban" | + "usage_unhost" | + "usage_unmod" | + "whisper_invalid_self" | + "whisper_limit_per_min" | + "whisper_limit_per_sec" | + "whisper_restricted_recipient" + + type ResubMethod = "Prime" | "1000" | "2000" | "3000" + + interface RoomState { + "broadcaster-lang"?: string, + "emote-only"?: boolean, + "followers-only"?: string | boolean, + "r9k"?: boolean, + "rituals"?: boolean, + "room-id"?: string + "slow"?: string | boolean, + "subs-only"?: boolean, + "channel"?: string + } + + type Client = StrictEventEmitter & Actions + + interface Options { + options?: { + clientId?: string, + debug?: boolean + }, + connection?: { + server?: string, + port?: number, + reconnect?: boolean, + maxReconnectAttempts?: number, + maxReconnectInverval?: number, + reconnectDecay?: number, + reconnectInterval?: number, + secure?: boolean, + timeout?: number + }, + identity?: { + username?: string, + password?: string + }, + channels?: string[], + logger?: { + info?: (message: string) => any, + warn?: (message: string) => any, + error?: (message: string) => any + } + } + + export function client(opts: Options): Client + export function Client(opts: Options): Client +} \ No newline at end of file diff --git a/types/tmi.js/package.json b/types/tmi.js/package.json new file mode 100644 index 0000000000..dd5c6e4363 --- /dev/null +++ b/types/tmi.js/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "strict-event-emitter-types": "^2.0.0" + } +} \ No newline at end of file diff --git a/types/tmi.js/tmijs-tests.ts b/types/tmi.js/tmijs-tests.ts new file mode 100644 index 0000000000..e80ad43915 --- /dev/null +++ b/types/tmi.js/tmijs-tests.ts @@ -0,0 +1,110 @@ +import * as tmi from "tmi.js" + +const options: tmi.Options = { + channels: ['#channel1', '#channel2'], + connection: { + maxReconnectAttempts: 2, + maxReconnectInverval: 10, + port: 100, + reconnect: true, + reconnectDecay: 20, + reconnectInterval: 10, + secure: true, + timeout: 20 + }, + identity: { + password: "oauth:xxxOAuthIDHerexxx", + username: "yourusernamehere" + }, + logger: { + warn: console.log, + error: console.log, + info: console.log, + }, + options: { + clientId: "xxxapiidherexxx", + debug: true + } +} + +const client: tmi.Client = tmi.Client(options) + +client.connect().then(() => { + client.on("subscription", (channel: string, username: string, method: tmi.ResubMethod, msg: string, userstate: tmi.SubUserstate) => { + client.say(channel, "Thank you to " + userstate["display-name"] + "for subscribing!") + client.ping() + client.r9kbeta(channel) + client.r9kbetaoff(channel) + client.raw("xxxRawIRCHere") + switch (client.readyState()) { + case "CLOSED": + case "CLOSING": + case "CONNECTING": + case "OPEN": + break + } + client.slow(channel, 5) + client.slowoff(channel) + client.subscribers(channel) + client.subscribersoff(channel) + client.timeout(channel, username, 600, "timeoutreason") + client.ban(channel, username, "reason") + client.unban(channel, username) + client.host(channel, "tohost") + client.unhost(channel) + client.mod(channel, username) + client.unmod(channel, username) + client.whisper(username, "whisper") + client.part(channel) + switch (method) { + case "1000": + case "2000": + case "3000": + case "Prime": + break + } + const { badges, color, emotes, flags, id, login, message, mod, subscriber, turbo } = userstate + if (emotes) { + emotes.test.forEach(element => { + console.log(element) + }) + } + if (badges) { + const { admin, turbo, subscriber, bits, broadcaster, global_mod, moderator, premium, staff } = badges + } + userstate["display-name"] + userstate["emotes-raw"] + userstate["badges-raw"] + userstate["message-type"] + userstate["msg-param-cumulative-months"] + userstate["msg-param-should-share-streak"] + userstate["msg-param-streak-months"] + userstate["msg-param-sub-plan"] + userstate["msg-param-sub-plan-name"] + userstate["room-id"] + userstate["system-msg"] + userstate["tmi-sent-ts"] + userstate["user-id"] + userstate["user-type"] + }).on("roomstate", (chnl: string, roomstate: tmi.RoomState) => { + const { channel, r9k, rituals, slow } = roomstate + roomstate["broadcaster-lang"] + roomstate["emote-only"] + roomstate["followers-only"] + roomstate["room-id"] + roomstate["subs-only"] + }).once("chat", (channel: string, userstate: tmi.ChatUserstate, message: string, self: boolean) => { + const { badges, bits, color, emotes, flags, id, mod, subscriber, turbo, username } = userstate + userstate["badges-raw"] + userstate["display-name"] + userstate["emotes-raw"] + userstate["message-type"] + userstate["room-id"] + userstate["tmi-sent-ts"] + userstate["user-id"] + userstate["user-type"] + }).once("emotesets", (sets, emotes) => { + emotes.test[0].code + emotes.test[0].id + }) +}) \ No newline at end of file diff --git a/types/tmi.js/tsconfig.json b/types/tmi.js/tsconfig.json new file mode 100644 index 0000000000..da2062714c --- /dev/null +++ b/types/tmi.js/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + /* Basic Options */ + "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */ + "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ + + /* Strict Type-Checking Options */ + "strict": true, /* Enable all strict type-checking options. */ + "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ + "strictNullChecks": true, /* Enable strict null checks. */ + "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ + } +} \ No newline at end of file diff --git a/types/tmi.js/tslint.json b/types/tmi.js/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/tmi.js/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file From 3ca57c4672f85a2d480160cfdd27c2bdfad930ec Mon Sep 17 00:00:00 2001 From: Wpapsco Date: Wed, 27 Feb 2019 21:42:18 -0800 Subject: [PATCH 169/924] added 'strictFunctionTypes: true' to tsconfig.json as recommended --- types/tmi.js/tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/types/tmi.js/tsconfig.json b/types/tmi.js/tsconfig.json index da2062714c..b8bbb67694 100644 --- a/types/tmi.js/tsconfig.json +++ b/types/tmi.js/tsconfig.json @@ -9,6 +9,7 @@ "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ "strictNullChecks": true, /* Enable strict null checks. */ "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + "strictFunctionTypes": true, "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ } } \ No newline at end of file From 82d73ce92b864b180defcc7d12e3307865edf3e6 Mon Sep 17 00:00:00 2001 From: Wpapsco Date: Wed, 27 Feb 2019 22:41:28 -0800 Subject: [PATCH 170/924] modified code to pass lint checks. --- types/tmi.js/index.d.ts | 549 +++++++++++++++++------------------ types/tmi.js/package.json | 2 +- types/tmi.js/tmi.js-tests.ts | 108 +++++++ types/tmi.js/tmijs-tests.ts | 110 ------- types/tmi.js/tsconfig.json | 36 ++- types/tmi.js/tslint.json | 2 +- 6 files changed, 406 insertions(+), 401 deletions(-) create mode 100644 types/tmi.js/tmi.js-tests.ts delete mode 100644 types/tmi.js/tmijs-tests.ts diff --git a/types/tmi.js/index.d.ts b/types/tmi.js/index.d.ts index dab0ce635b..95ca92edfa 100644 --- a/types/tmi.js/index.d.ts +++ b/types/tmi.js/index.d.ts @@ -1,299 +1,298 @@ -// Type definitions for tmi.js v1.3.1 -// Project: https://docs.tmijs.org/v1.3.0/index.html +// Type definitions for tmi.js 1.3 +// Project: https://github.com/tmijs/tmi.js // Definitions by: William Papsco // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.3 + // Twitch IRC docs: https://dev.twitch.tv/docs/irc/ // Last updated: 2019/2/27 +import { StrictEventEmitter } from "strict-event-emitter-types"; -declare module 'tmi.js' { - import { StrictEventEmitter } from "strict-event-emitter-types" +export interface Actions { + action(channel: string, message: string): Promise<[string]>; + ban(channel: string, username: string, reason?: string): Promise<[string, string, string]>; + clear(channel: string): Promise<[string]>; + color(color: string): Promise<[string]>; + commercial(channel: string, seconds: number): Promise<[string, number]>; + connect(): Promise<[string, number]>; + disconnect(): Promise<[string, number]>; + emoteonly(channel: string): Promise<[string]>; + emoteonlyoff(channel: string): Promise<[string]>; + followersonly(channel: string, length?: number): Promise<[string, number]>; + followersonlyoff(channel: string): Promise<[string]>; + host(channel: string, target: string): Promise<[string, string]>; + join(channel: string): Promise<[string]>; + mod(channel: string, username: string): Promise<[string, string]>; + mods(channel: string): Promise; + part(channel: string): Promise<[string]>; + ping(): Promise<[number]>; + r9kbeta(channel: string): Promise<[string]>; + r9kbetaoff(channel: string): Promise<[string]>; + raw(message: string): Promise<[string]>; + say(channel: string, message: string): Promise<[string]>; + slow(channel: string, length?: number): Promise<[string]>; + slowoff(channel: string): Promise<[string]>; + subscribers(channel: string): Promise<[string]>; + subscribersoff(channel: string): Promise<[string]>; + timeout(channel: string, username: string, length?: number, reason?: string): Promise<[string, string, number, string]>; + unban(channel: string, username: string): Promise<[string, string]>; + unhost(channel: string): Promise<[string]>; + unmod(channel: string, username: string): Promise<[string, string]>; + whisper(username: string, message: string): Promise<[string, string]>; +} - interface Actions { - action(channel: string, message: string): Promise<[string]>, - ban(channel: string, username: string, reason?: string): Promise<[string, string, string]>, - clear(channel: string): Promise<[string]>, - color(color: string): Promise<[string]>, - commercial(channel: string, seconds: number): Promise<[string, number]>, - connect(): Promise<[string, number]>, - disconnect(): Promise<[string, number]>, - emoteonly(channel: string): Promise<[string]>, - emoteonlyoff(channel: string): Promise<[string]>, - followersonly(channel: string, length?: number): Promise<[string, number]>, - followersonlyoff(channel: string): Promise<[string]>, - host(channel: string, target: string): Promise<[string, string]>, - join(channel: string): Promise<[string]>, - mod(channel: string, username: string): Promise<[string, string]>, - mods(channel: string): Promise, - part(channel: string): Promise<[string]>, - ping(): Promise<[number]>, - r9kbeta(channel: string): Promise<[string]>, - r9kbetaoff(channel: string): Promise<[string]>, - raw(message: string): Promise<[string]>, - say(channel: string, message: string): Promise<[string]>, - slow(channel: string, length?: number): Promise<[string]>, - slowoff(channel: string): Promise<[string]>, - subscribers(channel: string): Promise<[string]>, - subscribersoff(channel: string): Promise<[string]>, - timeout(channel: string, username: string, length?: number, reason?: string): Promise<[string, string, number, string]> - unban(channel: string, username: string): Promise<[string, string]>, - unhost(channel: string): Promise<[string]>, - unmod(channel: string, username: string): Promise<[string, string]>, - whisper(username: string, message: string): Promise<[string, string]> - } +export interface Events { + action(channel: string, userstate: ChatUserstate, message: string, self: boolean): void; + ban(channel: string, username: string, reason: string): void; + chat(channel: string, userstate: ChatUserstate, message: string, self: boolean): void; + cheer(channel: string, userstate: ChatUserstate, message: string): void; + clearchat(channel: string): void; + connected(address: string, port: number): void; + connecting(address: string, port: number): void; + disconnected(reason: string): void; + emoteonly(channel: string, enabled: boolean): void; + emotesets(sets: string, obj: EmoteObj): void; + followersonly(channel: string, enabled: boolean, length: number): void; + hosted(channel: string, username: string, viewers: number, autohost: boolean): void; + hosting(channel: string, target: string, viewers: number): void; + join(channel: string, username: string, self: boolean): void; + logon(): void; + message(channel: string, userstate: ChatUserstate, message: string, self: boolean): void; + mod(channel: string, username: string): void; + mods(channel: string, mods: string[]): void; + notice(channel: string, msgid: MsgID, message: string): void; + part(channel: string, username: string, self: boolean): void; + ping(): void; + pong(latency: number): void; + r9kbeta(channel: string, enabled: boolean): void; + reconnect(): void; + resub(channel: string, username: string, months: number, message: string, userstate: SubUserstate, methods: ResubMethod): void; + roomstate(channel: string, state: RoomState): void; + serverchange(channel: string): void; + slowmode(channel: string, enabled: boolean, length: number): void; + subscribers(channel: string, enabled: boolean): void; + subscription(channel: string, username: string, method: ResubMethod, message: string, userstate: SubUserstate): void; + timeout(channel: string, username: string, reason: string, duration: number): void; + unhost(channel: string, viewers: number): void; + unmod(channel: string, username: string): void; + whisper(from: string, userstate: ChatUserstate, message: string, self: boolean): void; +} - interface Events { - action(channel: string, userstate: ChatUserstate, message: string, self: boolean): void - ban(channel: string, username: string, reason: string): void, - chat(channel: string, userstate: ChatUserstate, message: string, self: boolean): void, - cheer(channel: string, userstate: ChatUserstate, message: string): void, - clearchat(channel: string): void, - connected(address: string, port: number): void, - connecting(address: string, port: number): void, - disconnected(reason: string): void, - emoteonly(channel: string, enabled: boolean): void, - emotesets(sets: string, obj: EmoteObj): void, - followersonly(channel: string, enabled: boolean, length: number): void, - hosted(channel: string, username: string, viewers: number, autohost: boolean): void, - hosting(channel: string, target: string, viewers: number): void, - join(channel: string, username: string, self: boolean): void, - logon(): void, - message(channel: string, userstate: ChatUserstate, message: string, self: boolean): void, - mod(channel: string, username: string): void, - mods(channel: string, mods: string[]): void, - notice(channel: string, msgid: MsgID, message: string): void, - part(channel: string, username: string, self: boolean): void, - ping(): void, - pong(latency: number): void, - r9kbeta(channel: string, enabled: boolean): void, - reconnect(): void, - resub(channel: string, username: string, months: number, message: string, userstate: SubUserstate, methods: ResubMethod): void, - roomstate(channel: string, state: RoomState): void, - serverchange(channel: string): void, - slowmode(channel: string, enabled: boolean, length: number): void, - subscribers(channel: string, enabled: boolean): void, - subscription(channel: string, username: string, method: ResubMethod, message: string, userstate: SubUserstate): void, - timeout(channel: string, username: string, reason: string, duration: number): void, - unhost(channel: string, viewers: number): void, - unmod(channel: string, username: string): void, - whisper(from: string, userstate: ChatUserstate, message: string, self: boolean): void - } +export interface ClientBase { + getChannels(): string[]; + getOptions(): Options; + getUsername(): string; + isMod(channel: string, username: string): boolean; + readyState(): "CONNECTING" | "OPEN" | "CLOSING" | "CLOSED"; + on(event: any, listener: any): Client; + addListener(event: any, listener: any): Client; + removeListener(event: any, listener: any): Client; + removeAllListeners(event?: keyof Events): Client; + setMaxListeners(n: number): Client; + emits(events: Array, values: any[][]): void; // wish this could work better but either I'm just not smart enough or it's not possible + emit: (event: any) => boolean; + once(event: any, listener: any): Client; + listenerCount(event: keyof Events): number; +} - interface ClientBase { - getChannels(): string[], - getOptions(): Options, - getUsername(): string, - isMod(channel: string, username: string): boolean, - readyState(): "CONNECTING" | "OPEN" | "CLOSING" | "CLOSED", - on(event: any, listener: any): Client, - addListener(event: any, listener: any): Client, - removeListener(event: any, listener: any): Client, - removeAllListeners

(event?: P): Client, - setMaxListeners(n: number): Client, - emits(events: (keyof Events)[], values: any[][]): void, //wish this could work better but either I'm just not smart enough or it's not possible - emit: (event: any) => boolean, - once(event: any, listener: any): Client, - listenerCount

(event: P): number, - } +export interface Badges { + admin?: string; + bits?: string; + broadcaster?: string; + global_mod?: string; + moderator?: string; + subscriber?: string; + staff?: string; + turbo?: string; + premium?: string; +} - interface Badges { - admin?: string, - bits?: string, - broadcaster?: string, - global_mod?: string, - moderator?: string, - subscriber?: string, - staff?: string, - turbo?: string, - premium?: string - } +export interface CommonUserstate { + badges?: Badges; + color?: string; + "display-name"?: string; + emotes?: { [emoteid: string]: string[] }; + id?: string; + mod?: boolean; + turbo?: boolean; + 'emotes-raw'?: string; + 'badges-raw'?: string; + "room-id"?: string; + subscriber?: boolean; + 'user-type'?: "" | "mod" | "global_mod" | "admin" | "staff"; + "user-id"?: string; + "tmi-sent-ts"?: string; + flags?: string; +} - interface CommonUserstate { - badges?: Badges, - color?: string, - "display-name"?: string, - emotes?: { [emoteid: string]: string[] }, - id?: string, - mod?: boolean, - turbo?: boolean, - 'emotes-raw'?: string, - 'badges-raw'?: string, - "room-id"?: string, - subscriber?: boolean, - 'user-type'?: "" | "mod" | "global_mod" | "admin" | "staff", - "user-id"?: string, - "tmi-sent-ts"?: string, - flags?: string, - } +export interface UserNoticeState extends CommonUserstate { + login?: string; + message?: string; + "system-msg"?: string; +} - interface UserNoticeState extends CommonUserstate { - login?: string, - message?: string, - "system-msg"?: string, - } +export interface CommonSubUserstate extends UserNoticeState { + "msg-param-sub-plan"?: ResubMethod; + "msg-param-sub-plan-name"?: string; +} - interface CommonSubUserstate extends UserNoticeState { - "msg-param-sub-plan"?: ResubMethod, - "msg-param-sub-plan-name"?: string - } +export interface ChatUserstate extends CommonUserstate { + 'message-type'?: "chat" | "action" | "whisper"; + username?: string; + bits?: string; +} - interface ChatUserstate extends CommonUserstate { - 'message-type'?: "chat" | "action" | "whisper", - username?: string, - bits?: string, - } +export interface SubUserstate extends CommonSubUserstate { + 'message-type'?: "sub" | "resub"; + "msg-param-cumulative-months"?: string | boolean; + "msg-param-should-share-streak"?: boolean; + "msg-param-streak-months"?: string | boolean; +} - interface SubUserstate extends CommonSubUserstate { - 'message-type'?: "sub" | "resub", - "msg-param-cumulative-months"?: string | boolean, - "msg-param-should-share-streak"?: boolean, - "msg-param-streak-months"?: string | boolean, - } +export interface SubGiftUserstate extends CommonSubUserstate { + 'message-type'?: "subgift" | "anonsubgift"; + "msg-param-recipient-display-name"?: string; + "msg-param-recipient-id"?: string; + "msg-param-recipient-user-name"?: string; +} - interface SubGiftUserstate extends CommonSubUserstate { - 'message-type'?: "subgift" | "anonsubgift", - "msg-param-recipient-display-name"?: string, - "msg-param-recipient-id"?: string, - "msg-param-recipient-user-name"?: string, - } +export interface RaidUserstate extends UserNoticeState { + "message-type"?: "raid"; + "msg-param-displayName"?: string; + "msg-param-login"?: string; + "msg-param-viewerCount"?: string; +} - interface RaidUserstate extends UserNoticeState { - "message-type"?: "raid" - "msg-param-displayName"?: string, - "msg-param-login"?: string, - "msg-param-viewerCount"?: string, - } +export interface RitualUserstate extends UserNoticeState { + "message-type"?: "ritual"; + "msg-param-ritual-name"?: "new_chatter"; +} - interface RitualUserstate extends UserNoticeState { - "message-type"?: "ritual" - "msg-param-ritual-name"?: "new_chatter" - } +export type Userstate = ChatUserstate | SubGiftUserstate | SubUserstate | RaidUserstate | RitualUserstate; - type Userstate = ChatUserstate | SubGiftUserstate | SubUserstate | RaidUserstate | RitualUserstate +export interface EmoteObj { + [id: string]: [{ + code: string; + id: number; + }]; +} - interface EmoteObj { - [id: string]: [{ - code: string, - id: number - }] - } +export type MsgID = "already_banned" | + "already_emote_only_on" | + "already_emote_only_off" | + "already_subs_on" | + "already_subs_off" | + "bad_ban_admin" | + "bad_ban_broadcaster" | + "bad_ban_global_mod" | + "bad_ban_self" | + "bad_ban_staff" | + "bad_commercial_error" | + "bad_host_hosting" | + "bad_host_rate_exceeded" | + "bad_mod_mod" | + "bad_mod_banned" | + "bad_timeout_admin" | + "bad_timeout_global_mod" | + "bad_timeout_self" | + "bad_timeout_staff" | + "bad_unban_no_ban" | + "bad_unmod_mod" | + "ban_success" | + "cmds_available" | + "color_changed" | + "commercial_success" | + "emote_only_on" | + "emote_only_off" | + "hosts_remaining" | + "host_target_went_offline" | + "mod_success" | + "msg_banned" | + "msg_censored_broadcaster" | + "msg_channel_suspended" | + "msg_duplicate" | + "msg_emoteonly" | + "msg_ratelimit" | + "msg_subsonly" | + "msg_timedout" | + "msg_verified_email" | + "no_help" | + "no_permission" | + "not_hosting" | + "timeout_success" | + "unban_success" | + "unmod_success" | + "unrecognized_cmd" | + "usage_ban" | + "usage_clear" | + "usage_color" | + "usage_commercial" | + "usage_disconnect" | + "usage_emote_only_on" | + "usage_emote_only_off" | + "usage_help" | + "usage_host" | + "usage_me" | + "usage_mod" | + "usage_mods" | + "usage_r9k_on" | + "usage_r9k_off" | + "usage_slow_on" | + "usage_slow_off" | + "usage_subs_on" | + "usage_subs_off" | + "usage_timeout" | + "usage_unban" | + "usage_unhost" | + "usage_unmod" | + "whisper_invalid_self" | + "whisper_limit_per_min" | + "whisper_limit_per_sec" | + "whisper_restricted_recipient"; - type MsgID = "already_banned" | - "already_emote_only_on" | - "already_emote_only_off" | - "already_subs_on" | - "already_subs_off" | - "bad_ban_admin" | - "bad_ban_broadcaster" | - "bad_ban_global_mod" | - "bad_ban_self" | - "bad_ban_staff" | - "bad_commercial_error" | - "bad_host_hosting" | - "bad_host_rate_exceeded" | - "bad_mod_mod" | - "bad_mod_banned" | - "bad_timeout_admin" | - "bad_timeout_global_mod" | - "bad_timeout_self" | - "bad_timeout_staff" | - "bad_unban_no_ban" | - "bad_unmod_mod" | - "ban_success" | - "cmds_available" | - "color_changed" | - "commercial_success" | - "emote_only_on" | - "emote_only_off" | - "hosts_remaining" | - "host_target_went_offline" | - "mod_success" | - "msg_banned" | - "msg_censored_broadcaster" | - "msg_channel_suspended" | - "msg_duplicate" | - "msg_emoteonly" | - "msg_ratelimit" | - "msg_subsonly" | - "msg_timedout" | - "msg_verified_email" | - "no_help" | - "no_permission" | - "not_hosting" | - "timeout_success" | - "unban_success" | - "unmod_success" | - "unrecognized_cmd" | - "usage_ban" | - "usage_clear" | - "usage_color" | - "usage_commercial" | - "usage_disconnect" | - "usage_emote_only_on" | - "usage_emote_only_off" | - "usage_help" | - "usage_host" | - "usage_me" | - "usage_mod" | - "usage_mods" | - "usage_r9k_on" | - "usage_r9k_off" | - "usage_slow_on" | - "usage_slow_off" | - "usage_subs_on" | - "usage_subs_off" | - "usage_timeout" | - "usage_unban" | - "usage_unhost" | - "usage_unmod" | - "whisper_invalid_self" | - "whisper_limit_per_min" | - "whisper_limit_per_sec" | - "whisper_restricted_recipient" +export type ResubMethod = "Prime" | "1000" | "2000" | "3000"; - type ResubMethod = "Prime" | "1000" | "2000" | "3000" +export interface RoomState { + "broadcaster-lang"?: string; + "emote-only"?: boolean; + "followers-only"?: string | boolean; + "r9k"?: boolean; + "rituals"?: boolean; + "room-id"?: string; + "slow"?: string | boolean; + "subs-only"?: boolean; + "channel"?: string; +} - interface RoomState { - "broadcaster-lang"?: string, - "emote-only"?: boolean, - "followers-only"?: string | boolean, - "r9k"?: boolean, - "rituals"?: boolean, - "room-id"?: string - "slow"?: string | boolean, - "subs-only"?: boolean, - "channel"?: string - } +export type Client = StrictEventEmitter & Actions; - type Client = StrictEventEmitter & Actions +export interface Options { + options?: { + clientId?: string; + debug?: boolean; + }; + connection?: { + server?: string; + port?: number; + reconnect?: boolean; + maxReconnectAttempts?: number; + maxReconnectInverval?: number; + reconnectDecay?: number; + reconnectInterval?: number; + secure?: boolean; + timeout?: number; + }; + identity?: { + username?: string; + password?: string; + }; + channels?: string[]; + logger?: { + info?: (message: string) => any; + warn?: (message: string) => any; + error?: (message: string) => any; + }; +} - interface Options { - options?: { - clientId?: string, - debug?: boolean - }, - connection?: { - server?: string, - port?: number, - reconnect?: boolean, - maxReconnectAttempts?: number, - maxReconnectInverval?: number, - reconnectDecay?: number, - reconnectInterval?: number, - secure?: boolean, - timeout?: number - }, - identity?: { - username?: string, - password?: string - }, - channels?: string[], - logger?: { - info?: (message: string) => any, - warn?: (message: string) => any, - error?: (message: string) => any - } - } - - export function client(opts: Options): Client - export function Client(opts: Options): Client -} \ No newline at end of file +export function client(opts: Options): Client; +export function Client(opts: Options): Client; diff --git a/types/tmi.js/package.json b/types/tmi.js/package.json index dd5c6e4363..924e8a8bbc 100644 --- a/types/tmi.js/package.json +++ b/types/tmi.js/package.json @@ -3,4 +3,4 @@ "dependencies": { "strict-event-emitter-types": "^2.0.0" } -} \ No newline at end of file +} diff --git a/types/tmi.js/tmi.js-tests.ts b/types/tmi.js/tmi.js-tests.ts new file mode 100644 index 0000000000..6cd2c62629 --- /dev/null +++ b/types/tmi.js/tmi.js-tests.ts @@ -0,0 +1,108 @@ +import * as tmi from "tmi.js"; + +const options: tmi.Options = { + channels: ['#channel1', '#channel2'], + connection: { + maxReconnectAttempts: 2, + maxReconnectInverval: 10, + port: 100, + reconnect: true, + reconnectDecay: 20, + reconnectInterval: 10, + secure: true, + timeout: 20 + }, + identity: { + password: "oauth:xxxOAuthIDHerexxx", + username: "yourusernamehere" + }, + logger: { + warn: (message) => { }, + error: (message) => { }, + info: (message) => { }, + }, + options: { + clientId: "xxxapiidherexxx", + debug: true + } +}; + +const client: tmi.Client = tmi.Client(options); + +client.connect().then(() => { + client.on("subscription", (channel: string, username: string, method: tmi.ResubMethod, msg: string, userstate: tmi.SubUserstate) => { + client.say(channel, `Thank you to ${userstate["display-name"]} for subscribing!`); + client.ping(); + client.r9kbeta(channel); + client.r9kbetaoff(channel); + client.raw("xxxRawIRCHere"); + switch (client.readyState()) { + case "CLOSED": + case "CLOSING": + case "CONNECTING": + case "OPEN": + break; + } + client.slow(channel, 5); + client.slowoff(channel); + client.subscribers(channel); + client.subscribersoff(channel); + client.timeout(channel, username, 600, "timeoutreason"); + client.ban(channel, username, "reason"); + client.unban(channel, username); + client.host(channel, "tohost"); + client.unhost(channel); + client.mod(channel, username); + client.unmod(channel, username); + client.whisper(username, "whisper"); + client.part(channel); + switch (method) { + case "1000": + case "2000": + case "3000": + case "Prime": + break; + } + const { badges, color, emotes, flags, id, login, message, mod, subscriber, turbo } = userstate; + if (emotes) { + emotes.test.forEach(element => { }); + } + if (badges) { + const { admin, turbo, subscriber, bits, broadcaster, global_mod, moderator, premium, staff } = badges; + } + userstate["display-name"]; + userstate["emotes-raw"]; + userstate["badges-raw"]; + userstate["message-type"]; + userstate["msg-param-cumulative-months"]; + userstate["msg-param-should-share-streak"]; + userstate["msg-param-streak-months"]; + userstate["msg-param-sub-plan"]; + userstate["msg-param-sub-plan-name"]; + userstate["room-id"]; + userstate["system-msg"]; + userstate["tmi-sent-ts"]; + userstate["user-id"]; + userstate["user-type"]; + }).on("roomstate", (chnl: string, roomstate: tmi.RoomState) => { + const { channel, r9k, rituals, slow } = roomstate; + roomstate["broadcaster-lang"]; + roomstate["emote-only"]; + roomstate["followers-only"]; + roomstate["room-id"]; + roomstate["subs-only"]; + }).once("chat", (channel: string, userstate: tmi.ChatUserstate, message: string, self: boolean) => { + const { badges, bits, color, emotes, flags, id, mod, subscriber, turbo, username } = userstate; + userstate["badges-raw"]; + userstate["display-name"]; + userstate["emotes-raw"]; + userstate["message-type"]; + userstate["room-id"]; + userstate["tmi-sent-ts"]; + userstate["user-id"]; + userstate["user-type"]; + }).once("emotesets", (sets: string, emotes: tmi.EmoteObj) => { + emotes.test[0].code; + emotes.test[0].id; + }); +}); diff --git a/types/tmi.js/tmijs-tests.ts b/types/tmi.js/tmijs-tests.ts deleted file mode 100644 index e80ad43915..0000000000 --- a/types/tmi.js/tmijs-tests.ts +++ /dev/null @@ -1,110 +0,0 @@ -import * as tmi from "tmi.js" - -const options: tmi.Options = { - channels: ['#channel1', '#channel2'], - connection: { - maxReconnectAttempts: 2, - maxReconnectInverval: 10, - port: 100, - reconnect: true, - reconnectDecay: 20, - reconnectInterval: 10, - secure: true, - timeout: 20 - }, - identity: { - password: "oauth:xxxOAuthIDHerexxx", - username: "yourusernamehere" - }, - logger: { - warn: console.log, - error: console.log, - info: console.log, - }, - options: { - clientId: "xxxapiidherexxx", - debug: true - } -} - -const client: tmi.Client = tmi.Client(options) - -client.connect().then(() => { - client.on("subscription", (channel: string, username: string, method: tmi.ResubMethod, msg: string, userstate: tmi.SubUserstate) => { - client.say(channel, "Thank you to " + userstate["display-name"] + "for subscribing!") - client.ping() - client.r9kbeta(channel) - client.r9kbetaoff(channel) - client.raw("xxxRawIRCHere") - switch (client.readyState()) { - case "CLOSED": - case "CLOSING": - case "CONNECTING": - case "OPEN": - break - } - client.slow(channel, 5) - client.slowoff(channel) - client.subscribers(channel) - client.subscribersoff(channel) - client.timeout(channel, username, 600, "timeoutreason") - client.ban(channel, username, "reason") - client.unban(channel, username) - client.host(channel, "tohost") - client.unhost(channel) - client.mod(channel, username) - client.unmod(channel, username) - client.whisper(username, "whisper") - client.part(channel) - switch (method) { - case "1000": - case "2000": - case "3000": - case "Prime": - break - } - const { badges, color, emotes, flags, id, login, message, mod, subscriber, turbo } = userstate - if (emotes) { - emotes.test.forEach(element => { - console.log(element) - }) - } - if (badges) { - const { admin, turbo, subscriber, bits, broadcaster, global_mod, moderator, premium, staff } = badges - } - userstate["display-name"] - userstate["emotes-raw"] - userstate["badges-raw"] - userstate["message-type"] - userstate["msg-param-cumulative-months"] - userstate["msg-param-should-share-streak"] - userstate["msg-param-streak-months"] - userstate["msg-param-sub-plan"] - userstate["msg-param-sub-plan-name"] - userstate["room-id"] - userstate["system-msg"] - userstate["tmi-sent-ts"] - userstate["user-id"] - userstate["user-type"] - }).on("roomstate", (chnl: string, roomstate: tmi.RoomState) => { - const { channel, r9k, rituals, slow } = roomstate - roomstate["broadcaster-lang"] - roomstate["emote-only"] - roomstate["followers-only"] - roomstate["room-id"] - roomstate["subs-only"] - }).once("chat", (channel: string, userstate: tmi.ChatUserstate, message: string, self: boolean) => { - const { badges, bits, color, emotes, flags, id, mod, subscriber, turbo, username } = userstate - userstate["badges-raw"] - userstate["display-name"] - userstate["emotes-raw"] - userstate["message-type"] - userstate["room-id"] - userstate["tmi-sent-ts"] - userstate["user-id"] - userstate["user-type"] - }).once("emotesets", (sets, emotes) => { - emotes.test[0].code - emotes.test[0].id - }) -}) \ No newline at end of file diff --git a/types/tmi.js/tsconfig.json b/types/tmi.js/tsconfig.json index b8bbb67694..70fffac476 100644 --- a/types/tmi.js/tsconfig.json +++ b/types/tmi.js/tsconfig.json @@ -1,15 +1,23 @@ { - "compilerOptions": { - /* Basic Options */ - "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */ - "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ - - /* Strict Type-Checking Options */ - "strict": true, /* Enable all strict type-checking options. */ - "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ - "strictNullChecks": true, /* Enable strict null checks. */ - "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - "strictFunctionTypes": true, - "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ - } -} \ No newline at end of file + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "tmi.js-tests.ts" + ] +} diff --git a/types/tmi.js/tslint.json b/types/tmi.js/tslint.json index 2750cc0197..3db14f85ea 100644 --- a/types/tmi.js/tslint.json +++ b/types/tmi.js/tslint.json @@ -1 +1 @@ -{ "extends": "dtslint/dt.json" } \ No newline at end of file +{ "extends": "dtslint/dt.json" } From 12fdba1ad1af914083b306064fd37fb0dd162245 Mon Sep 17 00:00:00 2001 From: Alan Choi Date: Thu, 28 Feb 2019 14:25:47 +0900 Subject: [PATCH 171/924] Delete SelectValue type --- types/storybook__addon-knobs/index.d.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/types/storybook__addon-knobs/index.d.ts b/types/storybook__addon-knobs/index.d.ts index d10652dabe..eb148ebbb8 100644 --- a/types/storybook__addon-knobs/index.d.ts +++ b/types/storybook__addon-knobs/index.d.ts @@ -50,11 +50,8 @@ export function object(name: string, value: T, groupId?: string): T; export function radios(name: string, options: { [s: string]: T }, value?: T, groupId?: string): string; -export type SelectValue = string | number; -export function select(name: string, options: { [s: string]: T }, value: T | ReadonlyArray, groupId?: string): T; -export function select(name: string, options: { [s: string]: ReadonlyArray }, value: ReadonlyArray, groupId?: string): T[]; -export function select(name: string, options: { [s: string]: T | ReadonlyArray }, value: T | ReadonlyArray, groupId?: string): T | T[]; -export function select(name: string, options: ReadonlyArray, value: T, groupId?: string): T; +export function select(name: string, options: { [s: string]: T }, value: T, groupId?: string): T; +export function select(name: string, options: ReadonlyArray, value: string, groupId?: string): string; export function date(name: string, value?: Date, groupId?: string): Date; From a8f5422dc22b357968c2edab333e1cd473604355 Mon Sep 17 00:00:00 2001 From: Alan Choi Date: Thu, 28 Feb 2019 14:27:36 +0900 Subject: [PATCH 172/924] Add contributor --- types/storybook__addon-knobs/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/storybook__addon-knobs/index.d.ts b/types/storybook__addon-knobs/index.d.ts index eb148ebbb8..3aab101f74 100644 --- a/types/storybook__addon-knobs/index.d.ts +++ b/types/storybook__addon-knobs/index.d.ts @@ -4,6 +4,7 @@ // Martynas Kadisa // A.MacLeay // Michael Loughry +// Alan Choi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 3.0 From 0013dcc072912a33b28e4a06c90f4140c9cddc71 Mon Sep 17 00:00:00 2001 From: Alan Choi Date: Thu, 28 Feb 2019 15:53:25 +0900 Subject: [PATCH 173/924] Add test --- .../storybook__addon-knobs/storybook__addon-knobs-tests.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/types/storybook__addon-knobs/storybook__addon-knobs-tests.tsx b/types/storybook__addon-knobs/storybook__addon-knobs-tests.tsx index c0c7f325ed..75ab4c79a9 100644 --- a/types/storybook__addon-knobs/storybook__addon-knobs-tests.tsx +++ b/types/storybook__addon-knobs/storybook__addon-knobs-tests.tsx @@ -96,6 +96,12 @@ stories.add('dynamic knobs', () => { const readonlyOptionsArray: ReadonlyArray = ['hi']; select('With readonly array', readonlyOptionsArray, readonlyOptionsArray[0]); +const optionsObject = { + Apple: { taste: 'sweet', color: 'red' }, + Lemon: { taste: 'sour', color: 'yellow' } +}; +select('With object', optionsObject, optionsObject.Apple); + const genericArray = array('With regular array', ['hi', 'there']); const userInputArray = array('With readonly array', readonlyOptionsArray); From 4c8bf178adddd6e51a52e319ca6f2aebeb936aeb Mon Sep 17 00:00:00 2001 From: Wpapsco Date: Wed, 27 Feb 2019 23:10:52 -0800 Subject: [PATCH 174/924] incoroprated dependency 'strict-event-emitter-types' --- types/tmi.js/index.d.ts | 2 +- types/tmi.js/package.json | 6 -- types/tmi.js/strict-event-emitter-types.ts | 67 ++++++++++++++++++++++ 3 files changed, 68 insertions(+), 7 deletions(-) delete mode 100644 types/tmi.js/package.json create mode 100644 types/tmi.js/strict-event-emitter-types.ts diff --git a/types/tmi.js/index.d.ts b/types/tmi.js/index.d.ts index 95ca92edfa..b222665660 100644 --- a/types/tmi.js/index.d.ts +++ b/types/tmi.js/index.d.ts @@ -6,7 +6,7 @@ // Twitch IRC docs: https://dev.twitch.tv/docs/irc/ // Last updated: 2019/2/27 -import { StrictEventEmitter } from "strict-event-emitter-types"; +import { StrictEventEmitter } from "./strict-event-emitter-types"; export interface Actions { action(channel: string, message: string): Promise<[string]>; diff --git a/types/tmi.js/package.json b/types/tmi.js/package.json deleted file mode 100644 index 924e8a8bbc..0000000000 --- a/types/tmi.js/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "private": true, - "dependencies": { - "strict-event-emitter-types": "^2.0.0" - } -} diff --git a/types/tmi.js/strict-event-emitter-types.ts b/types/tmi.js/strict-event-emitter-types.ts new file mode 100644 index 0000000000..d5d09a5d3a --- /dev/null +++ b/types/tmi.js/strict-event-emitter-types.ts @@ -0,0 +1,67 @@ +/** + * Copyright 2018 bterlson + * + * Permission to use, copy, modify, and/or distribute this software for any purpose + * with or without fee is hereby granted, provided that the above copyright notice + * and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ + +declare const assignmentCompatibilityHack: unique symbol; +export type MatchingKeys = K extends (TRecord[K] extends TMatch ? K : never) ? K : never; +export type VoidKeys = MatchingKeys; +export interface TypeRecord { + ' _emitterType'?: T; + ' _eventsType'?: U; + ' _emitType'?: V; +} +export type ReturnTypeOfMethod = T extends (...args: any[]) => any ? ReturnType : never; +export type ReturnTypeOfMethodIfExists = S extends keyof T ? ReturnTypeOfMethod : never; +export type InnerEEMethodReturnType = T extends (...args: any[]) => any ? ReturnType extends never | undefined ? FValue : TValue : FValue; +export type EEMethodReturnType = S extends keyof T ? InnerEEMethodReturnType : FValue; +type ListenerType = [T] extends [(...args: infer U) => any] ? U : [T] extends [never] ? [] : [T]; +export interface OverriddenMethods { + on

(this: T, event: P, listener: (...args: ListenerType) => void): EEMethodReturnType; + on(event: typeof assignmentCompatibilityHack, listener: (...args: any[]) => any): void; + addListener

(this: T, event: P, listener: (...args: ListenerType) => void): EEMethodReturnType; + addListener(event: typeof assignmentCompatibilityHack, listener: (...args: any[]) => any): void; + addEventListener

(this: T, event: P, listener: (...args: ListenerType) => void): EEMethodReturnType; + addEventListener(event: typeof assignmentCompatibilityHack, listener: (...args: any[]) => any): void; + removeListener(this: T, event: keyof TEventRecord, listener: (...args: any[]) => any): EEMethodReturnType; + removeListener(event: typeof assignmentCompatibilityHack, listener: (...args: any[]) => any): void; + removeEventListener(this: T, event: keyof TEventRecord, listener: (...args: any[]) => any): EEMethodReturnType; + removeEventListener(event: typeof assignmentCompatibilityHack, listener: (...args: any[]) => any): void; + once

(this: T, event: P, listener: (...args: ListenerType) => void): EEMethodReturnType; + once(event: typeof assignmentCompatibilityHack, listener: (...args: any[]) => any): void; + emit

(this: T, event: P, ...args: ListenerType): EEMethodReturnType; + emit(event: typeof assignmentCompatibilityHack, ...args: any[]): void; +} +export type OverriddenKeys = keyof OverriddenMethods; +export type StrictEventEmitter = + Exclude, NeededMethods extends Exclude = Exclude> = + TypeRecord & Pick> & + Pick, NeededMethods>; +export default StrictEventEmitter; +export type NoUndefined = T extends undefined ? never : T; +export interface StrictBroadcast, + TEmitRecord extends NoUndefined = NoUndefined, + VK extends VoidKeys = VoidKeys, NVK extends Exclude = Exclude> { + (event: E, request: TEmitRecord[E]): any; + (event: VK): any; +} +export type EventNames, + TEventRecord extends NoUndefined = NoUndefined, + TEmitRecord extends NoUndefined = NoUndefined> = keyof TEmitRecord | keyof TEventRecord; +export type OnEventNames, + TEventRecord extends NoUndefined = NoUndefined, + TEmitRecord extends NoUndefined = NoUndefined> = keyof TEventRecord; +export type EmitEventNames, + TEventRecord extends NoUndefined = NoUndefined, + TEmitRecord extends NoUndefined = NoUndefined> = keyof TEmitRecord; From c29b6c4481786c91677e918d7c22d464faec2bf2 Mon Sep 17 00:00:00 2001 From: Wpapsco Date: Wed, 27 Feb 2019 23:27:43 -0800 Subject: [PATCH 175/924] adjusted directory structure for strict-event-emitter-types in tmi.js --- types/tmi.js/index.d.ts | 1 + .../index.d.ts} | 0 2 files changed, 1 insertion(+) rename types/tmi.js/{strict-event-emitter-types.ts => strict-event-emitter-types/index.d.ts} (100%) diff --git a/types/tmi.js/index.d.ts b/types/tmi.js/index.d.ts index b222665660..86076ce202 100644 --- a/types/tmi.js/index.d.ts +++ b/types/tmi.js/index.d.ts @@ -6,6 +6,7 @@ // Twitch IRC docs: https://dev.twitch.tv/docs/irc/ // Last updated: 2019/2/27 + import { StrictEventEmitter } from "./strict-event-emitter-types"; export interface Actions { diff --git a/types/tmi.js/strict-event-emitter-types.ts b/types/tmi.js/strict-event-emitter-types/index.d.ts similarity index 100% rename from types/tmi.js/strict-event-emitter-types.ts rename to types/tmi.js/strict-event-emitter-types/index.d.ts From 19ed4efe6f40c3dfc4ccc967a753daca36d548dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Szabo?= Date: Thu, 28 Feb 2019 10:22:54 +0100 Subject: [PATCH 176/924] sharp: add "mitchell" kernel option --- types/sharp/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/sharp/index.d.ts b/types/sharp/index.d.ts index e47418badf..c92495aa69 100644 --- a/types/sharp/index.d.ts +++ b/types/sharp/index.d.ts @@ -947,6 +947,7 @@ declare namespace sharp { interface KernelEnum { nearest: "nearest"; cubic: "cubic"; + mitchell: "mitchell", lanczos2: "lanczos2"; lanczos3: "lanczos3"; } From 724e9807bb899ec42c15455f9620a749c61f9925 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Szabo?= Date: Thu, 28 Feb 2019 10:36:49 +0100 Subject: [PATCH 177/924] Make linter happy --- types/sharp/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/sharp/index.d.ts b/types/sharp/index.d.ts index c92495aa69..5fcc47a26d 100644 --- a/types/sharp/index.d.ts +++ b/types/sharp/index.d.ts @@ -947,7 +947,7 @@ declare namespace sharp { interface KernelEnum { nearest: "nearest"; cubic: "cubic"; - mitchell: "mitchell", + mitchell: "mitchell"; lanczos2: "lanczos2"; lanczos3: "lanczos3"; } From ebf272aface38c11047499fc62dffaf77d989f22 Mon Sep 17 00:00:00 2001 From: Borys Kupar Date: Thu, 28 Feb 2019 13:32:55 +0100 Subject: [PATCH 178/924] [moment-timezone] Add support for "moment-timezone/moment-timezone" import --- types/moment-timezone/index.d.ts | 1 + types/moment-timezone/moment-timezone.d.ts | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 types/moment-timezone/moment-timezone.d.ts diff --git a/types/moment-timezone/index.d.ts b/types/moment-timezone/index.d.ts index 95a8621fdd..9d365f01b4 100644 --- a/types/moment-timezone/index.d.ts +++ b/types/moment-timezone/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Michel Salib // Alan Brazil Lins // Agustin Carrasco +// Borys Kupar // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped import moment = require('moment'); diff --git a/types/moment-timezone/moment-timezone.d.ts b/types/moment-timezone/moment-timezone.d.ts new file mode 100644 index 0000000000..4f06f7e4f1 --- /dev/null +++ b/types/moment-timezone/moment-timezone.d.ts @@ -0,0 +1,3 @@ +import moment = require('moment'); + +export = moment; From e746218ba8915ee395e178e7e30dcbbdda4dfc50 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Thu, 28 Feb 2019 13:38:56 +0100 Subject: [PATCH 179/924] [react-router] Add failing test for union props --- types/react-router/test/WithRouter.tsx | 28 ++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/types/react-router/test/WithRouter.tsx b/types/react-router/test/WithRouter.tsx index 4db65a32bd..5782b08429 100644 --- a/types/react-router/test/WithRouter.tsx +++ b/types/react-router/test/WithRouter.tsx @@ -22,3 +22,31 @@ const WithRouterTestFunction = () => ( ); const WithRouterTestClass = () => ; + +// union props +{ + interface Book { + kind: 'book'; + author: string; + } + + interface Magazine { + kind: 'magazine'; + issue: number; + } + + type SomethingToRead = (Book | Magazine) & RouteComponentProps; + + const Readable: React.SFC = props => { + if (props.kind === 'magazine') { + return

magazine #{props.issue}
; + } + + return
magazine #{props.author}
; + }; + + const RoutedReadable = withRouter(Readable); + + ; + ; // $ExpectError +} From 5b3273643da6ff7cf328b26358aa67fc7d24749d Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Thu, 28 Feb 2019 13:39:08 +0100 Subject: [PATCH 180/924] [react-router] Fix withRouter loosing union type --- types/react-router/index.d.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/types/react-router/index.d.ts b/types/react-router/index.d.ts index 6ed1f19bd0..62c80aef8f 100644 --- a/types/react-router/index.d.ts +++ b/types/react-router/index.d.ts @@ -20,6 +20,7 @@ // Duong Tran // Ben Smith // Wesley Tsai +// Sebastian Silbermann // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -124,8 +125,8 @@ export interface match { url: string; } -// Omit taken from https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html -export type Omit = Pick>; +// Omit taken from https://github.com/Microsoft/TypeScript/issues/28339#issuecomment-467220238 +export type Omit = T extends any ? Pick> : never; export function matchPath(pathname: string, props: string | RouteProps, parent?: match | null): match | null; From 527ba73ec799dd660cbecaa74d531d294fde2857 Mon Sep 17 00:00:00 2001 From: Borys Kupar Date: Thu, 28 Feb 2019 14:05:54 +0100 Subject: [PATCH 181/924] Adjust tsconfig --- types/moment-timezone/tsconfig.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/moment-timezone/tsconfig.json b/types/moment-timezone/tsconfig.json index 62cbfb4214..55ec6cf7bb 100644 --- a/types/moment-timezone/tsconfig.json +++ b/types/moment-timezone/tsconfig.json @@ -18,6 +18,7 @@ }, "files": [ "index.d.ts", + "moment-timezone.d.ts", "moment-timezone-tests.ts" ] -} \ No newline at end of file +} From a5833836270ddc1d21b29c1d6f8f91ccd5d1e690 Mon Sep 17 00:00:00 2001 From: Akash Vishwakarma <14cse031giet@gmail.com> Date: Thu, 28 Feb 2019 18:42:58 +0530 Subject: [PATCH 182/924] Adding html5-History definition --- types/html5-history/html5-history-tests.ts | 10 +++++++++ types/html5-history/index.d.ts | 15 ++++++++++++++ types/html5-history/tsconfig.json | 24 ++++++++++++++++++++++ types/html5-history/tslint.json | 3 +++ 4 files changed, 52 insertions(+) create mode 100644 types/html5-history/html5-history-tests.ts create mode 100644 types/html5-history/index.d.ts create mode 100644 types/html5-history/tsconfig.json create mode 100644 types/html5-history/tslint.json diff --git a/types/html5-history/html5-history-tests.ts b/types/html5-history/html5-history-tests.ts new file mode 100644 index 0000000000..b492e46366 --- /dev/null +++ b/types/html5-history/html5-history-tests.ts @@ -0,0 +1,10 @@ +import * as History from 'html5-history'; + +History.init(); +History.getState(); +History.getCurrentIndex(); +History.getStateByIndex(1); +History.getHash(0); +History.unescapeHash(0); +History.normalizeHash(0); +History.setHash(1, 2); diff --git a/types/html5-history/index.d.ts b/types/html5-history/index.d.ts new file mode 100644 index 0000000000..d729181fdb --- /dev/null +++ b/types/html5-history/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for html5-history 0.1 +// Project: https://github.com/Raynos/html5-history +// Definitions by: Akash Vishwakarma +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + + +export function init(options?: any): boolean; +export function getState(friendly?: any,create?: any): any; +export function getCurrentIndex(): number; +export function getStateByIndex(index: number): any; +export function getHash(doc: any): any; +export function unescapeHash(hash: any): any; +export function normalizeHash(hash: any): any; +export function setHash(hash: any, queue: any): boolean; \ No newline at end of file diff --git a/types/html5-history/tsconfig.json b/types/html5-history/tsconfig.json new file mode 100644 index 0000000000..08937c1353 --- /dev/null +++ b/types/html5-history/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "html5-history-tests.ts" + ] +} \ No newline at end of file diff --git a/types/html5-history/tslint.json b/types/html5-history/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/html5-history/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From 09b944c9cc0bb2e434d75fba4911adcd7b24ba37 Mon Sep 17 00:00:00 2001 From: Akash Vishwakarma <14cse031giet@gmail.com> Date: Thu, 28 Feb 2019 18:52:44 +0530 Subject: [PATCH 183/924] fixing lint error --- types/html5-history/index.d.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/types/html5-history/index.d.ts b/types/html5-history/index.d.ts index d729181fdb..614928f79e 100644 --- a/types/html5-history/index.d.ts +++ b/types/html5-history/index.d.ts @@ -4,12 +4,11 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 - export function init(options?: any): boolean; -export function getState(friendly?: any,create?: any): any; +export function getState(friendly?: any, create?: any): any; export function getCurrentIndex(): number; export function getStateByIndex(index: number): any; export function getHash(doc: any): any; export function unescapeHash(hash: any): any; export function normalizeHash(hash: any): any; -export function setHash(hash: any, queue: any): boolean; \ No newline at end of file +export function setHash(hash: any, queue: any): boolean; From 68d2c7b85607a7991c7d3e288714cdf48cec532e Mon Sep 17 00:00:00 2001 From: Pierre Vigier Date: Thu, 28 Feb 2019 14:35:25 +0100 Subject: [PATCH 184/924] Fix some types in nodegit --- types/nodegit/commit.d.ts | 2 +- types/nodegit/diff.d.ts | 17 +++++++++-------- types/nodegit/index.d.ts | 4 +++- types/nodegit/reset.d.ts | 7 ++++--- types/nodegit/revert.d.ts | 2 +- 5 files changed, 18 insertions(+), 14 deletions(-) diff --git a/types/nodegit/commit.d.ts b/types/nodegit/commit.d.ts index 57e8c55d87..8152eb8a8d 100644 --- a/types/nodegit/commit.d.ts +++ b/types/nodegit/commit.d.ts @@ -25,7 +25,7 @@ export class Commit { static lookupPrefix(repo: Repository, id: Oid, len: number): Promise; static createWithSignature(repo: Repository, commitContent: string, signature: string, signatureField: string): Promise; - amend(updateRef: string, author: Signature, committer: Signature, messageEncoding: string, message: string, tree: Tree): Promise; + amend(updateRef: string, author: Signature, committer: Signature, messageEncoding: string, message: string, tree: Tree | Oid): Promise; author(): Signature; committer(): Signature; diff --git a/types/nodegit/diff.d.ts b/types/nodegit/diff.d.ts index 62de0de6c4..2f1abbda62 100644 --- a/types/nodegit/diff.d.ts +++ b/types/nodegit/diff.d.ts @@ -132,17 +132,18 @@ export class Diff { * * */ - static blobToBuffer(oldBlob: Blob, oldAsPath: string, - buffer: string, bufferAsPath: string, opts: DiffOptions, fileCb: Function, binaryCb: Function, hunkCb: Function, lineCb: Function): Promise; + static blobToBuffer(oldBlob: Blob | null, oldAsPath: string | null, + buffer: string | null, bufferAsPath: string | null, opts: DiffOptions | null, fileCb: Function | null, + binaryCb: Function | null, hunkCb: Function | null, lineCb: Function): Promise; static fromBuffer(content: string, contentLen: number): Promise; - static indexToWorkdir(repo: Repository, index: Index, opts?: DiffOptions): Promise; + static indexToWorkdir(repo: Repository, index: Index | null, opts?: DiffOptions): Promise; static indexToIndex(repo: Repository, oldIndex: Index, newIndex: Index, opts?: DiffOptions): Promise; - static treeToIndex(repo: Repository, oldTree: Tree, index: Index, opts?: DiffOptions): Promise; - static treeToTree(repo: Repository, oldTree: Tree, new_tree: Tree, opts?: DiffOptions): Promise; - static treeToWorkdir(repo: Repository, oldTree: Tree, opts?: DiffOptions): Promise; - static treeToWorkdirWithIndex(repo: Repository, oldTree: Tree, opts?: DiffOptions): Promise; + static treeToIndex(repo: Repository, oldTree: Tree | null, index: Index | null, opts?: DiffOptions): Promise; + static treeToTree(repo: Repository, oldTree: Tree | null, new_tree: Tree | null, opts?: DiffOptions): Promise; + static treeToWorkdir(repo: Repository, oldTree: Tree | null, opts?: DiffOptions): Promise; + static treeToWorkdirWithIndex(repo: Repository, oldTree: Tree | null, opts?: DiffOptions): Promise; - findSimilar(options: DiffFindOptions): Promise; + findSimilar(options?: DiffFindOptions): Promise; getDelta(idx: number): DiffDelta; getPerfdata(): Promise; numDeltas(): number; diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 8f0dd811a0..c0e18853a6 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -1,6 +1,8 @@ // Type definitions for nodegit 0.24 // Project: https://github.com/nodegit/nodegit, http://nodegit.org -// Definitions by: Dolan Miu , Tobias Nießen +// Definitions by: Dolan Miu , +// Tobias Nießen , +// Pierre Vigier // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export { AnnotatedCommit } from './annotated-commit'; diff --git a/types/nodegit/reset.d.ts b/types/nodegit/reset.d.ts index 9051fa693b..ca7ff41e86 100644 --- a/types/nodegit/reset.d.ts +++ b/types/nodegit/reset.d.ts @@ -1,8 +1,9 @@ import { AnnotatedCommit } from './annotated-commit'; import { Repository } from './repository'; -import { Object } from './object'; import { Strarray } from './str-array'; import { CheckoutOptions } from './checkout-options'; +import { Commit } from './commit'; +import { Tag } from './tag'; export namespace Reset { const enum TYPE { @@ -16,11 +17,11 @@ export class Reset { /** * Look up a refs's commit. */ - static reset(repo: Repository, target: Object, resetType: number, checkoutOpts: CheckoutOptions): Promise; + static reset(repo: Repository, target: Commit | Tag, resetType: number, checkoutOpts: CheckoutOptions): Promise; /** * Look up a refs's commit. */ - static default(repo: Repository, target: Object, pathspecs: Strarray | string | string[]): Promise; + static default(repo: Repository, target: Commit | Tag, pathspecs: Strarray | string | string[]): Promise; /** * Sets the current head to the specified commit oid and optionally resets the index and working tree to match. * This behaves like reset but takes an annotated commit, which lets you specify which extended sha syntax string was specified by a user, allowing for more exact reflog messages. diff --git a/types/nodegit/revert.d.ts b/types/nodegit/revert.d.ts index 1f9d4a2677..df804cbb48 100644 --- a/types/nodegit/revert.d.ts +++ b/types/nodegit/revert.d.ts @@ -13,7 +13,7 @@ export interface RevertOptions { } export class Revert { - static revert(repo: Repository, commit: Commit, givenOpts: RevertOptions): Promise; + static revert(repo: Repository, commit: Commit, givenOpts?: RevertOptions): Promise; /** * Reverts the given commit against the given "our" commit, producing an index that reflects the result of the revert. */ From 741a12130dda2a2db8cf4ac5bf284f034383e3cb Mon Sep 17 00:00:00 2001 From: Andrew Date: Thu, 28 Feb 2019 21:41:17 +0500 Subject: [PATCH 185/924] fix(unsplash-js): some types --- types/unsplash-js/index.d.ts | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/types/unsplash-js/index.d.ts b/types/unsplash-js/index.d.ts index de2272c422..4fb2fb9175 100644 --- a/types/unsplash-js/index.d.ts +++ b/types/unsplash-js/index.d.ts @@ -6,9 +6,9 @@ export default class Unsplash { public auth: Auth; public categories: CategoriesApi; - public collections: CollectionApi; + public collections: CollectionsApi; public currentUser: CurrentUserApi; - public users: UserApi; + public users: UsersApi; public photos: PhotoApi; public search: SearchApi; public stats: StatsApi; @@ -85,7 +85,7 @@ export class PhotoApi { }): Promise; } -export class CollectionApi { +export class CollectionsApi { public listCollections( page?: number, perPage?: number, @@ -96,10 +96,12 @@ export class CollectionApi { page?: number, perPage?: number ): Promise; + public listFeaturedCollections( page?: number, perPage?: number ): Promise; + public getCollection(id: number): Promise; public getCollectionPhotos( @@ -145,6 +147,8 @@ export class CollectionApi { } export class SearchApi { + public all(keyword: string, page: number, per_page: number): Promise; + public photos( keyword: string, page?: number, @@ -172,18 +176,18 @@ export class CurrentUserApi { public profile(): Promise; public updateProfile(options: { - username: string; - firstName: string; - lastName: string; - email: string; - url: string; - location: string; - bio: string; - instagramUsername: string; + username?: string; + firstName?: string; + lastName?: string; + email?: string; + url?: string; + location?: string; + bio?: string; + instagramUsername?: string; }): Promise; } -export class UserApi { +export class UsersApi { public profile(username: string): Promise; public statistics( @@ -217,7 +221,9 @@ export class UserApi { export class CategoriesApi { public listCategories(): Promise; + public category(id: any): Promise; + public categoryPhotos( id: any, page?: number, @@ -227,6 +233,8 @@ export class CategoriesApi { export class Auth { public getAuthenticationUrl(scopes?: ReadonlyArray): string; - public userAuthentication(code: string): object; + + public userAuthentication(code: string): Promise; + public setBearerToken(accessToken: string): void; } From af4fcef3bf8b374638827f1a4ae5ce6e970150cd Mon Sep 17 00:00:00 2001 From: Federico Della Rovere Date: Thu, 28 Feb 2019 17:50:59 +0100 Subject: [PATCH 186/924] Update twitch ext definitions with configuration feature --- types/twitch-ext/index.d.ts | 45 +++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/types/twitch-ext/index.d.ts b/types/twitch-ext/index.d.ts index 4cac514539..fac7ccaad4 100644 --- a/types/twitch-ext/index.d.ts +++ b/types/twitch-ext/index.d.ts @@ -29,6 +29,11 @@ interface TwitchExt { */ actions: TwitchExtActions; + /** + * @see https://dev.twitch.tv/docs/extensions/reference/#helper-configuration + */ + configuration: TwitchExtConfiguration; + /** * @see https://dev.twitch.tv/docs/extensions/reference/#twitch-extension-feature-flags */ @@ -170,6 +175,46 @@ interface TwitchExtActions { requestIdShare(): void; } +/** + * @see TwitchExt.configuration + */ +interface TwitchExtConfiguration { + /** + * This property returns the record for the broadcaster segment if one is found; otherwise, undefined. + */ + broadcaster: { version: string; content: string } | undefined; + + /** + * This property returns the record for the developer segment if one is found; otherwise, undefined. + */ + developer: { version: string; content: string } | undefined; + + /** + * This property returns the record for the global segment if one is found; otherwise, undefined. + */ + global: { version: string; content: string } | undefined; + + /** + * This function registers a callback that is called whenever an extension configuration is received. + * The callback function takes no input and returns nothing. After this is called for the first time, + * the records for the global, developer and broadcaster segments will be set if the data is available. + * @param callback The callback that is fired. + */ + onChanged( + callback: () => void + ): void + + + /** + * This function can be called by the front end to set an extension configuration. + * @param segment The string-encoded configuration. + * @param version The configuration segment to set. + * @param content The version of configuration with which the segment is stored. + */ + set(segment: string, version: string, content: string): void; +} + + interface TwitchExtFeatureFlags { /** * If this flag is true, you can send a chat message to the current channel using Send Extension Chat Message From 3aca920eeba6ab90ad673945cc5209bcf237096b Mon Sep 17 00:00:00 2001 From: ExE Boss <3889017+ExE-Boss@users.noreply.github.com> Date: Thu, 28 Feb 2019 20:20:00 +0100 Subject: [PATCH 187/924] =?UTF-8?q?feat:=20Add=20`tape=E2=80=91async`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/tape-async/.editorconfig | 3 + types/tape-async/index.d.ts | 74 +++++++++++ types/tape-async/tape-async-tests.ts | 186 +++++++++++++++++++++++++++ types/tape-async/tsconfig.json | 24 ++++ types/tape-async/tslint.json | 83 ++++++++++++ 5 files changed, 370 insertions(+) create mode 100644 types/tape-async/.editorconfig create mode 100644 types/tape-async/index.d.ts create mode 100644 types/tape-async/tape-async-tests.ts create mode 100644 types/tape-async/tsconfig.json create mode 100644 types/tape-async/tslint.json diff --git a/types/tape-async/.editorconfig b/types/tape-async/.editorconfig new file mode 100644 index 0000000000..a0207fa43b --- /dev/null +++ b/types/tape-async/.editorconfig @@ -0,0 +1,3 @@ +# This package uses tabs +[*] +indent_style = tab diff --git a/types/tape-async/index.d.ts b/types/tape-async/index.d.ts new file mode 100644 index 0000000000..9b5bfdc1d6 --- /dev/null +++ b/types/tape-async/index.d.ts @@ -0,0 +1,74 @@ +// Type definitions for tape-async v2.3 +// Project: https://github.com/parro-it/tape-async +// Definitions by: ExE Boss +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import tapeSync from "tape"; +export = tape; + +declare function tape(name: string, cb: tape.TestCase): void +declare function tape(name: string, opts: tape.TestOptions, cb: tape.TestCase): void; +declare function tape(cb: tape.TestCase): void; +declare function tape(opts: tape.TestOptions, cb: tape.TestCase): void; + +declare namespace tape { + + interface TestCase { + (test: Test): void | Generator | PromiseLike; + } + + /** + * Available opts options for the tape function. + */ + interface TestOptions extends tapeSync.TestOptions { + } + + /** + * Options for the createStream function. + */ + interface StreamOptions extends tapeSync.StreamOptions { + } + + /** + * Generate a new test that will be skipped over. + */ + export function skip(name: string, cb: tape.TestCase): void; + export function skip(name: string, opts: tape.TestOptions, cb: tape.TestCase): void; + export function skip(cb: tape.TestCase): void; + export function skip(opts: tape.TestOptions, cb: tape.TestCase): void; + + /** + * The onFinish hook will get invoked when ALL tape tests have finished right before tape is about to print the test summary. + */ + export function onFinish(cb: () => void): void; + + /** + * Like test(name?, opts?, cb) except if you use .only this is the only test case that will run for the entire process, all other test cases using tape will be ignored. + */ + export function only(name: string, cb: tape.TestCase): void; + export function only(name: string, opts: tape.TestOptions, cb: tape.TestCase): void; + export function only(cb: tape.TestCase): void; + export function only(opts: tape.TestOptions, cb: tape.TestCase): void; + + /** + * Create a new test harness instance, which is a function like test(), but with a new pending stack and test state. + */ + export function createHarness(): typeof tape; + /** + * Create a stream of output, bypassing the default output stream that writes messages to console.log(). + * By default stream will be a text stream of TAP output, but you can get an object stream instead by setting opts.objectMode to true. + */ + export function createStream(opts?: tape.StreamOptions): NodeJS.ReadableStream; + + interface Test extends tapeSync.Test { + /** + * Create a subtest with a new test handle st from cb(st) inside the current test. + * cb(st) will only fire when t finishes. + * Additional tests queued up after t will not be run until all subtests finish. + */ + test(name: string, cb: tape.TestCase): void; + test(name: string, opts: TestOptions, cb: tape.TestCase): void; + } +} diff --git a/types/tape-async/tape-async-tests.ts b/types/tape-async/tape-async-tests.ts new file mode 100644 index 0000000000..835661d6d7 --- /dev/null +++ b/types/tape-async/tape-async-tests.ts @@ -0,0 +1,186 @@ +import tape = require("tape-async"); + +var name: string; +var cb: (test: tape.Test) => Promise; +var opts: tape.TestOptions; +var t: tape.Test; + +tape(cb); +tape(name, cb); +tape(opts, cb); +tape(name, opts, cb); + +tape(name, async (test: tape.Test) => { + t = test; +}); + +tape(name, function* (test: tape.Test): IterableIterator { + t = test; +}); + +tape.skip(cb); +tape.skip(name, cb); +tape.skip(opts, cb); +tape.skip(name, opts, cb); + +tape.only(cb); +tape.only(name, cb); +tape.only(opts, cb); +tape.only(name, opts, cb); + +tape.onFinish(() => {}); + + +var sopts: tape.StreamOptions; +var rs: NodeJS.ReadableStream; +rs = tape.createStream(); +rs = tape.createStream(sopts); + + +var htest: typeof tape; +htest = tape.createHarness(); + +class CustomException extends Error { + constructor(message?: string) { + super(message); + } +} + + +tape(name, (test: tape.Test) => { + + var num: number; + var ms: number; + var value: any; + var actual: any; + var expected: any; + var err: any; + var fn = function() {}; + var msg: string; + + var exceptionExpected: RegExp | (() => void); + + test.plan(num); + test.end(); + test.end(err); + + test.fail(msg); + test.pass(msg); + test.timeoutAfter(ms); + test.skip(msg); + + test.ok(value); + test.ok(value, msg); + test.true(value); + test.true(value, msg); + test.assert(value); + test.assert(value, msg); + + test.notOk(value); + test.notOk(value, msg); + test.false(value); + test.false(value, msg); + test.notok(value); + test.notok(value, msg); + + test.error(err, msg); + test.ifError(err, msg); + test.ifErr(err, msg); + test.iferror(err, msg); + + test.equal(actual, expected); + test.equal(actual, expected, msg); + test.equals(actual, expected); + test.equals(actual, expected, msg); + test.isEqual(actual, expected); + test.isEqual(actual, expected, msg); + test.is(actual, expected); + test.is(actual, expected, msg); + test.strictEqual(actual, expected); + test.strictEqual(actual, expected, msg); + test.strictEquals(actual, expected); + test.strictEquals(actual, expected, msg); + + test.notEqual(actual, expected); + test.notEqual(actual, expected, msg); + test.notEquals(actual, expected); + test.notEquals(actual, expected, msg); + test.notStrictEqual(actual, expected); + test.notStrictEqual(actual, expected, msg); + test.notStrictEquals(actual, expected); + test.notStrictEquals(actual, expected, msg); + test.isNotEqual(actual, expected); + test.isNotEqual(actual, expected, msg); + test.isNot(actual, expected); + test.isNot(actual, expected, msg); + test.not(actual, expected); + test.not(actual, expected, msg); + test.doesNotEqual(actual, expected); + test.doesNotEqual(actual, expected, msg); + test.isInequal(actual, expected); + test.isInequal(actual, expected, msg); + + test.deepEqual(actual, expected); + test.deepEqual(actual, expected, msg); + test.deepEquals(actual, expected); + test.deepEquals(actual, expected, msg); + test.isEquivalent(actual, expected); + test.isEquivalent(actual, expected, msg); + test.same(actual, expected); + test.same(actual, expected, msg); + + test.notDeepEqual(actual, expected); + test.notDeepEqual(actual, expected, msg); + test.notEquivalent(actual, expected); + test.notEquivalent(actual, expected, msg); + test.notDeeply(actual, expected); + test.notDeeply(actual, expected, msg); + test.notSame(actual, expected); + test.notSame(actual, expected, msg); + test.isNotDeepEqual(actual, expected); + test.isNotDeepEqual(actual, expected, msg); + test.isNotDeeply(actual, expected); + test.isNotDeeply(actual, expected, msg); + test.isNotEquivalent(actual, expected); + test.isNotEquivalent(actual, expected, msg); + test.isInequivalent(actual, expected); + test.isInequivalent(actual, expected, msg); + + test.deepLooseEqual(actual, expected); + test.deepLooseEqual(actual, expected, msg); + test.looseEqual(actual, expected); + test.looseEqual(actual, expected, msg); + test.looseEquals(actual, expected); + test.looseEquals(actual, expected, msg); + + test.notDeepLooseEqual(actual, expected); + test.notDeepLooseEqual(actual, expected, msg); + test.notLooseEqual(actual, expected); + test.notLooseEqual(actual, expected, msg); + test.notLooseEquals(actual, expected); + test.notLooseEquals(actual, expected, msg); + + test.throws(fn); + test.throws(fn, msg); + test.throws(fn, exceptionExpected); + test.throws(fn, exceptionExpected, msg); + test.throws(fn, CustomException); + test.throws(fn, CustomException, msg); + + test.doesNotThrow(fn); + test.doesNotThrow(fn, msg); + test.doesNotThrow(fn, exceptionExpected); + test.doesNotThrow(fn, exceptionExpected, msg); + test.doesNotThrow(fn, CustomException); + test.doesNotThrow(fn, CustomException, msg); + + test.test(name, async (st) => { + t = st; + }); + + test.test(name, opts, async (st) => { + t = st; + }); + + test.comment(msg); +}); diff --git a/types/tape-async/tsconfig.json b/types/tape-async/tsconfig.json new file mode 100644 index 0000000000..af0ed451a1 --- /dev/null +++ b/types/tape-async/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "tape-async-tests.ts" + ] +} diff --git a/types/tape-async/tslint.json b/types/tape-async/tslint.json new file mode 100644 index 0000000000..b5f5694bcd --- /dev/null +++ b/types/tape-async/tslint.json @@ -0,0 +1,83 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "indent": [ + true, + "tabs" + ], + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} From 337b83294138ade3e60dfa59a27c649bca89d823 Mon Sep 17 00:00:00 2001 From: ExE Boss <3889017+ExE-Boss@users.noreply.github.com> Date: Thu, 28 Feb 2019 20:30:00 +0100 Subject: [PATCH 188/924] =?UTF-8?q?fix:=20Use=20`Iterator`=20instead?= =?UTF-8?q?=20of=C2=A0`Generator`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/tape-async/index.d.ts | 4 ++-- types/tape-async/tsconfig.json | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/types/tape-async/index.d.ts b/types/tape-async/index.d.ts index 9b5bfdc1d6..d5b07f37b7 100644 --- a/types/tape-async/index.d.ts +++ b/types/tape-async/index.d.ts @@ -5,7 +5,7 @@ /// -import tapeSync from "tape"; +import tapeSync = require("tape"); export = tape; declare function tape(name: string, cb: tape.TestCase): void @@ -16,7 +16,7 @@ declare function tape(opts: tape.TestOptions, cb: tape.TestCase): void; declare namespace tape { interface TestCase { - (test: Test): void | Generator | PromiseLike; + (test: Test): void | Iterator | PromiseLike; } /** diff --git a/types/tape-async/tsconfig.json b/types/tape-async/tsconfig.json index af0ed451a1..462155b141 100644 --- a/types/tape-async/tsconfig.json +++ b/types/tape-async/tsconfig.json @@ -14,7 +14,6 @@ ], "types": [], "noEmit": true, - "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true }, "files": [ From e63af8d856a7c09ee8e34e21cdb4fc59a4b843c7 Mon Sep 17 00:00:00 2001 From: Felix Becker Date: Thu, 28 Feb 2019 20:51:56 +0100 Subject: [PATCH 189/924] Extract inspectable spy API into own interface --- types/sinon/ts3.1/index.d.ts | 89 ++++++++++++++++++++---------------- 1 file changed, 50 insertions(+), 39 deletions(-) diff --git a/types/sinon/ts3.1/index.d.ts b/types/sinon/ts3.1/index.d.ts index aefc93f624..924fa3936e 100644 --- a/types/sinon/ts3.1/index.d.ts +++ b/types/sinon/ts3.1/index.d.ts @@ -145,7 +145,32 @@ declare namespace Sinon { calledAfter(call: SinonSpyCall): boolean; } - interface SinonSpy + /** + * A test spy is a function that records arguments, return value, + * the value of this and exception thrown (if any) for all its calls. + */ + interface SinonSpy extends SinonInspectable { + // Methods + (...args: TArgs): TReturnValue; + + /** + * Creates a spy that only records calls when the received arguments match those passed to withArgs. + * This is useful to be more expressive in your assertions, where you can access the spy with the same call. + * @param args Expected args + */ + withArgs(...args: MatchArguments): SinonSpy; + + /** + * Set the displayName of the spy or stub. + * @param name + */ + named(name: string): SinonSpy; + } + + /** + * The part of the spy API that allows inspecting the calls made on a spy. + */ + interface SinonInspectable extends Pick< SinonSpyCallApi, Exclude, 'args'> @@ -209,9 +234,6 @@ declare namespace Sinon { * If the call did not explicitly return a value, the value at the call’s location in .returnValues will be undefined. */ returnValues: TReturnValue[]; - - // Methods - (...args: TArgs): TReturnValue; /** * Returns true if the spy was called before @param anotherSpy * @param anotherSpy @@ -232,12 +254,6 @@ declare namespace Sinon { * @param anotherSpy */ calledImmediatelyAfter(anotherSpy: SinonSpy): boolean; - /** - * Creates a spy that only records calls when the received arguments match those passed to withArgs. - * This is useful to be more expressive in your assertions, where you can access the spy with the same call. - * @param args Expected args - */ - withArgs(...args: MatchArguments): SinonSpy; /** * Returns true if the spy was always called with @param obj as this. * @param obj @@ -292,11 +308,6 @@ declare namespace Sinon { * Returns an Array with all callbacks return values in the order they were called, if no error is thrown. */ invokeCallback(...args: TArgs): void; - /** - * Set the displayName of the spy or stub. - * @param name - */ - named(name: string): SinonSpy; /** * Returns the nth call. * Accessing individual calls helps with more detailed behavior verification when the spy is called more than once. @@ -1155,60 +1166,60 @@ declare namespace Sinon { * Passes if spy was never called * @param spy */ - notCalled(spy: SinonSpy): void; + notCalled(spy: SinonInspectable): void; /** * Passes if spy was called at least once. */ - called(spy: SinonSpy): void; + called(spy: SinonInspectable): void; /** * Passes if spy was called once and only once. */ - calledOnce(spy: SinonSpy): void; + calledOnce(spy: SinonInspectable): void; /** * Passes if spy was called exactly twice. */ - calledTwice(spy: SinonSpy): void; + calledTwice(spy: SinonInspectable): void; /** * Passes if spy was called exactly three times. */ - calledThrice(spy: SinonSpy): void; + calledThrice(spy: SinonInspectable): void; /** * Passes if spy was called exactly num times. */ - callCount(spy: SinonSpy, count: number): void; + callCount(spy: SinonInspectable, count: number): void; /** * Passes if provided spies were called in the specified order. * @param spies */ - callOrder(...spies: Array>): void; + callOrder(...spies: Array): void; /** * Passes if spy was ever called with obj as its this value. * It’s possible to assert on a dedicated spy call: sinon.assert.calledOn(spy.firstCall, arg1, arg2, ...);. */ - calledOn(spyOrSpyCall: SinonSpy | SinonSpyCall, obj: any): void; + calledOn(spyOrSpyCall: SinonInspectable | SinonSpyCall, obj: any): void; /** * Passes if spy was always called with obj as its this value. */ - alwaysCalledOn(spy: SinonSpy, obj: any): void; + alwaysCalledOn(spy: SinonInspectable, obj: any): void; /** * Passes if spy was called with the provided arguments. * It’s possible to assert on a dedicated spy call: sinon.assert.calledWith(spy.firstCall, arg1, arg2, ...);. * @param spyOrSpyCall * @param args */ - calledWith(spyOrSpyCall: SinonSpy | SinonSpyCall, ...args: MatchArguments): void; + calledWith(spyOrSpyCall: SinonInspectable | SinonSpyCall, ...args: MatchArguments): void; /** * Passes if spy was always called with the provided arguments. * @param spy * @param args */ - alwaysCalledWith(spy: SinonSpy, ...args: MatchArguments): void; + alwaysCalledWith(spy: SinonInspectable, ...args: MatchArguments): void; /** * Passes if spy was never called with the provided arguments. * @param spy * @param args */ - neverCalledWith(spy: SinonSpy, ...args: MatchArguments): void; + neverCalledWith(spy: SinonInspectable, ...args: MatchArguments): void; /** * Passes if spy was called with the provided arguments and no others. * It’s possible to assert on a dedicated spy call: sinon.assert.calledWithExactly(spy.getCall(1), arg1, arg2, ...);. @@ -1216,68 +1227,68 @@ declare namespace Sinon { * @param args */ calledWithExactly( - spyOrSpyCall: SinonSpy | SinonSpyCall, + spyOrSpyCall: SinonInspectable | SinonSpyCall, ...args: MatchArguments ): void; /** * Passes if spy was always called with the provided arguments and no others. */ - alwaysCalledWithExactly(spy: SinonSpy, ...args: MatchArguments): void; + alwaysCalledWithExactly(spy: SinonInspectable, ...args: MatchArguments): void; /** * Passes if spy was called with matching arguments. * This behaves the same way as sinon.assert.calledWith(spy, sinon.match(arg1), sinon.match(arg2), ...). * It’s possible to assert on a dedicated spy call: sinon.assert.calledWithMatch(spy.secondCall, arg1, arg2, ...);. */ calledWithMatch( - spyOrSpyCall: SinonSpy | SinonSpyCall, + spyOrSpyCall: SinonInspectable | SinonSpyCall, ...args: TArgs ): void; /** * Passes if spy was always called with matching arguments. * This behaves the same way as sinon.assert.alwaysCalledWith(spy, sinon.match(arg1), sinon.match(arg2), ...). */ - alwaysCalledWithMatch(spy: SinonSpy, ...args: TArgs): void; + alwaysCalledWithMatch(spy: SinonInspectable, ...args: TArgs): void; /** * Passes if spy was never called with matching arguments. * This behaves the same way as sinon.assert.neverCalledWith(spy, sinon.match(arg1), sinon.match(arg2), ...). * @param spy * @param args */ - neverCalledWithMatch(spy: SinonSpy, ...args: TArgs): void; + neverCalledWithMatch(spy: SinonInspectable, ...args: TArgs): void; /** * Passes if spy was called with the new operator. * It’s possible to assert on a dedicated spy call: sinon.assert.calledWithNew(spy.secondCall, arg1, arg2, ...);. * @param spyOrSpyCall */ - calledWithNew(spyOrSpyCall: SinonSpy | SinonSpyCall): void; + calledWithNew(spyOrSpyCall: SinonInspectable | SinonSpyCall): void; /** * Passes if spy threw any exception. */ - threw(spyOrSpyCall: SinonSpy | SinonSpyCall): void; + threw(spyOrSpyCall: SinonInspectable | SinonSpyCall): void; /** * Passes if spy threw the given exception. * The exception is an actual object. * It’s possible to assert on a dedicated spy call: sinon.assert.threw(spy.thirdCall, exception);. */ - threw(spyOrSpyCall: SinonSpy | SinonSpyCall, exception: string): void; + threw(spyOrSpyCall: SinonInspectable | SinonSpyCall, exception: string): void; /** * Passes if spy threw the given exception. * The exception is a String denoting its type. * It’s possible to assert on a dedicated spy call: sinon.assert.threw(spy.thirdCall, exception);. */ - threw(spyOrSpyCall: SinonSpy | SinonSpyCall, exception: any): void; + threw(spyOrSpyCall: SinonInspectable | SinonSpyCall, exception: any): void; /** * Like threw, only required for all calls to the spy. */ - alwaysThrew(spy: SinonSpy): void; + alwaysThrew(spy: SinonInspectable): void; /** * Like threw, only required for all calls to the spy. */ - alwaysThrew(spy: SinonSpy, exception: string): void; + alwaysThrew(spy: SinonInspectable, exception: string): void; /** * Like threw, only required for all calls to the spy. */ - alwaysThrew(spy: SinonSpy, exception: any): void; + alwaysThrew(spy: SinonInspectable, exception: any): void; /** * Uses sinon.match to test if the arguments can be considered a match. */ From 1a5a17ff827c7e4acb4cec9eee66a64bc5c2ad22 Mon Sep 17 00:00:00 2001 From: Lloyd Ho Date: Thu, 28 Feb 2019 12:33:09 -0800 Subject: [PATCH 190/924] Add useWorkerScheduler into config for cometd --- types/cometd/index.d.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/types/cometd/index.d.ts b/types/cometd/index.d.ts index d7103f15cd..ff780cfd42 100644 --- a/types/cometd/index.d.ts +++ b/types/cometd/index.d.ts @@ -70,6 +70,15 @@ export interface Configuration { * CometD may fail to remain within the max URI length when encoded in JSON. */ maxURILength?: number; + /** + * Uses the scheduler service available in Web Workers via Worker.setTimeout(fn, delay) rather + * than using that available via Window.setTimeout(fn, delay). Browsers are now throttling the + * Window scheduler in background tabs to save battery in mobile devices, so the Window scheduler + * events are delayed by possibly several seconds, causing CometD sessions to timeout on the + * server. The Worker scheduler is not throttled and guarantees that scheduler events happen + * on time. + */ + useWorkerScheduler?: boolean; } export interface Message { From 292e70357c273919f9c1aaa4fb2ae55d2ea08ff7 Mon Sep 17 00:00:00 2001 From: Felix Becker Date: Thu, 28 Feb 2019 21:52:39 +0100 Subject: [PATCH 191/924] Fix TSLint --- types/sinon/ts3.1/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/sinon/ts3.1/index.d.ts b/types/sinon/ts3.1/index.d.ts index 924fa3936e..4f5a23d450 100644 --- a/types/sinon/ts3.1/index.d.ts +++ b/types/sinon/ts3.1/index.d.ts @@ -1191,7 +1191,7 @@ declare namespace Sinon { * Passes if provided spies were called in the specified order. * @param spies */ - callOrder(...spies: Array): void; + callOrder(...spies: SinonInspectable[]): void; /** * Passes if spy was ever called with obj as its this value. * It’s possible to assert on a dedicated spy call: sinon.assert.calledOn(spy.firstCall, arg1, arg2, ...);. From 345ccdbe9e39f149e2f9684eb233b52e0cb306f2 Mon Sep 17 00:00:00 2001 From: Felix Becker Date: Thu, 28 Feb 2019 23:38:54 +0100 Subject: [PATCH 192/924] Fix wrong test https://github.com/DefinitelyTyped/DefinitelyTyped/pull/33223/files#r261413058 --- types/sinon/ts3.1/index.d.ts | 2 +- types/sinon/ts3.1/sinon-tests.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/types/sinon/ts3.1/index.d.ts b/types/sinon/ts3.1/index.d.ts index ccd9289ba3..80ec4ee483 100644 --- a/types/sinon/ts3.1/index.d.ts +++ b/types/sinon/ts3.1/index.d.ts @@ -1725,7 +1725,7 @@ declare namespace Sinon { createStubInstance( constructor: StubbableType, overrides?: { [K in keyof TType]?: - SinonStubbedMember | TType[K] extends (...args: any[]) => infer R ? R : TType[K] } + SinonStubbedMember | (TType[K] extends (...args: any[]) => infer R ? R : TType[K]) } ): SinonStubbedInstance; } diff --git a/types/sinon/ts3.1/sinon-tests.ts b/types/sinon/ts3.1/sinon-tests.ts index 24eb5b12b7..a2f8a393d8 100644 --- a/types/sinon/ts3.1/sinon-tests.ts +++ b/types/sinon/ts3.1/sinon-tests.ts @@ -89,9 +89,12 @@ function testSandbox() { const clsBar: number = stubInstance.bar; const privateFooBar: number = privateFooStubbedInstance.bar; sb.createStubInstance(cls, { - foo: (arg1: string, arg2: number) => 2, + foo: sinon.stub<[string, number], number>().returns(1), bar: 1 }); + sb.createStubInstance(cls, { + foo: 1, // used as return value + }); } function testFakeServer() { From 20750ac1262f4f4c76f9c59cf55c7e099c2b159c Mon Sep 17 00:00:00 2001 From: Elizabeth Samuel Date: Thu, 28 Feb 2019 14:53:35 -0800 Subject: [PATCH 193/924] [office-js] [office-js-preview] AttachmentDetails-Add url prop --- types/office-js-preview/index.d.ts | 6 ++++++ types/office-js/index.d.ts | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/types/office-js-preview/index.d.ts b/types/office-js-preview/index.d.ts index 80195cf516..3c5efda4b6 100644 --- a/types/office-js-preview/index.d.ts +++ b/types/office-js-preview/index.d.ts @@ -10751,6 +10751,12 @@ declare namespace Office { * Gets the size of the attachment in bytes. */ size: number; + /** + * Gets the url of the attachment if its type is `MailboxEnums.AttachmentType.Cloud`. + * + * [Api set: Mailbox Preview] + */ + url: string; } /** * The body object provides methods for adding and updating the content of the message or appointment. diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index 43a3bae9b8..076d531250 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -10751,6 +10751,12 @@ declare namespace Office { * Gets the size of the attachment in bytes. */ size: number; + /** + * Gets the url of the attachment if its type is `MailboxEnums.AttachmentType.Cloud`. + * + * [Api set: Mailbox Preview] + */ + url: string; } /** * The body object provides methods for adding and updating the content of the message or appointment. From cbe9422ac4bbf8bcc9addbdc04c8e317dd4b089a Mon Sep 17 00:00:00 2001 From: ExE Boss <3889017+ExE-Boss@users.noreply.github.com> Date: Fri, 1 Mar 2019 00:00:00 +0100 Subject: [PATCH 194/924] =?UTF-8?q?test(tape=E2=80=91async):=20Extract=20E?= =?UTF-8?q?S2015=C2=A0tests=20into=20separate=C2=A0files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tape-async/test/tape-async.async.test.ts | 37 +++++++++++++++++++ .../test/tape-async.generators.test.ts | 37 +++++++++++++++++++ .../tape-async.test.ts} | 12 ++---- types/tape-async/tsconfig.json | 4 +- 4 files changed, 81 insertions(+), 9 deletions(-) create mode 100644 types/tape-async/test/tape-async.async.test.ts create mode 100644 types/tape-async/test/tape-async.generators.test.ts rename types/tape-async/{tape-async-tests.ts => test/tape-async.test.ts} (94%) diff --git a/types/tape-async/test/tape-async.async.test.ts b/types/tape-async/test/tape-async.async.test.ts new file mode 100644 index 0000000000..bb8e226009 --- /dev/null +++ b/types/tape-async/test/tape-async.async.test.ts @@ -0,0 +1,37 @@ +// TypeScript Version: 2.1 + +import tape = require("tape-async"); + +var name: string; +var cb: (test: tape.Test) => Promise; +var opts: tape.TestOptions; +var t: tape.Test; + +tape(cb); +tape(name, cb); +tape(opts, cb); +tape(name, opts, cb); + +tape(name, async (test: tape.Test) => { + t = test; +}); + +tape.skip(cb); +tape.skip(name, cb); +tape.skip(opts, cb); +tape.skip(name, opts, cb); + +tape.only(cb); +tape.only(name, cb); +tape.only(opts, cb); +tape.only(name, opts, cb); + +tape(name, async (test: tape.Test) => { + test.test(name, async (st) => { + t = st; + }); + + test.test(name, opts, async (st) => { + t = st; + }); +}); diff --git a/types/tape-async/test/tape-async.generators.test.ts b/types/tape-async/test/tape-async.generators.test.ts new file mode 100644 index 0000000000..bf279030ef --- /dev/null +++ b/types/tape-async/test/tape-async.generators.test.ts @@ -0,0 +1,37 @@ +// TypeScript Version: 2.3 + +import tape = require("tape-async"); + +var name: string; +var cb: (test: tape.Test) => IterableIterator; +var opts: tape.TestOptions; +var t: tape.Test; + +tape(cb); +tape(name, cb); +tape(opts, cb); +tape(name, opts, cb); + +tape(name, function* (test: tape.Test): IterableIterator { + t = test; +}); + +tape.skip(cb); +tape.skip(name, cb); +tape.skip(opts, cb); +tape.skip(name, opts, cb); + +tape.only(cb); +tape.only(name, cb); +tape.only(opts, cb); +tape.only(name, opts, cb); + +tape(name, function* (test: tape.Test): IterableIterator { + test.test(name, function* (st: tape.Test): IterableIterator { + t = st; + }); + + test.test(name, opts, function* (st: tape.Test): IterableIterator { + t = st; + }); +}); diff --git a/types/tape-async/tape-async-tests.ts b/types/tape-async/test/tape-async.test.ts similarity index 94% rename from types/tape-async/tape-async-tests.ts rename to types/tape-async/test/tape-async.test.ts index 835661d6d7..060da063be 100644 --- a/types/tape-async/tape-async-tests.ts +++ b/types/tape-async/test/tape-async.test.ts @@ -1,7 +1,7 @@ import tape = require("tape-async"); var name: string; -var cb: (test: tape.Test) => Promise; +var cb: (test: tape.Test) => void; var opts: tape.TestOptions; var t: tape.Test; @@ -10,11 +10,7 @@ tape(name, cb); tape(opts, cb); tape(name, opts, cb); -tape(name, async (test: tape.Test) => { - t = test; -}); - -tape(name, function* (test: tape.Test): IterableIterator { +tape(name, (test: tape.Test) => { t = test; }); @@ -174,11 +170,11 @@ tape(name, (test: tape.Test) => { test.doesNotThrow(fn, CustomException); test.doesNotThrow(fn, CustomException, msg); - test.test(name, async (st) => { + test.test(name, st => { t = st; }); - test.test(name, opts, async (st) => { + test.test(name, opts, st => { t = st; }); diff --git a/types/tape-async/tsconfig.json b/types/tape-async/tsconfig.json index 462155b141..c5b3e90053 100644 --- a/types/tape-async/tsconfig.json +++ b/types/tape-async/tsconfig.json @@ -18,6 +18,8 @@ }, "files": [ "index.d.ts", - "tape-async-tests.ts" + "test/tape-async.async.test.ts", + "test/tape-async.generators.test.ts", + "test/tape-async.test.ts" ] } From ab818540d047bbea8448cac0b4791d4fd81ea480 Mon Sep 17 00:00:00 2001 From: Joe Lencioni Date: Thu, 28 Feb 2019 16:07:50 -0800 Subject: [PATCH 195/924] Add key to react-router-config RouteConfig Routes can have an optional `key`. https://www.npmjs.com/package/react-router-config#route-configuration-shape --- types/react-router-config/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/react-router-config/index.d.ts b/types/react-router-config/index.d.ts index 0dc1544ca6..bf719c5760 100644 --- a/types/react-router-config/index.d.ts +++ b/types/react-router-config/index.d.ts @@ -15,6 +15,7 @@ export interface RouteConfigComponentProps> | React.ComponentType; path?: string; From b826388e52ab7cb43944b9b9047c8170d9f2fd98 Mon Sep 17 00:00:00 2001 From: "Adam A. Zerella" Date: Fri, 1 Mar 2019 14:21:51 +1100 Subject: [PATCH 196/924] Added type defs for html-truncate --- types/html-truncate/html-truncate-tests.ts | 13 +++++++++++ types/html-truncate/index.d.ts | 20 +++++++++++++++++ types/html-truncate/tsconfig.json | 25 ++++++++++++++++++++++ types/html-truncate/tslint.json | 3 +++ 4 files changed, 61 insertions(+) create mode 100644 types/html-truncate/html-truncate-tests.ts create mode 100644 types/html-truncate/index.d.ts create mode 100644 types/html-truncate/tsconfig.json create mode 100644 types/html-truncate/tslint.json diff --git a/types/html-truncate/html-truncate-tests.ts b/types/html-truncate/html-truncate-tests.ts new file mode 100644 index 0000000000..0c46bf560b --- /dev/null +++ b/types/html-truncate/html-truncate-tests.ts @@ -0,0 +1,13 @@ +import Truncate from "html-truncate"; + +Truncate('hello world', 4); + +Truncate('

hello world

', 4, { + keepImageTag: true, + ellipsis: true +}); + +Truncate('

hello world

', 6, { + keepImageTag: false, + ellipsis: '---' +}); diff --git a/types/html-truncate/index.d.ts b/types/html-truncate/index.d.ts new file mode 100644 index 0000000000..8be4a950a3 --- /dev/null +++ b/types/html-truncate/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for html-truncate 1.2 +// Project: https://github.com/huang47/nodejs-html-truncate +// Definitions by: Adam Zerella +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export interface TruncateOptions { + /** + * Flag to specify if keep image tag, false by default. + */ + keepImageTag: boolean; + /** + * Omission symbol for truncated string, '...' by default. + */ + ellipsis: boolean|string; +} + +/** + * Truncate HTML text and also keep tag safe. + */ +export default function truncate(input: string, maxLength: number, options?: TruncateOptions): string; diff --git a/types/html-truncate/tsconfig.json b/types/html-truncate/tsconfig.json new file mode 100644 index 0000000000..693d5d17ba --- /dev/null +++ b/types/html-truncate/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [ + + ], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "html-truncate-tests.ts" + ] +} diff --git a/types/html-truncate/tslint.json b/types/html-truncate/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/html-truncate/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file From 64208f26fa7260ec9b49715122d94324caeed548 Mon Sep 17 00:00:00 2001 From: "Adam A. Zerella" Date: Fri, 1 Mar 2019 16:10:22 +1100 Subject: [PATCH 197/924] Added file export type defs --- types/mumath/clamp.d.ts | 6 ++++++ types/mumath/closest.d.ts | 6 ++++++ types/mumath/index.d.ts | 1 - types/mumath/isMultiple.d.ts | 7 +++++++ types/mumath/len.d.ts | 6 ++++++ types/mumath/lerp.d.ts | 6 ++++++ types/mumath/mod.d.ts | 6 ++++++ types/mumath/mumath-tests.ts | 23 +++++++++++++++++++++++ types/mumath/order.d.ts | 6 ++++++ types/mumath/precision.d.ts | 6 ++++++ types/mumath/round.d.ts | 6 ++++++ types/mumath/scale.d.ts | 8 ++++++++ types/mumath/tsconfig.json | 11 +++++++++++ types/mumath/within.d.ts | 6 ++++++ 14 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 types/mumath/clamp.d.ts create mode 100644 types/mumath/closest.d.ts create mode 100644 types/mumath/isMultiple.d.ts create mode 100644 types/mumath/len.d.ts create mode 100644 types/mumath/lerp.d.ts create mode 100644 types/mumath/mod.d.ts create mode 100644 types/mumath/order.d.ts create mode 100644 types/mumath/precision.d.ts create mode 100644 types/mumath/round.d.ts create mode 100644 types/mumath/scale.d.ts create mode 100644 types/mumath/within.d.ts diff --git a/types/mumath/clamp.d.ts b/types/mumath/clamp.d.ts new file mode 100644 index 0000000000..fe08302e37 --- /dev/null +++ b/types/mumath/clamp.d.ts @@ -0,0 +1,6 @@ +/** + * Detects proper clamp min/max. + */ +declare function clamp(value: number, left: number, right: number): number; + +export default clamp; diff --git a/types/mumath/closest.d.ts b/types/mumath/closest.d.ts new file mode 100644 index 0000000000..f2db4ea1ec --- /dev/null +++ b/types/mumath/closest.d.ts @@ -0,0 +1,6 @@ +/** + * Get closest value out of a set. + */ +declare function closest(value: number, list: number[]): number; + +export default closest; diff --git a/types/mumath/index.d.ts b/types/mumath/index.d.ts index 8967bafa4f..3dcfccf565 100644 --- a/types/mumath/index.d.ts +++ b/types/mumath/index.d.ts @@ -2,7 +2,6 @@ // Project: https://github.com/dfcreative/mumath // Definitions by: Adam Zerella // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 3.3 /** * Detects proper clamp min/max. diff --git a/types/mumath/isMultiple.d.ts b/types/mumath/isMultiple.d.ts new file mode 100644 index 0000000000..255d0ece72 --- /dev/null +++ b/types/mumath/isMultiple.d.ts @@ -0,0 +1,7 @@ +/** + * Check if one number is multiple of other + * Same as a % b === 0, but with precision check. + */ +declare function isMultiple(a: number, b: number, eps?: number): boolean; + +export default isMultiple; diff --git a/types/mumath/len.d.ts b/types/mumath/len.d.ts new file mode 100644 index 0000000000..2392cff32f --- /dev/null +++ b/types/mumath/len.d.ts @@ -0,0 +1,6 @@ +/** + * Return quadratic length of a vector. + */ +declare function len(a: number, b: number): number; + +export default len; diff --git a/types/mumath/lerp.d.ts b/types/mumath/lerp.d.ts new file mode 100644 index 0000000000..3ab8639c0c --- /dev/null +++ b/types/mumath/lerp.d.ts @@ -0,0 +1,6 @@ +/** + * Return value interpolated between x and y. + */ +declare function lerp(x: number, y: number, ratio: number): number; + +export default lerp; diff --git a/types/mumath/mod.d.ts b/types/mumath/mod.d.ts new file mode 100644 index 0000000000..6517271e45 --- /dev/null +++ b/types/mumath/mod.d.ts @@ -0,0 +1,6 @@ +/** + * An enhanced mod-loop, like fmod — loops value within a frame. + */ +declare function mod(value: number, max: number, min?: number): number; + +export default mod; diff --git a/types/mumath/mumath-tests.ts b/types/mumath/mumath-tests.ts index c0fed04336..5a8fd6476f 100644 --- a/types/mumath/mumath-tests.ts +++ b/types/mumath/mumath-tests.ts @@ -1,25 +1,48 @@ import * as mumath from "mumath"; +import mumathClamp from "mumath/clamp"; +import mumathClosest from "mumath/closest"; +import mumathIsMultiple from "mumath/isMultiple"; +import mumathLen from "mumath/len"; +import mumathLerp from "mumath/lerp"; +import mumathMod from "mumath/mod"; +import mumathOrder from "mumath/order"; +import mumathPrecision from "mumath/precision"; +import mumathRound from "mumath/round"; +import mumathScale from "mumath/scale"; +import mumathWithin from "mumath/within"; + mumath.clamp(1, 2, 3); +mumathClamp(1, 2, 3); mumath.closest(5, [1, 7, 3, 6, 10]); +mumathClosest(5, [1, 7, 3, 6, 10]); mumath.isMultiple(5, 10, 1.000074); mumath.isMultiple(5, 10); +mumathIsMultiple(5, 10, 1.000074); mumath.len(15, 1.0); +mumathLen(15, 1.0); mumath.lerp(1, 2, 3); +mumathLerp(1, 2, 3); mumath.mod(1, 2, 3); mumath.mod(1, 2); +mumathMod(1, 2, 3); mumath.order(5); +mumathOrder(5); mumath.precision(5.0000001); +mumathPrecision(5.0000001); mumath.round(0.3, 0.5); +mumathRound(0.3, 0.5); mumath.scale(5.93, [1.0, 35, 10, 7.135]); +mumathScale(5.93, [1.0, 35, 10, 7.135]); mumath.within(5, 1, 10); +mumathWithin(5, 1, 10); diff --git a/types/mumath/order.d.ts b/types/mumath/order.d.ts new file mode 100644 index 0000000000..6da624f1d3 --- /dev/null +++ b/types/mumath/order.d.ts @@ -0,0 +1,6 @@ +/** + * Get order of magnitude for a number. + */ +declare function order(value: number): number; + +export default order; diff --git a/types/mumath/precision.d.ts b/types/mumath/precision.d.ts new file mode 100644 index 0000000000..ec94b3a4ed --- /dev/null +++ b/types/mumath/precision.d.ts @@ -0,0 +1,6 @@ +/** + * Get precision from float: + */ +declare function precision(value: number): number; + +export default precision; diff --git a/types/mumath/round.d.ts b/types/mumath/round.d.ts new file mode 100644 index 0000000000..09549f14f1 --- /dev/null +++ b/types/mumath/round.d.ts @@ -0,0 +1,6 @@ +/** + * Rounds value to optional step. + */ +declare function round(value: number, step?: number): number; + +export default round; diff --git a/types/mumath/scale.d.ts b/types/mumath/scale.d.ts new file mode 100644 index 0000000000..2d5487ea10 --- /dev/null +++ b/types/mumath/scale.d.ts @@ -0,0 +1,8 @@ +/** + * Get first scale out of a list of basic scales, aligned to the power. E. g. + * step(.37, [1, 2, 5]) → .5 step(456, [1, 2]) → 1000 + * Similar to closest, but takes all possible powers of scales. + */ +declare function scale(value: number, list: number[]): number; + +export default scale; diff --git a/types/mumath/tsconfig.json b/types/mumath/tsconfig.json index 67aa9c2b29..e96b912780 100644 --- a/types/mumath/tsconfig.json +++ b/types/mumath/tsconfig.json @@ -20,6 +20,17 @@ }, "files": [ "index.d.ts", + "clamp.d.ts", + "closest.d.ts", + "isMultiple.d.ts", + "len.d.ts", + "lerp.d.ts", + "mod.d.ts", + "order.d.ts", + "precision.d.ts", + "round.d.ts", + "scale.d.ts", + "within.d.ts", "mumath-tests.ts" ] } diff --git a/types/mumath/within.d.ts b/types/mumath/within.d.ts new file mode 100644 index 0000000000..47558c73d0 --- /dev/null +++ b/types/mumath/within.d.ts @@ -0,0 +1,6 @@ +/** + * Whether element is between left & right, including. + */ +declare function within(value: number, left: number, right: number): number; + +export default within; From e0cf0c55204ff4d5f4501a57aebb0c302084701d Mon Sep 17 00:00:00 2001 From: Andrew Date: Fri, 1 Mar 2019 11:00:34 +0500 Subject: [PATCH 198/924] feat(unsplash-js): replace classes with interfaces and update fetch types --- types/unsplash-js/index.d.ts | 160 +++++++++++++++----------------- types/unsplash-js/tsconfig.json | 3 +- 2 files changed, 75 insertions(+), 88 deletions(-) diff --git a/types/unsplash-js/index.d.ts b/types/unsplash-js/index.d.ts index 4fb2fb9175..e68a854510 100644 --- a/types/unsplash-js/index.d.ts +++ b/types/unsplash-js/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for unsplash-js 5.0 // Project: https://github.com/unsplash/unsplash-js#readme -// Definitions by: My Self +// Definitions by: Andrew Malikov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export default class Unsplash { @@ -13,7 +13,7 @@ export default class Unsplash { public search: SearchApi; public stats: StatsApi; - constructor(options: { + public constructor(options: { apiUrl: string; apiVersion: string; applicationId: string; @@ -23,48 +23,48 @@ export default class Unsplash { headers?: { [key: string]: string }; }); - private request(requestOptions: { + public request(requestOptions: { url: string; method: string; query: object; headers: object; body: object; oauth: boolean; - }): Promise; + }): Promise; } export function toJson(response: any): any; -export class PhotoApi { - public listPhotos( +export interface PhotoApi { + listPhotos( page?: number, perPage?: number, orderBy?: string - ): Promise; + ): Promise; - public listCuratedPhotos( + listCuratedPhotos( page?: number, perPage?: number, orderBy?: string - ): Promise; + ): Promise; - public searchPhotos( + searchPhotos( query: string, categories: ReadonlyArray, page: number, perPage: number - ): Promise; + ): Promise; - public getPhoto( + getPhoto( id: string, width?: number, height?: number, rectangle?: ReadonlyArray - ): Promise; + ): Promise; - public getPhotoStats(id: string): Promise; + getPhotoStats(id: string): Promise; - public getRandomPhoto(options: { + getRandomPhoto(options: { width?: number; height?: number; query?: string; @@ -72,110 +72,100 @@ export class PhotoApi { featured?: boolean; collections?: ReadonlyArray; count?: number; - }): Promise; + }): Promise; - public uploadPhoto(photo: object): void; + uploadPhoto(photo: object): void; - public likePhoto(id: string): Promise; + likePhoto(id: string): Promise; - public unlikePhoto(id: string): Promise; + unlikePhoto(id: string): Promise; - public downloadPhoto(photo: { + downloadPhoto(photo: { links: { download_location: string }; - }): Promise; + }): Promise; } -export class CollectionsApi { - public listCollections( +export interface CollectionsApi { + listCollections( page?: number, perPage?: number, orderBy?: string - ): Promise; + ): Promise; - public listCuratedCollections( - page?: number, - perPage?: number - ): Promise; + listCuratedCollections(page?: number, perPage?: number): Promise; - public listFeaturedCollections( - page?: number, - perPage?: number - ): Promise; + listFeaturedCollections(page?: number, perPage?: number): Promise; - public getCollection(id: number): Promise; + getCollection(id: number): Promise; - public getCollectionPhotos( + getCollectionPhotos( id: number, page?: number, perPage?: number, orderBy?: string - ): Promise; + ): Promise; - public getCuratedCollectionPhotos( + getCuratedCollectionPhotos( id: number, page?: number, perPage?: number, orderBy?: string - ): Promise; + ): Promise; - public createCollection( + createCollection( title: string, description?: string, private?: boolean - ): Promise; + ): Promise; - public updateCollection( + updateCollection( id: number, title?: string, description?: string, private?: boolean - ): Promise; + ): Promise; - public deleteCollection(id: number): Promise; + deleteCollection(id: number): Promise; - public addPhotoToCollection( + addPhotoToCollection( collectionId: number, photoId: string - ): Promise; + ): Promise; - public removePhotoFromCollection( + removePhotoFromCollection( collectionId: number, photoId: string - ): Promise; + ): Promise; - public listRelatedCollections(collectionId: number): Promise; + listRelatedCollections(collectionId: number): Promise; } -export class SearchApi { - public all(keyword: string, page: number, per_page: number): Promise; +export interface SearchApi { + all(keyword: string, page: number, per_page: number): Promise; - public photos( + photos( keyword: string, page?: number, per_page?: number - ): Promise; + ): Promise; - public users( + users(keyword: string, page?: number, per_page?: number): Promise; + + collections( keyword: string, page?: number, per_page?: number - ): Promise; - - public collections( - keyword: string, - page?: number, - per_page?: number - ): Promise; + ): Promise; } -export class StatsApi { - public total(): Promise; +export interface StatsApi { + total(): Promise; } -export class CurrentUserApi { - public profile(): Promise; +export interface CurrentUserApi { + profile(): Promise; - public updateProfile(options: { + updateProfile(options: { username?: string; firstName?: string; lastName?: string; @@ -184,57 +174,53 @@ export class CurrentUserApi { location?: string; bio?: string; instagramUsername?: string; - }): Promise; + }): Promise; } -export class UsersApi { - public profile(username: string): Promise; +export interface UsersApi { + profile(username: string): Promise; - public statistics( + statistics( username: string, resolution?: string, quantity?: string - ): Promise; + ): Promise; - public photos( + photos( username: string, page?: number, perPage?: number, orderBy?: string, stats?: boolean - ): Promise; + ): Promise; - public likes( + likes( username: string, page?: number, perPage?: number, orderBy?: string - ): Promise; + ): Promise; - public collections( + collections( username: string, page?: number, perPage?: number, orderBy?: string - ): Promise; + ): Promise; } -export class CategoriesApi { - public listCategories(): Promise; +export interface CategoriesApi { + listCategories(): Promise; - public category(id: any): Promise; + category(id: any): Promise; - public categoryPhotos( - id: any, - page?: number, - perPage?: number - ): Promise; + categoryPhotos(id: any, page?: number, perPage?: number): Promise; } -export class Auth { - public getAuthenticationUrl(scopes?: ReadonlyArray): string; +export interface Auth { + getAuthenticationUrl(scopes?: ReadonlyArray): string; - public userAuthentication(code: string): Promise; + userAuthentication(code: string): Promise; - public setBearerToken(accessToken: string): void; + setBearerToken(accessToken: string): void; } diff --git a/types/unsplash-js/tsconfig.json b/types/unsplash-js/tsconfig.json index 79f45318aa..a76632982c 100644 --- a/types/unsplash-js/tsconfig.json +++ b/types/unsplash-js/tsconfig.json @@ -2,7 +2,8 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], "noImplicitAny": true, "noImplicitThis": true, From a3770d86923cd891fbc77c67b9e5ee5b3afe1a18 Mon Sep 17 00:00:00 2001 From: Andrew Date: Fri, 1 Mar 2019 11:41:53 +0500 Subject: [PATCH 199/924] feat(unsplash-js): add tests --- types/unsplash-js/index.d.ts | 6 +- types/unsplash-js/unsplash-js-tests.ts | 100 +++++++++++++++++++++++++ 2 files changed, 103 insertions(+), 3 deletions(-) diff --git a/types/unsplash-js/index.d.ts b/types/unsplash-js/index.d.ts index e68a854510..92a8eceb8b 100644 --- a/types/unsplash-js/index.d.ts +++ b/types/unsplash-js/index.d.ts @@ -14,8 +14,8 @@ export default class Unsplash { public stats: StatsApi; public constructor(options: { - apiUrl: string; - apiVersion: string; + apiUrl?: string; + apiVersion?: string; applicationId: string; secret: string; callbackUrl?: string; @@ -183,7 +183,7 @@ export interface UsersApi { statistics( username: string, resolution?: string, - quantity?: string + quantity?: number ): Promise; photos( diff --git a/types/unsplash-js/unsplash-js-tests.ts b/types/unsplash-js/unsplash-js-tests.ts index e69de29bb2..262d4c5e02 100644 --- a/types/unsplash-js/unsplash-js-tests.ts +++ b/types/unsplash-js/unsplash-js-tests.ts @@ -0,0 +1,100 @@ +import Unsplash, { toJson } from "unsplash-js"; + +const unsplash = new Unsplash({ + applicationId: "{APP_ACCESS_KEY}", + secret: "{APP_SECRET}" +}); + +const authenticationUrl = unsplash.auth.getAuthenticationUrl([ + "public", + "read_user", + "write_user", + "read_photos", + "write_photos" +]); + +unsplash.auth + .userAuthentication("{OAUTH_CODE}") + .then(toJson) + .then(json => { + unsplash.auth.setBearerToken(json.access_token); + }); + +unsplash.currentUser.profile(); + +unsplash.currentUser.updateProfile({ + username: "drizzy", + firstName: "Aubrey", + lastName: "Graham", + email: "drizzy@octobersveryown.com", + url: "http://octobersveryown.com", + location: "Toronto, Ontario, Canada", + bio: "Views from the 6", + instagramUsername: "champagnepapi" +}); + +unsplash.users.profile("naoufal"); + +unsplash.users.statistics("naoufal", "days", 30); + +unsplash.users.photos("naoufal", 1, 10, "popular", false); + +unsplash.users.likes("naoufal", 2, 15, "popular"); + +unsplash.users.collections("naoufal", 2, 15, "updated"); + +unsplash.photos.listPhotos(2, 15, "latest"); + +unsplash.photos.getPhoto("mtNweauBsMQ", 1920, 1080, [0, 0, 1920, 1080]); + +unsplash.photos.getPhotoStats("mtNweauBsMQ"); + +unsplash.photos.getRandomPhoto({ username: "naoufal" }); + +unsplash.photos.likePhoto("mtNweauBsMQ"); + +unsplash.photos.unlikePhoto("mtNweauBsMQ"); + +unsplash.photos + .getPhoto("mtNweauBsMQ") + .then(toJson) + .then(json => { + unsplash.photos.downloadPhoto(json); + }); + +unsplash.collections.listCollections(1, 10, "popular"); + +unsplash.collections.listFeaturedCollections(1, 10); + +unsplash.collections.getCollection(123456); + +unsplash.collections.getCollectionPhotos(123456, 1, 10, "popular"); + +unsplash.collections.createCollection( + "Birds", + "Wild birds from 'round the world", + true +); + +unsplash.collections.updateCollection( + 12345, + "Wild Birds", + "Wild birds from around the world", + false +); + +unsplash.collections.deleteCollection(42); + +unsplash.collections.addPhotoToCollection(88, "abc1234"); + +unsplash.collections.removePhotoFromCollection(88, "abc1234"); + +unsplash.collections.listRelatedCollections(88); + +unsplash.search.photos("dogs", 1); + +unsplash.search.users("steve", 1); + +unsplash.search.collections("dogs", 1); + +unsplash.stats.total(); From f583652711dc5038fa4d3bec0eff75cae7d2f85c Mon Sep 17 00:00:00 2001 From: Andrew Date: Fri, 1 Mar 2019 12:06:13 +0500 Subject: [PATCH 200/924] feat(unsplash-js): add ts version and remove implicit modificators --- types/unsplash-js/index.d.ts | 21 +++++++++++---------- types/unsplash-js/tsconfig.json | 1 + 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/types/unsplash-js/index.d.ts b/types/unsplash-js/index.d.ts index 92a8eceb8b..40971248f6 100644 --- a/types/unsplash-js/index.d.ts +++ b/types/unsplash-js/index.d.ts @@ -2,18 +2,19 @@ // Project: https://github.com/unsplash/unsplash-js#readme // Definitions by: Andrew Malikov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 export default class Unsplash { - public auth: Auth; - public categories: CategoriesApi; - public collections: CollectionsApi; - public currentUser: CurrentUserApi; - public users: UsersApi; - public photos: PhotoApi; - public search: SearchApi; - public stats: StatsApi; + auth: Auth; + categories: CategoriesApi; + collections: CollectionsApi; + currentUser: CurrentUserApi; + users: UsersApi; + photos: PhotoApi; + search: SearchApi; + stats: StatsApi; - public constructor(options: { + constructor(options: { apiUrl?: string; apiVersion?: string; applicationId: string; @@ -23,7 +24,7 @@ export default class Unsplash { headers?: { [key: string]: string }; }); - public request(requestOptions: { + request(requestOptions: { url: string; method: string; query: object; diff --git a/types/unsplash-js/tsconfig.json b/types/unsplash-js/tsconfig.json index a76632982c..8d04d7480f 100644 --- a/types/unsplash-js/tsconfig.json +++ b/types/unsplash-js/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" From 1b6ef0e8f0c6a468d2f2caf070791c52447a9fe2 Mon Sep 17 00:00:00 2001 From: Andrew Date: Fri, 1 Mar 2019 12:26:42 +0500 Subject: [PATCH 201/924] feat(unsplash-js): hide internal API --- types/unsplash-js/index.d.ts | 390 ++++++++++++++++++----------------- 1 file changed, 203 insertions(+), 187 deletions(-) diff --git a/types/unsplash-js/index.d.ts b/types/unsplash-js/index.d.ts index 40971248f6..682eef058b 100644 --- a/types/unsplash-js/index.d.ts +++ b/types/unsplash-js/index.d.ts @@ -5,14 +5,14 @@ // TypeScript Version: 2.2 export default class Unsplash { - auth: Auth; - categories: CategoriesApi; - collections: CollectionsApi; - currentUser: CurrentUserApi; - users: UsersApi; - photos: PhotoApi; - search: SearchApi; - stats: StatsApi; + auth: UnsplashApi.Auth; + categories: UnsplashApi.Categories; + collections: UnsplashApi.Collections; + currentUser: UnsplashApi.CurrentUser; + users: UnsplashApi.Users; + photos: UnsplashApi.Photo; + search: UnsplashApi.Search; + stats: UnsplashApi.Stats; constructor(options: { apiUrl?: string; @@ -36,192 +36,208 @@ export default class Unsplash { export function toJson(response: any): any; -export interface PhotoApi { - listPhotos( - page?: number, - perPage?: number, - orderBy?: string - ): Promise; +declare module UnsplashApi { + interface Photo { + listPhotos( + page?: number, + perPage?: number, + orderBy?: string + ): Promise; - listCuratedPhotos( - page?: number, - perPage?: number, - orderBy?: string - ): Promise; + listCuratedPhotos( + page?: number, + perPage?: number, + orderBy?: string + ): Promise; - searchPhotos( - query: string, - categories: ReadonlyArray, - page: number, - perPage: number - ): Promise; + searchPhotos( + query: string, + categories: ReadonlyArray, + page: number, + perPage: number + ): Promise; - getPhoto( - id: string, - width?: number, - height?: number, - rectangle?: ReadonlyArray - ): Promise; + getPhoto( + id: string, + width?: number, + height?: number, + rectangle?: ReadonlyArray + ): Promise; - getPhotoStats(id: string): Promise; + getPhotoStats(id: string): Promise; - getRandomPhoto(options: { - width?: number; - height?: number; - query?: string; - username?: string; - featured?: boolean; - collections?: ReadonlyArray; - count?: number; - }): Promise; + getRandomPhoto(options: { + width?: number; + height?: number; + query?: string; + username?: string; + featured?: boolean; + collections?: ReadonlyArray; + count?: number; + }): Promise; - uploadPhoto(photo: object): void; + uploadPhoto(photo: object): void; - likePhoto(id: string): Promise; + likePhoto(id: string): Promise; - unlikePhoto(id: string): Promise; + unlikePhoto(id: string): Promise; - downloadPhoto(photo: { - links: { download_location: string }; - }): Promise; -} - -export interface CollectionsApi { - listCollections( - page?: number, - perPage?: number, - orderBy?: string - ): Promise; - - listCuratedCollections(page?: number, perPage?: number): Promise; - - listFeaturedCollections(page?: number, perPage?: number): Promise; - - getCollection(id: number): Promise; - - getCollectionPhotos( - id: number, - page?: number, - perPage?: number, - orderBy?: string - ): Promise; - - getCuratedCollectionPhotos( - id: number, - page?: number, - perPage?: number, - orderBy?: string - ): Promise; - - createCollection( - title: string, - description?: string, - private?: boolean - ): Promise; - - updateCollection( - id: number, - title?: string, - description?: string, - private?: boolean - ): Promise; - - deleteCollection(id: number): Promise; - - addPhotoToCollection( - collectionId: number, - photoId: string - ): Promise; - - removePhotoFromCollection( - collectionId: number, - photoId: string - ): Promise; - - listRelatedCollections(collectionId: number): Promise; -} - -export interface SearchApi { - all(keyword: string, page: number, per_page: number): Promise; - - photos( - keyword: string, - page?: number, - per_page?: number - ): Promise; - - users(keyword: string, page?: number, per_page?: number): Promise; - - collections( - keyword: string, - page?: number, - per_page?: number - ): Promise; -} - -export interface StatsApi { - total(): Promise; -} - -export interface CurrentUserApi { - profile(): Promise; - - updateProfile(options: { - username?: string; - firstName?: string; - lastName?: string; - email?: string; - url?: string; - location?: string; - bio?: string; - instagramUsername?: string; - }): Promise; -} - -export interface UsersApi { - profile(username: string): Promise; - - statistics( - username: string, - resolution?: string, - quantity?: number - ): Promise; - - photos( - username: string, - page?: number, - perPage?: number, - orderBy?: string, - stats?: boolean - ): Promise; - - likes( - username: string, - page?: number, - perPage?: number, - orderBy?: string - ): Promise; - - collections( - username: string, - page?: number, - perPage?: number, - orderBy?: string - ): Promise; -} - -export interface CategoriesApi { - listCategories(): Promise; - - category(id: any): Promise; - - categoryPhotos(id: any, page?: number, perPage?: number): Promise; -} - -export interface Auth { - getAuthenticationUrl(scopes?: ReadonlyArray): string; - - userAuthentication(code: string): Promise; - - setBearerToken(accessToken: string): void; + downloadPhoto(photo: { + links: { download_location: string }; + }): Promise; + } + + interface Collections { + listCollections( + page?: number, + perPage?: number, + orderBy?: string + ): Promise; + + listCuratedCollections( + page?: number, + perPage?: number + ): Promise; + + listFeaturedCollections( + page?: number, + perPage?: number + ): Promise; + + getCollection(id: number): Promise; + + getCollectionPhotos( + id: number, + page?: number, + perPage?: number, + orderBy?: string + ): Promise; + + getCuratedCollectionPhotos( + id: number, + page?: number, + perPage?: number, + orderBy?: string + ): Promise; + + createCollection( + title: string, + description?: string, + private?: boolean + ): Promise; + + updateCollection( + id: number, + title?: string, + description?: string, + private?: boolean + ): Promise; + + deleteCollection(id: number): Promise; + + addPhotoToCollection( + collectionId: number, + photoId: string + ): Promise; + + removePhotoFromCollection( + collectionId: number, + photoId: string + ): Promise; + + listRelatedCollections(collectionId: number): Promise; + } + + interface Search { + all(keyword: string, page: number, per_page: number): Promise; + + photos( + keyword: string, + page?: number, + per_page?: number + ): Promise; + + users( + keyword: string, + page?: number, + per_page?: number + ): Promise; + + collections( + keyword: string, + page?: number, + per_page?: number + ): Promise; + } + + interface Stats { + total(): Promise; + } + + interface CurrentUser { + profile(): Promise; + + updateProfile(options: { + username?: string; + firstName?: string; + lastName?: string; + email?: string; + url?: string; + location?: string; + bio?: string; + instagramUsername?: string; + }): Promise; + } + + interface Users { + profile(username: string): Promise; + + statistics( + username: string, + resolution?: string, + quantity?: number + ): Promise; + + photos( + username: string, + page?: number, + perPage?: number, + orderBy?: string, + stats?: boolean + ): Promise; + + likes( + username: string, + page?: number, + perPage?: number, + orderBy?: string + ): Promise; + + collections( + username: string, + page?: number, + perPage?: number, + orderBy?: string + ): Promise; + } + + interface Categories { + listCategories(): Promise; + + category(id: any): Promise; + + categoryPhotos( + id: any, + page?: number, + perPage?: number + ): Promise; + } + + interface Auth { + getAuthenticationUrl(scopes?: ReadonlyArray): string; + + userAuthentication(code: string): Promise; + + setBearerToken(accessToken: string): void; + } } From 41ca4ffe36b43a056982cdfac27219a34fd1e385 Mon Sep 17 00:00:00 2001 From: Andrew Date: Fri, 1 Mar 2019 12:38:08 +0500 Subject: [PATCH 202/924] fix(unspash-js): remove deprecated 'module' syntax --- types/unsplash-js/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/unsplash-js/index.d.ts b/types/unsplash-js/index.d.ts index 682eef058b..8eb6222778 100644 --- a/types/unsplash-js/index.d.ts +++ b/types/unsplash-js/index.d.ts @@ -36,7 +36,7 @@ export default class Unsplash { export function toJson(response: any): any; -declare module UnsplashApi { +export namespace UnsplashApi { interface Photo { listPhotos( page?: number, From 21f65b52987ff81e9bc01c26707ed83bd7b663b8 Mon Sep 17 00:00:00 2001 From: Bryan Huang Date: Fri, 1 Mar 2019 15:57:03 +0800 Subject: [PATCH 203/924] Upgrade to Viewer v6.4 --- types/forge-viewer/index.d.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/types/forge-viewer/index.d.ts b/types/forge-viewer/index.d.ts index bff0c637a0..878a3926fa 100644 --- a/types/forge-viewer/index.d.ts +++ b/types/forge-viewer/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Forge Viewer 6.3 +// Type definitions for Forge Viewer 6.4 // Project: https://forge.autodesk.com/en/docs/viewer/v6/reference/javascript/viewer3d/ // Definitions by: Autodesk Forge Partner Development , Alan Smith // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -238,10 +238,14 @@ declare namespace Autodesk { [key: string]: any; } + const AGGREGATE_FIT_TO_VIEW_EVENT = 'aggregateFitToView'; + const AGGREGATE_ISOLATION_CHANGED_EVENT = 'aggregateIsolation'; const AGGREGATE_SELECTION_CHANGED_EVENT = 'aggregateSelection'; const ANIMATION_READY_EVENT = 'animationReady'; const CAMERA_CHANGE_EVENT = 'cameraChanged'; + const CAMERA_TRANSITION_COMPLETED = 'cameraTransitionCompleted'; const CUTPLANES_CHANGE_EVENT = 'cutplanesChanged'; + const CANCEL_LEAFLET_SCREENSHOT = 'cancelLeafletScreenshot'; const ESCAPE_EVENT = 'escape'; const EXPLODE_CHANGE_EVENT = 'explodeChanged'; const EXTENSION_LOADED_EVENT = 'extensionLoaded'; @@ -251,12 +255,17 @@ declare namespace Autodesk { const FRAGMENTS_LOADED_EVENT = 'fragmentsLoaded'; const FULLSCREEN_MODE_EVENT = 'fullscreenMode'; const GEOMETRY_LOADED_EVENT = 'geometryLoaded'; + const GEOMETRY_DOWNLOAD_COMPLETE_EVENT = 'geometryDownloadComplete'; const HIDE_EVENT = 'hide'; const HYPERLINK_EVENT = 'hyperlink'; const ISOLATE_EVENT = 'isolate'; const LAYER_VISIBILITY_CHANGED_EVENT = 'layerVisibilityChanged'; + const LOAD_GEOMETRY_EVENT = 'loadGeometry'; const LOAD_MISSING_GEOMETRY = 'loadMissingGeometry'; + const MODEL_ADDED_EVENT = 'modelAdded'; const MODEL_ROOT_LOADED_EVENT = 'modelRootLoaded'; + const MODEL_REMOVED_EVENT = 'modelRemoved'; + const MODEL_LAYERS_LOADED_EVENT = 'modelLayersLoaded'; const MODEL_UNLOADED_EVENT = 'modelUnloaded'; const NAVIGATION_MODE_CHANGED_EVENT = 'navigationModeChanged'; const OBJECT_TREE_CREATED_EVENT = 'objectTreeCreated'; @@ -277,6 +286,7 @@ declare namespace Autodesk { const VIEWER_RESIZE_EVENT = 'viewerResize'; const VIEWER_STATE_RESTORED_EVENT = 'viewerStateRestored'; const VIEWER_UNINITIALIZED = 'viewerUninitialized'; + const WEBGL_CONTEXT_LOST_EVENT = 'webGlContextLost'; interface ViewerEventArgs { target?: Viewer3D; @@ -333,6 +343,7 @@ declare namespace Autodesk { setTag(tag: string, value: any): void; traverse(cb: () => void): boolean; urn(searchParent: boolean): string; + useAsDefault(): boolean; } let theExtensionManager: ExtensionManager; @@ -850,11 +861,15 @@ declare namespace Autodesk { hitTestViewport(vpVec: THREE.Vector3, ignoreTransparent: boolean): HitTestResult; initialize(): void; setLightPreset(index: number, force?: boolean): void; + viewportToClient(viewportX: number, viewportY: number): THREE.Vector3; getMaterials(): any; + getScreenShotProgressive(w: number, h: number, onFinished?: () => void, options?: any): any; + getRenderProxy(model: Model, fragId: number): any; sceneUpdated(param: boolean): void; + setViewFromCamera(camera: THREE.Camera, skipTransition?: boolean, useExactCamera?: boolean): void; } class VisibilityManager { From 5941e3481c703daf85efaa1e083a9d8e04af2913 Mon Sep 17 00:00:00 2001 From: Akihiro Uchida Date: Fri, 1 Mar 2019 15:05:09 +0900 Subject: [PATCH 204/924] Add definitions for puppeteer BrowserFetcher --- types/puppeteer/index.d.ts | 28 ++++++++++++++++++++++++++++ types/puppeteer/puppeteer-tests.ts | 8 ++++++++ 2 files changed, 36 insertions(+) diff --git a/types/puppeteer/index.d.ts b/types/puppeteer/index.d.ts index 1b9428392a..a4bf6e0d73 100644 --- a/types/puppeteer/index.d.ts +++ b/types/puppeteer/index.d.ts @@ -2195,3 +2195,31 @@ export function defaultArgs(options?: ChromeArgOptions): string[]; export function executablePath(): string; /** The method launches a browser instance with given arguments. The browser will be closed when the parent node.js process is closed. */ export function launch(options?: LaunchOptions): Promise; + +/** This methods attaches Puppeteer to an existing Chromium instance. */ +export function createBrowserFetcher(options?: LaunchOptions): BrowserFetcher; + +/** BrowserFetcher can download and manage different versions of Chromium. */ +export interface BrowserFetcher { + /** The method initiates a HEAD request to check if the revision is available. */ + canDownload(revision: string): Promise; + /** The method initiates a GET request to download the revision from the host. */ + download(revision: string, progressCallback?: (downloadBytes: number, totalBytes: number) => any): Promise; + localRevisions(): Promise; + platform(): string; + remove(revision: string): Promise; + revisionInfo(revision: string): RevisionInfo; +} + +export interface RevisionInfo { + /** The revision the info was created from */ + revision: string; + /** Path to the extracted revision folder */ + folderPath: string; + /** Path to the revision executable */ + executablePath: string; + /** URL this revision can be downloaded from */ + url: string; + /** whether the revision is locally available on disk */ + local: boolean; +} diff --git a/types/puppeteer/puppeteer-tests.ts b/types/puppeteer/puppeteer-tests.ts index e5c287b6ee..e62be5b7d5 100644 --- a/types/puppeteer/puppeteer-tests.ts +++ b/types/puppeteer/puppeteer-tests.ts @@ -618,3 +618,11 @@ puppeteer.launch().then(async browser => { ); console.log('there are', numMatchingEls, 'banana paragaphs'); }); + +(async () => { + const rev = '630727'; + const browserFetcher = puppeteer.createBrowserFetcher(); + await browserFetcher.canDownload(rev); + const revisionInfo = await browserFetcher.download(rev); + await browserFetcher.remove(rev); +}); From 80b5ecb0821f57cb96890431dd31d8fd1d7ce2aa Mon Sep 17 00:00:00 2001 From: Federico Della Rovere Date: Fri, 1 Mar 2019 09:23:11 +0100 Subject: [PATCH 205/924] fix linting issues --- types/twitch-ext/index.d.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/types/twitch-ext/index.d.ts b/types/twitch-ext/index.d.ts index fac7ccaad4..2aa518fb43 100644 --- a/types/twitch-ext/index.d.ts +++ b/types/twitch-ext/index.d.ts @@ -186,7 +186,7 @@ interface TwitchExtConfiguration { /** * This property returns the record for the developer segment if one is found; otherwise, undefined. - */ + */ developer: { version: string; content: string } | undefined; /** @@ -199,11 +199,10 @@ interface TwitchExtConfiguration { * The callback function takes no input and returns nothing. After this is called for the first time, * the records for the global, developer and broadcaster segments will be set if the data is available. * @param callback The callback that is fired. - */ + */ onChanged( callback: () => void - ): void - + ): void; /** * This function can be called by the front end to set an extension configuration. @@ -214,7 +213,6 @@ interface TwitchExtConfiguration { set(segment: string, version: string, content: string): void; } - interface TwitchExtFeatureFlags { /** * If this flag is true, you can send a chat message to the current channel using Send Extension Chat Message From 4853a9065b484a47c33a56eb3cc29c48ab144f39 Mon Sep 17 00:00:00 2001 From: Federico Della Rovere Date: Fri, 1 Mar 2019 10:04:20 +0100 Subject: [PATCH 206/924] add twitch-ext configuration test --- types/twitch-ext/twitch-ext-tests.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/types/twitch-ext/twitch-ext-tests.ts b/types/twitch-ext/twitch-ext-tests.ts index f6a70f86cb..f3b16517d2 100644 --- a/types/twitch-ext/twitch-ext-tests.ts +++ b/types/twitch-ext/twitch-ext-tests.ts @@ -36,6 +36,28 @@ window.Twitch.ext.actions.minimize(); window.Twitch.ext.actions.followChannel("hearthsim"); window.Twitch.ext.actions.requestIdShare(); +// Twitch Extension Configuration +window.Twitch.ext.configuration.onChanged(() => { + console.log('Configuration changed'); + if (window.Twitch.ext.configuration.broadcaster) { + console.log('Caster configuration'); + console.log('version: ', window.Twitch.ext.configuration.broadcaster.version); + console.log('content: ', window.Twitch.ext.configuration.broadcaster.content); + } + if (window.Twitch.ext.configuration.developer) { + console.log('Developer configuration'); + console.log('version:', window.Twitch.ext.configuration.developer.version); + console.log('content: ', window.Twitch.ext.configuration.developer.content); + } + if (window.Twitch.ext.configuration.global) { + console.log('Global configuration'); + console.log('version: ', window.Twitch.ext.configuration.global.version); + console.log('content: ', window.Twitch.ext.configuration.global.content); + } +}); + +window.Twitch.ext.configuration.set('broadcaster', '0.0.1', '{"test": "test"}'); + // Twitch Extension Feature flags window.Twitch.ext.features.onChanged(changed => { if (changed.indexOf("isChatEnabled") !== -1) { From 4158bbc44beb3cbce3bd584cdc3a28a2d430ec66 Mon Sep 17 00:00:00 2001 From: Bryan Huang Date: Fri, 1 Mar 2019 17:09:43 +0800 Subject: [PATCH 207/924] Merging in contributions from Norconsult --- types/forge-viewer/index.d.ts | 52 +++++++++++++++++++++++++++++++---- 1 file changed, 47 insertions(+), 5 deletions(-) diff --git a/types/forge-viewer/index.d.ts b/types/forge-viewer/index.d.ts index 878a3926fa..8bb90b6d59 100644 --- a/types/forge-viewer/index.d.ts +++ b/types/forge-viewer/index.d.ts @@ -150,6 +150,13 @@ declare namespace Autodesk { interface ViewerConfig { disableBrowserContextMenu?: boolean; + disabledExtensions?: { + bimwalk?: boolean; + hyperlink?: boolean; + measure?: boolean; + scalarisSimulation?: boolean; + section?: boolean; + }; extensions?: string[]; useConsolidation?: boolean; consolidationMemoryLimit?: number; @@ -356,6 +363,7 @@ declare namespace Autodesk { language?: string; accessToken?: string; useADP?: boolean; + useConsolidation?: boolean; [key: string]: any; } @@ -449,16 +457,42 @@ declare namespace Autodesk { } class Model { - getBoundingBox(): THREE.Box3; + fetchTopology(maxSizeMB: number): Promise; getBulkProperties(dbIds: number[], propFilter?: string[], successCallback?: (r: any) => void, errorCallback?: (err: any) => void): void; getData(): any; getFragmentList(): any; getObjectTree(successCallback?: (result: InstanceTree) => void, errorCallback?: (err: any) => void): void; getProperties(dbId: number, successCallback?: (r: PropertyResult) => void, errorCallback?: (err: any) => void): void; + geomPolyCount(): number; + getDefaultCamera(): THREE.Camera; + getDisplayUnit(): string; + getDocumentNode(): object; + getExternalIdMapping(onSuccessCallback: () => void, onErrorCallback: () => void): any; + getFastLoadList(): any; + getFragmentMap(): any; // DbidFragmentMap|InstanceTree; + getLayersRoot(): object; + getMetadata(itemName: string, subitemName?: string, defaultValue?: any): any; + getRoot(): object; + getRootId(): number; + getTopoIndex(fragId: number): number; + getTopology(index: number): object; + getUnitData(unit: string): object; getUnitScale(): number; - getUnitString(): number; - - search(text: string, successCallback: (r: number[]) => void, errorCallback?: (err: any) => void, attributeNames?: string[]): void; + getUnitString(): string; + getUpVector(): any; + hasTopology(): boolean; + instancePolyCount(): number; + is2d(): boolean; + is3d(): boolean; + isAEC(): boolean; + isLoadDone(): boolean; + isObjectTreeCreated(): boolean; + isObjectTreeLoaded(): boolean; + pageToModel(): void; + pointInClip(): void; + search(text: string, onSuccessCallback: () => void, onErrorCallback: () => void, attributeNames?: string[]): void; + setData(data: object): void; + setUUID(urn: string): void; clearThemingColors(): void; getInstanceTree(): InstanceTree; @@ -771,6 +805,13 @@ declare namespace Autodesk { getHitPoint(x: number, y: number): THREE.Vector3; } + namespace Extensions { + class ViewerPropertyPanel extends UI.PropertyPanel { + constructor(viewer: Private.GuiViewer3D); + currentNodeIds: object[]; + } + } + namespace Private { function getHtmlTemplate(url: string, callback: (error: string, content: string) => void): void; @@ -863,7 +904,8 @@ declare namespace Autodesk { setLightPreset(index: number, force?: boolean): void; viewportToClient(viewportX: number, viewportY: number): THREE.Vector3; - + modelqueue(): any; + matman(): any; getMaterials(): any; getScreenShotProgressive(w: number, h: number, onFinished?: () => void, options?: any): any; From d730f94be2975694dca164e13c98fb6f05ad4627 Mon Sep 17 00:00:00 2001 From: "Adam A. Zerella" Date: Fri, 1 Mar 2019 20:12:40 +1100 Subject: [PATCH 208/924] Added type defs for repeat-string --- types/repeat-string/index.d.ts | 9 ++++++++ types/repeat-string/repeat-string-tests.ts | 3 +++ types/repeat-string/tsconfig.json | 25 ++++++++++++++++++++++ types/repeat-string/tslint.json | 3 +++ 4 files changed, 40 insertions(+) create mode 100644 types/repeat-string/index.d.ts create mode 100644 types/repeat-string/repeat-string-tests.ts create mode 100644 types/repeat-string/tsconfig.json create mode 100644 types/repeat-string/tslint.json diff --git a/types/repeat-string/index.d.ts b/types/repeat-string/index.d.ts new file mode 100644 index 0000000000..e593a62b68 --- /dev/null +++ b/types/repeat-string/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for repeat-string 1.6 +// Project: https://github.com/jonschlinkert/repeat-string +// Definitions by: Adam Zerella +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Repeat the given `string` the specified `number` of times. + */ +export default function(str: string, num: number): string; diff --git a/types/repeat-string/repeat-string-tests.ts b/types/repeat-string/repeat-string-tests.ts new file mode 100644 index 0000000000..7095ea672b --- /dev/null +++ b/types/repeat-string/repeat-string-tests.ts @@ -0,0 +1,3 @@ +import Repeat from "repeat-string"; + +Repeat('A', 5); diff --git a/types/repeat-string/tsconfig.json b/types/repeat-string/tsconfig.json new file mode 100644 index 0000000000..a56114d84f --- /dev/null +++ b/types/repeat-string/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [ + + ], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "repeat-string-tests.ts" + ] +} diff --git a/types/repeat-string/tslint.json b/types/repeat-string/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/repeat-string/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file From 129237bb3c8098e4b013233ea2ce9484d9d3e37d Mon Sep 17 00:00:00 2001 From: Federico Della Rovere Date: Fri, 1 Mar 2019 10:23:01 +0100 Subject: [PATCH 209/924] add contribution sign --- types/twitch-ext/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/twitch-ext/index.d.ts b/types/twitch-ext/index.d.ts index 2aa518fb43..cb02f14538 100644 --- a/types/twitch-ext/index.d.ts +++ b/types/twitch-ext/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for non-npm package twitch-ext 1.15 // Project: https://dev.twitch.tv/docs/extensions/reference/#javascript-helper // Definitions by: Benedict Etzel +// Federico Della Rovere // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 From 3796d81ce2f6df3e1dcc839245881086c8d10c1a Mon Sep 17 00:00:00 2001 From: Federico Della Rovere Date: Fri, 1 Mar 2019 10:33:24 +0100 Subject: [PATCH 210/924] increase twitch-ext version --- types/twitch-ext/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/twitch-ext/index.d.ts b/types/twitch-ext/index.d.ts index cb02f14538..a9e2a648d9 100644 --- a/types/twitch-ext/index.d.ts +++ b/types/twitch-ext/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for non-npm package twitch-ext 1.15 +// Type definitions for non-npm package twitch-ext 1.16 // Project: https://dev.twitch.tv/docs/extensions/reference/#javascript-helper // Definitions by: Benedict Etzel // Federico Della Rovere From 017b8bdd70cc40d68698fe948eb8c983cfc90161 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20M=C3=BCller?= Date: Fri, 1 Mar 2019 11:16:20 +0100 Subject: [PATCH 211/924] Fix spelling of a setting The "D" of "Domains" should be written in uppercase according to the docs: https://helmetjs.github.io/docs/hsts/ --- types/helmet/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/helmet/index.d.ts b/types/helmet/index.d.ts index b0a50c901e..82ad12929b 100644 --- a/types/helmet/index.d.ts +++ b/types/helmet/index.d.ts @@ -134,7 +134,7 @@ declare namespace helmet { export interface IHelmetHpkpConfiguration { maxAge: number; sha256s: string[]; - includeSubdomains?: boolean; + includeSubDomains?: boolean; reportUri?: string; reportOnly?: boolean; setIf?: IHelmetSetIfFunction; From f257e0ca0fb86fa449fdb52ad7d5e9961afcf28a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20M=C3=BCller?= Date: Fri, 1 Mar 2019 11:35:26 +0100 Subject: [PATCH 212/924] Add blameable person --- types/helmet/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/helmet/index.d.ts b/types/helmet/index.d.ts index 82ad12929b..565dda9ebf 100644 --- a/types/helmet/index.d.ts +++ b/types/helmet/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for helmet // Project: https://github.com/helmetjs/helmet -// Definitions by: Cyril Schumacher , Evan Hahn , Elliot Blackburn +// Definitions by: Cyril Schumacher , Evan Hahn , Elliot Blackburn , Daniel MĂŒller // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 From ca6acc7eb2a594e5dd70fc203dd34f667789dbc6 Mon Sep 17 00:00:00 2001 From: chdanielmueller Date: Fri, 1 Mar 2019 11:43:05 +0100 Subject: [PATCH 213/924] Fix Tests --- types/helmet/helmet-tests.ts | 6 +++--- types/helmet/index.d.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/types/helmet/helmet-tests.ts b/types/helmet/helmet-tests.ts index 8b4c5634ac..f73095b714 100644 --- a/types/helmet/helmet-tests.ts +++ b/types/helmet/helmet-tests.ts @@ -122,13 +122,13 @@ function hpkpTest() { app.use(helmet.hpkp({ maxAge: 7776000000, sha256s: ['AbCdEf123=', 'ZyXwVu456='], - includeSubdomains: false + includeSubDomains: false })); app.use(helmet.hpkp({ maxAge: 7776000000, sha256s: ['AbCdEf123=', 'ZyXwVu456='], - includeSubdomains: true + includeSubDomains: true })); app.use(helmet.hpkp({ @@ -164,7 +164,7 @@ function hstsTest() { app.use(helmet.hsts({ maxAge: 7776000000, - includeSubdomains: true + includeSubDomains: true })); app.use(helmet.hsts({ diff --git a/types/helmet/index.d.ts b/types/helmet/index.d.ts index 565dda9ebf..573395831b 100644 --- a/types/helmet/index.d.ts +++ b/types/helmet/index.d.ts @@ -142,7 +142,7 @@ declare namespace helmet { export interface IHelmetHstsConfiguration { maxAge?: number; - includeSubdomains?: boolean; + includeSubDomains?: boolean; preload?: boolean; setIf?: IHelmetSetIfFunction; force?: boolean; From 2203ddb799a7581e69b7f1a0693be7891c810d42 Mon Sep 17 00:00:00 2001 From: chdanielmueller Date: Fri, 1 Mar 2019 11:49:56 +0100 Subject: [PATCH 214/924] Koa Tests --- types/koa-helmet/koa-helmet-tests.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/koa-helmet/koa-helmet-tests.ts b/types/koa-helmet/koa-helmet-tests.ts index 2290ab07fa..34bca1958a 100644 --- a/types/koa-helmet/koa-helmet-tests.ts +++ b/types/koa-helmet/koa-helmet-tests.ts @@ -95,13 +95,13 @@ function hpkpTest() { app.use(helmet.hpkp({ maxAge: 7776000000, sha256s: ['AbCdEf123=', 'ZyXwVu456='], - includeSubdomains: false + includeSubDomains: false })); app.use(helmet.hpkp({ maxAge: 7776000000, sha256s: ['AbCdEf123=', 'ZyXwVu456='], - includeSubdomains: true + includeSubDomains: true })); app.use(helmet.hpkp({ @@ -137,7 +137,7 @@ function hstsTest() { app.use(helmet.hsts({ maxAge: 7776000000, - includeSubdomains: true + includeSubDomains: true })); app.use(helmet.hsts({ From 480b1438e0049ea087e78ff35842e35c0391c9af Mon Sep 17 00:00:00 2001 From: zy410419243 Date: Fri, 1 Mar 2019 19:04:28 +0800 Subject: [PATCH 215/924] fix: Cesium3DTilesetItem --- types/cesium/index.d.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/types/cesium/index.d.ts b/types/cesium/index.d.ts index 398d05ad33..7cb7752223 100644 --- a/types/cesium/index.d.ts +++ b/types/cesium/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for cesium 1.47 +// Type definitions for cesium 1.54 // Project: http://cesiumjs.org // Definitions by: Aigars Zeiza // Harry Nicholls @@ -1393,7 +1393,7 @@ declare namespace Cesium { class ScreenSpaceEventHandler { constructor(element?: HTMLCanvasElement); - setInputAction(action: () => void, type: number, modifier?: number): void; + setInputAction(action: (click: { position: Cartesian2 }) => void, type: number, modifier?: number): void; getInputAction(type: number, modifier?: number): () => void; removeInputAction(type: number, modifier?: number): void; isDestroyed(): boolean; @@ -3134,6 +3134,16 @@ declare namespace Cesium { static clone(hpr: HeadingPitchRange, result?: HeadingPitchRange): HeadingPitchRange; } + class Cesium3DTilesetItem { + url: string; + maximumScreenSpaceError: number; + maximumNumberOfLoadedTiles: number; + } + + class Cesium3DTileset { + constructor (Cesium3DTilesetItem: Cesium3DTilesetItem) + } + class ImageryLayer { alpha: number; brightness: number; From 52748754cf41c58a00a0a4a8311555fbda59253b Mon Sep 17 00:00:00 2001 From: zy410419243 Date: Fri, 1 Mar 2019 19:28:11 +0800 Subject: [PATCH 216/924] pref: disable tslint rule => no-unnecessary-class --- types/cesium/index.d.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/types/cesium/index.d.ts b/types/cesium/index.d.ts index 7cb7752223..497c763ebf 100644 --- a/types/cesium/index.d.ts +++ b/types/cesium/index.d.ts @@ -3134,14 +3134,13 @@ declare namespace Cesium { static clone(hpr: HeadingPitchRange, result?: HeadingPitchRange): HeadingPitchRange; } - class Cesium3DTilesetItem { - url: string; - maximumScreenSpaceError: number; - maximumNumberOfLoadedTiles: number; - } - + // tslint:disable-next-line:no-unnecessary-class class Cesium3DTileset { - constructor (Cesium3DTilesetItem: Cesium3DTilesetItem) + constructor(Cesium3DTilesetItem: { + url: string; + maximumScreenSpaceError: number; + maximumNumberOfLoadedTiles: number; + }) } class ImageryLayer { From b269c7cfcb6ead375fc10a8a165f151dfa936da3 Mon Sep 17 00:00:00 2001 From: Federico Della Rovere Date: Fri, 1 Mar 2019 15:07:44 +0100 Subject: [PATCH 217/924] fix with more natural syntax --- types/twitch-ext/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/twitch-ext/index.d.ts b/types/twitch-ext/index.d.ts index a9e2a648d9..5e1c9bfc74 100644 --- a/types/twitch-ext/index.d.ts +++ b/types/twitch-ext/index.d.ts @@ -183,17 +183,17 @@ interface TwitchExtConfiguration { /** * This property returns the record for the broadcaster segment if one is found; otherwise, undefined. */ - broadcaster: { version: string; content: string } | undefined; + broadcaster?: { version: string; content: string }; /** * This property returns the record for the developer segment if one is found; otherwise, undefined. */ - developer: { version: string; content: string } | undefined; + developer?: { version: string; content: string }; /** * This property returns the record for the global segment if one is found; otherwise, undefined. */ - global: { version: string; content: string } | undefined; + global?: { version: string; content: string }; /** * This function registers a callback that is called whenever an extension configuration is received. From b98bcdf2e2be48ded1d34f2c9007bb92acd0071e Mon Sep 17 00:00:00 2001 From: Federico Della Rovere Date: Fri, 1 Mar 2019 15:11:03 +0100 Subject: [PATCH 218/924] enforce segment's only valid value --- types/twitch-ext/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/twitch-ext/index.d.ts b/types/twitch-ext/index.d.ts index 5e1c9bfc74..b603c8aa92 100644 --- a/types/twitch-ext/index.d.ts +++ b/types/twitch-ext/index.d.ts @@ -211,7 +211,7 @@ interface TwitchExtConfiguration { * @param version The configuration segment to set. * @param content The version of configuration with which the segment is stored. */ - set(segment: string, version: string, content: string): void; + set(segment: "broadcaster", version: string, content: string): void; } interface TwitchExtFeatureFlags { From b48449e7839db521b06deb9a2ff579440ab35ecf Mon Sep 17 00:00:00 2001 From: Federico Della Rovere Date: Fri, 1 Mar 2019 15:14:53 +0100 Subject: [PATCH 219/924] update version according to twitch-ext javascript helper --- types/twitch-ext/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/twitch-ext/index.d.ts b/types/twitch-ext/index.d.ts index b603c8aa92..b8d29c5818 100644 --- a/types/twitch-ext/index.d.ts +++ b/types/twitch-ext/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for non-npm package twitch-ext 1.16 +// Type definitions for non-npm package twitch-ext 1.20 // Project: https://dev.twitch.tv/docs/extensions/reference/#javascript-helper // Definitions by: Benedict Etzel // Federico Della Rovere From 4587a70f1392222049dffba832ac0abde1485040 Mon Sep 17 00:00:00 2001 From: Nikolaj Kappler Date: Fri, 1 Mar 2019 15:39:37 +0100 Subject: [PATCH 220/924] added and improved declarations that were missing/incomplete/incorrect workstream: --- types/tern/index.d.ts | 5 ++-- types/tern/lib/infer/index.d.ts | 44 +++++++++++++++++++++++++-------- types/tern/lib/tern/index.d.ts | 11 +++++++-- 3 files changed, 46 insertions(+), 14 deletions(-) diff --git a/types/tern/index.d.ts b/types/tern/index.d.ts index ef01c0e289..ae5a793383 100644 --- a/types/tern/index.d.ts +++ b/types/tern/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for tern 0.22 +// Type definitions for tern 0.23 // Project: https://github.com/ternjs/tern // Definitions by: Nikolaj Kappler // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -11,5 +11,6 @@ // thus if you want to use undocumented APIs, you should extends these definitions with // ambient declaration merging: https://www.typescriptlang.org/docs/handbook/declaration-merging.html -export * from "./lib/tern"; export * from "./lib/infer"; +export * from "./lib/tern"; + diff --git a/types/tern/lib/infer/index.d.ts b/types/tern/lib/infer/index.d.ts index 58e83ea1c7..25bb7ab0d9 100644 --- a/types/tern/lib/infer/index.d.ts +++ b/types/tern/lib/infer/index.d.ts @@ -1,12 +1,14 @@ import * as ESTree from "estree"; +import { Server } from "../tern"; export { }; // #### Context #### interface ContextConstructor { - new(defs: any[]): Context; + new(defs: any[], parent: Server): Context; } export const Context: ContextConstructor; export interface Context { + parent?: Server; topScope: Scope; /** The primitive number type. */ num: Type; @@ -15,8 +17,10 @@ export interface Context { /** The primitive boolean type. */ bool: Type; } +/** Returns the current context object. */ export function cx(): Context; -export function withContext(context: Context, f: () => void): void; +/** Calls f with the current context bound to context. Basically, all code that does something with the inference engine should be wrapped in such a call. */ +export function withContext(context: Context, f: () => R): R; // #### Analysis #### /** Parse a piece of code for use by Tern. Will automatically fall back to the error-tolerant parser if the regular parser can’t parse the code. */ @@ -59,6 +63,7 @@ export interface Obj extends Type { hasProp(prop: string): AVal | null; /** Looks up the given property, or defines it if it did not yet exist (in which case it will be associated with the given AST node). */ defProp(prop: string, originNode?: ESTree.Node): AVal; + getType(): Obj; } interface FnConstructor { @@ -66,18 +71,27 @@ interface FnConstructor { } /** Constructor for the type that implements functions. Inherits from `Obj`. The `AVal` types are used to track the input and output types of the function. */ export const Fn: FnConstructor; -export type Fn = Obj; +export interface Fn extends Obj { + readonly args?: AVal[]; + readonly argNames?: string[]; + self?: Type; + readonly retval: AVal; + isArrowFn(): boolean; + getType(): Fn; +} interface ArrConstructor { /** Constructor that creates an array type with the given content type. */ - new(contentType: AVal): Arr; + new(contentType?: AVal): Arr; } export const Arr: ArrConstructor; -export type Arr = Obj; +export interface Arr extends Obj { + getType(): Arr; +} export interface Type extends AVal { /** The name of the type, if any. */ - name: string; + name: string | undefined; /** The origin file of the type. */ origin: string; /** @@ -88,10 +102,9 @@ export interface Type extends AVal { originNode?: ESTree.Node; /** Return a string that describes the type. maxDepth indicates the depth to which inner types should be shown. */ toString(maxDepth: number): string; - /** Get an `AVal` that represents the named property of this type. */ - getProp(prop: string): AVal; /** Call the given function for all properties of the object, including properties that are added in the future. */ forAllProps(f: (prop: string, val: AVal, local: boolean) => void): void; + getType(): Type; } // #### Abstract Values #### @@ -131,13 +144,23 @@ export interface AVal { * Asks the AVal if it contains a function type. Useful when * you aren’t interested in other kinds of types. */ - getFunctionType(): Type | undefined; + getFunctionType(): Fn | undefined; + /** Get an `AVal` that represents the named property of this type. */ + getProp(prop: string): AVal; + /** + * Asks the AVal if it contains an Object type. Useful when + * you aren’t interested in other kinds of types. + */ + getObjType(): Obj | null; /** * Abstract values that are used to represent variables * or properties will have, when possible, an `originNode` * property pointing to an AST node. */ originNode?: ESTree.Node; + + readonly types: Type[]; + readonly propertyOf?: Obj; } export const ANull: ANull; @@ -171,6 +194,7 @@ export interface Constraint extends AVal { // #### Scopes #### interface ScopeConstructor { new(parent?: Scope): Scope; + new(parent: Scope, originNode: ESTree.Node): Scope; } export const Scope: ScopeConstructor; export interface Scope extends Obj { @@ -199,7 +223,7 @@ export function findExpressionAround(ast: ESTree.Program, start: number | undefi /** Similar to `findExpressionAround`, except that it use the same AST walker as `findExpressionAt`. */ export function findClosestExpression(ast: ESTree.Program, start: number | undefined, end: number, scope?: Scope): { node: ESTree.Node, state: Scope } | null; /** Determine an expression for the given node and scope (as returned by the functions above). Will return an `AVal` or plain `Type`. */ -export function expressionType(expr: { node: ESTree.Node, state: Scope }): AVal | Type; +export function expressionType(expr: { node: ESTree.Node, state: Scope | null }): AVal | Type; /** Find the scope at a given position in the syntax tree. The `scope` parameter can be used to override the scope used for code that isn’t wrapped in any function. */ export function scopeAt(ast: ESTree.Program, pos: number, scope?: Scope): Scope; /** diff --git a/types/tern/lib/tern/index.d.ts b/types/tern/lib/tern/index.d.ts index 7ecb4ac73e..22001ed075 100644 --- a/types/tern/lib/tern/index.d.ts +++ b/types/tern/lib/tern/index.d.ts @@ -1,5 +1,5 @@ import * as ESTree from "estree"; -import { Scope, Type } from "../infer"; +import { Context, Scope, Type } from "../infer"; export { }; @@ -48,6 +48,10 @@ interface TernConstructor { export const Server: TernConstructor; export interface Server { + readonly cx: Context; + readonly options: ConstructorOptions; + readonly files: File[]; + readonly plugins: any; /** * Add a set of type definitions to the server. If `atFront` is true, they will be added before all other * existing definitions. Otherwise, they are added at the back. @@ -93,10 +97,12 @@ export interface Server { request( doc: D & { query?: Q }, callback: ( - error: Error | undefined, + error: string | null, response: (D extends { query: undefined } ? {} : D extends { query: Query } ? QueryResult : {}) | undefined ) => void ): void; + reset(): void; + signal(event: keyof Events, file: File): void; } // #### JSON Protocol #### @@ -156,6 +162,7 @@ export interface File { scope: Scope; ast: ESTree.Program; type?: "full" | "part" | "delete"; + asLineChar?(nodePosition: number): Position; } export interface BaseQuery { From f7cb1d4bd030f16bdb594b2c1d17fe620508a30c Mon Sep 17 00:00:00 2001 From: Nikolaj Kappler Date: Fri, 1 Mar 2019 15:39:37 +0100 Subject: [PATCH 221/924] added and improved declarations that were missing/incomplete/incorrect workstream: --- types/tern/index.d.ts | 5 ++-- types/tern/lib/infer/index.d.ts | 44 +++++++++++++++++++++++++-------- types/tern/lib/tern/index.d.ts | 11 +++++++-- 3 files changed, 46 insertions(+), 14 deletions(-) diff --git a/types/tern/index.d.ts b/types/tern/index.d.ts index ef01c0e289..ae5a793383 100644 --- a/types/tern/index.d.ts +++ b/types/tern/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for tern 0.22 +// Type definitions for tern 0.23 // Project: https://github.com/ternjs/tern // Definitions by: Nikolaj Kappler // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -11,5 +11,6 @@ // thus if you want to use undocumented APIs, you should extends these definitions with // ambient declaration merging: https://www.typescriptlang.org/docs/handbook/declaration-merging.html -export * from "./lib/tern"; export * from "./lib/infer"; +export * from "./lib/tern"; + diff --git a/types/tern/lib/infer/index.d.ts b/types/tern/lib/infer/index.d.ts index 58e83ea1c7..25bb7ab0d9 100644 --- a/types/tern/lib/infer/index.d.ts +++ b/types/tern/lib/infer/index.d.ts @@ -1,12 +1,14 @@ import * as ESTree from "estree"; +import { Server } from "../tern"; export { }; // #### Context #### interface ContextConstructor { - new(defs: any[]): Context; + new(defs: any[], parent: Server): Context; } export const Context: ContextConstructor; export interface Context { + parent?: Server; topScope: Scope; /** The primitive number type. */ num: Type; @@ -15,8 +17,10 @@ export interface Context { /** The primitive boolean type. */ bool: Type; } +/** Returns the current context object. */ export function cx(): Context; -export function withContext(context: Context, f: () => void): void; +/** Calls f with the current context bound to context. Basically, all code that does something with the inference engine should be wrapped in such a call. */ +export function withContext(context: Context, f: () => R): R; // #### Analysis #### /** Parse a piece of code for use by Tern. Will automatically fall back to the error-tolerant parser if the regular parser can’t parse the code. */ @@ -59,6 +63,7 @@ export interface Obj extends Type { hasProp(prop: string): AVal | null; /** Looks up the given property, or defines it if it did not yet exist (in which case it will be associated with the given AST node). */ defProp(prop: string, originNode?: ESTree.Node): AVal; + getType(): Obj; } interface FnConstructor { @@ -66,18 +71,27 @@ interface FnConstructor { } /** Constructor for the type that implements functions. Inherits from `Obj`. The `AVal` types are used to track the input and output types of the function. */ export const Fn: FnConstructor; -export type Fn = Obj; +export interface Fn extends Obj { + readonly args?: AVal[]; + readonly argNames?: string[]; + self?: Type; + readonly retval: AVal; + isArrowFn(): boolean; + getType(): Fn; +} interface ArrConstructor { /** Constructor that creates an array type with the given content type. */ - new(contentType: AVal): Arr; + new(contentType?: AVal): Arr; } export const Arr: ArrConstructor; -export type Arr = Obj; +export interface Arr extends Obj { + getType(): Arr; +} export interface Type extends AVal { /** The name of the type, if any. */ - name: string; + name: string | undefined; /** The origin file of the type. */ origin: string; /** @@ -88,10 +102,9 @@ export interface Type extends AVal { originNode?: ESTree.Node; /** Return a string that describes the type. maxDepth indicates the depth to which inner types should be shown. */ toString(maxDepth: number): string; - /** Get an `AVal` that represents the named property of this type. */ - getProp(prop: string): AVal; /** Call the given function for all properties of the object, including properties that are added in the future. */ forAllProps(f: (prop: string, val: AVal, local: boolean) => void): void; + getType(): Type; } // #### Abstract Values #### @@ -131,13 +144,23 @@ export interface AVal { * Asks the AVal if it contains a function type. Useful when * you aren’t interested in other kinds of types. */ - getFunctionType(): Type | undefined; + getFunctionType(): Fn | undefined; + /** Get an `AVal` that represents the named property of this type. */ + getProp(prop: string): AVal; + /** + * Asks the AVal if it contains an Object type. Useful when + * you aren’t interested in other kinds of types. + */ + getObjType(): Obj | null; /** * Abstract values that are used to represent variables * or properties will have, when possible, an `originNode` * property pointing to an AST node. */ originNode?: ESTree.Node; + + readonly types: Type[]; + readonly propertyOf?: Obj; } export const ANull: ANull; @@ -171,6 +194,7 @@ export interface Constraint extends AVal { // #### Scopes #### interface ScopeConstructor { new(parent?: Scope): Scope; + new(parent: Scope, originNode: ESTree.Node): Scope; } export const Scope: ScopeConstructor; export interface Scope extends Obj { @@ -199,7 +223,7 @@ export function findExpressionAround(ast: ESTree.Program, start: number | undefi /** Similar to `findExpressionAround`, except that it use the same AST walker as `findExpressionAt`. */ export function findClosestExpression(ast: ESTree.Program, start: number | undefined, end: number, scope?: Scope): { node: ESTree.Node, state: Scope } | null; /** Determine an expression for the given node and scope (as returned by the functions above). Will return an `AVal` or plain `Type`. */ -export function expressionType(expr: { node: ESTree.Node, state: Scope }): AVal | Type; +export function expressionType(expr: { node: ESTree.Node, state: Scope | null }): AVal | Type; /** Find the scope at a given position in the syntax tree. The `scope` parameter can be used to override the scope used for code that isn’t wrapped in any function. */ export function scopeAt(ast: ESTree.Program, pos: number, scope?: Scope): Scope; /** diff --git a/types/tern/lib/tern/index.d.ts b/types/tern/lib/tern/index.d.ts index 7ecb4ac73e..22001ed075 100644 --- a/types/tern/lib/tern/index.d.ts +++ b/types/tern/lib/tern/index.d.ts @@ -1,5 +1,5 @@ import * as ESTree from "estree"; -import { Scope, Type } from "../infer"; +import { Context, Scope, Type } from "../infer"; export { }; @@ -48,6 +48,10 @@ interface TernConstructor { export const Server: TernConstructor; export interface Server { + readonly cx: Context; + readonly options: ConstructorOptions; + readonly files: File[]; + readonly plugins: any; /** * Add a set of type definitions to the server. If `atFront` is true, they will be added before all other * existing definitions. Otherwise, they are added at the back. @@ -93,10 +97,12 @@ export interface Server { request( doc: D & { query?: Q }, callback: ( - error: Error | undefined, + error: string | null, response: (D extends { query: undefined } ? {} : D extends { query: Query } ? QueryResult : {}) | undefined ) => void ): void; + reset(): void; + signal(event: keyof Events, file: File): void; } // #### JSON Protocol #### @@ -156,6 +162,7 @@ export interface File { scope: Scope; ast: ESTree.Program; type?: "full" | "part" | "delete"; + asLineChar?(nodePosition: number): Position; } export interface BaseQuery { From 1c297422251c19d2eff70985738f47f04b4fa94d Mon Sep 17 00:00:00 2001 From: Nikolaj Kappler Date: Fri, 1 Mar 2019 16:17:29 +0100 Subject: [PATCH 222/924] fixed failing test workstream: --- types/tern/index.d.ts | 1 - types/tern/lib/infer/index.d.ts | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/types/tern/index.d.ts b/types/tern/index.d.ts index ae5a793383..7ef634e6a6 100644 --- a/types/tern/index.d.ts +++ b/types/tern/index.d.ts @@ -13,4 +13,3 @@ export * from "./lib/infer"; export * from "./lib/tern"; - diff --git a/types/tern/lib/infer/index.d.ts b/types/tern/lib/infer/index.d.ts index 25bb7ab0d9..b8cc01e68f 100644 --- a/types/tern/lib/infer/index.d.ts +++ b/types/tern/lib/infer/index.d.ts @@ -193,7 +193,7 @@ export interface Constraint extends AVal { // #### Scopes #### interface ScopeConstructor { - new(parent?: Scope): Scope; + new(): Scope; new(parent: Scope, originNode: ESTree.Node): Scope; } export const Scope: ScopeConstructor; From 0bcf782f9dc132cba866ffacbdbe6753279c2869 Mon Sep 17 00:00:00 2001 From: Eric Musgrave Date: Fri, 1 Mar 2019 11:14:03 -0500 Subject: [PATCH 223/924] Fix/add more zeromq types --- types/zeromq/index.d.ts | 75 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 72 insertions(+), 3 deletions(-) diff --git a/types/zeromq/index.d.ts b/types/zeromq/index.d.ts index d1088aba8f..29bc442723 100644 --- a/types/zeromq/index.d.ts +++ b/types/zeromq/index.d.ts @@ -1,3 +1,5 @@ +import { EventEmitter } from "events"; + // Type definitions for zeromq 4.6 // Project: https://github.com/zeromq/zeromq.js // Definitions by: Dave McKeown @@ -58,21 +60,79 @@ export interface SocketOptions { zap_domain: number; } -export class Socket { +/** + * Export all option names at the global level + */ +export const ZMQ_HWM: number; +export const ZMQ_SWAP: number; +export const ZMQ_AFFINITY: number; +export const ZMQ_IDENTITY: number; +export const ZMQ_SUBSCRIBE: number; +export const ZMQ_UNSUBSCRIBE: number; +export const ZMQ_RATE: number; +export const ZMQ_RECOVERY_IVL: number; +export const ZMQ_MCAST_LOOP: number; +export const ZMQ_SNDBUF: number; +export const ZMQ_RCVBUF: number; +export const ZMQ_RCVMORE: number; +export const ZMQ_FD: number; +export const ZMQ_EVENTS: number; +export const ZMQ_TYPE: number; +export const ZMQ_LINGER: number; +export const ZMQ_RECONNECT_IVL: number; +export const ZMQ_BACKLOG: number; +export const ZMQ_RECOVERY_IVL_MSEC: number; +export const ZMQ_RECONNECT_IVL_MAX: number; +export const ZMQ_MAXMSGSIZE: number; +export const ZMQ_SNDHWM: number; +export const ZMQ_RCVHWM: number; +export const ZMQ_MULTICAST_HOPS: number; +export const ZMQ_RCVTIMEO: number; +export const ZMQ_SNDTIMEO: number; +export const ZMQ_IPV4ONLY: number; +export const ZMQ_LAST_ENDPOINT: number; +export const ZMQ_ROUTER_MANDATORY: number; +export const ZMQ_TCP_KEEPALIVE: number; +export const ZMQ_TCP_KEEPALIVE_CNT: number; +export const ZMQ_TCP_KEEPALIVE_IDLE: number; +export const ZMQ_TCP_KEEPALIVE_INTVL: number; +export const ZMQ_TCP_ACCEPT_FILTER: number; +export const ZMQ_DELAY_ATTACH_ON_CONNECT: number; +export const ZMQ_XPUB_VERBOSE: number; +export const ZMQ_ROUTER_RAW: number; +export const ZMQ_IPV6: number; +export const ZMQ_MECHANISM: number; +export const ZMQ_PLAIN_SERVER: number; +export const ZMQ_PLAIN_USERNAME: number; +export const ZMQ_PLAIN_PASSWORD: number; +export const ZMQ_CURVE_SERVER: number; +export const ZMQ_CURVE_PUBLICKEY: number; +export const ZMQ_CURVE_SECRETKEY: number; +export const ZMQ_CURVE_SERVERKEY: number; +export const ZMQ_ZAP_DOMAIN: number; +export const ZMQ_HEARTBEAT_IVL: number; +export const ZMQ_HEARTBEAT_TTL: number; +export const ZMQ_HEARTBEAT_TIMEOUT: number; +export const ZMQ_CONNECT_TIMEOUT: number; +export const ZMQ_IO_THREADS: number; +export const ZMQ_MAX_SOCKETS: number; +export const ZMQ_ROUTER_HANDOVER: number; + +export class Socket extends EventEmitter { /** * Set `opt` to `val`. * * @param opt Option * @param val Value */ - setsocketopt(opt: number|string, val: any): Socket; + setsockopt(opt: number|string, val: any): Socket; /** * Get socket `opt`. * * @param opt Option number */ - getsocketopt(opt: number|string): any; + getsockopt(opt: number|string): any; /** * Async bind. @@ -156,6 +216,15 @@ export class Socket { */ monitor(interval?: number, numOfEvents?: number): Socket; + /** + * Disable monitoring of a Socket release idle handler + * and close the socket + * + * @return {Socket} for chaining + * @api public + */ + unmonitor(): Socket; + /** * Close the socket. * From 1a3a185d97a1ed0edf2d84684f75c63f7a6be043 Mon Sep 17 00:00:00 2001 From: Eric Date: Fri, 1 Mar 2019 12:35:56 -0500 Subject: [PATCH 224/924] Remove `on` definition --- types/zeromq/index.d.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/types/zeromq/index.d.ts b/types/zeromq/index.d.ts index 29bc442723..7f9573555e 100644 --- a/types/zeromq/index.d.ts +++ b/types/zeromq/index.d.ts @@ -231,11 +231,6 @@ export class Socket extends EventEmitter { */ close(): Socket; - /** - * Socket event - 'message' - */ - on(eventName: string, callback: (...buffer: Buffer[]) => void): void; - pause(): void; resume(): void; From 9623d61290fb9ded402ecd6f3de40fac17b2c60c Mon Sep 17 00:00:00 2001 From: Klaus Reimer Date: Fri, 1 Mar 2019 19:13:17 +0100 Subject: [PATCH 225/924] Add offscreencanvas types --- types/offscreencanvas/index.d.ts | 50 +++++++++++++++++++ .../offscreencanvas/offscreencanvas-tests.ts | 29 +++++++++++ types/offscreencanvas/tsconfig.json | 23 +++++++++ types/offscreencanvas/tslint.json | 1 + 4 files changed, 103 insertions(+) create mode 100644 types/offscreencanvas/index.d.ts create mode 100644 types/offscreencanvas/offscreencanvas-tests.ts create mode 100644 types/offscreencanvas/tsconfig.json create mode 100644 types/offscreencanvas/tslint.json diff --git a/types/offscreencanvas/index.d.ts b/types/offscreencanvas/index.d.ts new file mode 100644 index 0000000000..395af42f16 --- /dev/null +++ b/types/offscreencanvas/index.d.ts @@ -0,0 +1,50 @@ +// Type definitions for the W3C OffscreenCanvas +// Project: https://html.spec.whatwg.org/multipage/canvas.html#the-offscreencanvas-interface +// Definitions by: Klaus Reimer +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare global { + // https://html.spec.whatwg.org/multipage/canvas.html#canvasdrawimage + interface CanvasDrawImage { + drawImage(image: OffscreenCanvas, dx: number, dy: number): void; + drawImage(image: OffscreenCanvas, dx: number, dy: number, dw: number, dh: number): void; + drawImage(image: OffscreenCanvas, sx: number, sy: number, sw: number, sh: number, + dx: number, dy: number, dw: number, dh: number): void; + } + + // https://html.spec.whatwg.org/multipage/canvas.html#dom-canvas-transfercontroltooffscreen + interface HTMLCanvasElement extends HTMLElement { + transferControlToOffscreen(): OffscreenCanvas; + } + + // https://html.spec.whatwg.org/multipage/canvas.html#offscreencanvasrenderingcontext2d + interface OffscreenCanvasRenderingContext2D extends CanvasState, CanvasTransform, CanvasCompositing, + CanvasImageSmoothing, CanvasFillStrokeStyles, CanvasShadowStyles, CanvasFilters, CanvasRect, + CanvasDrawPath, CanvasText, CanvasDrawImage, CanvasImageData, CanvasPathDrawingStyles, + CanvasTextDrawingStyles, CanvasPath { + readonly canvas: OffscreenCanvas; + } + var OffscreenCanvasRenderingContext2D: { + prototype: OffscreenCanvasRenderingContext2D; + new (): OffscreenCanvasRenderingContext2D; + } + + // https://html.spec.whatwg.org/multipage/canvas.html#the-offscreencanvas-interface + interface OffscreenCanvas extends EventTarget { + width: number; + height: number; + getContext(contextId: "2d", contextAttributes?: CanvasRenderingContext2DSettings): + OffscreenCanvasRenderingContext2D | null; + getContext(contextId: "webgl", contextAttributes?: WebGLContextAttributes): WebGLRenderingContext | null; + getContext(contextId: string, contextAttributes?: {}): OffscreenCanvasRenderingContext2D + | WebGLRenderingContext | null; + transferToImageBitmap(): ImageBitmap; + convertToBlob(options?: { type?: string, quality?: number }): Promise; + } + var OffscreenCanvas: { + prototype: OffscreenCanvas; + new (width: number, height: number): OffscreenCanvas; + } +} + +export { }; diff --git a/types/offscreencanvas/offscreencanvas-tests.ts b/types/offscreencanvas/offscreencanvas-tests.ts new file mode 100644 index 0000000000..f74690ad9a --- /dev/null +++ b/types/offscreencanvas/offscreencanvas-tests.ts @@ -0,0 +1,29 @@ +// Test constructor +const offscreenCanvas: OffscreenCanvas = new OffscreenCanvas(20, 10); + +// Test OffscreenCanvas properties +let width: number = offscreenCanvas.width; +let height: number = offscreenCanvas.height; + +// Test OffscreenCanvas methods +const context2D: OffscreenCanvasRenderingContext2D | null = offscreenCanvas.getContext("2d"); +const webglContext: WebGLRenderingContext | null = offscreenCanvas.getContext("webgl"); +const otherContext: OffscreenCanvasRenderingContext2D | WebGLRenderingContext | null = + offscreenCanvas.getContext("foobar"); +const imageBitmap: ImageBitmap = offscreenCanvas.transferToImageBitmap(); +const blob1: Promise = offscreenCanvas.convertToBlob(); +const blob2: Promise = offscreenCanvas.convertToBlob({ type: "image/jpeg" }); +const blob3: Promise = offscreenCanvas.convertToBlob({ type: "image/jpeg", quality: 0.92 }); + +// Test OffscreenCanvasRenderingContext2D properties +const canvasRef: OffscreenCanvas = context2D!.canvas; + +// Test HTMLCanvasElement methods +const canvas: HTMLCanvasElement = document.createElement("canvas"); +const transferredCanvas: OffscreenCanvas = canvas.transferControlToOffscreen(); + +// Test CanvasRenderingContext2D methods +const ctx = canvas.getContext("2d")!; +ctx.drawImage(offscreenCanvas, 0, 0); +ctx.drawImage(offscreenCanvas, 0, 0, 20, 10); +ctx.drawImage(offscreenCanvas, 0, 0, 20, 10, 0, 0, 20, 10); diff --git a/types/offscreencanvas/tsconfig.json b/types/offscreencanvas/tsconfig.json new file mode 100644 index 0000000000..3bb1ca90b4 --- /dev/null +++ b/types/offscreencanvas/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", + "offscreencanvas-tests.ts" + ] +} diff --git a/types/offscreencanvas/tslint.json b/types/offscreencanvas/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/offscreencanvas/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 749f6eaf2e2164380eeb9e5db8fd68ed103dd487 Mon Sep 17 00:00:00 2001 From: Klaus Reimer Date: Fri, 1 Mar 2019 19:46:08 +0100 Subject: [PATCH 226/924] Fix createImageBitmap and drawImage --- types/offscreencanvas/index.d.ts | 11 ++++++++--- types/offscreencanvas/offscreencanvas-tests.ts | 4 ++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/types/offscreencanvas/index.d.ts b/types/offscreencanvas/index.d.ts index 395af42f16..810ba7a5f5 100644 --- a/types/offscreencanvas/index.d.ts +++ b/types/offscreencanvas/index.d.ts @@ -6,12 +6,17 @@ declare global { // https://html.spec.whatwg.org/multipage/canvas.html#canvasdrawimage interface CanvasDrawImage { - drawImage(image: OffscreenCanvas, dx: number, dy: number): void; - drawImage(image: OffscreenCanvas, dx: number, dy: number, dw: number, dh: number): void; - drawImage(image: OffscreenCanvas, sx: number, sy: number, sw: number, sh: number, + drawImage(image: CanvasImageSource | OffscreenCanvas, dx: number, dy: number): void; + drawImage(image: CanvasImageSource | OffscreenCanvas, dx: number, dy: number, dw: number, dh: number): void; + drawImage(image: CanvasImageSource | OffscreenCanvas, sx: number, sy: number, sw: number, sh: number, dx: number, dy: number, dw: number, dh: number): void; } + // https://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html#dom-createimagebitmap + function createImageBitmap(image: ImageBitmapSource | OffscreenCanvas): Promise; + function createImageBitmap(image: ImageBitmapSource | OffscreenCanvas, sx: number, sy: number, + sw: number, sh: number): Promise; + // https://html.spec.whatwg.org/multipage/canvas.html#dom-canvas-transfercontroltooffscreen interface HTMLCanvasElement extends HTMLElement { transferControlToOffscreen(): OffscreenCanvas; diff --git a/types/offscreencanvas/offscreencanvas-tests.ts b/types/offscreencanvas/offscreencanvas-tests.ts index f74690ad9a..9f89e374b3 100644 --- a/types/offscreencanvas/offscreencanvas-tests.ts +++ b/types/offscreencanvas/offscreencanvas-tests.ts @@ -27,3 +27,7 @@ const ctx = canvas.getContext("2d")!; ctx.drawImage(offscreenCanvas, 0, 0); ctx.drawImage(offscreenCanvas, 0, 0, 20, 10); ctx.drawImage(offscreenCanvas, 0, 0, 20, 10, 0, 0, 20, 10); + +// Test createImageBitmap function with offscreen canvas +const imageBitmap1 = createImageBitmap(offscreenCanvas); +const imageBitmap2 = createImageBitmap(offscreenCanvas, 1, 2, 3, 4); From cb32368e03397703ce9741a8b064b6616b7b0700 Mon Sep 17 00:00:00 2001 From: Klaus Reimer Date: Fri, 1 Mar 2019 19:46:21 +0100 Subject: [PATCH 227/924] Add strictFunctionTypes option --- types/offscreencanvas/tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/types/offscreencanvas/tsconfig.json b/types/offscreencanvas/tsconfig.json index 3bb1ca90b4..12d786084f 100644 --- a/types/offscreencanvas/tsconfig.json +++ b/types/offscreencanvas/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" From 5c448bba7fe3a96e0f472f1e32ecb8c568e74174 Mon Sep 17 00:00:00 2001 From: Eric Date: Fri, 1 Mar 2019 13:48:11 -0500 Subject: [PATCH 228/924] Use NodeJS.EventEmitter instead of importing event --- types/zeromq/index.d.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/types/zeromq/index.d.ts b/types/zeromq/index.d.ts index 7f9573555e..cb21200253 100644 --- a/types/zeromq/index.d.ts +++ b/types/zeromq/index.d.ts @@ -1,5 +1,3 @@ -import { EventEmitter } from "events"; - // Type definitions for zeromq 4.6 // Project: https://github.com/zeromq/zeromq.js // Definitions by: Dave McKeown @@ -118,7 +116,7 @@ export const ZMQ_IO_THREADS: number; export const ZMQ_MAX_SOCKETS: number; export const ZMQ_ROUTER_HANDOVER: number; -export class Socket extends EventEmitter { +export class Socket extends NodeJS.EventEmitter { /** * Set `opt` to `val`. * From dd14243978af5beb48a230d93f94932d9c821e5e Mon Sep 17 00:00:00 2001 From: Klaus Reimer Date: Fri, 1 Mar 2019 19:52:52 +0100 Subject: [PATCH 229/924] Fix header format --- types/offscreencanvas/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/offscreencanvas/index.d.ts b/types/offscreencanvas/index.d.ts index 810ba7a5f5..a5940042d8 100644 --- a/types/offscreencanvas/index.d.ts +++ b/types/offscreencanvas/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for the W3C OffscreenCanvas +// Type definitions for non-npm package offscreencanvas-browser // Project: https://html.spec.whatwg.org/multipage/canvas.html#the-offscreencanvas-interface // Definitions by: Klaus Reimer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 3764aa01952e399c9c4e876df4c9fd47e2fefae1 Mon Sep 17 00:00:00 2001 From: Klaus Reimer Date: Fri, 1 Mar 2019 20:00:41 +0100 Subject: [PATCH 230/924] Fix liniting errors --- types/offscreencanvas/index.d.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/types/offscreencanvas/index.d.ts b/types/offscreencanvas/index.d.ts index a5940042d8..de3b3a7fe3 100644 --- a/types/offscreencanvas/index.d.ts +++ b/types/offscreencanvas/index.d.ts @@ -1,8 +1,10 @@ -// Type definitions for non-npm package offscreencanvas-browser +// Type definitions for non-npm package offscreencanvas-browser 2019.3 // Project: https://html.spec.whatwg.org/multipage/canvas.html#the-offscreencanvas-interface // Definitions by: Klaus Reimer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.1 + declare global { // https://html.spec.whatwg.org/multipage/canvas.html#canvasdrawimage interface CanvasDrawImage { @@ -32,7 +34,7 @@ declare global { var OffscreenCanvasRenderingContext2D: { prototype: OffscreenCanvasRenderingContext2D; new (): OffscreenCanvasRenderingContext2D; - } + }; // https://html.spec.whatwg.org/multipage/canvas.html#the-offscreencanvas-interface interface OffscreenCanvas extends EventTarget { @@ -49,7 +51,7 @@ declare global { var OffscreenCanvas: { prototype: OffscreenCanvas; new (width: number, height: number): OffscreenCanvas; - } + }; } export { }; From 112076b653608455c1cd658a9e3140ba5b4556e3 Mon Sep 17 00:00:00 2001 From: Mike North Date: Fri, 1 Mar 2019 11:42:23 -0800 Subject: [PATCH 231/924] [ember] remove dependency on handlebars types --- types/ember-data/tsconfig.json | 1 + types/ember-feature-flags/tsconfig.json | 1 + types/ember-mocha/tsconfig.json | 1 + types/ember-modal-dialog/tsconfig.json | 1 + types/ember-qunit/tsconfig.json | 1 + types/ember-resolver/tsconfig.json | 1 + types/ember-test-helpers/tsconfig.json | 1 + types/ember/index.d.ts | 7 +++++-- types/ember/package.json | 6 ------ types/ember/test/ember-tests.ts | 4 ++-- types/ember/test/string.ts | 2 +- types/ember/tsconfig.json | 1 + types/ember__string/-private/handlebars.d.ts | 5 +++++ types/ember__string/ember__string-tests.ts | 4 ++-- types/ember__string/index.d.ts | 2 +- types/ember__string/package.json | 6 ------ types/ember__string/tsconfig.json | 4 +++- types/ember__test-helpers/tsconfig.json | 1 + types/ember__test/tsconfig.json | 1 + 19 files changed, 29 insertions(+), 21 deletions(-) delete mode 100644 types/ember/package.json create mode 100644 types/ember__string/-private/handlebars.d.ts delete mode 100644 types/ember__string/package.json diff --git a/types/ember-data/tsconfig.json b/types/ember-data/tsconfig.json index f476362aaf..aadbbe7f5f 100644 --- a/types/ember-data/tsconfig.json +++ b/types/ember-data/tsconfig.json @@ -35,6 +35,7 @@ "@ember/runloop/*": ["ember__runloop/*"], "@ember/service": ["ember__service"], "@ember/string": ["ember__string"], + "@ember/string/*": ["ember__string/*"], "@ember/test": ["ember__test"], "@ember/test/*": ["ember__test/*"], "@ember/utils": ["ember__utils"], diff --git a/types/ember-feature-flags/tsconfig.json b/types/ember-feature-flags/tsconfig.json index 957a7a00f8..dc3260af3a 100644 --- a/types/ember-feature-flags/tsconfig.json +++ b/types/ember-feature-flags/tsconfig.json @@ -35,6 +35,7 @@ "@ember/runloop/*": ["ember__runloop/*"], "@ember/service": ["ember__service"], "@ember/string": ["ember__string"], + "@ember/string/*": ["ember__string/*"], "@ember/test": ["ember__test"], "@ember/test/*": ["ember__test/*"], "@ember/utils": ["ember__utils"], diff --git a/types/ember-mocha/tsconfig.json b/types/ember-mocha/tsconfig.json index 4e9b406e2e..c6c6a09f65 100644 --- a/types/ember-mocha/tsconfig.json +++ b/types/ember-mocha/tsconfig.json @@ -35,6 +35,7 @@ "@ember/runloop/*": ["ember__runloop/*"], "@ember/service": ["ember__service"], "@ember/string": ["ember__string"], + "@ember/string/*": ["ember__string/*"], "@ember/test": ["ember__test"], "@ember/test/*": ["ember__test/*"], "@ember/utils": ["ember__utils"], diff --git a/types/ember-modal-dialog/tsconfig.json b/types/ember-modal-dialog/tsconfig.json index 0b0b6f91fb..8fc7a37808 100644 --- a/types/ember-modal-dialog/tsconfig.json +++ b/types/ember-modal-dialog/tsconfig.json @@ -35,6 +35,7 @@ "@ember/runloop/*": ["ember__runloop/*"], "@ember/service": ["ember__service"], "@ember/string": ["ember__string"], + "@ember/string/*": ["ember__string/*"], "@ember/test": ["ember__test"], "@ember/test/*": ["ember__test/*"], "@ember/utils": ["ember__utils"], diff --git a/types/ember-qunit/tsconfig.json b/types/ember-qunit/tsconfig.json index df4899b37c..92a555a59f 100644 --- a/types/ember-qunit/tsconfig.json +++ b/types/ember-qunit/tsconfig.json @@ -35,6 +35,7 @@ "@ember/runloop/*": ["ember__runloop/*"], "@ember/service": ["ember__service"], "@ember/string": ["ember__string"], + "@ember/string/*": ["ember__string/*"], "@ember/test": ["ember__test"], "@ember/test/*": ["ember__test/*"], "@ember/utils": ["ember__utils"], diff --git a/types/ember-resolver/tsconfig.json b/types/ember-resolver/tsconfig.json index bc476c5723..7263220f71 100644 --- a/types/ember-resolver/tsconfig.json +++ b/types/ember-resolver/tsconfig.json @@ -35,6 +35,7 @@ "@ember/runloop/*": ["ember__runloop/*"], "@ember/service": ["ember__service"], "@ember/string": ["ember__string"], + "@ember/string/*": ["ember__string/*"], "@ember/test": ["ember__test"], "@ember/test/*": ["ember__test/*"], "@ember/utils": ["ember__utils"], diff --git a/types/ember-test-helpers/tsconfig.json b/types/ember-test-helpers/tsconfig.json index 2e0ddf49b1..ca139535f3 100644 --- a/types/ember-test-helpers/tsconfig.json +++ b/types/ember-test-helpers/tsconfig.json @@ -35,6 +35,7 @@ "@ember/runloop/*": ["ember__runloop/*"], "@ember/service": ["ember__service"], "@ember/string": ["ember__string"], + "@ember/string/*": ["ember__string/*"], "@ember/test": ["ember__test"], "@ember/test/*": ["ember__test/*"], "@ember/utils": ["ember__utils"], diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts index fbe058a643..d0f9896eb9 100755 --- a/types/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -38,15 +38,17 @@ import { ComputedPropertyCallback, ObserverMethod } from '@ember/object/-private/types'; -import * as HandlebarsNamespace from 'handlebars'; + // Capitalization is intentional: this makes it much easier to re-export RSVP on // the Ember namespace. import Rsvp from 'rsvp'; + import { TemplateFactory } from 'htmlbars-inline-precompile'; import { Registry as ServiceRegistry } from '@ember/service'; import { Registry as ControllerRegistry } from '@ember/controller'; import * as EmberStringNs from '@ember/string'; +import * as EmberStringHandlebarsNs from '@ember/string/-private/handlebars'; // tslint:disable-next-line:no-duplicate-imports import * as EmberServiceNs from '@ember/service'; import * as EmberPolyfillsNs from '@ember/polyfills'; @@ -424,11 +426,12 @@ export namespace Ember { function K(): any; function createFrame(objec: any): any; function Exception(message: string): void; - const SafeString: typeof HandlebarsNamespace.SafeString; + class SafeString extends EmberStringHandlebarsNs.SafeString {} function parse(string: string): any; function print(ast: any): void; const logger: typeof Logger; function log(level: string, str: string): void; + function registerHelper(name: string, helper: any): void; } namespace String { const camelize: typeof EmberStringNs.camelize; diff --git a/types/ember/package.json b/types/ember/package.json deleted file mode 100644 index b6f5204c9a..0000000000 --- a/types/ember/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "private": true, - "dependencies": { - "handlebars": "^4.1.0" - } -} \ No newline at end of file diff --git a/types/ember/test/ember-tests.ts b/types/ember/test/ember-tests.ts index 01aaab7452..eb317c3ab1 100755 --- a/types/ember/test/ember-tests.ts +++ b/types/ember/test/ember-tests.ts @@ -92,10 +92,10 @@ App.userController = Ember.Object.create({ }), }); -Handlebars.registerHelper( +Ember.Handlebars.registerHelper( 'highlight', (property: string, options: any) => - new Handlebars.SafeString('' + 'some value' + '') + new Ember.Handlebars.SafeString('' + 'some value' + '') ); const coolView = App.CoolView.create(); diff --git a/types/ember/test/string.ts b/types/ember/test/string.ts index 4363b375f3..d812a52dd5 100644 --- a/types/ember/test/string.ts +++ b/types/ember/test/string.ts @@ -1,5 +1,5 @@ import Ember from 'ember'; -import { SafeString } from 'handlebars'; +import { SafeString } from '@ember/string/-private/handlebars'; const { dasherize, camelize, capitalize, classify, decamelize, htmlSafe, loc, underscore, w } = Ember.String; diff --git a/types/ember/tsconfig.json b/types/ember/tsconfig.json index be47225e72..6e494f5a03 100755 --- a/types/ember/tsconfig.json +++ b/types/ember/tsconfig.json @@ -36,6 +36,7 @@ "@ember/runloop/*": ["ember__runloop/*"], "@ember/service": ["ember__service"], "@ember/string": ["ember__string"], + "@ember/string/*": ["ember__string/*"], "@ember/test": ["ember__test"], "@ember/test/*": ["ember__test/*"], "@ember/utils": ["ember__utils"], diff --git a/types/ember__string/-private/handlebars.d.ts b/types/ember__string/-private/handlebars.d.ts new file mode 100644 index 0000000000..8d8dce118c --- /dev/null +++ b/types/ember__string/-private/handlebars.d.ts @@ -0,0 +1,5 @@ +export class SafeString { + constructor(str: string); + toString(): string; + toHTML(): string; +} diff --git a/types/ember__string/ember__string-tests.ts b/types/ember__string/ember__string-tests.ts index 500c67546e..c6474cd266 100644 --- a/types/ember__string/ember__string-tests.ts +++ b/types/ember__string/ember__string-tests.ts @@ -1,5 +1,5 @@ import { dasherize, camelize, capitalize, classify, decamelize, htmlSafe, loc, underscore, w, isHTMLSafe } from '@ember/string'; -import { SafeString } from 'handlebars'; +import { SafeString } from '@ember/string/-private/handlebars'; dasherize(); // $ExpectError dasherize('blue man group'); // $ExpectType string @@ -37,7 +37,7 @@ const handlebarsSafeString: SafeString = htmlSafe('lorem ipsum...'); htmlSafe('lorem ipsum...'); // $ExpectType SafeString const regularString: string = htmlSafe('lorem ipsum...'); // $ExpectError -function isSafeTest(a: string|Handlebars.SafeString) { +function isSafeTest(a: string | SafeString) { if (isHTMLSafe(a)) { a = a.toString(); } diff --git a/types/ember__string/index.d.ts b/types/ember__string/index.d.ts index c25da1f823..2a65c9b5df 100644 --- a/types/ember__string/index.d.ts +++ b/types/ember__string/index.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 -import { SafeString } from 'handlebars'; +import { SafeString } from "./-private/handlebars"; export function camelize(str: string): string; export function capitalize(str: string): string; diff --git a/types/ember__string/package.json b/types/ember__string/package.json deleted file mode 100644 index b6f5204c9a..0000000000 --- a/types/ember__string/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "private": true, - "dependencies": { - "handlebars": "^4.1.0" - } -} \ No newline at end of file diff --git a/types/ember__string/tsconfig.json b/types/ember__string/tsconfig.json index 100fad10f5..a5a7ecc944 100644 --- a/types/ember__string/tsconfig.json +++ b/types/ember__string/tsconfig.json @@ -15,13 +15,15 @@ "../" ], "paths": { - "@ember/string": ["ember__string"] + "@ember/string": ["ember__string"], + "@ember/string/*": ["ember__string/*"] }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, "files": [ + "-private/handlebars.d.ts", "index.d.ts", "ember__string-tests.ts" ] diff --git a/types/ember__test-helpers/tsconfig.json b/types/ember__test-helpers/tsconfig.json index 7b167f14d5..35638865d8 100644 --- a/types/ember__test-helpers/tsconfig.json +++ b/types/ember__test-helpers/tsconfig.json @@ -38,6 +38,7 @@ "@ember/runloop/*": ["ember__runloop/*"], "@ember/service": ["ember__service"], "@ember/string": ["ember__string"], + "@ember/string/*": ["ember__string/*"], "@ember/test": ["ember__test"], "@ember/test/*": ["ember__test/*"], "@ember/utils": ["ember__utils"], diff --git a/types/ember__test/tsconfig.json b/types/ember__test/tsconfig.json index da00f05337..bb95710392 100644 --- a/types/ember__test/tsconfig.json +++ b/types/ember__test/tsconfig.json @@ -36,6 +36,7 @@ "@ember/runloop/*": ["ember__runloop/*"], "@ember/service": ["ember__service"], "@ember/string": ["ember__string"], + "@ember/string/*": ["ember__string/*"], "@ember/test": ["ember__test"], "@ember/test/*": ["ember__test/*"], "@ember/utils": ["ember__utils"], From 465aea12e4ecf7692d8d4e6e4f77bc7a032945f6 Mon Sep 17 00:00:00 2001 From: simonihmig Date: Mon, 11 Feb 2019 20:40:23 +0100 Subject: [PATCH 232/924] [ember] Fix wrongly deprecated Ember.assign --- types/ember/index.d.ts | 1 - types/ember/v2/index.d.ts | 3 +-- types/ember__polyfills/index.d.ts | 3 +-- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts index d0f9896eb9..d7aaa35b36 100755 --- a/types/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -498,7 +498,6 @@ export namespace Ember { // TODO: replace with an es6 reexport when declare module 'ember' is removed /** * Copy properties from a source object to a target object. - * @deprecated Use Object.assign */ const assign: typeof EmberPolyfillsNs.assign; /** diff --git a/types/ember/v2/index.d.ts b/types/ember/v2/index.d.ts index 54b6d2e4a9..1734ee6a14 100755 --- a/types/ember/v2/index.d.ts +++ b/types/ember/v2/index.d.ts @@ -3131,7 +3131,7 @@ declare module 'ember' { function isPresent(obj: any): boolean; /** * Merge the contents of two objects together into the first object. - * @deprecated Use Object.assign + * @deprecated Use Ember.assign */ function merge(original: T, updates: U): T & U; /** @@ -3284,7 +3284,6 @@ declare module 'ember' { function typeOf(item: any): string; /** * Copy properties from a source object to a target object. - * @deprecated Use Object.assign */ function assign(target: T, source: U): T & U; function assign(target: T, source1: U, source2: V): T & U & V; diff --git a/types/ember__polyfills/index.d.ts b/types/ember__polyfills/index.d.ts index e5ace0fe2e..01820351e5 100644 --- a/types/ember__polyfills/index.d.ts +++ b/types/ember__polyfills/index.d.ts @@ -8,7 +8,6 @@ import { Mix, Mix3, Mix4 } from './types'; /** * Copy properties from a source object to a target object. - * @deprecated Use Object.assign */ export function assign(target: T, source: U): Mix; export function assign(target: T, source1: U, source2: V): Mix3; @@ -17,6 +16,6 @@ export function assign(target: object, ...sources: object[]): any; /** * Merge the contents of two objects together into the first object. - * @deprecated Use Object.assign + * @deprecated Use Ember.assign */ export function merge(original: T, updates: U): Mix; From d55ea815de1b8d4aeca766cccd4ca74f114dd467 Mon Sep 17 00:00:00 2001 From: tylerprice1 <33133203+tylerprice1@users.noreply.github.com> Date: Fri, 1 Mar 2019 14:55:07 -0500 Subject: [PATCH 233/924] Add tests for using and xusing --- .../jasmine-data_driven_tests-tests.ts | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/types/jasmine-data_driven_tests/jasmine-data_driven_tests-tests.ts b/types/jasmine-data_driven_tests/jasmine-data_driven_tests-tests.ts index 6689159b58..be3c43a7e6 100644 --- a/types/jasmine-data_driven_tests/jasmine-data_driven_tests-tests.ts +++ b/types/jasmine-data_driven_tests/jasmine-data_driven_tests-tests.ts @@ -1,5 +1,44 @@ /// +using("A suite", + [ + [1, 2, 3], + [2, 4, 6] + ], + function (a, b, c) { + it("can be data driven", function () { + expect(c).toBe(a + b); + }); + } +); + +xusing("A data driven suite", + [ + [1, 2, 3], + [2, 4, 6] + ], + function (a, b, c) { + it("can be pending", function () { + expect(c).toBe(a + b); + }); + } +); + +using("A data driven suite", + [ 'a', 'b', 'c' ], + (lhs) => { + beforeEach(() => { + console.log(`lhs = ${lhs}`); + }); + all("can contain data driven tests", + [ 'd', 'e', 'f' ], + (rhs) => { + expect(lhs).not.toBe(rhs); + } + ); + } +); + all("A data driven test is a suite with multiple specs", ['a', 'b', 'c'], value => { From 4245ec91060834381448443e347f7bb751e74855 Mon Sep 17 00:00:00 2001 From: Mike North Date: Fri, 1 Mar 2019 11:57:56 -0800 Subject: [PATCH 234/924] [ember/v2] remove dependency on handlebars types --- types/ember/v2/index.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/types/ember/v2/index.d.ts b/types/ember/v2/index.d.ts index 1734ee6a14..cfc95ed691 100755 --- a/types/ember/v2/index.d.ts +++ b/types/ember/v2/index.d.ts @@ -12,7 +12,6 @@ // TypeScript Version: 2.4 /// -/// declare module 'ember' { // Capitalization is intentional: this makes it much easier to re-export RSVP on From 9ecdc820da5e79c24a6d9abcf6336ff459e05a0b Mon Sep 17 00:00:00 2001 From: Mike North Date: Fri, 1 Mar 2019 12:00:16 -0800 Subject: [PATCH 235/924] [ember/v2] add limited handlebars types to old ember types --- types/ember/v2/index.d.ts | 1 + types/ember/v2/test/ember-tests.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/types/ember/v2/index.d.ts b/types/ember/v2/index.d.ts index cfc95ed691..b414a6f79b 100755 --- a/types/ember/v2/index.d.ts +++ b/types/ember/v2/index.d.ts @@ -2414,6 +2414,7 @@ declare module 'ember' { function print(ast: any): void; const logger: typeof Ember.Logger; function log(level: string, str: string): void; + function registerHelper(name: string, helper: any): void; } namespace String { function camelize(str: string): string; diff --git a/types/ember/v2/test/ember-tests.ts b/types/ember/v2/test/ember-tests.ts index c049512eb0..892c9ed9a8 100755 --- a/types/ember/v2/test/ember-tests.ts +++ b/types/ember/v2/test/ember-tests.ts @@ -92,10 +92,10 @@ App.userController = Ember.Object.create({ }), }); -Handlebars.registerHelper( +Ember.Handlebars.registerHelper( 'highlight', (property: string, options: any) => - new Handlebars.SafeString('' + 'some value' + '') + new Ember.Handlebars.SafeString('' + 'some value' + '') ); const coolView = App.CoolView.create(); From 6f902f72236853917a57173919cfa2a893aff1f6 Mon Sep 17 00:00:00 2001 From: tylerprice1 <33133203+tylerprice1@users.noreply.github.com> Date: Fri, 1 Mar 2019 15:01:33 -0500 Subject: [PATCH 236/924] Style fixes --- .../jasmine-data_driven_tests-tests.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/types/jasmine-data_driven_tests/jasmine-data_driven_tests-tests.ts b/types/jasmine-data_driven_tests/jasmine-data_driven_tests-tests.ts index be3c43a7e6..511d687420 100644 --- a/types/jasmine-data_driven_tests/jasmine-data_driven_tests-tests.ts +++ b/types/jasmine-data_driven_tests/jasmine-data_driven_tests-tests.ts @@ -5,8 +5,8 @@ using("A suite", [1, 2, 3], [2, 4, 6] ], - function (a, b, c) { - it("can be data driven", function () { + (a, b, c) => { + it("can be data driven", () => { expect(c).toBe(a + b); }); } @@ -17,8 +17,8 @@ xusing("A data driven suite", [1, 2, 3], [2, 4, 6] ], - function (a, b, c) { - it("can be pending", function () { + (a, b, c) => { + it("can be pending", () => { expect(c).toBe(a + b); }); } @@ -26,13 +26,13 @@ xusing("A data driven suite", using("A data driven suite", [ 'a', 'b', 'c' ], - (lhs) => { + lhs => { beforeEach(() => { console.log(`lhs = ${lhs}`); }); all("can contain data driven tests", [ 'd', 'e', 'f' ], - (rhs) => { + rhs => { expect(lhs).not.toBe(rhs); } ); From 12c7576fedcdd83e51fde9561f5c7b71cbe3de78 Mon Sep 17 00:00:00 2001 From: Jonathan Viney Date: Tue, 5 Feb 2019 17:41:32 +1300 Subject: [PATCH 237/924] [@ember/object]: Make ObjectProxy content generic. Add type checks for EmberObject getters. --- types/ember__object/proxy.d.ts | 24 +++++++++++++++++-- types/ember__object/test/proxy.ts | 38 +++++++++++++++++++++++++++++++ types/ember__object/tsconfig.json | 1 + 3 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 types/ember__object/test/proxy.ts diff --git a/types/ember__object/proxy.d.ts b/types/ember__object/proxy.d.ts index 841b211e49..38c690fe72 100644 --- a/types/ember__object/proxy.d.ts +++ b/types/ember__object/proxy.d.ts @@ -1,12 +1,32 @@ import EmberObject from "@ember/object"; +import { + UnwrapComputedPropertyGetter, + UnwrapComputedPropertyGetters +} from "@ember/object/-private/types"; /** * `Ember.ObjectProxy` forwards all properties not defined by the proxy itself * to a proxied `content` object. */ -export default class ObjectProxy extends EmberObject { +export default class ObjectProxy extends EmberObject { /** * The object whose properties will be forwarded. */ - content: object; + content: T | undefined; + + get(key: K): UnwrapComputedPropertyGetter; + get(key: K): UnwrapComputedPropertyGetter | undefined; + + getProperties( + list: K[] + ): Pick, K>; + getProperties( + ...list: K[] + ): Pick, K>; + getProperties( + list: K[] + ): Pick>, K>; + getProperties( + ...list: K[] + ): Pick>, K>; } diff --git a/types/ember__object/test/proxy.ts b/types/ember__object/test/proxy.ts new file mode 100644 index 0000000000..bacfd013f1 --- /dev/null +++ b/types/ember__object/test/proxy.ts @@ -0,0 +1,38 @@ +import ObjectProxy from "@ember/object/proxy"; + +interface Book { + title: string; + subtitle: string; + chapters: Array<{ title: string }>; +} + +class DefaultProxy extends ObjectProxy {} +DefaultProxy.create().content; // $ExpectType object | undefined + +class BookProxy extends ObjectProxy { + private readonly baz = 'baz'; + + getTitle() { + return this.get('title'); + } + + getPropertiesTitleSubtitle() { + return this.getProperties('title', 'subtitle'); + } +} + +const book = BookProxy.create(); +book.content; // $ExpectType Book | undefined + +book.get("unknownProperty"); // $ExpectError +book.get("title"); // $ExpectType string | undefined +book.getTitle(); // $ExpectType string | undefined + +book.getProperties("title", "unknownProperty"); // $ExpectError +book.getProperties("title", "subtitle"); // $ExpectType Pick>, "title" | "subtitle"> +book.getPropertiesTitleSubtitle(); // $ExpectType Pick>, "title" | "subtitle"> + +book.getProperties(["subtitle", "chapters"]); // $ExpectType Pick>, "subtitle" | "chapters"> +book.getProperties(["title", "unknownProperty"]); // $ExpectError + +book.get("baz"); // $ExpectError diff --git a/types/ember__object/tsconfig.json b/types/ember__object/tsconfig.json index 5ed61a24d3..deeb128e7b 100644 --- a/types/ember__object/tsconfig.json +++ b/types/ember__object/tsconfig.json @@ -49,6 +49,7 @@ "test/extend.ts", "test/object.ts", "test/observable.ts", + "test/proxy.ts", "test/reopen.ts" ] } From e065fec3902500ac044320b984b44bea07a54980 Mon Sep 17 00:00:00 2001 From: simonihmig Date: Sun, 27 Jan 2019 20:42:18 +0100 Subject: [PATCH 238/924] Add url property to deprecation options See https://github.com/emberjs/ember.js/blob/56d60eac537933e20ef66e735299b81dba9a1788/packages/%40ember/debug/lib/deprecate.ts#L16 --- types/ember/v2/index.d.ts | 16 +++++++++++----- types/ember/v2/test/utils.ts | 8 ++++++++ 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/types/ember/v2/index.d.ts b/types/ember/v2/index.d.ts index 54b6d2e4a9..bdea9c24f8 100755 --- a/types/ember/v2/index.d.ts +++ b/types/ember/v2/index.d.ts @@ -274,6 +274,12 @@ declare module 'ember' { triggerAction(opts: TriggerActionOptions): boolean; } + interface DeprecationOptions { + id: string; + until: string; + url?: string; + } + export namespace Ember { interface FunctionPrototypeExtensions { /** @@ -2574,14 +2580,14 @@ declare module 'ember' { */ deprecatingAlias( dependentKey: string, - options: { id: string; until: string } + options: DeprecationOptions ): ComputedProperty; /** * @deprecated Missing deprecation options: https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options */ deprecatingAlias( dependentKey: string, - options?: { id?: string; until?: string } + options?: Partial ): ComputedProperty; /** * A computed property that returns the sum of the values @@ -2977,7 +2983,7 @@ declare module 'ember' { function deprecate( message: string, test: boolean, - options: { id: string; until: string } + options: DeprecationOptions ): any; /** * @deprecated Missing deprecation options: https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options @@ -2985,7 +2991,7 @@ declare module 'ember' { function deprecate( message: string, test: boolean, - options?: { id?: string; until?: string } + options?: Partial ): any; /** * Define an assertion that will throw an exception if the condition is not met. @@ -3012,7 +3018,7 @@ declare module 'ember' { */ function deprecateFunc any)>( message: string, - options: { id: string; until: string }, + options: DeprecationOptions, func: Func ): Func; /** diff --git a/types/ember/v2/test/utils.ts b/types/ember/v2/test/utils.ts index d729d472b8..72d55184ab 100755 --- a/types/ember/v2/test/utils.ts +++ b/types/ember/v2/test/utils.ts @@ -50,6 +50,14 @@ function testDeprecateFunc() { assertType(oldMethod('first', 123)); } +function testDeprecate() { + Ember.deprecate('This has been deprecated', false, { + id: 'some.id', + until: '1.0.0', + url: 'http://www.emberjs.com' + }); +} + function testDefineProperty() { const contact = {}; From 8cfa0ed3349d02128424dbe9dd112c8f85e11ff8 Mon Sep 17 00:00:00 2001 From: simonihmig Date: Fri, 1 Feb 2019 14:17:49 +0100 Subject: [PATCH 239/924] Add url property to deprecation options in ember/application/deprecations --- types/ember__application/deprecations.d.ts | 11 +++++++++-- types/ember__application/test/deprecations.ts | 7 ++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/types/ember__application/deprecations.d.ts b/types/ember__application/deprecations.d.ts index 8509e2f69d..ddc5af5019 100644 --- a/types/ember__application/deprecations.d.ts +++ b/types/ember__application/deprecations.d.ts @@ -1,3 +1,10 @@ +// tslint:disable-next-line:strict-export-declare-modifiers +interface DeprecationOptions { + id: string; + until: string; + url?: string; +} + /** * Display a deprecation warning with the provided message and a stack trace * (Chrome and Firefox only). @@ -5,7 +12,7 @@ export function deprecate( message: string, test: boolean, - options: { id: string; until: string } + options: DeprecationOptions ): any; /** @@ -13,6 +20,6 @@ export function deprecate( */ export function deprecateFunc any)>( message: string, - options: { id: string; until: string }, + options: DeprecationOptions, func: Func ): Func; diff --git a/types/ember__application/test/deprecations.ts b/types/ember__application/test/deprecations.ts index 30d1e8a075..c5db468535 100644 --- a/types/ember__application/test/deprecations.ts +++ b/types/ember__application/test/deprecations.ts @@ -1,8 +1,13 @@ import { deprecate, deprecateFunc } from '@ember/application/deprecations'; +deprecate('this is no longer advised', false, { + id: 'no-longer-advised', + until: 'v4.0' +}); deprecate('this is no longer advised', false, { id: 'no-longer-advised', - until: 'v4.0' + until: 'v4.0', + url: 'https://emberjs.com' }); deprecate('this is no longer advised', false); // $ExpectError From 3bf06f2894dd547e71ddd817a55d1f6802982d01 Mon Sep 17 00:00:00 2001 From: Mike North Date: Fri, 1 Mar 2019 12:00:16 -0800 Subject: [PATCH 240/924] [ember/v2] add limited handlebars types to old ember types --- types/ember/v2/index.d.ts | 2 +- types/ember/v2/test/ember-tests.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/types/ember/v2/index.d.ts b/types/ember/v2/index.d.ts index bdea9c24f8..1875f23eca 100755 --- a/types/ember/v2/index.d.ts +++ b/types/ember/v2/index.d.ts @@ -12,7 +12,6 @@ // TypeScript Version: 2.4 /// -/// declare module 'ember' { // Capitalization is intentional: this makes it much easier to re-export RSVP on @@ -2421,6 +2420,7 @@ declare module 'ember' { function print(ast: any): void; const logger: typeof Ember.Logger; function log(level: string, str: string): void; + function registerHelper(name: string, helper: any): void; } namespace String { function camelize(str: string): string; diff --git a/types/ember/v2/test/ember-tests.ts b/types/ember/v2/test/ember-tests.ts index c049512eb0..892c9ed9a8 100755 --- a/types/ember/v2/test/ember-tests.ts +++ b/types/ember/v2/test/ember-tests.ts @@ -92,10 +92,10 @@ App.userController = Ember.Object.create({ }), }); -Handlebars.registerHelper( +Ember.Handlebars.registerHelper( 'highlight', (property: string, options: any) => - new Handlebars.SafeString('' + 'some value' + '') + new Ember.Handlebars.SafeString('' + 'some value' + '') ); const coolView = App.CoolView.create(); From 431fd2a147a4a1e2188dafb208983b8639dded74 Mon Sep 17 00:00:00 2001 From: Elizabeth Samuel Date: Fri, 1 Mar 2019 13:09:03 -0800 Subject: [PATCH 241/924] [office-js] [office-js-preview] (Outlook) Event.completed preview --- types/office-js-preview/index.d.ts | 12 ++++++------ types/office-js/index.d.ts | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/types/office-js-preview/index.d.ts b/types/office-js-preview/index.d.ts index 80195cf516..431e9e76e7 100644 --- a/types/office-js-preview/index.d.ts +++ b/types/office-js-preview/index.d.ts @@ -962,11 +962,11 @@ declare namespace Office { * * *Supported hosts, by platform* * - * - * - * - * - * + * + * + * + * + * *
Office for Windows desktop Office Online (in browser) Office for iPad
Excel Y Y Y
Outlook Y (Mailbox 1.3)
PowerPoint Y Y Y
Word Y Y Y
Office for Windows desktop Office Online (in browser) Office for iPad
Excel Y Y Y
Outlook Y (Mailbox 1.3: without options
Mailbox Preview: with options)
PowerPoint Y Y Y
Word Y Y Y
* * @param options Optional. An object literal that contains one or more of the following properties. @@ -974,7 +974,7 @@ declare namespace Office { * this value indicates of the handled event should continue execution or be canceled. * For example, an add-in that handles the ItemSend event can set allowEvent = false to cancel sending of the message. */ - completed(options?: any): void; + completed(options?: { allowEvent: boolean }): void; } /** diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index 43a3bae9b8..e2bf496488 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -962,11 +962,11 @@ declare namespace Office { * * *Supported hosts, by platform* * - * - * - * - * - * + * + * + * + * + * *
Office for Windows desktop Office Online (in browser) Office for iPad
Excel Y Y Y
Outlook Y (Mailbox 1.3)
PowerPoint Y Y Y
Word Y Y Y
Office for Windows desktop Office Online (in browser) Office for iPad
Excel Y Y Y
Outlook Y (Mailbox 1.3: without options
Mailbox Preview: with options)
PowerPoint Y Y Y
Word Y Y Y
* * @param options Optional. An object literal that contains one or more of the following properties. @@ -974,7 +974,7 @@ declare namespace Office { * this value indicates of the handled event should continue execution or be canceled. * For example, an add-in that handles the ItemSend event can set allowEvent = false to cancel sending of the message. */ - completed(options?: any): void; + completed(options?: { allowEvent: boolean }): void; } /** From bdad98eff86a701b05256c1f8720ff631ebdd5c8 Mon Sep 17 00:00:00 2001 From: Ron Newcomb Date: Fri, 1 Mar 2019 13:19:06 -0800 Subject: [PATCH 242/924] VictoryVoronoiContainer for tooltips on Line chart VictoryVoronoiContainer for tooltips on Line chart --- types/victory/index.d.ts | 75 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/types/victory/index.d.ts b/types/victory/index.d.ts index f5c67995da..f70e8f7bf9 100644 --- a/types/victory/index.d.ts +++ b/types/victory/index.d.ts @@ -420,6 +420,81 @@ declare module "victory" { export class VictoryBrushContainer extends React.Component {} + export interface VictoryVoronoiContainerProps extends VictoryContainerProps { + /** + * When the activateData prop is set to true, the active prop will be set to true on all + * data components within a voronoi area. When this prop is set to false, the onActivated + * and onDeactivated callbacks will still fire, but no mutations to data components will + * occur via Victory’s event system. + */ + activateData?: boolean; + /** + * When the activateLabels prop is set to true, the active prop will be set to true on all + * labels corresponding to points within a voronoi area. When this prop is set to false, + * the onActivated and onDeactivated callbacks will still fire, but no mutations to label + * components will occur via Victory’s event system. Labels defined directly on + * VictoryVoronoiContainer via the labels prop will still appear when this prop is set to false. + */ + activateLabels?: boolean; + /** + * When the disable prop is set to true, VictoryVoronoiContainer events will not fire. + */ + disable?: boolean; + /** + * When a labels prop is provided to VictoryVoronoiContainer it will render a label component + * rather than activating labels on the child components it renders. This is useful for + * creating multi- point tooltips. This prop should be given as a function which will be called + * once for each active point. The labels function will be called with the arguments point, + * index, and points, where point refers to a single active point, index refers to the position + * of that point in the array of active points, and points is an array of all active points. + */ + labels?: (point: any, index: number, points: any[]) => string; + /** + * The labelComponent prop specified the component that will be rendered when labels are defined + * on VictoryVoronoiContainer. If the labels prop is omitted, no label component will be rendered. + */ + labelComponent?: React.ReactElement; + /** + * The onActivated prop accepts a function to be called whenever new data points are activated. + * The function is called with the parameters points (an array of active data objects) and props + * (the props used by VictoryVoronoiContainer). + */ + onActivated?: (points: any[], props: VictoryVoronoiContainerProps) => void; + /** + * The onDeactivated prop accepts a function to be called whenever points are deactivated. The + * function is called with the parameters points (an array of the newly-deactivated data objects) + * and props (the props used by VictoryVoronoiContainer). + */ + onDeactivated?: (points: any[], props: VictoryVoronoiContainerProps) => void; + /** + * When the radius prop is set, the voronoi areas associated with each data point will be no larger + * than the given radius. This prop should be given as a number. + */ + radius?: number; + /** + * The voronoiBlacklist prop is used to specify a list of components to ignore when calculating a + * shared voronoi diagram. Components with a name prop matching an element in the voronoiBlacklist + * array will be ignored by VictoryVoronoiContainer. Ignored components will never be flagged as + * active, and will not contribute date to shared tooltips or labels. + */ + voronoiBlacklist?: string[]; + /** + *When the voronoiDimension prop is set, voronoi selection will only take the given dimension into + * account. For example, when dimension is set to “x”, all data points matching a particular x mouse + * position will be activated regardless of y value. When this prop is not given, voronoi selection + * is determined by both x any y values. + */ + voronoiDimension?: "x" | "y"; + /** + * When the voronoiPadding prop is given, the area of the chart that will trigger voronoi events is + * reduced by the given padding on every side. By default, no padding is applied, and the entire range + * of a given chart may trigger voronoi events. This prop should be given as a number. + */ + voronoiPadding?: number; + } + + export class VictoryVoronoiContainer extends React.Component { } + export interface VictoryZoomContainerProps extends VictoryContainerProps { /** * The optional allowPan prop accepts a boolean that enables the panning From 9ea4c0ba6048ceb5435345b2598fdee6652d70d4 Mon Sep 17 00:00:00 2001 From: Eric Date: Fri, 1 Mar 2019 16:35:43 -0500 Subject: [PATCH 243/924] Remove JSDoc type annotation --- types/zeromq/index.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/types/zeromq/index.d.ts b/types/zeromq/index.d.ts index cb21200253..e40e5cc3aa 100644 --- a/types/zeromq/index.d.ts +++ b/types/zeromq/index.d.ts @@ -218,8 +218,7 @@ export class Socket extends NodeJS.EventEmitter { * Disable monitoring of a Socket release idle handler * and close the socket * - * @return {Socket} for chaining - * @api public + * @return for chaining */ unmonitor(): Socket; From 1717bac2515339ca81bbed35ba1a588bfa3bc7c1 Mon Sep 17 00:00:00 2001 From: Ron Newcomb Date: Fri, 1 Mar 2019 14:47:33 -0800 Subject: [PATCH 244/924] VictoryVoronoiContainer for tooltips on Line chart --- types/victory/index.d.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/types/victory/index.d.ts b/types/victory/index.d.ts index f70e8f7bf9..e6443c37d8 100644 --- a/types/victory/index.d.ts +++ b/types/victory/index.d.ts @@ -423,7 +423,7 @@ declare module "victory" { export interface VictoryVoronoiContainerProps extends VictoryContainerProps { /** * When the activateData prop is set to true, the active prop will be set to true on all - * data components within a voronoi area. When this prop is set to false, the onActivated + * data components within a voronoi area. When this prop is set to false, the onActivated * and onDeactivated callbacks will still fire, but no mutations to data components will * occur via Victory’s event system. */ @@ -431,8 +431,8 @@ declare module "victory" { /** * When the activateLabels prop is set to true, the active prop will be set to true on all * labels corresponding to points within a voronoi area. When this prop is set to false, - * the onActivated and onDeactivated callbacks will still fire, but no mutations to label - * components will occur via Victory’s event system. Labels defined directly on + * the onActivated and onDeactivated callbacks will still fire, but no mutations to label + * components will occur via Victory’s event system. Labels defined directly on * VictoryVoronoiContainer via the labels prop will still appear when this prop is set to false. */ activateLabels?: boolean; @@ -441,8 +441,8 @@ declare module "victory" { */ disable?: boolean; /** - * When a labels prop is provided to VictoryVoronoiContainer it will render a label component - * rather than activating labels on the child components it renders. This is useful for + * When a labels prop is provided to VictoryVoronoiContainer it will render a label component + * rather than activating labels on the child components it renders. This is useful for * creating multi- point tooltips. This prop should be given as a function which will be called * once for each active point. The labels function will be called with the arguments point, * index, and points, where point refers to a single active point, index refers to the position @@ -455,7 +455,7 @@ declare module "victory" { */ labelComponent?: React.ReactElement; /** - * The onActivated prop accepts a function to be called whenever new data points are activated. + * The onActivated prop accepts a function to be called whenever new data points are activated. * The function is called with the parameters points (an array of active data objects) and props * (the props used by VictoryVoronoiContainer). */ @@ -474,14 +474,14 @@ declare module "victory" { /** * The voronoiBlacklist prop is used to specify a list of components to ignore when calculating a * shared voronoi diagram. Components with a name prop matching an element in the voronoiBlacklist - * array will be ignored by VictoryVoronoiContainer. Ignored components will never be flagged as + * array will be ignored by VictoryVoronoiContainer. Ignored components will never be flagged as * active, and will not contribute date to shared tooltips or labels. */ voronoiBlacklist?: string[]; /** - *When the voronoiDimension prop is set, voronoi selection will only take the given dimension into + * When the voronoiDimension prop is set, voronoi selection will only take the given dimension into * account. For example, when dimension is set to “x”, all data points matching a particular x mouse - * position will be activated regardless of y value. When this prop is not given, voronoi selection + * position will be activated regardless of y value. When this prop is not given, voronoi selection * is determined by both x any y values. */ voronoiDimension?: "x" | "y"; From 328c85b59a52f21ba75ff3f001b9799af3490dc3 Mon Sep 17 00:00:00 2001 From: Jordan Abreu Date: Fri, 1 Mar 2019 15:13:04 -0800 Subject: [PATCH 245/924] Add missing property boolean `followRedirects` Add missing boolean property `followRedirects ` to ServerOptions interface --- types/http-proxy/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/http-proxy/index.d.ts b/types/http-proxy/index.d.ts index 2560b0a38d..535c12ab8a 100644 --- a/types/http-proxy/index.d.ts +++ b/types/http-proxy/index.d.ts @@ -207,6 +207,8 @@ declare namespace Server { headers?: {[header: string]: string}; /** Timeout (in milliseconds) when proxy receives no response from target. Default: 120000 (2 minutes) */ proxyTimeout?: number; + /** Specify whether you want to follow redirects. Default: false */ + followRedirects?: boolean; /** If set to true, none of the webOutgoing passes are called and it's your responsibility to appropriately return the response by listening and acting on the proxyRes event */ selfHandleResponse?: boolean; } From 46c8b18ad68ffc0f4a973f4339b9e4bee060ff4f Mon Sep 17 00:00:00 2001 From: Jordan Abreu Date: Fri, 1 Mar 2019 15:42:41 -0800 Subject: [PATCH 246/924] Updates ServerOptions interface Bumps version Adds timeout and cookiePathRewite to ServerOptions interface reorders ServerOptions interface to reflect order in http-proxy readme --- types/http-proxy/index.d.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/types/http-proxy/index.d.ts b/types/http-proxy/index.d.ts index 535c12ab8a..80e09de68f 100644 --- a/types/http-proxy/index.d.ts +++ b/types/http-proxy/index.d.ts @@ -1,8 +1,9 @@ -// Type definitions for node-http-proxy 1.16 +// Type definitions for node-http-proxy 1.17 // Project: https://github.com/nodejitsu/node-http-proxy // Definitions by: Maxime LUCE // Florian Oellerich // Daniel Schmidt +// Jordan Abreu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -165,8 +166,6 @@ declare class Server extends events.EventEmitter { declare namespace Server { interface ServerOptions { - /** Buffer */ - buffer?: stream.Stream; /** URL string to be parsed with the url module. */ target?: ProxyTargetUrl; /** URL string to be parsed with the url module. */ @@ -203,14 +202,20 @@ declare namespace Server { protocolRewrite?: string; /** rewrites domain of set-cookie headers. */ cookieDomainRewrite?: false | string | {[oldDomain: string]: string}; + /** rewrites path of set-cookie headers. Default: false */ + cookiePathRewrite?: false | string | {[oldPath: string]: string}; /** object with extra headers to be added to target requests. */ headers?: {[header: string]: string}; /** Timeout (in milliseconds) when proxy receives no response from target. Default: 120000 (2 minutes) */ proxyTimeout?: number; + /** Timeout (in milliseconds) for incoming requests */ + timeout?: number; /** Specify whether you want to follow redirects. Default: false */ followRedirects?: boolean; /** If set to true, none of the webOutgoing passes are called and it's your responsibility to appropriately return the response by listening and acting on the proxyRes event */ selfHandleResponse?: boolean; + /** Buffer */ + buffer?: stream.Stream; } } From 16499663766496af9ce29ebd6687886fb79751ba Mon Sep 17 00:00:00 2001 From: Thanik Bhongbhibhat Date: Sun, 24 Feb 2019 11:16:10 -0800 Subject: [PATCH 247/924] [@types/node]: Add argument types for net.Server.close callback --- types/node/index.d.ts | 1 + types/node/net.d.ts | 2 +- types/node/test/net.ts | 8 +++++--- types/node/v10/index.d.ts | 1 + types/node/v10/net.d.ts | 2 +- types/node/v10/node-tests.ts | 15 +++++++++------ types/node/v8/index.d.ts | 3 ++- types/node/v8/node-tests.ts | 15 +++++++++------ types/node/v9/index.d.ts | 3 ++- types/node/v9/node-tests.ts | 15 +++++++++------ 10 files changed, 40 insertions(+), 25 deletions(-) diff --git a/types/node/index.d.ts b/types/node/index.d.ts index 41bfd02671..23b53a5f0d 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -36,6 +36,7 @@ // Samuel Ainsworth // Kyle Uehlein // Jordi Oliveras Rovira +// Thanik Bhongbhibhat // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // NOTE: These definitions support NodeJS and TypeScript 3.2. diff --git a/types/node/net.d.ts b/types/node/net.d.ts index 33858de8df..d011f6297c 100644 --- a/types/node/net.d.ts +++ b/types/node/net.d.ts @@ -178,7 +178,7 @@ declare module "net" { listen(options: ListenOptions, listeningListener?: Function): this; listen(handle: any, backlog?: number, listeningListener?: Function): this; listen(handle: any, listeningListener?: Function): this; - close(callback?: Function): this; + close(callback?: (err?: Error) => void): this; address(): AddressInfo | string | null; getConnections(cb: (error: Error | null, count: number) => void): void; ref(): this; diff --git a/types/node/test/net.ts b/types/node/test/net.ts index a2276654c8..f2c212d1fc 100644 --- a/types/node/test/net.ts +++ b/types/node/test/net.ts @@ -26,9 +26,11 @@ import { LookupOneOptions } from 'dns'; ipv6Only: true, }); - // close has an optional callback function. No callback parameters are - // specified, so any callback function is permissible. - server = server.close((...args: any[]) => { }); + // close callback parameter can be either nothing (undefined) or an error + server = server.close(() => { }); + server = server.close((err) => { + if (typeof err !== 'undefined') { const _err: Error = err; } + }); // test the types of the address object fields const address: net.AddressInfo | string | null = server.address(); diff --git a/types/node/v10/index.d.ts b/types/node/v10/index.d.ts index 65f057b262..cf67202129 100644 --- a/types/node/v10/index.d.ts +++ b/types/node/v10/index.d.ts @@ -34,6 +34,7 @@ // Samuel Ainsworth // Kyle Uehlein // Jordi Oliveras Rovira +// Thanik Bhongbhibhat // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // NOTE: These definitions support NodeJS and TypeScript 3.1. diff --git a/types/node/v10/net.d.ts b/types/node/v10/net.d.ts index 27804375aa..056cdec17a 100644 --- a/types/node/v10/net.d.ts +++ b/types/node/v10/net.d.ts @@ -174,7 +174,7 @@ declare module "net" { listen(options: ListenOptions, listeningListener?: Function): this; listen(handle: any, backlog?: number, listeningListener?: Function): this; listen(handle: any, listeningListener?: Function): this; - close(callback?: Function): this; + close(callback?: (err?: Error) => void): this; address(): AddressInfo | string; getConnections(cb: (error: Error | null, count: number) => void): void; ref(): this; diff --git a/types/node/v10/node-tests.ts b/types/node/v10/node-tests.ts index 6602ce7af2..6ae1c52bde 100644 --- a/types/node/v10/node-tests.ts +++ b/types/node/v10/node-tests.ts @@ -1826,10 +1826,11 @@ async function asyncStreamPipelineFinished() { // close callback parameter is optional _server = _server.close(); - // close callback parameter doesn't specify any arguments, so any - // function is acceptable + // close callback parameter can be either nothing (undefined) or an error _server = _server.close(() => { }); - _server = _server.close((...args: any[]) => { }); + _server = _server.close((err) => { + if (typeof err !== 'undefined') { const _err: Error = err; } + }); } { @@ -3502,9 +3503,11 @@ import * as p from "process"; .ref() .unref(); - // close has an optional callback function. No callback parameters are - // specified, so any callback function is permissible. - server = server.close((...args: any[]) => { }); + // close callback parameter can be either nothing (undefined) or an error + server = server.close(() => { }); + server = server.close((err) => { + if (typeof err !== 'undefined') { const _err: Error = err; } + }); // test the types of the address object fields const address: net.AddressInfo | string = server.address(); diff --git a/types/node/v8/index.d.ts b/types/node/v8/index.d.ts index 9728ade03f..83deb05d33 100644 --- a/types/node/v8/index.d.ts +++ b/types/node/v8/index.d.ts @@ -23,6 +23,7 @@ // Lishude // Andrew Makarov // Jordi Oliveras Rovira +// Thanik Bhongbhibhat // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 @@ -2901,7 +2902,7 @@ declare module "net" { listen(options: ListenOptions, listeningListener?: Function): this; listen(handle: any, backlog?: number, listeningListener?: Function): this; listen(handle: any, listeningListener?: Function): this; - close(callback?: Function): this; + close(callback?: (err?: Error) => void): this; address(): { port: number; family: string; address: string; }; getConnections(cb: (error: Error | null, count: number) => void): void; ref(): this; diff --git a/types/node/v8/node-tests.ts b/types/node/v8/node-tests.ts index 706b39600a..0ca392ab33 100644 --- a/types/node/v8/node-tests.ts +++ b/types/node/v8/node-tests.ts @@ -1299,10 +1299,11 @@ namespace tls_tests { // close callback parameter is optional _server = _server.close(); - // close callback parameter doesn't specify any arguments, so any - // function is acceptable + // close callback parameter can be either nothing (undefined) or an error _server = _server.close(() => { }); - _server = _server.close((...args: any[]) => { }); + _server = _server.close((err) => { + if (typeof err !== 'undefined') { const _err: Error = err; } + }); } { @@ -2788,9 +2789,11 @@ namespace net_tests { .ref() .unref(); - // close has an optional callback function. No callback parameters are - // specified, so any callback function is permissible. - server = server.close((...args: any[]) => { }); + // close callback parameter can be either nothing (undefined) or an error + server = server.close(() => { }); + server = server.close((err) => { + if (typeof err !== 'undefined') { const _err: Error = err; } + }); // test the types of the address object fields let address = server.address(); diff --git a/types/node/v9/index.d.ts b/types/node/v9/index.d.ts index 9934b38eb4..ce36ad42d0 100644 --- a/types/node/v9/index.d.ts +++ b/types/node/v9/index.d.ts @@ -27,6 +27,7 @@ // Andrew Makarov // Eugene Y. Q. Shen // Jordi Oliveras Rovira +// Thanik Bhongbhibhat // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /** inspector module types */ @@ -3316,7 +3317,7 @@ declare module "net" { listen(options: ListenOptions, listeningListener?: Function): this; listen(handle: any, backlog?: number, listeningListener?: Function): this; listen(handle: any, listeningListener?: Function): this; - close(callback?: Function): this; + close(callback?: (err?: Error) => void): this; address(): AddressInfo | string; getConnections(cb: (error: Error | null, count: number) => void): void; ref(): this; diff --git a/types/node/v9/node-tests.ts b/types/node/v9/node-tests.ts index 4d0b5407c7..7d29ffbf95 100644 --- a/types/node/v9/node-tests.ts +++ b/types/node/v9/node-tests.ts @@ -1327,10 +1327,11 @@ namespace tls_tests { // close callback parameter is optional _server = _server.close(); - // close callback parameter doesn't specify any arguments, so any - // function is acceptable + // close callback parameter can be either nothing (undefined) or an error _server = _server.close(() => { }); - _server = _server.close((...args: any[]) => { }); + _server = _server.close((err) => { + if (typeof err !== 'undefined') { const _err: Error = err; } + }); } { @@ -2826,9 +2827,11 @@ namespace net_tests { .ref() .unref(); - // close has an optional callback function. No callback parameters are - // specified, so any callback function is permissible. - server = server.close((...args: any[]) => { }); + // close callback parameter can be either nothing (undefined) or an error + server = server.close(() => { }); + server = server.close((err) => { + if (typeof err !== 'undefined') { const _err: Error = err; } + }); // test the types of the address object fields let address: net.AddressInfo | string = server.address(); From e5f8ae32346b7574f264ecc366914c8459fe4751 Mon Sep 17 00:00:00 2001 From: Ori Livni Date: Wed, 27 Feb 2019 10:21:44 +0200 Subject: [PATCH 248/924] electron-store - Fix `onDidChange` return value --- types/electron-store/electron-store-tests.ts | 4 ++++ types/electron-store/index.d.ts | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/types/electron-store/electron-store-tests.ts b/types/electron-store/electron-store-tests.ts index f27cd6aca3..318af19f5c 100644 --- a/types/electron-store/electron-store-tests.ts +++ b/types/electron-store/electron-store-tests.ts @@ -52,3 +52,7 @@ typedElectronStore.set({ enabled: true, interval: 10000, }); + +const offDidChange = typedElectronStore.onDidChange("enabled", (n: boolean | undefined, p: boolean | undefined) => {}); + +offDidChange(); diff --git a/types/electron-store/index.d.ts b/types/electron-store/index.d.ts index 66e579b392..721386de2f 100644 --- a/types/electron-store/index.d.ts +++ b/types/electron-store/index.d.ts @@ -8,6 +8,8 @@ /// +import EventEmitter = require("events"); + type JSONValue = string | number | boolean | JSONObject | JSONArray; interface JSONObject { @@ -79,12 +81,12 @@ declare class ElectronStore implements Iterable<[string, JSONValue]> { */ onDidChange( key: K, - callback: (newValue: T[K], oldValue: T[K]) => void - ): void; + callback: (newValue: T[K] | undefined, oldValue: T[K] | undefined) => void + ): () => EventEmitter; onDidChange( key: string, - callback: (newValue: JSONValue, oldValue: JSONValue) => void - ): void; + callback: (newValue: JSONValue | undefined, oldValue: JSONValue | undefined) => void + ): () => EventEmitter; /** * Get the item count. From e1f5902b818ca6bad10eb5b1ffba96ec5150ba6f Mon Sep 17 00:00:00 2001 From: Adam Zerella Date: Sat, 2 Mar 2019 15:52:56 +1100 Subject: [PATCH 249/924] Added type defs for humanize-ms --- types/humanize-ms/humanize-ms-tests.ts | 5 +++++ types/humanize-ms/index.d.ts | 6 ++++++ types/humanize-ms/tsconfig.json | 25 +++++++++++++++++++++++++ types/humanize-ms/tslint.json | 3 +++ 4 files changed, 39 insertions(+) create mode 100644 types/humanize-ms/humanize-ms-tests.ts create mode 100644 types/humanize-ms/index.d.ts create mode 100644 types/humanize-ms/tsconfig.json create mode 100644 types/humanize-ms/tslint.json diff --git a/types/humanize-ms/humanize-ms-tests.ts b/types/humanize-ms/humanize-ms-tests.ts new file mode 100644 index 0000000000..80b675429a --- /dev/null +++ b/types/humanize-ms/humanize-ms-tests.ts @@ -0,0 +1,5 @@ +import HumanizeMs from "humanize-ms"; + +HumanizeMs('1s'); + +HumanizeMs(1000); diff --git a/types/humanize-ms/index.d.ts b/types/humanize-ms/index.d.ts new file mode 100644 index 0000000000..ea7e65bc80 --- /dev/null +++ b/types/humanize-ms/index.d.ts @@ -0,0 +1,6 @@ +// Type definitions for humanize-ms 1.2 +// Project: https://github.com/node-modules/humanize-ms +// Definitions by: Adam Zerella +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export default function(input: string|number): number; diff --git a/types/humanize-ms/tsconfig.json b/types/humanize-ms/tsconfig.json new file mode 100644 index 0000000000..2e451381a9 --- /dev/null +++ b/types/humanize-ms/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [ + + ], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "humanize-ms-tests.ts" + ] +} diff --git a/types/humanize-ms/tslint.json b/types/humanize-ms/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/humanize-ms/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file From 558d043fd0f9b3e247839d2a09a16accf4e21e09 Mon Sep 17 00:00:00 2001 From: Akihiro Uchida Date: Sat, 2 Mar 2019 14:24:36 +0900 Subject: [PATCH 250/924] put options to createBrowserFetcher test --- types/puppeteer/puppeteer-tests.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/types/puppeteer/puppeteer-tests.ts b/types/puppeteer/puppeteer-tests.ts index e62be5b7d5..81c23e5b5e 100644 --- a/types/puppeteer/puppeteer-tests.ts +++ b/types/puppeteer/puppeteer-tests.ts @@ -621,7 +621,11 @@ puppeteer.launch().then(async browser => { (async () => { const rev = '630727'; - const browserFetcher = puppeteer.createBrowserFetcher(); + const browserFetcher = puppeteer.createBrowserFetcher({ + host: 'https://storage.googleapis.com', + path: '/tmp/.local-chromium', + platform: 'linux', + }); await browserFetcher.canDownload(rev); const revisionInfo = await browserFetcher.download(rev); await browserFetcher.remove(rev); From efaf421de15617c280593b8a45168874896c391f Mon Sep 17 00:00:00 2001 From: Akihiro Uchida Date: Sat, 2 Mar 2019 14:24:47 +0900 Subject: [PATCH 251/924] fixes due to the review comments --- types/puppeteer/index.d.ts | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/types/puppeteer/index.d.ts b/types/puppeteer/index.d.ts index a4bf6e0d73..aacd54a9d0 100644 --- a/types/puppeteer/index.d.ts +++ b/types/puppeteer/index.d.ts @@ -31,6 +31,8 @@ export interface JSONObject { } export type SerializableOrJSHandle = Serializable | JSHandle; +export type Platform = "mac" | "win32" | "win64" | "linux"; + /** Defines `$eval` and `$$eval` for Page, Frame and ElementHandle. */ export interface Evalable { /** @@ -2187,26 +2189,14 @@ export interface CoverageEntry { ranges: Array<{start: number, end: number}>; } -/** Attaches Puppeteer to an existing Chromium instance */ -export function connect(options?: ConnectOptions): Promise; -/** The default flags that Chromium will be launched with */ -export function defaultArgs(options?: ChromeArgOptions): string[]; -/** Path where Puppeteer expects to find bundled Chromium */ -export function executablePath(): string; -/** The method launches a browser instance with given arguments. The browser will be closed when the parent node.js process is closed. */ -export function launch(options?: LaunchOptions): Promise; - -/** This methods attaches Puppeteer to an existing Chromium instance. */ -export function createBrowserFetcher(options?: LaunchOptions): BrowserFetcher; - /** BrowserFetcher can download and manage different versions of Chromium. */ export interface BrowserFetcher { /** The method initiates a HEAD request to check if the revision is available. */ canDownload(revision: string): Promise; /** The method initiates a GET request to download the revision from the host. */ - download(revision: string, progressCallback?: (downloadBytes: number, totalBytes: number) => any): Promise; + download(revision: string, progressCallback?: (downloadBytes: number, totalBytes: number) => void): Promise; localRevisions(): Promise; - platform(): string; + platform(): Platform; remove(revision: string): Promise; revisionInfo(revision: string): RevisionInfo; } @@ -2223,3 +2213,23 @@ export interface RevisionInfo { /** whether the revision is locally available on disk */ local: boolean; } + +export interface FetcherOptions { + /** A download host to be used. Defaults to `https://storage.googleapis.com`. */ + host: string; + /** A path for the downloads folder. Defaults to `/.local-chromium`, where `` is puppeteer's package root. */ + path: string; + /** Possible values are: `mac`, `win32`, `win64`, `linux`. Defaults to the current platform. */ + platform: Platform; +} + +/** Attaches Puppeteer to an existing Chromium instance */ +export function connect(options?: ConnectOptions): Promise; +/** The default flags that Chromium will be launched with */ +export function defaultArgs(options?: ChromeArgOptions): string[]; +/** Path where Puppeteer expects to find bundled Chromium */ +export function executablePath(): string; +/** The method launches a browser instance with given arguments. The browser will be closed when the parent node.js process is closed. */ +export function launch(options?: LaunchOptions): Promise; +/** This methods attaches Puppeteer to an existing Chromium instance. */ +export function createBrowserFetcher(options?: FetcherOptions): BrowserFetcher; From 8057cda1792524316a88ff73ca9054dd97b2888d Mon Sep 17 00:00:00 2001 From: Akihiro Uchida Date: Sat, 2 Mar 2019 17:07:47 +0900 Subject: [PATCH 252/924] make optional properties in FetcherOptions --- types/puppeteer/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/puppeteer/index.d.ts b/types/puppeteer/index.d.ts index aacd54a9d0..e043587e16 100644 --- a/types/puppeteer/index.d.ts +++ b/types/puppeteer/index.d.ts @@ -2216,11 +2216,11 @@ export interface RevisionInfo { export interface FetcherOptions { /** A download host to be used. Defaults to `https://storage.googleapis.com`. */ - host: string; + host?: string; /** A path for the downloads folder. Defaults to `/.local-chromium`, where `` is puppeteer's package root. */ - path: string; + path?: string; /** Possible values are: `mac`, `win32`, `win64`, `linux`. Defaults to the current platform. */ - platform: Platform; + platform?: Platform; } /** Attaches Puppeteer to an existing Chromium instance */ From 4b389b4092cb2a915f75767823fdbad1947469fc Mon Sep 17 00:00:00 2001 From: Akihiro Uchida Date: Sat, 2 Mar 2019 17:13:58 +0900 Subject: [PATCH 253/924] add some tests to cover methods and properties --- types/puppeteer/puppeteer-tests.ts | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/types/puppeteer/puppeteer-tests.ts b/types/puppeteer/puppeteer-tests.ts index 81c23e5b5e..90006c77d4 100644 --- a/types/puppeteer/puppeteer-tests.ts +++ b/types/puppeteer/puppeteer-tests.ts @@ -621,12 +621,25 @@ puppeteer.launch().then(async browser => { (async () => { const rev = '630727'; - const browserFetcher = puppeteer.createBrowserFetcher({ + const defaultFetcher = puppeteer.createBrowserFetcher(); + const options: puppeteer.FetcherOptions = { host: 'https://storage.googleapis.com', path: '/tmp/.local-chromium', platform: 'linux', - }); - await browserFetcher.canDownload(rev); - const revisionInfo = await browserFetcher.download(rev); - await browserFetcher.remove(rev); + }; + const browserFetcher = puppeteer.createBrowserFetcher(options); + const canDownload = await browserFetcher.canDownload(rev); + if (canDownload) { + const revisionInfo = await browserFetcher.download(rev); + const localRevisions = await browserFetcher.localRevisions(); + const browser = await puppeteer.launch({executablePath: revisionInfo.executablePath}); + browser.close(); + if (localRevisions.includes(rev)) { + await browserFetcher.remove(rev); + } + await browserFetcher.download(rev, (download, total) => { + console.log('downloadBytes:', download, 'totalBytes:', total); + }); + await browserFetcher.remove(rev); + } }); From dc452cdb4d335ee6690480cbc6e3f557f51908bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BE=BD=E5=B7=9D=E7=BF=BC?= <48148944+senjyouhara@users.noreply.github.com> Date: Sat, 2 Mar 2019 20:24:35 +0800 Subject: [PATCH 254/924] Create index.d.ts retinajs --- retinajs/index.d.ts | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 retinajs/index.d.ts diff --git a/retinajs/index.d.ts b/retinajs/index.d.ts new file mode 100644 index 0000000000..58b3e3b653 --- /dev/null +++ b/retinajs/index.d.ts @@ -0,0 +1,42 @@ +export = retinajs.retina; + +export as namespace retinajs; + +declare namespace retinajs { + var hasWindow: boolean; + + var environment: number; + + var srcReplace: RegExp; + + var inlineReplace: RegExp; + + var selector: string; + + var processedAttr: string; + + var processedAttr: string; + + function arrayify(object: any): HTMLImageElement[]; + + function chooseCap(cap: number | string): number; + + function forceOriginalDimensions(image: HTMLImageElement): HTMLImageElement; + + function setSourceIfAvailable( + image: HTMLImageElement, + retinaURL: string + ): void; + + function dynamicSwapImage(image: HTMLImageElement, src: string): void; + + function manualSwapImage(image: HTMLImageElement, hdsrc: string): void; + + function getImages(images: HTMLImageElement[] | null): HTMLImageElement[]; + + function cleanBgImg(img: HTMLImageElement): HTMLImageElement; + + function retina(): void; + + function retina(images: any): void; +} From ecc222e7529c73a95b95fcac93c990d5040e7a9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BE=BD=E5=B7=9D=E7=BF=BC?= <48148944+senjyouhara@users.noreply.github.com> Date: Sat, 2 Mar 2019 20:47:59 +0800 Subject: [PATCH 255/924] create --- retinajs/package.json | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 retinajs/package.json diff --git a/retinajs/package.json b/retinajs/package.json new file mode 100644 index 0000000000..2c3081334e --- /dev/null +++ b/retinajs/package.json @@ -0,0 +1,28 @@ +{ + "name": "@types/retinajs", + "version": "2.1.3", + "description": "TypeScript definitions for retinajs", + "license": "MIT", + "contributors": [ + "senjyouhara (https://github.com/senjyouhara)" + ], + "main": "", + "types": "index", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git" + }, + "scripts": {}, + "dependencies": {}, + "typesPublisherContentHash": "4BCEA62CB241C5EA821904599800CBA7A5695E03776CAE7E46CC1FDE98B73069", + "typeScriptVersion": ">= 3.2", + "bugs": { + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues" + }, + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme", + "keywords": [ + "retinajs", + "retina" + ], + "author": "senjyouhara" +} From 63a3de36cea6484083cc6ce613d3fa95aefee9cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BE=BD=E5=B7=9D=E7=BF=BC?= <48148944+senjyouhara@users.noreply.github.com> Date: Sat, 2 Mar 2019 20:48:43 +0800 Subject: [PATCH 256/924] create --- types/retinajs/package.json | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 types/retinajs/package.json diff --git a/types/retinajs/package.json b/types/retinajs/package.json new file mode 100644 index 0000000000..2c3081334e --- /dev/null +++ b/types/retinajs/package.json @@ -0,0 +1,28 @@ +{ + "name": "@types/retinajs", + "version": "2.1.3", + "description": "TypeScript definitions for retinajs", + "license": "MIT", + "contributors": [ + "senjyouhara (https://github.com/senjyouhara)" + ], + "main": "", + "types": "index", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git" + }, + "scripts": {}, + "dependencies": {}, + "typesPublisherContentHash": "4BCEA62CB241C5EA821904599800CBA7A5695E03776CAE7E46CC1FDE98B73069", + "typeScriptVersion": ">= 3.2", + "bugs": { + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues" + }, + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme", + "keywords": [ + "retinajs", + "retina" + ], + "author": "senjyouhara" +} From 0c8a03cc88985a2ee00cc8cf829263260870535a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BE=BD=E5=B7=9D=E7=BF=BC?= <48148944+senjyouhara@users.noreply.github.com> Date: Sat, 2 Mar 2019 20:49:11 +0800 Subject: [PATCH 257/924] create --- types/retinajs/index.d.ts | 42 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 types/retinajs/index.d.ts diff --git a/types/retinajs/index.d.ts b/types/retinajs/index.d.ts new file mode 100644 index 0000000000..58b3e3b653 --- /dev/null +++ b/types/retinajs/index.d.ts @@ -0,0 +1,42 @@ +export = retinajs.retina; + +export as namespace retinajs; + +declare namespace retinajs { + var hasWindow: boolean; + + var environment: number; + + var srcReplace: RegExp; + + var inlineReplace: RegExp; + + var selector: string; + + var processedAttr: string; + + var processedAttr: string; + + function arrayify(object: any): HTMLImageElement[]; + + function chooseCap(cap: number | string): number; + + function forceOriginalDimensions(image: HTMLImageElement): HTMLImageElement; + + function setSourceIfAvailable( + image: HTMLImageElement, + retinaURL: string + ): void; + + function dynamicSwapImage(image: HTMLImageElement, src: string): void; + + function manualSwapImage(image: HTMLImageElement, hdsrc: string): void; + + function getImages(images: HTMLImageElement[] | null): HTMLImageElement[]; + + function cleanBgImg(img: HTMLImageElement): HTMLImageElement; + + function retina(): void; + + function retina(images: any): void; +} From 8bd09c0fb42a8508d222aa500ba9a2758f148ae8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BE=BD=E5=B7=9D=E7=BF=BC?= <48148944+senjyouhara@users.noreply.github.com> Date: Sat, 2 Mar 2019 20:49:33 +0800 Subject: [PATCH 258/924] create --- types/retinajs/LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 types/retinajs/LICENSE diff --git a/types/retinajs/LICENSE b/types/retinajs/LICENSE new file mode 100644 index 0000000000..21071075c2 --- /dev/null +++ b/types/retinajs/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + 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 From 83f39442eb2dcbb9d1c830f8c827b8cdc5dfa856 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BE=BD=E5=B7=9D=E7=BF=BC?= <48148944+senjyouhara@users.noreply.github.com> Date: Sat, 2 Mar 2019 20:49:57 +0800 Subject: [PATCH 259/924] create --- types/retinajs/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 types/retinajs/README.md diff --git a/types/retinajs/README.md b/types/retinajs/README.md new file mode 100644 index 0000000000..d28dcdd483 --- /dev/null +++ b/types/retinajs/README.md @@ -0,0 +1,14 @@ +# Installation + +> `npm install --save @types/retinajs` + +# Summary + +This package contains type definitions for retinajs ( https://github.com/strues/retinajs ). + +# Details + +Additional Details + +- Last updated: Sat Mar 02 2019 15:07:39 GMT+0800 +- Dependencies: none From d18678b1702f47319cbbf28547d71758f2cbe465 Mon Sep 17 00:00:00 2001 From: denis Date: Sat, 2 Mar 2019 13:57:54 +0100 Subject: [PATCH 260/924] Update to bootstrap 4.3 --- types/bootstrap/bootstrap-tests.ts | 73 ++++++++++++------------------ types/bootstrap/index.d.ts | 21 ++++++++- 2 files changed, 50 insertions(+), 44 deletions(-) diff --git a/types/bootstrap/bootstrap-tests.ts b/types/bootstrap/bootstrap-tests.ts index 9344423cfb..01e5d5352f 100755 --- a/types/bootstrap/bootstrap-tests.ts +++ b/types/bootstrap/bootstrap-tests.ts @@ -196,6 +196,12 @@ $("#popover").popover({ offset: 10, fallbackPlacement: ["flip", "clockwise"], boundary: "scrollParent", + sanitize: false, + whiteList: { + h1: [], + img: ['src', 'alt', 'title', 'width', 'height'], + }, + sanitizeFn: (x: string) => x.replace("<", ""), }); $("#popover").popover({ @@ -207,6 +213,10 @@ $("#popover").popover({ }, }); +$("#popover").popover({ + sanitizeFn: null, +}); + // -------------------------------------------------------------------------------------- // Scrollspy // -------------------------------------------------------------------------------------- @@ -280,10 +290,23 @@ $("#tooltip").on("hide.bs.tooltip", () => {}); $("#tooltip").tooltip({ animation: false, -}); - -$("#tooltip").tooltip({ container: "#container", + delay: {show: 500, hide: 100}, + html: true, + placement: "auto", + selector: "[rel=\"tooltip\"]", + template: '', + title: "Hello world", + trigger: "hover focus", + offset: 10, + fallbackPlacement: ["flip", "clockwise"], + boundary: "scrollParent", + sanitize: false, + whiteList: { + h1: [], + img: ['src', 'alt', 'title', 'width', 'height'], + }, + sanitizeFn: (x: string) => x.replace("<", ""), }); $("#tooltip").tooltip({ @@ -298,18 +321,6 @@ $("#tooltip").tooltip({ delay: 250, }); -$("#tooltip").tooltip({ - delay: {show: 500, hide: 100}, -}); - -$("#tooltip").tooltip({ - html: true, -}); - -$("#tooltip").tooltip({ - placement: "auto", -}); - $("#tooltip").tooltip({ placement(this, tooltip, trigger) { console.log(this.tip === tooltip); @@ -327,22 +338,10 @@ $("#tooltip").tooltip({ }, }); -$("#tooltip").tooltip({ - selector: "[rel=\"tooltip\"]", -}); - $("#tooltip").tooltip({ selector: false, }); -$("#tooltip").tooltip({ - template: '', -}); - -$("#tooltip").tooltip({ - title: "Hello world", -}); - $("#tooltip").tooltip({ title: document.getElementById("title-element") as HTMLElement, }); @@ -353,14 +352,6 @@ $("#tooltip").tooltip({ }, }); -$("#tooltip").tooltip({ - trigger: "hover focus", -}); - -$("#tooltip").tooltip({ - offset: 10, -}); - $("#tooltip").tooltip({ offset: "10px", }); @@ -369,14 +360,10 @@ $("#tooltip").tooltip({ fallbackPlacement: "clockwise", }); -$("#tooltip").tooltip({ - fallbackPlacement: ["flip", "clockwise"], -}); - -$("#tooltip").tooltip({ - boundary: "scrollParent", -}); - $("#tooltip").tooltip({ boundary: aHtmlElement, }); + +$("#popover").popover({ + sanitizeFn: null, +}); diff --git a/types/bootstrap/index.d.ts b/types/bootstrap/index.d.ts index 2fb473fc29..6dc5f21a28 100755 --- a/types/bootstrap/index.d.ts +++ b/types/bootstrap/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Bootstrap 4.2 +// Type definitions for Bootstrap 4.3 // Project: https://github.com/twbs/bootstrap/, https://getbootstrap.com // Definitions by: denisname // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -352,6 +352,25 @@ export interface TooltipOption { * @default "scrollParent" */ boundary?: Popper.Boundary | HTMLElement; + + /** + * Enable or disable the sanitization. If activated 'template', 'content' and 'title' options will be sanitized. + * + * @default true + */ + sanitize?: boolean; + + /** + * Object which contains allowed attributes and tags. + */ + whiteList?: {[key: string]: string[]}; + + /** + * Here you can supply your own sanitize function. This can be useful if you prefer to use a dedicated library to perform sanitization. + * + * @default null + */ + sanitizeFn?: null | ((input: string) => string); } // -------------------------------------------------------------------------------------- From 96f97bd1ab84dcaaf4e8d1ca9380efd15409a2d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BE=BD=E5=B7=9D=E7=BF=BC?= <48148944+senjyouhara@users.noreply.github.com> Date: Sat, 2 Mar 2019 21:03:24 +0800 Subject: [PATCH 261/924] Delete package.json --- retinajs/package.json | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 retinajs/package.json diff --git a/retinajs/package.json b/retinajs/package.json deleted file mode 100644 index 2c3081334e..0000000000 --- a/retinajs/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "@types/retinajs", - "version": "2.1.3", - "description": "TypeScript definitions for retinajs", - "license": "MIT", - "contributors": [ - "senjyouhara (https://github.com/senjyouhara)" - ], - "main": "", - "types": "index", - "repository": { - "type": "git", - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git" - }, - "scripts": {}, - "dependencies": {}, - "typesPublisherContentHash": "4BCEA62CB241C5EA821904599800CBA7A5695E03776CAE7E46CC1FDE98B73069", - "typeScriptVersion": ">= 3.2", - "bugs": { - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues" - }, - "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme", - "keywords": [ - "retinajs", - "retina" - ], - "author": "senjyouhara" -} From eed28b1a47cc7ca700d945e196db57e2e8ba736d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BE=BD=E5=B7=9D=E7=BF=BC?= <48148944+senjyouhara@users.noreply.github.com> Date: Sat, 2 Mar 2019 21:17:55 +0800 Subject: [PATCH 262/924] Create index.d.ts --- types/retinajs/index.d.ts | 42 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 types/retinajs/index.d.ts diff --git a/types/retinajs/index.d.ts b/types/retinajs/index.d.ts new file mode 100644 index 0000000000..58b3e3b653 --- /dev/null +++ b/types/retinajs/index.d.ts @@ -0,0 +1,42 @@ +export = retinajs.retina; + +export as namespace retinajs; + +declare namespace retinajs { + var hasWindow: boolean; + + var environment: number; + + var srcReplace: RegExp; + + var inlineReplace: RegExp; + + var selector: string; + + var processedAttr: string; + + var processedAttr: string; + + function arrayify(object: any): HTMLImageElement[]; + + function chooseCap(cap: number | string): number; + + function forceOriginalDimensions(image: HTMLImageElement): HTMLImageElement; + + function setSourceIfAvailable( + image: HTMLImageElement, + retinaURL: string + ): void; + + function dynamicSwapImage(image: HTMLImageElement, src: string): void; + + function manualSwapImage(image: HTMLImageElement, hdsrc: string): void; + + function getImages(images: HTMLImageElement[] | null): HTMLImageElement[]; + + function cleanBgImg(img: HTMLImageElement): HTMLImageElement; + + function retina(): void; + + function retina(images: any): void; +} From 074c39b139ffa668ce24c1dfbc34ad8f3680c998 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BE=BD=E5=B7=9D=E7=BF=BC?= <48148944+senjyouhara@users.noreply.github.com> Date: Sat, 2 Mar 2019 21:18:28 +0800 Subject: [PATCH 263/924] create --- types/retinajs/package.json | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 types/retinajs/package.json diff --git a/types/retinajs/package.json b/types/retinajs/package.json new file mode 100644 index 0000000000..2c3081334e --- /dev/null +++ b/types/retinajs/package.json @@ -0,0 +1,28 @@ +{ + "name": "@types/retinajs", + "version": "2.1.3", + "description": "TypeScript definitions for retinajs", + "license": "MIT", + "contributors": [ + "senjyouhara (https://github.com/senjyouhara)" + ], + "main": "", + "types": "index", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git" + }, + "scripts": {}, + "dependencies": {}, + "typesPublisherContentHash": "4BCEA62CB241C5EA821904599800CBA7A5695E03776CAE7E46CC1FDE98B73069", + "typeScriptVersion": ">= 3.2", + "bugs": { + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues" + }, + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme", + "keywords": [ + "retinajs", + "retina" + ], + "author": "senjyouhara" +} From 0f9be7571c6a0ed2c0f7443c215f0956ebbec12c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BE=BD=E5=B7=9D=E7=BF=BC?= <48148944+senjyouhara@users.noreply.github.com> Date: Sat, 2 Mar 2019 21:18:46 +0800 Subject: [PATCH 264/924] create --- types/retinajs/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 types/retinajs/README.md diff --git a/types/retinajs/README.md b/types/retinajs/README.md new file mode 100644 index 0000000000..d28dcdd483 --- /dev/null +++ b/types/retinajs/README.md @@ -0,0 +1,14 @@ +# Installation + +> `npm install --save @types/retinajs` + +# Summary + +This package contains type definitions for retinajs ( https://github.com/strues/retinajs ). + +# Details + +Additional Details + +- Last updated: Sat Mar 02 2019 15:07:39 GMT+0800 +- Dependencies: none From 4668a6dedf8eb5d411d4ce67394de71d53a88366 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BE=BD=E5=B7=9D=E7=BF=BC?= <48148944+senjyouhara@users.noreply.github.com> Date: Sat, 2 Mar 2019 21:19:06 +0800 Subject: [PATCH 265/924] create --- types/retinajs/LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 types/retinajs/LICENSE diff --git a/types/retinajs/LICENSE b/types/retinajs/LICENSE new file mode 100644 index 0000000000..21071075c2 --- /dev/null +++ b/types/retinajs/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + 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 From 3bc7ca0fdea4ab321fb227cfa20910b68fd557ef Mon Sep 17 00:00:00 2001 From: Flexmonster Pivot Table Date: Sat, 2 Mar 2019 16:39:12 +0200 Subject: [PATCH 266/924] d.ts update --- types/flexmonster/index.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/flexmonster/index.d.ts b/types/flexmonster/index.d.ts index 192e8f2d93..fad76ca64d 100644 --- a/types/flexmonster/index.d.ts +++ b/types/flexmonster/index.d.ts @@ -193,6 +193,8 @@ declare namespace Flexmonster { hash?: string; username?: string; password?: string; + requestHeader?: object; + subquery?: string; } interface Slice { @@ -278,6 +280,7 @@ declare namespace Flexmonster { saveAllFormats?: boolean; showDrillThroughConfigurator?: boolean; grouping?: boolean; + showAllFieldsDrillThrough?: boolean; } interface PrintOptions { @@ -345,6 +348,7 @@ declare namespace Flexmonster { useOlapFormattingInExcel?: boolean; useCustomizeCellForData?: boolean; excelExportAll?: boolean; + requestHeader?: object; } interface Hierarchy { From 0a5d7232d4929460ea810688ba78092a1d973fa0 Mon Sep 17 00:00:00 2001 From: Evgeni Zharkov Date: Sat, 2 Mar 2019 18:31:09 +0300 Subject: [PATCH 267/924] Add typings for tarantool-driver --- types/tarantool-driver/index.d.ts | 58 +++++++++++++++++++ .../tarantool-driver-tests.ts | 3 + types/tarantool-driver/tsconfig.json | 23 ++++++++ types/tarantool-driver/tslint.json | 1 + 4 files changed, 85 insertions(+) create mode 100644 types/tarantool-driver/index.d.ts create mode 100644 types/tarantool-driver/tarantool-driver-tests.ts create mode 100644 types/tarantool-driver/tsconfig.json create mode 100644 types/tarantool-driver/tslint.json diff --git a/types/tarantool-driver/index.d.ts b/types/tarantool-driver/index.d.ts new file mode 100644 index 0000000000..63b34cb6fa --- /dev/null +++ b/types/tarantool-driver/index.d.ts @@ -0,0 +1,58 @@ +// Type definitions for tarantool-driver 3.0 +// Project: https://github.com/tarantool/node-tarantool-driver +// Definitions by: Evgeni Zharkov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { EventEmitter } from "events"; + +export interface TarantoolOptions { + host?: string; + port?: number; + username?: string; + password?: string; + reserveHosts?: string[]; + beforeReserve?: number; + timeout?: number; + retryStrategy?: (times: number) => number; + lazyConnect?: boolean; +} + +export default class TarantoolConnection extends EventEmitter { + constructor(options: TarantoolOptions); + + /* Connection */ + + connect(): Promise; + + flushQueue(cb: (err: Error) => void): void; + + destroy(): void; + + disconnect(reconnect?: boolean): void; + + /* Commands */ + + select(spaceId: number | string, + indexId: number | string, + limit: number, offset: number, + iterator: string, key: string | string[]): Promise; + + delete(spaceId: number | string, + indexId: number | string, + key: any[]): Promise; + + update(spaceId: number | string, + indexId: number | string, + key: any[], ops: any[]): Promise; + + upsert(spaceId: number | string, + ops: any[], tuple: any[]): Promise; + + eval(expression: string, ...args: any[]): Promise; + + call(functionName: string, ...args: any[]): Promise; + + insert(spaceId: number | string, tuple: any[]): Promise; + + replace(spaceId: number | string, tuple: any[]): Promise; +} diff --git a/types/tarantool-driver/tarantool-driver-tests.ts b/types/tarantool-driver/tarantool-driver-tests.ts new file mode 100644 index 0000000000..cf27d123fb --- /dev/null +++ b/types/tarantool-driver/tarantool-driver-tests.ts @@ -0,0 +1,3 @@ +import TarantoolDriver from "tarantool-driver"; + +new TarantoolDriver({}).connect(); // $ExpectedType Promise diff --git a/types/tarantool-driver/tsconfig.json b/types/tarantool-driver/tsconfig.json new file mode 100644 index 0000000000..c49fafed46 --- /dev/null +++ b/types/tarantool-driver/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "tarantool-driver-tests.ts" + ] +} \ No newline at end of file diff --git a/types/tarantool-driver/tslint.json b/types/tarantool-driver/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/tarantool-driver/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file From 26fe0ed1615538292deb11cbbb7a691dac2fbb46 Mon Sep 17 00:00:00 2001 From: Dimitri Benin Date: Sat, 2 Mar 2019 21:18:09 +0100 Subject: [PATCH 268/924] [pkg-conf] Remove types --- notNeededPackages.json | 6 ++++++ types/pkg-conf/index.d.ts | 34 -------------------------------- types/pkg-conf/pkg-conf-tests.ts | 6 ------ types/pkg-conf/tsconfig.json | 23 --------------------- types/pkg-conf/tslint.json | 1 - 5 files changed, 6 insertions(+), 64 deletions(-) delete mode 100644 types/pkg-conf/index.d.ts delete mode 100644 types/pkg-conf/pkg-conf-tests.ts delete mode 100644 types/pkg-conf/tsconfig.json delete mode 100644 types/pkg-conf/tslint.json diff --git a/notNeededPackages.json b/notNeededPackages.json index 4289393363..6b24197054 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -1230,6 +1230,12 @@ "sourceRepoURL": "https://github.com/PeculiarVentures/pkcs11js", "asOfVersion": "1.0.4" }, + { + "libraryName": "pkg-conf", + "typingsPackageName": "pkg-conf", + "sourceRepoURL": "https://github.com/sindresorhus/pkg-conf", + "asOfVersion": "3.0.0" + }, { "libraryName": "plottable", "typingsPackageName": "plottable", diff --git a/types/pkg-conf/index.d.ts b/types/pkg-conf/index.d.ts deleted file mode 100644 index 6a783c1891..0000000000 --- a/types/pkg-conf/index.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -// Type definitions for pkg-conf 2.1 -// Project: https://github.com/sindresorhus/pkg-conf#readme -// Definitions by: Jorge Gonzalez -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 - -declare namespace pkgConf { - type AnyJson = boolean | number | string | null | JsonArray | JsonMap; - interface JsonArray extends Array { } - interface JsonMap { - [key: string]: AnyJson; - } - - interface Options { - // Directory to start looking up for a package.json file. - // Default: process.cwd() - cwd?: string; - // Default config. - defaults?: object; - // Skip package.json files that have the namespaced config explicitly set to false. - skipOnFalse?: boolean; - } - - // Returns the config. - function sync(namespace: string, options?: Options): JsonMap; - // Pass in the config returned from any of the above methods. - // Returns the filepath to the package.json file or null when not found. - function filepath(config: JsonMap): string | null; -} - -// Returns a Promise for the config. -declare function pkgConf(namespace: string, options?: pkgConf.Options): Promise; - -export = pkgConf; diff --git a/types/pkg-conf/pkg-conf-tests.ts b/types/pkg-conf/pkg-conf-tests.ts deleted file mode 100644 index bf2dee1e2f..0000000000 --- a/types/pkg-conf/pkg-conf-tests.ts +++ /dev/null @@ -1,6 +0,0 @@ -import pkgConf = require('pkg-conf'); - -pkgConf('name'); // $ExpectType Promise -const config = pkgConf.sync('bugs'); // $ExpectType JsonMap -pkgConf.filepath(config); // $ExpectType string | null -config.url; // $ExpectType AnyJson diff --git a/types/pkg-conf/tsconfig.json b/types/pkg-conf/tsconfig.json deleted file mode 100644 index 449922d19e..0000000000 --- a/types/pkg-conf/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "pkg-conf-tests.ts" - ] -} diff --git a/types/pkg-conf/tslint.json b/types/pkg-conf/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/pkg-conf/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" } From 41da6031823f34d2c08e276b952d0d110696bc53 Mon Sep 17 00:00:00 2001 From: Dimitri Benin Date: Sat, 2 Mar 2019 21:25:36 +0100 Subject: [PATCH 269/924] [p-queue] Remove types --- notNeededPackages.json | 6 ++ types/p-queue/index.d.ts | 160 ------------------------------ types/p-queue/p-queue-tests.ts | 49 --------- types/p-queue/tsconfig.json | 23 ----- types/p-queue/tslint.json | 1 - types/p-queue/v2/index.d.ts | 103 ------------------- types/p-queue/v2/p-queue-tests.ts | 51 ---------- types/p-queue/v2/tsconfig.json | 26 ----- types/p-queue/v2/tslint.json | 1 - 9 files changed, 6 insertions(+), 414 deletions(-) delete mode 100644 types/p-queue/index.d.ts delete mode 100644 types/p-queue/p-queue-tests.ts delete mode 100644 types/p-queue/tsconfig.json delete mode 100644 types/p-queue/tslint.json delete mode 100644 types/p-queue/v2/index.d.ts delete mode 100644 types/p-queue/v2/p-queue-tests.ts delete mode 100644 types/p-queue/v2/tsconfig.json delete mode 100644 types/p-queue/v2/tslint.json diff --git a/notNeededPackages.json b/notNeededPackages.json index 4289393363..82c50ddaab 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -1158,6 +1158,12 @@ "sourceRepoURL": "https://github.com/sindresorhus/p-pipe", "asOfVersion": "2.0.1" }, + { + "libraryName": "p-queue", + "typingsPackageName": "p-queue", + "sourceRepoURL": "https://github.com/sindresorhus/p-queue", + "asOfVersion": "3.2.0" + }, { "libraryName": "p-throttle", "typingsPackageName": "p-throttle", diff --git a/types/p-queue/index.d.ts b/types/p-queue/index.d.ts deleted file mode 100644 index 96fda8426a..0000000000 --- a/types/p-queue/index.d.ts +++ /dev/null @@ -1,160 +0,0 @@ -// Type definitions for p-queue 3.1 -// Project: https://github.com/sindresorhus/p-queue#readme -// Definitions by: BendingBender -// Evan Shortiss -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 - -/// - -import { EventEmitter } from 'events'; - -export = PQueue; - -/** - * Promise queue with concurrency control. - */ -declare class PQueue< - TEnqueueOptions extends PQueue.QueueAddOptions = PQueue.DefaultAddOptions -> extends EventEmitter { - /** - * Size of the queue. - */ - readonly size: number; - - /** - * Number of pending promises. - */ - readonly pending: number; - - /** - * Whether the queue is currently paused. - */ - readonly isPaused: boolean; - - constructor(opts?: PQueue.Options); - - /** - * Adds a sync or async task to the queue. Always returns a promise. - * @param fn Promise-returning/async function. - * @param opts - */ - add(fn: PQueue.Task, opts?: TEnqueueOptions): Promise; - - /** - * Same as `.add()`, but accepts an array of sync or async functions - * and returns a promise that resolves when all functions are resolved. - * @param fn Array of Promise-returning/async functions. - */ - addAll(fns: Array>, opts?: TEnqueueOptions): Promise; - - /** - * Returns a promise that settles when the queue becomes empty. - * - * Can be called multiple times. Useful if you for example add - * additional items at a later time. - */ - onEmpty(): Promise; - - /** - * Returns a promise that settles when the queue becomes empty, and all - * promises have completed; `queue.size === 0 && queue.pending === 0`. - * - * The difference with `.onEmpty` is that `.onIdle` guarantees that all work - * from the queue has finished. `.onEmpty` merely signals that the queue is - * empty, but it could mean that some promises haven't completed yet. - */ - onIdle(): Promise; - - /** - * Start (or resume) executing enqueued tasks within concurrency limit. - * No need to call this if queue is not paused - * (via `options.autoStart = false` or by `.pause()` method.) - */ - start(): void; - - /** - * Clear the queue. - */ - clear(): void; - - /** - * Put queue execution on hold. - */ - pause(): void; - - addListener(event: 'active', listener: () => void): this; - on(event: 'active', listener: () => void): this; - once(event: 'active', listener: () => void): this; - prependListener(event: 'active', listener: () => void): this; - prependOnceListener(event: 'active', listener: () => void): this; - removeListener(event: 'active', listener: () => void): this; - off(event: 'active', listener: () => void): this; - removeAllListeners(event?: 'active'): this; - listeners(event: 'active'): Array<() => void>; - rawListeners(event: 'active'): Array<() => void>; - emit(event: 'active'): boolean; - eventNames(): Array<'active'>; - listenerCount(type: 'active'): number; -} - -declare namespace PQueue { - interface QueueAddOptions { - [key: string]: any; - } - - interface QueueClassConstructor { - new (): QueueClass; - } - - interface QueueClass { - size: number; - - enqueue(run: () => void, options?: TEnqueueOptions): void; - - dequeue(): (() => void) | undefined; - } - - interface Options { - /** - * Concurrency limit. Minimum: `1`. - * @default Infinity - */ - concurrency?: number; - /** - * Whether queue tasks within concurrency limit, are auto-executed as soon as they're added. - * @default true - */ - autoStart?: boolean; - /** - * Class with a `enqueue` and `dequeue` method, and a `size` getter. See the - * [Custom QueueClass](https://github.com/sindresorhus/p-queue#custom-queueclass) section. - */ - queueClass?: QueueClassConstructor; - /** - * The max number of runs in the given interval of time. Minimum: `1`. - * @default Infinity - */ - intervalCap?: number; - /** - * The length of time in milliseconds before the interval count resets. Must be finite. Minimum: `0`. - * @default 0 - */ - interval?: number; - /** - * Whether the task must finish in the given interval or will be carried over into the next interval count. - * @default false - */ - carryoverConcurrencyCount?: boolean; - } - - interface DefaultAddOptions { - /** - * Priority of operation. Operations with greater priority will be scheduled first. - * @default 0 - */ - priority?: number; - } - - type Task = (() => PromiseLike) | (() => T); -} diff --git a/types/p-queue/p-queue-tests.ts b/types/p-queue/p-queue-tests.ts deleted file mode 100644 index 4ce6fbb13e..0000000000 --- a/types/p-queue/p-queue-tests.ts +++ /dev/null @@ -1,49 +0,0 @@ -import PQueue = require('p-queue'); - -const queue = new PQueue({ concurrency: 1 }); -new PQueue({ autoStart: false }); -new PQueue({ intervalCap: 1 }); -new PQueue({ interval: 0 }); -new PQueue({ carryoverConcurrencyCount: true }); - -queue.add(() => Promise.resolve('sindresorhus.com')); // $ExpectType Promise -queue.add(() => 'sindresorhus.com'); // $ExpectType Promise -queue.add(() => 'sindresorhus.com', { priority: 1 }); // $ExpectType Promise - -queue.addAll([() => Promise.resolve('oh'), () => 'hi']); // $ExpectType Promise -queue.addAll([() => Promise.resolve('oh'), () => 1]); // $ExpectType Promise<(string | number)[]> -queue.addAll([() => Promise.resolve('oh'), () => 'hi'], { priority: 1 }); // $ExpectType Promise - -queue.onEmpty(); // $ExpectType Promise -queue.onIdle(); // $ExpectType Promise -queue.start(); -queue.pause(); -queue.clear(); - -queue.size; // $ExpectType number -queue.size = 1; // $ExpectError -queue.pending; // $ExpectType number -queue.pending = 5; // $ExpectError -queue.isPaused; // $ExpectType boolean -queue.isPaused = true; // $ExpectError - -class QueueClass implements PQueue.QueueClass<{ any: string }> { - private readonly queue: Array<() => void>; - - size = 0; - - constructor() { - this.queue = []; - } - - enqueue(run: () => void, options: { any: string }) { - this.queue.push(run); - } - - dequeue() { - return this.queue.shift(); - } -} - -const queue2 = new PQueue({ queueClass: QueueClass }); -queue2.add(() => Promise.resolve(), { any: 'hi' }); diff --git a/types/p-queue/tsconfig.json b/types/p-queue/tsconfig.json deleted file mode 100644 index b3dd5e5314..0000000000 --- a/types/p-queue/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "p-queue-tests.ts" - ] -} \ No newline at end of file diff --git a/types/p-queue/tslint.json b/types/p-queue/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/p-queue/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" } diff --git a/types/p-queue/v2/index.d.ts b/types/p-queue/v2/index.d.ts deleted file mode 100644 index 568de0ca1d..0000000000 --- a/types/p-queue/v2/index.d.ts +++ /dev/null @@ -1,103 +0,0 @@ -// Type definitions for p-queue 2.3 -// Project: https://github.com/sindresorhus/p-queue#readme -// Definitions by: BendingBender -// Evan Shortiss -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -export = PQueue; - -declare class PQueue { - /** - * Size of the queue. - */ - size: number; - - /** - * Number of pending promises. - */ - pending: number; - - /** - * Whether the queue is currently paused. - */ - isPaused: boolean; - - constructor(opts?: PQueue.Options); - - /** - * Returns the promise returned by calling fn. - * @param fn Promise-returning/async function. - */ - add(fn: PQueue.Task, opts?: O): Promise; - - /** - * Same as .add(), but accepts an array of async functions and - * returns a promise that resolves when all async functions are resolved. - * @param fn Array of Promise-returning/async functions. - */ - addAll(fns: Array>, opts?: O): Promise; - - /** - * Returns a promise that settles when the queue becomes empty. - * Can be called multiple times. Useful if you for example add - * additional items at a later time. - */ - onEmpty(): Promise; - - /** - * Returns a promise that settles when the queue becomes empty, and all - * promises have completed; queue.size === 0 && queue.pending === 0. - * The difference with .onEmpty is that .onIdle guarantees that all work - * from the queue has finished. .onEmpty merely signals that the queue is - * empty, but it could mean that some promises haven't completed yet. - */ - onIdle(): Promise; - - /** - * Start (or resume) executing enqueued tasks within concurrency limit. - * No need to call this if queue is not paused (via options.autoStart = false - * or by .pause() method.) - */ - start(): void; - - /** - * Clear the queue. - */ - clear(): void; - - /** - * Put queue execution on hold. - */ - pause(): void; -} - -declare namespace PQueue { - interface QueueAddOptions { - [key: string]: any; - } - - interface QueueClassConstructor { - new(): QueueClass; - } - - interface QueueClass { - size: number; - - enqueue(run: () => void, options?: O): void; - - dequeue(): (() => void) | undefined; - } - - interface Options { - concurrency?: number; - autoStart?: boolean; - queueClass?: QueueClassConstructor; - } - - interface DefaultAddOptions { - priority?: number; - } - - type Task = () => Promise; -} diff --git a/types/p-queue/v2/p-queue-tests.ts b/types/p-queue/v2/p-queue-tests.ts deleted file mode 100644 index fcd48c852d..0000000000 --- a/types/p-queue/v2/p-queue-tests.ts +++ /dev/null @@ -1,51 +0,0 @@ -import PQueue = require("p-queue"); - -const queue = new PQueue({ concurrency: 1 }); - -queue - .add(() => Promise.resolve("sindresorhus.com")) - .then(sindre => { - const str: string = sindre; - }); - -queue.addAll([() => Promise.resolve("oh"), () => Promise.resolve("hi")]).then(r => { - r.indexOf("h"); -}); - -Promise.resolve((): Promise => Promise.resolve("unicorn")) - .then(task => queue.add(task, { priority: 5 })) - .then(unicorn => { - const str: string = unicorn; - }); - -queue.onEmpty().then(() => {}); -queue.onIdle().then(() => {}); -queue.start(); -queue.pause(); -queue.clear(); - -let num: number; -num = queue.size; -num = queue.pending; -const paused = queue.isPaused; - -class QueueClass implements PQueue.QueueClass<{ any: string }> { - private readonly queue: Array<() => void>; - - size = 0; - - constructor() { - this.queue = []; - } - - enqueue(run: () => void, options: { any: string }) { - this.queue.push(run); - } - - dequeue() { - return this.queue.shift(); - } -} - -const queue2 = new PQueue({ queueClass: QueueClass }); -queue2.add(() => Promise.resolve(), { any: "hi" }); diff --git a/types/p-queue/v2/tsconfig.json b/types/p-queue/v2/tsconfig.json deleted file mode 100644 index 49d979aa06..0000000000 --- a/types/p-queue/v2/tsconfig.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../../", - "typeRoots": [ - "../../" - ], - "paths": { - "p-queue": [ "p-queue/v2" ] - }, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "p-queue-tests.ts" - ] -} diff --git a/types/p-queue/v2/tslint.json b/types/p-queue/v2/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/p-queue/v2/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" } From 71d5d3eb68861b24546f8d171f7c3a8ef226d778 Mon Sep 17 00:00:00 2001 From: ark120202 Date: Sun, 3 Mar 2019 01:07:11 +0500 Subject: [PATCH 270/924] Add types for wordwrap --- types/wordwrap/index.d.ts | 51 ++++++++++++++++++++++++++++++++ types/wordwrap/tsconfig.json | 23 ++++++++++++++ types/wordwrap/tslint.json | 1 + types/wordwrap/wordwrap-tests.ts | 19 ++++++++++++ 4 files changed, 94 insertions(+) create mode 100644 types/wordwrap/index.d.ts create mode 100644 types/wordwrap/tsconfig.json create mode 100644 types/wordwrap/tslint.json create mode 100644 types/wordwrap/wordwrap-tests.ts diff --git a/types/wordwrap/index.d.ts b/types/wordwrap/index.d.ts new file mode 100644 index 0000000000..63f700df13 --- /dev/null +++ b/types/wordwrap/index.d.ts @@ -0,0 +1,51 @@ +// Type definitions for wordwrap 1.0 +// Project: https://github.com/substack/node-wordwrap#readme +// Definitions by: ark120202 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +type Wrap = (text: string) => string; + +/** + * Wrap lines until column `stop`. If a word is longer than `stop` characters + * it will overflow. + */ +declare function wordwrap(stop: number, params?: { mode?: wordwrap.Mode }): Wrap; + +/** + * Pad out lines with spaces out to column `start` and then wrap until column + * `stop`. If a word is longer than `stop - start` characters it will overflow. + */ +declare function wordwrap(start: number, stop: number, params?: { mode?: wordwrap.Mode }): Wrap; + +/** + * Pad out lines with spaces out to column `start` and then wrap until column + * `stop`. If a word is longer than `stop - start` characters it will overflow. + */ +declare function wordwrap(params: wordwrap.Options): Wrap; + +declare namespace wordwrap { + interface Options { + stop: number; + start: number; + mode?: Mode; + } + + /** + * Wrap lines until column `stop`. Break up chunks longer than `stop`. + */ + function hard(stop: number): Wrap; + + /** + * Wrap lines until column `stop`. Break up chunks longer than `stop - start`. + */ + function hard(start: number, stop: number): Wrap; // tslint:disable-line:unified-signatures + + /** + * In "soft" mode, split chunks by `/(\S+\s+/` and don't break up chunks + * which are longer than `stop - start`, in "hard" mode, split chunks with + * `/\b/` and break up chunks longer than `stop - start`. + */ + type Mode = "soft" | "hard"; +} + +export = wordwrap; diff --git a/types/wordwrap/tsconfig.json b/types/wordwrap/tsconfig.json new file mode 100644 index 0000000000..5444f259f7 --- /dev/null +++ b/types/wordwrap/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "wordwrap-tests.ts" + ] +} diff --git a/types/wordwrap/tslint.json b/types/wordwrap/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/wordwrap/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/wordwrap/wordwrap-tests.ts b/types/wordwrap/wordwrap-tests.ts new file mode 100644 index 0000000000..d9661bdac0 --- /dev/null +++ b/types/wordwrap/wordwrap-tests.ts @@ -0,0 +1,19 @@ +import wordwrap = require("wordwrap"); + +// $ExpectType Wrap +wordwrap(80); + +// $ExpectType string +wordwrap(80)(""); + +// $ExpectType string +wordwrap(20, 80)(""); + +// $ExpectType string +wordwrap({ start: 20, stop: 80 })(""); + +// $ExpectType string +wordwrap(80, { mode: "hard" })(""); + +// $ExpectType string +wordwrap.hard(80)(""); From 42525f11d7536811e47362f6fa70b25e99023e7c Mon Sep 17 00:00:00 2001 From: Dimitri Benin Date: Sat, 2 Mar 2019 21:38:57 +0100 Subject: [PATCH 271/924] [p-limit] Remove types --- notNeededPackages.json | 6 +++++ types/p-limit/index.d.ts | 43 ---------------------------------- types/p-limit/p-limit-tests.ts | 23 ------------------ types/p-limit/tsconfig.json | 23 ------------------ types/p-limit/tslint.json | 1 - 5 files changed, 6 insertions(+), 90 deletions(-) delete mode 100644 types/p-limit/index.d.ts delete mode 100644 types/p-limit/p-limit-tests.ts delete mode 100644 types/p-limit/tsconfig.json delete mode 100644 types/p-limit/tslint.json diff --git a/notNeededPackages.json b/notNeededPackages.json index 4289393363..4f3620d26f 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -1146,6 +1146,12 @@ "sourceRepoURL": "http://onsen.io", "asOfVersion": "2.0.0" }, + { + "libraryName": "p-limit", + "typingsPackageName": "p-limit", + "sourceRepoURL": "https://github.com/sindresorhus/p-limit", + "asOfVersion": "2.2.0" + }, { "libraryName": "p-map", "typingsPackageName": "p-map", diff --git a/types/p-limit/index.d.ts b/types/p-limit/index.d.ts deleted file mode 100644 index de7b0a07d9..0000000000 --- a/types/p-limit/index.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -// Type definitions for p-limit 2.1 -// Project: https://github.com/sindresorhus/p-limit#readme -// Definitions by: BendingBender -// Linus UnnebĂ€ck -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 3.0 - -export = pLimit; - -/** - * Run multiple promise-returning & async functions with limited concurrency. - * @param concurrency Concurrency limit. Minimum: `1`. - * @returns A `limit` function. - */ -declare function pLimit(concurrency: number): pLimit.Limit; - -declare namespace pLimit { - interface Limit { - /** - * Returns the promise returned by calling `fn(...args)`. - * - * @param fn Promise-returning/async function. - * @param args Any arguments to pass through to `fn`. - * Support for passing arguments on to the `fn` is provided in order to be able to avoid - * creating unnecessary closures. You probably don't need this optimization unless you're - * pushing a lot of functions. - */ - ( - fn: (...args: TArgs) => PromiseLike | R, - ...args: TArgs - ): Promise; - - /** - * The number of promises that are currently running. - */ - readonly activeCount: number; - - /** - * The number of promises that are waiting to run (i.e. their internal `fn` was not called yet). - */ - readonly pendingCount: number; - } -} diff --git a/types/p-limit/p-limit-tests.ts b/types/p-limit/p-limit-tests.ts deleted file mode 100644 index 3f9fb51083..0000000000 --- a/types/p-limit/p-limit-tests.ts +++ /dev/null @@ -1,23 +0,0 @@ -import pLimit = require('p-limit'); - -const limit = pLimit(1); - -const input = [ - limit(() => Promise.resolve('foo')), - limit(() => Promise.resolve('bar')), - limit(() => Promise.resolve(undefined)), -]; - -Promise.all(input); // $ExpectType Promise<(string | undefined)[]> - -limit((a: string) => '', 'test').then(v => { - v; // $ExpectType string -}); -limit((a: string, b: number) => Promise.resolve(''), 'test', 1).then(v => { - v; // $ExpectType string -}); - -limit.activeCount; // $ExpectType number -limit.activeCount = 1; // $ExpectError -limit.pendingCount; // $ExpectType number -limit.pendingCount = 1; // $ExpectError diff --git a/types/p-limit/tsconfig.json b/types/p-limit/tsconfig.json deleted file mode 100644 index 4634bf6300..0000000000 --- a/types/p-limit/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "p-limit-tests.ts" - ] -} \ No newline at end of file diff --git a/types/p-limit/tslint.json b/types/p-limit/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/p-limit/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" } From ab4aa16e85e13003fdf5f369525ff81e4c1ec8ed Mon Sep 17 00:00:00 2001 From: alreadyExisted Date: Sat, 2 Mar 2019 22:43:58 +0200 Subject: [PATCH 272/924] #30562 Updated VictoryLegendProps --- types/victory/index.d.ts | 2008 ++++++++++++++++--------------- types/victory/victory-tests.tsx | 28 +- 2 files changed, 1036 insertions(+), 1000 deletions(-) diff --git a/types/victory/index.d.ts b/types/victory/index.d.ts index f5c67995da..b34b192a65 100644 --- a/types/victory/index.d.ts +++ b/types/victory/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Alexey Svetliakov // snerks // Krzysztof Cebula -// Vitaliy Polyanskiy +// Vitaliy Polyanskiy // James Lismore // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -16,7 +16,7 @@ declare module "victory" { /** * Single animation object to interpolate */ - export type AnimationStyle = { [key: string ]: string | number }; + export type AnimationStyle = { [key: string]: string | number }; /** * Animation styles to interpolate @@ -32,6 +32,20 @@ declare module "victory" { "expIn" | "expOut" | "expInOut" | "poly" | "polyIn" | "polyOut" | "polyInOut" | "quad" | "quadIn" | "quadOut" | "quadInOut" | "sin" | "sinIn" | "sinOut" | "sinInOut"; + /** + * @see https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html + */ + type Omit = Pick>; + + type BlockProps = { + top?: number; + bottom?: number; + left?: number; + right?: number; + }; + + type PaddingProps = number | BlockProps; + // Many victory components accept string or number or callback which returns string or number type StringOrNumberOrCallback = | string @@ -44,9 +58,9 @@ declare module "victory" { * Style interface used in components/themeing */ export interface VictoryStyleInterface { - parent?: VictoryStyleObject; - data?: VictoryStyleObject; - labels?: VictoryStyleObject; + parent?: VictoryStyleObject; + data?: VictoryStyleObject; + labels?: VictoryStyleObject; } export interface VictoryAnimationProps { @@ -774,8 +788,10 @@ declare module "victory" { */ eventHandlers: { [key: string]: { - (event: React.SyntheticEvent): EventCallbackInterface } | - { (event: React.SyntheticEvent): EventCallbackInterface[] + (event: React.SyntheticEvent): EventCallbackInterface + } | + { + (event: React.SyntheticEvent): EventCallbackInterface[] } }; } @@ -791,8 +807,8 @@ declare module "victory" { * Domain padding */ type DomainPaddingPropType = number | { - x?: number | [ number, number]; - y?: number | [ number, number]; + x?: number | [number, number]; + y?: number | [number, number]; }; /** @@ -858,12 +874,7 @@ declare module "victory" { * and right. * @default 50 */ - padding?: number | { - top?: number; - bottom?: number; - left?: number; - right?: number; - }; + padding?: PaddingProps; /** * The scale prop determines which scales your chart should use. This prop can be * given as a string specifying a supported scale ("linear", "time", "log", "sqrt"), @@ -1030,66 +1041,66 @@ declare module "victory" { } export interface VictoryAreaProps - extends VictoryCommonProps, - VictoryDatableProps, - VictorySingleLabableProps { - /** - * The event prop take an array of event objects. Event objects are composed of - * a target, an eventKey, and eventHandlers. Targets may be any valid style namespace - * for a given component, so "data" and "labels" are all valid targets for VictoryArea events. - * Since VictoryArea only renders a single element, the eventKey property is not used. - * The eventHandlers object should be given as an object whose keys are standard - * event names (i.e. onClick) and whose values are event callbacks. The return value - * of an event handler is used to modify elemnts. The return value should be given - * as an object or an array of objects with optional target and eventKey keys, - * and a mutation key whose value is a function. The target and eventKey keys - * will default to those corresponding to the element the event handler was attached to. - * The mutation function will be called with the calculated props for the individual selected - * element (i.e. an area), and the object returned from the mutation function - * will override the props of the selected element via object assignment. - * @example - * events={[ - * { - * target: "data", - * eventHandlers: { - * onClick: () => { - * return [ - * { - * mutation: (props) => { - * return {style: merge({}, props.style, {fill: "orange"})}; - * } - * }, { - * target: "labels", - * mutation: () => { - * return {text: "hey"}; - * } - * } - * ]; - * } - * } - * } - * ]} - */ - events?: EventPropTypeInterface<"data" | "labels" | "parent", "all">[]; - /** - * The interpolation prop determines how data points should be connected when plotting a line - * @default "linear" - */ - interpolation?: InterpolationPropType; - /** - * The samples prop specifies how many individual points to plot when plotting - * y as a function of x. Samples is ignored if x props are provided instead. - * @default 50 - */ - samples?: number; - /** - * The style prop specifies styles for your VictoryArea. Any valid inline style properties - * will be applied. Height, width, and padding should be specified via the height, - * width, and padding props, as they are used to calculate the alignment of - * components within chart. - * @example {data: {fill: "red"}, labels: {fontSize: 12}} - */ - style?: VictoryStyleInterface; + extends VictoryCommonProps, + VictoryDatableProps, + VictorySingleLabableProps { + /** + * The event prop take an array of event objects. Event objects are composed of + * a target, an eventKey, and eventHandlers. Targets may be any valid style namespace + * for a given component, so "data" and "labels" are all valid targets for VictoryArea events. + * Since VictoryArea only renders a single element, the eventKey property is not used. + * The eventHandlers object should be given as an object whose keys are standard + * event names (i.e. onClick) and whose values are event callbacks. The return value + * of an event handler is used to modify elemnts. The return value should be given + * as an object or an array of objects with optional target and eventKey keys, + * and a mutation key whose value is a function. The target and eventKey keys + * will default to those corresponding to the element the event handler was attached to. + * The mutation function will be called with the calculated props for the individual selected + * element (i.e. an area), and the object returned from the mutation function + * will override the props of the selected element via object assignment. + * @example + * events={[ + * { + * target: "data", + * eventHandlers: { + * onClick: () => { + * return [ + * { + * mutation: (props) => { + * return {style: merge({}, props.style, {fill: "orange"})}; + * } + * }, { + * target: "labels", + * mutation: () => { + * return {text: "hey"}; + * } + * } + * ]; + * } + * } + * } + * ]} + */ + events?: EventPropTypeInterface<"data" | "labels" | "parent", "all">[]; + /** + * The interpolation prop determines how data points should be connected when plotting a line + * @default "linear" + */ + interpolation?: InterpolationPropType; + /** + * The samples prop specifies how many individual points to plot when plotting + * y as a function of x. Samples is ignored if x props are provided instead. + * @default 50 + */ + samples?: number; + /** + * The style prop specifies styles for your VictoryArea. Any valid inline style properties + * will be applied. Height, width, and padding should be specified via the height, + * width, and padding props, as they are used to calculate the alignment of + * components within chart. + * @example {data: {fill: "red"}, labels: {fontSize: 12}} + */ + style?: VictoryStyleInterface; } /** @@ -1341,13 +1352,13 @@ declare module "victory" { */ cornerRadius?: NumberOrCallback | { - top?: number | (NumberOrCallback), - topLeft?: number | (NumberOrCallback), - topRight?: number | (NumberOrCallback), - bottom?: number | (NumberOrCallback), - bottomLeft?: number | (NumberOrCallback), - bottomRight?: number | (NumberOrCallback) - }; + top?: number | (NumberOrCallback), + topLeft?: number | (NumberOrCallback), + topRight?: number | (NumberOrCallback), + bottom?: number | (NumberOrCallback), + bottomLeft?: number | (NumberOrCallback), + bottomRight?: number | (NumberOrCallback) + }; /** * The event prop take an array of event objects. Event objects are composed of * a target, an eventKey, and eventHandlers. Targets may be any valid style namespace @@ -1418,917 +1429,924 @@ declare module "victory" { */ export class VictoryBar extends React.Component {} - export interface VictoryBoxPlotStyleInterface - extends VictoryStyleInterface { - max?: VictoryStyleObject; - maxLabels?: VictoryStyleObject; - min?: VictoryStyleObject; - minLabels?: VictoryStyleObject; - median?: VictoryStyleObject; - medianLabels?: VictoryStyleObject; - q1?: VictoryStyleObject; - q1Labels?: VictoryStyleObject; - q3?: VictoryStyleObject; - q3Labels?: VictoryStyleObject; - } - - export interface VictoryBoxPlotProps - extends VictoryCommonProps, - VictoryDatableProps { - /** - * The boxWidth prop specifies how wide each box should be. If the whiskerWidth - * prop is not set, this prop will also determine the width of the whisker crosshair. - */ - boxWidth?: number; - /** - * The domain prop describes the range of values your chart will include. This prop can be - * given as a array of the minimum and maximum expected values for your chart, - * or as an object that specifies separate arrays for x and y. - * If this prop is not provided, a domain will be calculated from data, or other - * available information. - * @example: [-1, 1], {x: [0, 100], y: [0, 1]} - */ - domain?: DomainPropType; - /** - * The domainPadding prop specifies a number of pixels of padding to add to the - * beginning and end of a domain. This prop is useful for explicitly spacing ticks farther - * from the origin to prevent crowding. This prop should be given as an object with - * numbers specified for x and y. - */ - domainPadding?: DomainPaddingPropType; - /** - * The event prop take an array of event objects. Event objects are composed of - * a childName, target, eventKey, and eventHandlers. Targets may be any valid style namespace - * for a given component, (i.e. "data" and "labels"). The childName will refer to an - * individual child of VictoryChart, either by its name prop, or by index. The eventKey - * may optionally be used to select a single element by index or eventKey rather than - * an entire set. The eventHandlers object should be given as an object whose keys are standard - * event names (i.e. onClick) and whose values are event callbacks. The return value - * of an event handler is used to modify elemnts. The return value should be given - * as an object or an array of objects with optional target and eventKey and childName keys, - * and a mutation key whose value is a function. The target and eventKey and childName keys - * will default to those corresponding to the element the event handler was attached to. - * The mutation function will be called with the calculated props for the individual selected - * element (i.e. a single bar), and the object returned from the mutation function - * will override the props of the selected element via object assignment. - * @examples - * events={[ - * { - * target: "data", - * childName: "firstBar", - * eventHandlers: { - * onClick: () => { - * return [ - * { - * childName: "secondBar", - * mutation: (props) => { - * return {style: merge({}, props.style, {fill: "orange"})}; - * } - * }, { - * childName: "secondBar", - * target: "labels", - * mutation: () => { - * return {text: "hey"}; - * } - * } - * ]; - * } - * } - * } - * ]} - */ - events?: EventPropTypeInterface[]; - /** - * Similar to data accessor props `x` and `y`, this prop may be used to functionally - * assign eventKeys to data - */ - eventKey?: StringOrNumberOrCallback; - /** - * The horizontal prop determines whether the bars will be laid vertically or - * horizontally. The bars will be vertical if this prop is false or unspecified, - * or horizontal if the prop is set to true. - */ - horizontal?: boolean; - /** - * The labelOrientation prop determines where labels are placed relative to their - * corresponding data. If this prop is not set, it will be set to “top” for - * horizontal charts, and “right” for vertical charts. - */ - labelOrientation?: "top" | "bottom" | "left" | "right"; - /** - * When the boolean labels prop is set to true, the values for min, max, median, - * q1, and q3 will be displayed for each box. For more granular label control, use - * the individual minLabels, maxLabels, medianLabels, q1Labels, and q3Labels props. - */ - labels?: boolean; - /** - * Use the max data accessor prop to define the max value of a box plot. - */ - max?: StringOrNumberOrCallback; - /** - * Use the median data accessor prop to define the median value of a box plot. - */ - median?: StringOrNumberOrCallback; - /** - * Use the min data accessor prop to define the min value of a box plot. - */ - min?: StringOrNumberOrCallback; - /** - * Use the q1 data accessor prop to define the q1 value of a box plot. - */ - q1?: StringOrNumberOrCallback; - /** - * Use the q3 data accessor prop to define the q1 value of a box plot. - */ - q3?: StringOrNumberOrCallback; - /** - * The style prop defines the style of the component. The style prop - * should be given as an object with styles defined for parent, max, - * maxLabels, min, minLabels,median, medianLabels,q1, q1Labels,q3, - * q3Labels. Any valid svg styles are supported, but width, height, a - * nd padding should be specified via props as they determine relative - * layout for components in VictoryChart. Functional styles may be - * defined for style properties, and they will be evaluated with each datum. - */ - style?: VictoryBoxPlotStyleInterface; - /** - * The whiskerWidth prop specifies how wide each whisker crosshair should be. If the - * whiskerWidth prop is not set, the width of the whisker crosshair will match - * the width of the box. - */ - whiskerWidth?: number; - } - - /** - * VictoryBoxPlot renders a box plot to describe the distribution of a set of data. Data for - * VictoryBoxPlot may be given with summary statistics pre-calculated (min, median, max, q1, q3), - * or as an array of raw data. VictoryBoxPlot can be composed with VictoryChart to create box plot charts. - */ - export class VictoryBoxPlot extends React.Component< - VictoryBoxPlotProps, - any - > {} - - export interface VictoryChartProps extends VictoryCommonProps { - /** - * The domain prop describes the range of values your chart will include. This prop can be - * given as a array of the minimum and maximum expected values for your chart, - * or as an object that specifies separate arrays for x and y. - * If this prop is not provided, a domain will be calculated from data, or other - * available information. - * @example: [-1, 1], {x: [0, 100], y: [0, 1]} - */ - domain?: DomainPropType; - /** - * The domainPadding prop specifies a number of pixels of padding to add to the - * beginning and end of a domain. This prop is useful for explicitly spacing ticks farther - * from the origin to prevent crowding. This prop should be given as an object with - * numbers specified for x and y. - */ - domainPadding?: DomainPaddingPropType; - /** - * The event prop take an array of event objects. Event objects are composed of - * a childName, target, eventKey, and eventHandlers. Targets may be any valid style namespace - * for a given component, (i.e. "data" and "labels"). The childName will refer to an - * individual child of VictoryChart, either by its name prop, or by index. The eventKey - * may optionally be used to select a single element by index or eventKey rather than - * an entire set. The eventHandlers object should be given as an object whose keys are standard - * event names (i.e. onClick) and whose values are event callbacks. The return value - * of an event handler is used to modify elemnts. The return value should be given - * as an object or an array of objects with optional target and eventKey and childName keys, - * and a mutation key whose value is a function. The target and eventKey and childName keys - * will default to those corresponding to the element the event handler was attached to. - * The mutation function will be called with the calculated props for the individual selected - * element (i.e. a single bar), and the object returned from the mutation function - * will override the props of the selected element via object assignment. - * @examples - * events={[ - * { - * target: "data", - * childName: "firstBar", - * eventHandlers: { - * onClick: () => { - * return [ - * { - * childName: "secondBar", - * mutation: (props) => { - * return {style: merge({}, props.style, {fill: "orange"})}; - * } - * }, { - * childName: "secondBar", - * target: "labels", - * mutation: () => { - * return {text: "hey"}; - * } - * } - * ]; - * } - * } - * } - * ]} - */ - events?: EventPropTypeInterface[]; - /** - * Similar to data accessor props `x` and `y`, this prop may be used to functionally - * assign eventKeys to data - */ - eventKey?: StringOrNumberOrCallback; - /** - * The style prop specifies styles for your chart. Any valid inline style properties - * will be applied. Height, width, and padding should be specified via the height, - * width, and padding props, as they are used to calculate the alignment of - * components within chart. - * @example {border: "1px solid #ccc", margin: "2%", maxWidth: "40%"} - */ - style?: Pick; - } - - /** - * A flexible charting component for React. - * VictoryChart composes other Victory components into reusable charts. - * Acting as a coordinator rather than a stand-alone component, VictoryChart reconciles props such as domain and scale for child components, - * and provides a set of sensible defaults. This component works with: - * - VictoryAxis - * - VictoryLine - * - VictoryScatter - * - VictoryBar - */ - export class VictoryChart extends React.Component {} - - export interface VictoryGroupProps extends VictoryCommonProps, VictoryMultiLabeableProps { - /** - * The categories prop specifies how categorical data for a chart should be ordered. - * This prop should be given as an array of string values, or an object with - * these values for x and y. When categories are not given as an object - * When this prop is set on a wrapper component, it will dictate the categories of - * its the children. If this prop is not set, any categories on child component - * or categorical data, will be merged to create a shared set of categories. - * @example ["dogs", "cats", "mice"] - */ - categories?: CategoryPropType; - /** - * The colorScale prop is an optional prop that defines the color scale the chart's bars - * will be created on. This prop should be given as an array of CSS colors, or as a string - * corresponding to one of the built in color scales. VictoryBar will automatically assign - * values from this color scale to the bars unless colors are explicitly provided in the - * `dataAttributes` prop. - */ - colorScale?: ColorScalePropType; - /** - * The domain prop describes the range of values your chart will include. This prop can be - * given as a array of the minimum and maximum expected values for your chart, - * or as an object that specifies separate arrays for x and y. - * If this prop is not provided, a domain will be calculated from data, or other - * available information. - * @examples: [-1, 1], {x: [0, 100], y: [0, 1]} - */ - domain?: DomainPropType; - /** - * The domainPadding prop specifies a number of pixels of padding to add to the - * beginning and end of a domain. This prop is useful for explicitly spacing ticks farther - * from the origin to prevent crowding. This prop should be given as an object with - * numbers specified for x and y. - */ - domainPadding?: DomainPaddingPropType; - /** - * The event prop take an array of event objects. Event objects are composed of - * a childName, target, eventKey, and eventHandlers. Targets may be any valid style namespace - * for a given component, (i.e. "data" and "labels"). The childName will refer to an - * individual child of VictoryGroup, either by its name prop, or by index. The eventKey - * may optionally be used to select a single element by index or eventKey rather than - * an entire set. The eventHandlers object should be given as an object whose keys are standard - * event names (i.e. onClick) and whose values are event callbacks. The return value - * of an event handler is used to modify elemnts. The return value should be given - * as an object or an array of objects with optional target and eventKey and childName keys, - * and a mutation key whose value is a function. The target and eventKey and childName keys - * will default to those corresponding to the element the event handler was attached to. - * The mutation function will be called with the calculated props for the individual selected - * element (i.e. a single bar), and the object returned from the mutation function - * will override the props of the selected element via object assignment. - * @examples - * events={[ - * { - * target: "data", - * childName: "firstBar", - * eventHandlers: { - * onClick: () => { - * return [ - * { - * childName: "secondBar", - * mutation: (props) => { - * return {style: merge({}, props.style, {fill: "orange"})}; - * } - * }, { - * childName: "secondBar", - * target: "labels", - * mutation: () => { - * return {text: "hey"}; - * } - * } - * ]; - * } - * } - * } - * ]} - */ - events?: EventPropTypeInterface<"data" | "labels" | "parent", StringOrNumberOrCallback>[]; - /** - * Similar to data accessor props `x` and `y`, this prop may be used to functionally - * assign eventKeys to data - */ - eventKey?: StringOrNumberOrCallback; - /** - * The horizontal prop determines whether the bars will be laid vertically or - * horizontally. The bars will be vertical if this prop is false or unspecified, - * or horizontal if the prop is set to true. - */ - horizontal?: boolean; - /** - * The offset prop determines the number of pixels each element in a group should - * be offset from its original position of the on the independent axis. In the - * case of groups of bars, this number should be equal to the width of the bar - * plus the desired spacing between bars. - */ - offset?: number; - /** - * The style prop specifies styles for your grouped chart. These styles will be - * applied to all grouped children - */ - style?: VictoryStyleInterface; - } - - export class VictoryGroup extends React.Component {} - - export interface VictoryLineProps extends VictoryCommonProps, VictoryDatableProps, VictorySingleLabableProps { - /** - * The event prop take an array of event objects. Event objects are composed of - * a target, an eventKey, and eventHandlers. Targets may be any valid style namespace - * for a given component, so "data" and "labels" are all valid targets for VictoryLine events. - * Since VictoryLine only renders a single element, the eventKey property is not used. - * The eventHandlers object should be given as an object whose keys are standard - * event names (i.e. onClick) and whose values are event callbacks. The return value - * of an event handler is used to modify elemnts. The return value should be given - * as an object or an array of objects with optional target and eventKey keys, - * and a mutation key whose value is a function. The target and eventKey keys - * will default to those corresponding to the element the event handler was attached to. - * The mutation function will be called with the calculated props for the individual selected - * element (i.e. a line), and the object returned from the mutation function - * will override the props of the selected element via object assignment. - * @examples - * events={[ - * { - * target: "data", - * eventHandlers: { - * onClick: () => { - * return [ - * { - * mutation: (props) => { - * return {style: merge({}, props.style, {stroke: "orange"})}; - * } - * }, { - * target: "labels", - * mutation: () => { - * return {text: "hey"}; - * } - * } - * ]; - * } - * } - * } - * ]} - */ - events?: EventPropTypeInterface<"data" | "labels" | "parent", number | string>[]; - /** - * The interpolation prop determines how data points should be connected - * when plotting a line - */ - interpolation?: InterpolationPropType; - /** - * The samples prop specifies how many individual points to plot when plotting - * y as a function of x. Samples is ignored if x props are provided instead. - */ - samples?: number; - /** - * The labels prop defines the labels that will appear above each point. - * This prop should be given as an array or as a function of data. - */ - labels?: string[]|number[]|Function; - /** - * Use the sortKey prop to indicate how data should be sorted. This prop - * is given directly to the lodash sortBy function to be executed on the - * final dataset. - */ - sortKey?: string|string[]|Function; - /** - * The style prop specifies styles for your VictoryLine. Any valid inline style properties - * will be applied. Height, width, and padding should be specified via the height, - * width, and padding props, as they are used to calculate the alignment of - * components within chart. in addition to normal style properties, angle and verticalAnchor - * may also be specified via the labels object, and they will be passed as props to - * VictoryLabel, or any custom labelComponent. - * @examples{data: {stroke: "red"}, labels: {fontSize: 12}} - */ - style?: VictoryStyleInterface; - } - - /** - * VictoryLine creates a line based on data. VictoryLine is a composable component, so it does not include an axis. - * Check out VictoryChart for easy to use line charts and more. - */ - export class VictoryLine extends React.Component {} - - export interface VictoryLegendProps extends VictoryCommonProps, VictoryDatableProps, VictorySingleLabableProps { - /** - * The colorScale prop defines a color scale to be applied to each data - * symbol in VictoryLegend. This prop should be given as an array of CSS - * colors, or as a string corresponding to one of the built in color - * scales: "grayscale", "qualitative", "heatmap", "warm", "cool", "red", - * "green", "blue". VictoryLegend will assign a color to each symbol by - * index, unless they are explicitly specified in the data object. - * Colors will repeat when there are more symbols than colors in the - * provided colorScale. - */ - colorScale?: ColorScalePropType; - /** - * The style prop defines the style of the VictoryLegend component. - * The style prop should be given as an object with styles defined for data, labels and - * parent. Any valid svg styles are supported, but width, height, and - * padding should be specified via props as they determine relative - * layout for components in VictoryLegend. - */ - style?: VictoryStyleInterface; - /** - * The containerComponent prop takes a component instance which will be - * used to create a container element for standalone legends. The new - * element created from the passed containerComponent will be provided - * with the following props: height, width, children (the legend itself) - * and style. If a containerComponent is not provided, the default - * VictoryContainer component will be used. VictoryContainer supports - * title and desc props, which are intended to add accessibility to - * Victory components. The more descriptive these props are, the more - * accessible your data will be for people using screen readers. These - * props may be set by passing them directly to the supplied component. - * By default, VictoryContainer renders a responsive svg using the - * viewBox attribute. To render a static container, set - * responsive={false} directly on the instance of VictoryContainer - * supplied via the containerComponent prop. VictoryContainer also - * renders a Portal element that may be used in conjunction with - * VictoryPortal to force components to render above other children. - * @default - */ - containerComponent?: React.ReactElement; - /** - * Specify data via the data prop. VictoryLegend expects data as an - * array of objects with name (required), symbol, and labels properties. - * The data prop must be given as an array. - */ - data?: Array<{ - name?: string; - symbol?: { - fill?: string; - type?: string; - }; - }>; - /** - * The itemsPerRow prop determines how many items to render in each row - * of a horizontal legend, or in each column of a vertical legend. This - * prop should be given as an integer. When this prop is not given, - * legend items will be rendered in a single row or column. - */ - itemsPerRow?: number; - /** - * The dataComponent prop takes a component instance which will be - * responsible for rendering a data element used to associate a symbol - * or color with each data series. The new element created from the - * passed dataComponent will be provided with the following properties - * calculated by VictoryLegend: x, y, size, style, and symbol. Any of - * these props may be overridden by passing in props to the supplied - * component, or modified or ignored within the custom component itself. - * If a dataComponent is not provided, VictoryLegend will use its - * default Point component. - */ - dataComponent?: React.ReactElement; - /** - * The groupComponent prop takes an entire component which will be used to - * create group elements for use within container elements. This prop defaults - * to a tag on web, and a react-native-svg tag on mobile - * @default - */ - groupComponent?: React.ReactElement; - /** - * The gutter prop defines the number of pixels between legend rows or - * columns, depending on orientation. When orientation is horizontal, - * gutters are between columns. When orientation is vertical, gutters - * are the space between rows. - */ - gutter?: number; - /** - * The labelComponent prop takes a component instance which will be used - * to render each legend label. The new element created from the passed - * labelComponent will be supplied with the following properties: x, y, - * style, and text. Any of these props may be overridden by passing in - * props to the supplied component, or modified or ignored within the - * custom component itself. If labelComponent is omitted, a new - * VictoryLabel will be created with the props described above. - */ - labelComponent?: React.ReactElement; - /** - * The orientation prop takes a string that defines whether legend data - * are displayed in a row or column. When orientation is "horizontal", - * legend items will be displayed in a single row. When orientation is - * "vertical", legend items will be displayed in a single column. Line - * and text-wrapping is not currently supported, so "vertical" - * orientation is both the default setting and recommended for - * displaying many series of data. - * @default 'vertical' - */ - orientation?: 'horizontal'|'vertical'; - /** - * The padding prop specifies the amount of padding in pixels between - * the edge of the legend and any rendered child components. This prop - * can be given as a number or as an object with padding specified for - * top, bottom, left and right. As with width and height, the absolute - * padding will depend on whether the component is rendered in a - * responsive container. When a component is nested within - * VictoryLegend, setting padding on the child component will have no - * effect. - */ - padding?: number | { - top?: number; - bottom?: number; - left?: number; - right?: number; - }; - /** - * The standalone props specifies whether the component should be - * rendered in an independent element or in a tag. This prop - * defaults to true, and renders an svg. - */ - standalone?: boolean; - /** - * The symbolSpacer prop defines the number of pixels between data - * components and label components. - */ - symbolSpacer?: number; - /** - * The width and height props define the width and height of the legend. - * These props may be given as positive numbers or functions of data. If - * these props are not set, width and height will be determined based on - * an approximate text size calculated from the text and style props - * provided to VictoryLegend. - */ - width?: number; - height?: number; - /** - * The x and y props define the base position of the legend element. - */ - x?: number; - y?: number; - } - - /** - * VictoryLegend renders a chart legend component. - */ - export class VictoryLegend extends React.Component {} - - type ScatterSymbolType = "circle" | "diamond" | "plus" | "square" | "star" | "triangleDown" | "triangleUp"; - - export interface VictoryScatterProps extends VictoryCommonProps, VictoryDatableProps, VictoryMultiLabeableProps { - /** - * The bubbleProperty prop indicates which property of the data object should be used - * to scale data points in a bubble chart - */ - bubbleProperty?: string; - /** - * The event prop take an array of event objects. Event objects are composed of - * a target, an eventKey, and eventHandlers. Targets may be any valid style namespace - * for a given component, so "data" and "labels" are all valid targets for VictoryScatter - * events. The eventKey may optionally be used to select a single element by index rather than - * an entire set. The eventHandlers object should be given as an object whose keys are standard - * event names (i.e. onClick) and whose values are event callbacks. The return value - * of an event handler is used to modify elemnts. The return value should be given - * as an object or an array of objects with optional target and eventKey keys, - * and a mutation key whose value is a function. The target and eventKey keys - * will default to those corresponding to the element the event handler was attached to. - * The mutation function will be called with the calculated props for the individual selected - * element (i.e. a single bar), and the object returned from the mutation function - * will override the props of the selected element via object assignment. - * @examples - * events={[ - * { - * target: "data", - * eventKey: "thisOne", - * eventHandlers: { - * onClick: () => { - * return [ - * { - * eventKey: "theOtherOne", - * mutation: (props) => { - * return {style: merge({}, props.style, {fill: "orange"})}; - * } - * }, { - * eventKey: "theOtherOne", - * target: "labels", - * mutation: () => { - * return {text: "hey"}; - * } - * } - * ]; - * } - * } - * } - * ]} - */ - events?: EventPropTypeInterface<"data" | "labels" | "parent", StringOrNumberOrCallback>[]; - /** - * Similar to data accessor props `x` and `y`, this prop may be used to functionally - * assign eventKeys to data - */ - eventKey?: StringOrNumberOrCallback; - /** - * The maxBubbleSize prop sets an upper limit for scaling data points in a bubble chart - */ - maxBubbleSize?: number; - /** - * The samples prop specifies how many individual points to plot when plotting - * y as a function of x. Samples is ignored if x props are provided instead. - */ - samples?: number; - /** - * The size prop determines how to scale each data point - */ - size?: number | { (data: any): number }; - /** - * The style prop specifies styles for your VictoryScatter. Any valid inline style properties - * will be applied. Height, width, and padding should be specified via the height, - * width, and padding props, as they are used to calculate the alignment of - * components within chart. In addition to normal style properties, angle and verticalAnchor - * may also be specified via the labels object, and they will be passed as props to - * VictoryLabel, or any custom labelComponent. - * @example {data: {fill: "red"}, labels: {fontSize: 12}} - */ - style?: VictoryStyleInterface; - /** - * The symbol prop determines which symbol should be drawn to represent data points. - */ - symbol?: ScatterSymbolType | { (data: any): ScatterSymbolType }; - } - - /** - * VictoryScatter creates a scatter of points from data. VictoryScatter is a composable component, so it does not include an axis. - * Check out VictoryChart for easy to use scatter plots and more. - */ - export class VictoryScatter extends React.Component {} - - export interface VictoryStackProps extends VictoryCommonProps, VictoryMultiLabeableProps { - /** - * The categories prop specifies how categorical data for a chart should be ordered. - * This prop should be given as an array of string values, or an object with - * these values for x and y. When categories are not given as an object - * When this prop is set on a wrapper component, it will dictate the categories of - * its the children. If this prop is not set, any categories on child component - * or catigorical data, will be merged to create a shared set of categories. - * @example ["dogs", "cats", "mice"] - */ - categories?: CategoryPropType; - /** - * The colorScale prop is an optional prop that defines the color scale the chart's bars - * will be created on. This prop should be given as an array of CSS colors, or as a string - * corresponding to one of the built in color scales. VictoryBar will automatically assign - * values from this color scale to the bars unless colors are explicitly provided in the - * `dataAttributes` prop. - */ - colorScale?: ColorScalePropType; - /** - * The domain prop describes the range of values your chart will include. This prop can be - * given as a array of the minimum and maximum expected values for your chart, - * or as an object that specifies separate arrays for x and y. - * If this prop is not provided, a domain will be calculated from data, or other - * available information. - * @example: [-1, 1], {x: [0, 100], y: [0, 1]} - */ - domain?: DomainPropType; - /** - * The domainPadding prop specifies a number of pixels of padding to add to the - * beginning and end of a domain. This prop is useful for explicitly spacing ticks farther - * from the origin to prevent crowding. This prop should be given as an object with - * numbers specified for x and y. - */ - domainPadding?: DomainPaddingPropType; - /** - * The event prop take an array of event objects. Event objects are composed of - * a childName, target, eventKey, and eventHandlers. Targets may be any valid style namespace - * for a given component, (i.e. "data" and "labels"). The childName will refer to an - * individual child of VictoryStack, either by its name prop, or by index. The eventKey - * may optionally be used to select a single element by index or eventKey rather than - * an entire set. The eventHandlers object should be given as an object whose keys are standard - * event names (i.e. onClick) and whose values are event callbacks. The return value - * of an event handler is used to modify elemnts. The return value should be given - * as an object or an array of objects with optional target and eventKey and childName keys, - * and a mutation key whose value is a function. The target and eventKey and childName keys - * will default to those corresponding to the element the event handler was attached to. - * The mutation function will be called with the calculated props for the individual selected - * element (i.e. a single bar), and the object returned from the mutation function - * will override the props of the selected element via object assignment. - * @examples - * events={[ - * { - * target: "data", - * childName: "firstBar", - * eventHandlers: { - * onClick: () => { - * return [ - * { - * childName: "secondBar", - * mutation: (props) => { - * return {style: merge({}, props.style, {fill: "orange"})}; - * } - * }, { - * childName: "secondBar", - * target: "labels", - * mutation: () => { - * return {text: "hey"}; - * } - * } - * ]; - * } - * } - * } - * ]} - */ - events?: EventPropTypeInterface<"data" | "labels" | "parent", StringOrNumberOrCallback>[]; - /** - * Similar to data accessor props `x` and `y`, this prop may be used to functionally - * assign eventKeys to data - */ - eventKey?: StringOrNumberOrCallback; - /** - * The horizontal prop determines whether the bars will be laid vertically or - * horizontally. The bars will be vertical if this prop is false or unspecified, - * or horizontal if the prop is set to true. - */ - horizontal?: boolean; - /** - * The style prop specifies styles for your grouped chart. These styles will be - * applied to all grouped children - */ - style?: VictoryStyleInterface; - /** - * The xOffset prop is used for grouping stacks of bars. This prop will be set - * by the VictoryGroup component wrapper, or can be set manually. - */ - xOffset?: number; - } - - export class VictoryStack extends React.Component {} - - export interface VictoryPieProps extends VictoryCommonProps, VictoryMultiLabeableProps { - /** - * The colorScale prop is an optional prop that defines the color scale the pie - * will be created on. This prop should be given as an array of CSS colors, or as a string - * corresponding to one of the built in color scales. VictoryPie will automatically assign - * values from this color scale to the pie slices unless colors are explicitly provided in the - * data object - */ - colorScale?: ColorScalePropType; - /** - * The data prop specifies the data to be plotted, - * where data X-value is the slice label (string or number), - * and Y-value is the corresponding number value represented by the slice - * Data should be in the form of an array of data points. - * Each data point may be any format you wish (depending on the `x` and `y` accessor props), - * but by default, an object with x and y properties is expected. - * @example [{x: 1, y: 2}, {x: 2, y: 3}], [[1, 2], [2, 3]], - * [[{x: "a", y: 1}, {x: "b", y: 2}], [{x: "a", y: 2}, {x: "b", y: 3}]] - */ - data?: any[]; - /** - * The dataComponent prop takes an entire, HTML-complete data component which will be used to - * create slices for each datum in the pie chart. The new element created from the passed - * dataComponent will have the property datum set by the pie chart for the point it renders; - * properties style and pathFunction calculated by VictoryPie; an index property set - * corresponding to the location of the datum in the data provided to the pie; events bound to - * the VictoryPie; and the d3 compatible slice object. - * If a dataComponent is not provided, VictoryPie's Slice component will be used. - */ - dataComponent?: React.ReactElement; - /** - * The labelRadius prop defines the radius of the arc that will be used for positioning each slice label. - * If this prop is not set, the label radius will default to the radius of the pie + label padding. - */ - labelRadius?: number; - /** - * The overall end angle of the pie in degrees. This prop is used in conjunction with - * startAngle to create a pie that spans only a segment of a circle. - */ - endAngle?: number; - /** - * The event prop takes an array of event objects. Event objects are composed of - * a target, an eventKey, and eventHandlers. Targets may be any valid style namespace - * for a given component, so "data" and "labels" are all valid targets for VictoryPie - * events. The eventKey may optionally be used to select a single element by index rather than - * an entire set. The eventHandlers object should be given as an object whose keys are standard - * event names (i.e. onClick) and whose values are event callbacks. The return value - * of an event handler is used to modify elemnts. The return value should be given - * as an object or an array of objects with optional target and eventKey keys, - * and a mutation key whose value is a function. The target and eventKey keys - * will default to those corresponding to the element the event handler was attached to. - * The mutation function will be called with the calculated props for the individual selected - * element (i.e. a single bar), and the object returned from the mutation function - * will override the props of the selected element via object assignment. - * @examples - * events={[ - * { - * target: "data", - * eventKey: 1, - * eventHandlers: { - * onClick: () => { - * return [ - * { - * eventKey: 2, - * mutation: (props) => { - * return {style: merge({}, props.style, {fill: "orange"})}; - * } - * }, { - * eventKey: 2, - * target: "labels", - * mutation: () => { - * return {text: "hey"}; - * } - * } - * ]; - * } - * } - * } - * ]} - */ - events?: EventPropTypeInterface<"data" | "labels" | "parent", StringOrNumberOrCallback | string[] | number[]>[]; - /** - * Similar to data accessor props `x` and `y`, this prop may be used to functionally - * assign eventKeys to data - */ - eventKey?: StringOrNumberOrCallback; - /** - * Specifies the radius of the chart. If this property is not provided it is computed - * from width, height, and padding props - * - */ - radius?: number; - /** - * When creating a donut chart, this prop determines the number of pixels between - * the center of the chart and the inner edge of a donut. When this prop is set to zero - * a regular pie chart is rendered. - */ - innerRadius?: number; - /** - * Set the cornerRadius for every dataComponent (Slice by default) within VictoryPie - */ - cornerRadius?: number; - /** - * The padAngle prop determines the amount of separation between adjacent data slices - * in number of degrees - */ - padAngle?: number; - /** - * The overall start angle of the pie in degrees. This prop is used in conjunction with - * endAngle to create a pie that spans only a segment of a circle. - */ - startAngle?: number; - /** - * The style prop specifies styles for your pie. VictoryPie relies on Radium, - * so valid Radium style objects should work for this prop. Height, width, and - * padding should be specified via the height, width, and padding props. - * @example {data: {stroke: "black"}, label: {fontSize: 10}} - */ - style?: VictoryStyleInterface; - /** - * The x prop specifies how to access the X value of each data point. - * If given as a function, it will be run on each data point, and returned value will be used. - * If given as an integer, it will be used as an array index for array-type data points. - * If given as a string, it will be used as a property key for object-type data points. - * If given as an array of strings, or a string containing dots or brackets, - * it will be used as a nested object property path (for details see Lodash docs for _.get). - * If `null` or `undefined`, the data value will be used as is (identity function/pass-through). - * @example 0, 'x', 'x.value.nested.1.thing', 'x[2].also.nested', null, d => Math.sin(d) - */ - x?: DataGetterPropType; - /** - * The y prop specifies how to access the Y value of each data point. - * If given as a function, it will be run on each data point, and returned value will be used. - * If given as an integer, it will be used as an array index for array-type data points. - * If given as a string, it will be used as a property key for object-type data points. - * If given as an array of strings, or a string containing dots or brackets, - * it will be used as a nested object property path (for details see Lodash docs for _.get). - * If `null` or `undefined`, the data value will be used as is (identity function/pass-through). - * @example 0, 'y', 'y.value.nested.1.thing', 'y[2].also.nested', null, d => Math.sin(d) - */ - y?: DataGetterPropType; - } - - /** - * victory-pie draws an SVG pie or donut chart with React. - * Styles and data can be customized by passing in your own values as properties to the component. - * Data changes are animated with VictoryAnimation. - */ - export class VictoryPie extends React.Component {} + export interface VictoryBoxPlotStyleInterface extends VictoryStyleInterface { + max?: VictoryStyleObject; + maxLabels?: VictoryStyleObject; + min?: VictoryStyleObject; + minLabels?: VictoryStyleObject; + median?: VictoryStyleObject; + medianLabels?: VictoryStyleObject; + q1?: VictoryStyleObject; + q1Labels?: VictoryStyleObject; + q3?: VictoryStyleObject; + q3Labels?: VictoryStyleObject; } + + export interface VictoryBoxPlotProps extends VictoryCommonProps, VictoryDatableProps { + /** + * The boxWidth prop specifies how wide each box should be. If the whiskerWidth + * prop is not set, this prop will also determine the width of the whisker crosshair. + */ + boxWidth?: number; + /** + * The domain prop describes the range of values your chart will include. This prop can be + * given as a array of the minimum and maximum expected values for your chart, + * or as an object that specifies separate arrays for x and y. + * If this prop is not provided, a domain will be calculated from data, or other + * available information. + * @example: [-1, 1], {x: [0, 100], y: [0, 1]} + */ + domain?: DomainPropType; + /** + * The domainPadding prop specifies a number of pixels of padding to add to the + * beginning and end of a domain. This prop is useful for explicitly spacing ticks farther + * from the origin to prevent crowding. This prop should be given as an object with + * numbers specified for x and y. + */ + domainPadding?: DomainPaddingPropType; + /** + * The event prop take an array of event objects. Event objects are composed of + * a childName, target, eventKey, and eventHandlers. Targets may be any valid style namespace + * for a given component, (i.e. "data" and "labels"). The childName will refer to an + * individual child of VictoryChart, either by its name prop, or by index. The eventKey + * may optionally be used to select a single element by index or eventKey rather than + * an entire set. The eventHandlers object should be given as an object whose keys are standard + * event names (i.e. onClick) and whose values are event callbacks. The return value + * of an event handler is used to modify elemnts. The return value should be given + * as an object or an array of objects with optional target and eventKey and childName keys, + * and a mutation key whose value is a function. The target and eventKey and childName keys + * will default to those corresponding to the element the event handler was attached to. + * The mutation function will be called with the calculated props for the individual selected + * element (i.e. a single bar), and the object returned from the mutation function + * will override the props of the selected element via object assignment. + * @examples + * events={[ + * { + * target: "data", + * childName: "firstBar", + * eventHandlers: { + * onClick: () => { + * return [ + * { + * childName: "secondBar", + * mutation: (props) => { + * return {style: merge({}, props.style, {fill: "orange"})}; + * } + * }, { + * childName: "secondBar", + * target: "labels", + * mutation: () => { + * return {text: "hey"}; + * } + * } + * ]; + * } + * } + * } + * ]} + */ + events?: EventPropTypeInterface[]; + /** + * Similar to data accessor props `x` and `y`, this prop may be used to functionally + * assign eventKeys to data + */ + eventKey?: StringOrNumberOrCallback; + /** + * The horizontal prop determines whether the bars will be laid vertically or + * horizontally. The bars will be vertical if this prop is false or unspecified, + * or horizontal if the prop is set to true. + */ + horizontal?: boolean; + /** + * The labelOrientation prop determines where labels are placed relative to their + * corresponding data. If this prop is not set, it will be set to “top” for + * horizontal charts, and “right” for vertical charts. + */ + labelOrientation?: "top" | "bottom" | "left" | "right"; + /** + * When the boolean labels prop is set to true, the values for min, max, median, + * q1, and q3 will be displayed for each box. For more granular label control, use + * the individual minLabels, maxLabels, medianLabels, q1Labels, and q3Labels props. + */ + labels?: boolean; + /** + * Use the max data accessor prop to define the max value of a box plot. + */ + max?: StringOrNumberOrCallback; + /** + * Use the median data accessor prop to define the median value of a box plot. + */ + median?: StringOrNumberOrCallback; + /** + * Use the min data accessor prop to define the min value of a box plot. + */ + min?: StringOrNumberOrCallback; + /** + * Use the q1 data accessor prop to define the q1 value of a box plot. + */ + q1?: StringOrNumberOrCallback; + /** + * Use the q3 data accessor prop to define the q1 value of a box plot. + */ + q3?: StringOrNumberOrCallback; + /** + * The style prop defines the style of the component. The style prop + * should be given as an object with styles defined for parent, max, + * maxLabels, min, minLabels,median, medianLabels,q1, q1Labels,q3, + * q3Labels. Any valid svg styles are supported, but width, height, a + * nd padding should be specified via props as they determine relative + * layout for components in VictoryChart. Functional styles may be + * defined for style properties, and they will be evaluated with each datum. + */ + style?: VictoryBoxPlotStyleInterface; + /** + * The whiskerWidth prop specifies how wide each whisker crosshair should be. If the + * whiskerWidth prop is not set, the width of the whisker crosshair will match + * the width of the box. + */ + whiskerWidth?: number; + } + + /** + * VictoryBoxPlot renders a box plot to describe the distribution of a set of data. Data for + * VictoryBoxPlot may be given with summary statistics pre-calculated (min, median, max, q1, q3), + * or as an array of raw data. VictoryBoxPlot can be composed with VictoryChart to create box plot charts. + */ + export class VictoryBoxPlot extends React.Component< + VictoryBoxPlotProps, + any + > {} + + export interface VictoryChartProps extends VictoryCommonProps { + /** + * The domain prop describes the range of values your chart will include. This prop can be + * given as a array of the minimum and maximum expected values for your chart, + * or as an object that specifies separate arrays for x and y. + * If this prop is not provided, a domain will be calculated from data, or other + * available information. + * @example: [-1, 1], {x: [0, 100], y: [0, 1]} + */ + domain?: DomainPropType; + /** + * The domainPadding prop specifies a number of pixels of padding to add to the + * beginning and end of a domain. This prop is useful for explicitly spacing ticks farther + * from the origin to prevent crowding. This prop should be given as an object with + * numbers specified for x and y. + */ + domainPadding?: DomainPaddingPropType; + /** + * The event prop take an array of event objects. Event objects are composed of + * a childName, target, eventKey, and eventHandlers. Targets may be any valid style namespace + * for a given component, (i.e. "data" and "labels"). The childName will refer to an + * individual child of VictoryChart, either by its name prop, or by index. The eventKey + * may optionally be used to select a single element by index or eventKey rather than + * an entire set. The eventHandlers object should be given as an object whose keys are standard + * event names (i.e. onClick) and whose values are event callbacks. The return value + * of an event handler is used to modify elemnts. The return value should be given + * as an object or an array of objects with optional target and eventKey and childName keys, + * and a mutation key whose value is a function. The target and eventKey and childName keys + * will default to those corresponding to the element the event handler was attached to. + * The mutation function will be called with the calculated props for the individual selected + * element (i.e. a single bar), and the object returned from the mutation function + * will override the props of the selected element via object assignment. + * @examples + * events={[ + * { + * target: "data", + * childName: "firstBar", + * eventHandlers: { + * onClick: () => { + * return [ + * { + * childName: "secondBar", + * mutation: (props) => { + * return {style: merge({}, props.style, {fill: "orange"})}; + * } + * }, { + * childName: "secondBar", + * target: "labels", + * mutation: () => { + * return {text: "hey"}; + * } + * } + * ]; + * } + * } + * } + * ]} + */ + events?: EventPropTypeInterface[]; + /** + * Similar to data accessor props `x` and `y`, this prop may be used to functionally + * assign eventKeys to data + */ + eventKey?: StringOrNumberOrCallback; + /** + * The style prop specifies styles for your chart. Any valid inline style properties + * will be applied. Height, width, and padding should be specified via the height, + * width, and padding props, as they are used to calculate the alignment of + * components within chart. + * @example {border: "1px solid #ccc", margin: "2%", maxWidth: "40%"} + */ + style?: Pick; + } + + /** + * A flexible charting component for React. + * VictoryChart composes other Victory components into reusable charts. + * Acting as a coordinator rather than a stand-alone component, VictoryChart reconciles props such as domain and scale for child components, + * and provides a set of sensible defaults. This component works with: + * - VictoryAxis + * - VictoryLine + * - VictoryScatter + * - VictoryBar + */ + export class VictoryChart extends React.Component {} + + export interface VictoryGroupProps extends VictoryCommonProps, VictoryMultiLabeableProps { + /** + * The categories prop specifies how categorical data for a chart should be ordered. + * This prop should be given as an array of string values, or an object with + * these values for x and y. When categories are not given as an object + * When this prop is set on a wrapper component, it will dictate the categories of + * its the children. If this prop is not set, any categories on child component + * or categorical data, will be merged to create a shared set of categories. + * @example ["dogs", "cats", "mice"] + */ + categories?: CategoryPropType; + /** + * The colorScale prop is an optional prop that defines the color scale the chart's bars + * will be created on. This prop should be given as an array of CSS colors, or as a string + * corresponding to one of the built in color scales. VictoryBar will automatically assign + * values from this color scale to the bars unless colors are explicitly provided in the + * `dataAttributes` prop. + */ + colorScale?: ColorScalePropType; + /** + * The domain prop describes the range of values your chart will include. This prop can be + * given as a array of the minimum and maximum expected values for your chart, + * or as an object that specifies separate arrays for x and y. + * If this prop is not provided, a domain will be calculated from data, or other + * available information. + * @examples: [-1, 1], {x: [0, 100], y: [0, 1]} + */ + domain?: DomainPropType; + /** + * The domainPadding prop specifies a number of pixels of padding to add to the + * beginning and end of a domain. This prop is useful for explicitly spacing ticks farther + * from the origin to prevent crowding. This prop should be given as an object with + * numbers specified for x and y. + */ + domainPadding?: DomainPaddingPropType; + /** + * The event prop take an array of event objects. Event objects are composed of + * a childName, target, eventKey, and eventHandlers. Targets may be any valid style namespace + * for a given component, (i.e. "data" and "labels"). The childName will refer to an + * individual child of VictoryGroup, either by its name prop, or by index. The eventKey + * may optionally be used to select a single element by index or eventKey rather than + * an entire set. The eventHandlers object should be given as an object whose keys are standard + * event names (i.e. onClick) and whose values are event callbacks. The return value + * of an event handler is used to modify elemnts. The return value should be given + * as an object or an array of objects with optional target and eventKey and childName keys, + * and a mutation key whose value is a function. The target and eventKey and childName keys + * will default to those corresponding to the element the event handler was attached to. + * The mutation function will be called with the calculated props for the individual selected + * element (i.e. a single bar), and the object returned from the mutation function + * will override the props of the selected element via object assignment. + * @examples + * events={[ + * { + * target: "data", + * childName: "firstBar", + * eventHandlers: { + * onClick: () => { + * return [ + * { + * childName: "secondBar", + * mutation: (props) => { + * return {style: merge({}, props.style, {fill: "orange"})}; + * } + * }, { + * childName: "secondBar", + * target: "labels", + * mutation: () => { + * return {text: "hey"}; + * } + * } + * ]; + * } + * } + * } + * ]} + */ + events?: EventPropTypeInterface<"data" | "labels" | "parent", StringOrNumberOrCallback>[]; + /** + * Similar to data accessor props `x` and `y`, this prop may be used to functionally + * assign eventKeys to data + */ + eventKey?: StringOrNumberOrCallback; + /** + * The horizontal prop determines whether the bars will be laid vertically or + * horizontally. The bars will be vertical if this prop is false or unspecified, + * or horizontal if the prop is set to true. + */ + horizontal?: boolean; + /** + * The offset prop determines the number of pixels each element in a group should + * be offset from its original position of the on the independent axis. In the + * case of groups of bars, this number should be equal to the width of the bar + * plus the desired spacing between bars. + */ + offset?: number; + /** + * The style prop specifies styles for your grouped chart. These styles will be + * applied to all grouped children + */ + style?: VictoryStyleInterface; + } + + export class VictoryGroup extends React.Component {} + + export interface VictoryLineProps extends VictoryCommonProps, VictoryDatableProps, VictorySingleLabableProps { + /** + * The event prop take an array of event objects. Event objects are composed of + * a target, an eventKey, and eventHandlers. Targets may be any valid style namespace + * for a given component, so "data" and "labels" are all valid targets for VictoryLine events. + * Since VictoryLine only renders a single element, the eventKey property is not used. + * The eventHandlers object should be given as an object whose keys are standard + * event names (i.e. onClick) and whose values are event callbacks. The return value + * of an event handler is used to modify elemnts. The return value should be given + * as an object or an array of objects with optional target and eventKey keys, + * and a mutation key whose value is a function. The target and eventKey keys + * will default to those corresponding to the element the event handler was attached to. + * The mutation function will be called with the calculated props for the individual selected + * element (i.e. a line), and the object returned from the mutation function + * will override the props of the selected element via object assignment. + * @examples + * events={[ + * { + * target: "data", + * eventHandlers: { + * onClick: () => { + * return [ + * { + * mutation: (props) => { + * return {style: merge({}, props.style, {stroke: "orange"})}; + * } + * }, { + * target: "labels", + * mutation: () => { + * return {text: "hey"}; + * } + * } + * ]; + * } + * } + * } + * ]} + */ + events?: EventPropTypeInterface<"data" | "labels" | "parent", number | string>[]; + /** + * The interpolation prop determines how data points should be connected + * when plotting a line + */ + interpolation?: InterpolationPropType; + /** + * The samples prop specifies how many individual points to plot when plotting + * y as a function of x. Samples is ignored if x props are provided instead. + */ + samples?: number; + /** + * The labels prop defines the labels that will appear above each point. + * This prop should be given as an array or as a function of data. + */ + labels?: string[] | number[] | Function; + /** + * Use the sortKey prop to indicate how data should be sorted. This prop + * is given directly to the lodash sortBy function to be executed on the + * final dataset. + */ + sortKey?: string | string[] | Function; + /** + * The style prop specifies styles for your VictoryLine. Any valid inline style properties + * will be applied. Height, width, and padding should be specified via the height, + * width, and padding props, as they are used to calculate the alignment of + * components within chart. in addition to normal style properties, angle and verticalAnchor + * may also be specified via the labels object, and they will be passed as props to + * VictoryLabel, or any custom labelComponent. + * @examples{data: {stroke: "red"}, labels: {fontSize: 12}} + */ + style?: VictoryStyleInterface; + } + + /** + * VictoryLine creates a line based on data. VictoryLine is a composable component, so it does not include an axis. + * Check out VictoryChart for easy to use line charts and more. + */ + export class VictoryLine extends React.Component {} + + export interface VictoryLegendProps extends VictoryCommonProps, VictoryDatableProps, VictorySingleLabableProps { + /** + * The borderComponent prop takes a component instance which will be responsible + * for rendering a border around the legend. The new element created from the passed + * borderComponent will be provided with the following properties calculated by + * VictoryLegend: x, y, width, height, and style. Any of these props may be + * overridden by passing in props to the supplied component, or modified or ignored + * within the custom component itself. If a borderComponent + * is not provided, VictoryLegend will use its default Border component. + * Please note that the default width and height calculated + * for the border component is based on approximated + * text measurements, and may need to be adjusted. + * @default + */ + borderComponent?: React.ReactElement; + /** + * The borderPadding specifies the amount of padding that should + * be added between the legend items and the border. This prop may be given as + * a number, or asanobject with values specified for top, bottom, left, and right. + * Please note that the default width and height calculated for the border + * component is based on approximated text measurements, so padding may need to be adjusted. + */ + borderPadding?: PaddingProps; + /** + * The centerTitle boolean prop specifies whether a legend title should be centered. + */ + centerTitle?: boolean; + /** + * The colorScale prop defines a color scale to be applied to each data + * symbol in VictoryLegend. This prop should be given as an array of CSS + * colors, or as a string corresponding to one of the built in color + * scales: "grayscale", "qualitative", "heatmap", "warm", "cool", "red", + * "green", "blue". VictoryLegend will assign a color to each symbol by + * index, unless they are explicitly specified in the data object. + * Colors will repeat when there are more symbols than colors in the + * provided colorScale. + */ + colorScale?: ColorScalePropType; + /** + * Specify data via the data prop. VictoryLegend expects data as an + * array of objects with name (required), symbol, and labels properties. + * The data prop must be given as an array. + */ + data?: Array<{ + name?: string; + symbol?: { + fill?: string; + type?: string; + }; + }>; + /** + * The dataComponent prop takes a component instance which will be + * responsible for rendering a data element used to associate a symbol + * or color with each data series. The new element created from the + * passed dataComponent will be provided with the following properties + * calculated by VictoryLegend: x, y, size, style, and symbol. Any of + * these props may be overridden by passing in props to the supplied + * component, or modified or ignored within the custom component itself. + * If a dataComponent is not provided, VictoryLegend will use its + * default Point component. + */ + dataComponent?: React.ReactElement; + /** + * VictoryLegend uses the standard eventKey prop to specify how event targets + * are addressed. This prop is not commonly used. + */ + eventKey?: StringOrNumberOrCallback | string[]; + /** + * VictoryLegend uses the standard events prop. + */ + events?: EventPropTypeInterface<"data" | "labels" | "parent", StringOrNumberOrCallback>[]; + /** + * VictoryLegend uses the standard externalEventMutations prop. + */ + externalEventMutations?: any[]; + /** + * The gutter prop defines the number of pixels between legend rows or + * columns, depending on orientation. When orientation is horizontal, + * gutters are between columns. When orientation is vertical, gutters + * are the space between rows. + */ + gutter?: number; + /** + * The itemsPerRow prop determines how many items to render in each row + * of a horizontal legend, or in each column of a vertical legend. This + * prop should be given as an integer. When this prop is not given, + * legend items will be rendered in a single row or column. + */ + itemsPerRow?: number; + /** + * The labelComponent prop takes a component instance which will be used + * to render each legend label. The new element created from the passed + * labelComponent will be supplied with the following properties: x, y, + * style, and text. Any of these props may be overridden by passing in + * props to the supplied component, or modified or ignored within the + * custom component itself. If labelComponent is omitted, a new + * VictoryLabel will be created with the props described above. + */ + labelComponent?: React.ReactElement; + /** + * The orientation prop takes a string that defines whether legend data + * are displayed in a row or column. When orientation is "horizontal", + * legend items will be displayed in a single row. When orientation is + * "vertical", legend items will be displayed in a single column. Line + * and text-wrapping is not currently supported, so "vertical" + * orientation is both the default setting and recommended for + * displaying many series of data. + * @default 'vertical' + */ + orientation?: 'horizontal' | 'vertical'; + /** + * The rowGutter prop defines the number of pixels between legend rows. + * This prop may be given as a number, or as an object with values + * specified for “top” and “bottom” gutters. To set spacing between columns, + * use the gutter prop. + */ + rowGutter?: number | Omit; + /** + * The style prop defines the style of the VictoryLegend component. + * The style prop should be given as an object with styles defined for data, labels and + * parent. Any valid svg styles are supported, but width, height, and + * padding should be specified via props as they determine relative + * layout for components in VictoryLegend. + */ + style?: VictoryStyleInterface; + /** + * The symbolSpacer prop defines the number of pixels between data + * components and label components. + */ + symbolSpacer?: number; + /** + * The title prop specifies a title to render with the legend. + * This prop should be given as a string, or an array of strings for multi-line titles. + */ + title?: string | string[]; + /** + * The titleComponent prop takes a component instance which will be used to render + * a title for the component. The new element created from the passed + * labelComponent will be supplied with the following properties: x, y, index, data, + * datum, verticalAnchor, textAnchor, style, text, and events. Any of these props + * may be overridden by passing in props to the supplied component, or modified + * or ignored within the custom component itself. If labelComponent is omitted, + * a new VictoryLabel will be created with the props described above. + */ + titleComponent?: React.ReactElement; + /** + * The titleOrientation prop specifies where the a title should be rendered + * in relation to the rest of the legend. Possible values + * for this prop are “top”, “bottom”, “left”, and “right”. + * @default (provided by default theme): titleOrientation="top" + */ + titleOrientation?: OrientationTypes; + /** + * The x and y props define the base position of the legend element. + */ + x?: number; + y?: number; + } + + /** + * VictoryLegend renders a chart legend component. + */ + export class VictoryLegend extends React.Component {} + + type ScatterSymbolType = "circle" | "diamond" | "plus" | "square" | "star" | "triangleDown" | "triangleUp"; + + export interface VictoryScatterProps extends VictoryCommonProps, VictoryDatableProps, VictoryMultiLabeableProps { + /** + * The bubbleProperty prop indicates which property of the data object should be used + * to scale data points in a bubble chart + */ + bubbleProperty?: string; + /** + * The event prop take an array of event objects. Event objects are composed of + * a target, an eventKey, and eventHandlers. Targets may be any valid style namespace + * for a given component, so "data" and "labels" are all valid targets for VictoryScatter + * events. The eventKey may optionally be used to select a single element by index rather than + * an entire set. The eventHandlers object should be given as an object whose keys are standard + * event names (i.e. onClick) and whose values are event callbacks. The return value + * of an event handler is used to modify elemnts. The return value should be given + * as an object or an array of objects with optional target and eventKey keys, + * and a mutation key whose value is a function. The target and eventKey keys + * will default to those corresponding to the element the event handler was attached to. + * The mutation function will be called with the calculated props for the individual selected + * element (i.e. a single bar), and the object returned from the mutation function + * will override the props of the selected element via object assignment. + * @examples + * events={[ + * { + * target: "data", + * eventKey: "thisOne", + * eventHandlers: { + * onClick: () => { + * return [ + * { + * eventKey: "theOtherOne", + * mutation: (props) => { + * return {style: merge({}, props.style, {fill: "orange"})}; + * } + * }, { + * eventKey: "theOtherOne", + * target: "labels", + * mutation: () => { + * return {text: "hey"}; + * } + * } + * ]; + * } + * } + * } + * ]} + */ + events?: EventPropTypeInterface<"data" | "labels" | "parent", StringOrNumberOrCallback>[]; + /** + * Similar to data accessor props `x` and `y`, this prop may be used to functionally + * assign eventKeys to data + */ + eventKey?: StringOrNumberOrCallback; + /** + * The maxBubbleSize prop sets an upper limit for scaling data points in a bubble chart + */ + maxBubbleSize?: number; + /** + * The samples prop specifies how many individual points to plot when plotting + * y as a function of x. Samples is ignored if x props are provided instead. + */ + samples?: number; + /** + * The size prop determines how to scale each data point + */ + size?: number | { (data: any): number }; + /** + * The style prop specifies styles for your VictoryScatter. Any valid inline style properties + * will be applied. Height, width, and padding should be specified via the height, + * width, and padding props, as they are used to calculate the alignment of + * components within chart. In addition to normal style properties, angle and verticalAnchor + * may also be specified via the labels object, and they will be passed as props to + * VictoryLabel, or any custom labelComponent. + * @example {data: {fill: "red"}, labels: {fontSize: 12}} + */ + style?: VictoryStyleInterface; + /** + * The symbol prop determines which symbol should be drawn to represent data points. + */ + symbol?: ScatterSymbolType | { (data: any): ScatterSymbolType }; + } + + /** + * VictoryScatter creates a scatter of points from data. VictoryScatter is a composable component, so it does not include an axis. + * Check out VictoryChart for easy to use scatter plots and more. + */ + export class VictoryScatter extends React.Component {} + + export interface VictoryStackProps extends VictoryCommonProps, VictoryMultiLabeableProps { + /** + * The categories prop specifies how categorical data for a chart should be ordered. + * This prop should be given as an array of string values, or an object with + * these values for x and y. When categories are not given as an object + * When this prop is set on a wrapper component, it will dictate the categories of + * its the children. If this prop is not set, any categories on child component + * or catigorical data, will be merged to create a shared set of categories. + * @example ["dogs", "cats", "mice"] + */ + categories?: CategoryPropType; + /** + * The colorScale prop is an optional prop that defines the color scale the chart's bars + * will be created on. This prop should be given as an array of CSS colors, or as a string + * corresponding to one of the built in color scales. VictoryBar will automatically assign + * values from this color scale to the bars unless colors are explicitly provided in the + * `dataAttributes` prop. + */ + colorScale?: ColorScalePropType; + /** + * The domain prop describes the range of values your chart will include. This prop can be + * given as a array of the minimum and maximum expected values for your chart, + * or as an object that specifies separate arrays for x and y. + * If this prop is not provided, a domain will be calculated from data, or other + * available information. + * @example: [-1, 1], {x: [0, 100], y: [0, 1]} + */ + domain?: DomainPropType; + /** + * The domainPadding prop specifies a number of pixels of padding to add to the + * beginning and end of a domain. This prop is useful for explicitly spacing ticks farther + * from the origin to prevent crowding. This prop should be given as an object with + * numbers specified for x and y. + */ + domainPadding?: DomainPaddingPropType; + /** + * The event prop take an array of event objects. Event objects are composed of + * a childName, target, eventKey, and eventHandlers. Targets may be any valid style namespace + * for a given component, (i.e. "data" and "labels"). The childName will refer to an + * individual child of VictoryStack, either by its name prop, or by index. The eventKey + * may optionally be used to select a single element by index or eventKey rather than + * an entire set. The eventHandlers object should be given as an object whose keys are standard + * event names (i.e. onClick) and whose values are event callbacks. The return value + * of an event handler is used to modify elemnts. The return value should be given + * as an object or an array of objects with optional target and eventKey and childName keys, + * and a mutation key whose value is a function. The target and eventKey and childName keys + * will default to those corresponding to the element the event handler was attached to. + * The mutation function will be called with the calculated props for the individual selected + * element (i.e. a single bar), and the object returned from the mutation function + * will override the props of the selected element via object assignment. + * @examples + * events={[ + * { + * target: "data", + * childName: "firstBar", + * eventHandlers: { + * onClick: () => { + * return [ + * { + * childName: "secondBar", + * mutation: (props) => { + * return {style: merge({}, props.style, {fill: "orange"})}; + * } + * }, { + * childName: "secondBar", + * target: "labels", + * mutation: () => { + * return {text: "hey"}; + * } + * } + * ]; + * } + * } + * } + * ]} + */ + events?: EventPropTypeInterface<"data" | "labels" | "parent", StringOrNumberOrCallback>[]; + /** + * Similar to data accessor props `x` and `y`, this prop may be used to functionally + * assign eventKeys to data + */ + eventKey?: StringOrNumberOrCallback; + /** + * The horizontal prop determines whether the bars will be laid vertically or + * horizontally. The bars will be vertical if this prop is false or unspecified, + * or horizontal if the prop is set to true. + */ + horizontal?: boolean; + /** + * The style prop specifies styles for your grouped chart. These styles will be + * applied to all grouped children + */ + style?: VictoryStyleInterface; + /** + * The xOffset prop is used for grouping stacks of bars. This prop will be set + * by the VictoryGroup component wrapper, or can be set manually. + */ + xOffset?: number; + } + + export class VictoryStack extends React.Component {} + + export interface VictoryPieProps extends VictoryCommonProps, VictoryMultiLabeableProps { + /** + * The colorScale prop is an optional prop that defines the color scale the pie + * will be created on. This prop should be given as an array of CSS colors, or as a string + * corresponding to one of the built in color scales. VictoryPie will automatically assign + * values from this color scale to the pie slices unless colors are explicitly provided in the + * data object + */ + colorScale?: ColorScalePropType; + /** + * The data prop specifies the data to be plotted, + * where data X-value is the slice label (string or number), + * and Y-value is the corresponding number value represented by the slice + * Data should be in the form of an array of data points. + * Each data point may be any format you wish (depending on the `x` and `y` accessor props), + * but by default, an object with x and y properties is expected. + * @example [{x: 1, y: 2}, {x: 2, y: 3}], [[1, 2], [2, 3]], + * [[{x: "a", y: 1}, {x: "b", y: 2}], [{x: "a", y: 2}, {x: "b", y: 3}]] + */ + data?: any[]; + /** + * The dataComponent prop takes an entire, HTML-complete data component which will be used to + * create slices for each datum in the pie chart. The new element created from the passed + * dataComponent will have the property datum set by the pie chart for the point it renders; + * properties style and pathFunction calculated by VictoryPie; an index property set + * corresponding to the location of the datum in the data provided to the pie; events bound to + * the VictoryPie; and the d3 compatible slice object. + * If a dataComponent is not provided, VictoryPie's Slice component will be used. + */ + dataComponent?: React.ReactElement; + /** + * The labelRadius prop defines the radius of the arc that will be used for positioning each slice label. + * If this prop is not set, the label radius will default to the radius of the pie + label padding. + */ + labelRadius?: number; + /** + * The overall end angle of the pie in degrees. This prop is used in conjunction with + * startAngle to create a pie that spans only a segment of a circle. + */ + endAngle?: number; + /** + * The event prop takes an array of event objects. Event objects are composed of + * a target, an eventKey, and eventHandlers. Targets may be any valid style namespace + * for a given component, so "data" and "labels" are all valid targets for VictoryPie + * events. The eventKey may optionally be used to select a single element by index rather than + * an entire set. The eventHandlers object should be given as an object whose keys are standard + * event names (i.e. onClick) and whose values are event callbacks. The return value + * of an event handler is used to modify elemnts. The return value should be given + * as an object or an array of objects with optional target and eventKey keys, + * and a mutation key whose value is a function. The target and eventKey keys + * will default to those corresponding to the element the event handler was attached to. + * The mutation function will be called with the calculated props for the individual selected + * element (i.e. a single bar), and the object returned from the mutation function + * will override the props of the selected element via object assignment. + * @examples + * events={[ + * { + * target: "data", + * eventKey: 1, + * eventHandlers: { + * onClick: () => { + * return [ + * { + * eventKey: 2, + * mutation: (props) => { + * return {style: merge({}, props.style, {fill: "orange"})}; + * } + * }, { + * eventKey: 2, + * target: "labels", + * mutation: () => { + * return {text: "hey"}; + * } + * } + * ]; + * } + * } + * } + * ]} + */ + events?: EventPropTypeInterface<"data" | "labels" | "parent", StringOrNumberOrCallback | string[] | number[]>[]; + /** + * Similar to data accessor props `x` and `y`, this prop may be used to functionally + * assign eventKeys to data + */ + eventKey?: StringOrNumberOrCallback; + /** + * Specifies the radius of the chart. If this property is not provided it is computed + * from width, height, and padding props + * + */ + radius?: number; + /** + * When creating a donut chart, this prop determines the number of pixels between + * the center of the chart and the inner edge of a donut. When this prop is set to zero + * a regular pie chart is rendered. + */ + innerRadius?: number; + /** + * Set the cornerRadius for every dataComponent (Slice by default) within VictoryPie + */ + cornerRadius?: number; + /** + * The padAngle prop determines the amount of separation between adjacent data slices + * in number of degrees + */ + padAngle?: number; + /** + * The overall start angle of the pie in degrees. This prop is used in conjunction with + * endAngle to create a pie that spans only a segment of a circle. + */ + startAngle?: number; + /** + * The style prop specifies styles for your pie. VictoryPie relies on Radium, + * so valid Radium style objects should work for this prop. Height, width, and + * padding should be specified via the height, width, and padding props. + * @example {data: {stroke: "black"}, label: {fontSize: 10}} + */ + style?: VictoryStyleInterface; + /** + * The x prop specifies how to access the X value of each data point. + * If given as a function, it will be run on each data point, and returned value will be used. + * If given as an integer, it will be used as an array index for array-type data points. + * If given as a string, it will be used as a property key for object-type data points. + * If given as an array of strings, or a string containing dots or brackets, + * it will be used as a nested object property path (for details see Lodash docs for _.get). + * If `null` or `undefined`, the data value will be used as is (identity function/pass-through). + * @example 0, 'x', 'x.value.nested.1.thing', 'x[2].also.nested', null, d => Math.sin(d) + */ + x?: DataGetterPropType; + /** + * The y prop specifies how to access the Y value of each data point. + * If given as a function, it will be run on each data point, and returned value will be used. + * If given as an integer, it will be used as an array index for array-type data points. + * If given as a string, it will be used as a property key for object-type data points. + * If given as an array of strings, or a string containing dots or brackets, + * it will be used as a nested object property path (for details see Lodash docs for _.get). + * If `null` or `undefined`, the data value will be used as is (identity function/pass-through). + * @example 0, 'y', 'y.value.nested.1.thing', 'y[2].also.nested', null, d => Math.sin(d) + */ + y?: DataGetterPropType; + } + + /** + * victory-pie draws an SVG pie or donut chart with React. + * Styles and data can be customized by passing in your own values as properties to the component. + * Data changes are animated with VictoryAnimation. + */ + export class VictoryPie extends React.Component {} +} diff --git a/types/victory/victory-tests.tsx b/types/victory/victory-tests.tsx index fcd18571e3..682b8c30d8 100644 --- a/types/victory/victory-tests.tsx +++ b/types/victory/victory-tests.tsx @@ -197,9 +197,9 @@ test = ( tick.x }, - ticks: { stroke: tick => tick.color }, - tickLabels: { fontSize: tick => tick.y }, + grid: { strokeWidth: (tick: any) => tick.x }, + ticks: { stroke: (tick: any) => tick.color }, + tickLabels: { fontSize: (tick: any) => tick.y }, }} tickValues={[ new Date(1980, 1, 1), @@ -611,8 +611,8 @@ test = ( ]} style={{ data: { - fill: d => d.x, - stroke: (datum, active) => active ? datum.x : datum.y, + fill: (d: any) => d.x, + stroke: (datum: any, active: boolean) => active ? datum.x : datum.y, strokeWidth: 3 } }} @@ -757,6 +757,7 @@ test = ( ]} gutter={10} orientation="horizontal" + title="Title" symbolSpacer={8} width={100} height={50} @@ -771,5 +772,22 @@ test = ( standalone padding={{ top: 20, right: 40, bottom: 60, left: 20 }} colorScale="heatmap" + events={[{ + target: "data", + eventKey: "thisOne", + eventHandlers: { + onClick: () => ([ + { + eventKey: "theOtherOne", + mutation: props => ({ style: { ...props.style, fill: "orange" } }) + }, + { + eventKey: "theOtherOne", + target: "labels", + mutation: () => ({ text: "hey" }) + } + ]) + } + }]} /> ); From c49bfdbd027a34049bad66f3740c666c0cd83f45 Mon Sep 17 00:00:00 2001 From: Dimitri Benin Date: Sat, 2 Mar 2019 21:45:57 +0100 Subject: [PATCH 273/924] [p-event] Remove types --- notNeededPackages.json | 6 + types/p-event/index.d.ts | 205 ------------------------------ types/p-event/p-event-tests.ts | 110 ---------------- types/p-event/tsconfig.json | 24 ---- types/p-event/tslint.json | 1 - types/p-event/v1/index.d.ts | 36 ------ types/p-event/v1/p-event-tests.ts | 61 --------- types/p-event/v1/tsconfig.json | 29 ----- types/p-event/v1/tslint.json | 1 - 9 files changed, 6 insertions(+), 467 deletions(-) delete mode 100644 types/p-event/index.d.ts delete mode 100644 types/p-event/p-event-tests.ts delete mode 100644 types/p-event/tsconfig.json delete mode 100644 types/p-event/tslint.json delete mode 100644 types/p-event/v1/index.d.ts delete mode 100644 types/p-event/v1/p-event-tests.ts delete mode 100644 types/p-event/v1/tsconfig.json delete mode 100644 types/p-event/v1/tslint.json diff --git a/notNeededPackages.json b/notNeededPackages.json index 4289393363..62f6bbb802 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -1146,6 +1146,12 @@ "sourceRepoURL": "http://onsen.io", "asOfVersion": "2.0.0" }, + { + "libraryName": "p-event", + "typingsPackageName": "p-event", + "sourceRepoURL": "https://github.com/sindresorhus/p-event", + "asOfVersion": "3.0.0" + }, { "libraryName": "p-map", "typingsPackageName": "p-map", diff --git a/types/p-event/index.d.ts b/types/p-event/index.d.ts deleted file mode 100644 index 6f76b75748..0000000000 --- a/types/p-event/index.d.ts +++ /dev/null @@ -1,205 +0,0 @@ -// Type definitions for p-event 2.3 -// Project: https://github.com/sindresorhus/p-event#readme -// Definitions by: BendingBender -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -import { PCancelable } from 'p-cancelable'; - -export = pEvent; - -/** - * Promisify an event by waiting for it to be emitted. - * - * Returns a `Promise` that is fulfilled when emitter emits an event matching `event`, or rejects if emitter emits - * any of the events defined in the `rejectionEvents` option. - * - * **Note**: `event` is a string for a single event type, for example, `'data'`. To listen on multiple - * events, pass an array of strings, such as `['started', 'stopped']`. - * - * The returned promise has a `.cancel()` method, which when called, removes the event listeners and causes the promise to never be settled. - * - * @param emitter Event emitter object. Should have either a `.on()`/`.addListener()`/`.addEventListener()` and - * `.off()`/`.removeListener()`/`.removeEventListener()` method, like the [Node.js `EventEmitter`](https://nodejs.org/api/events.html) and - * [DOM events](https://developer.mozilla.org/en-US/docs/Web/Events). - * @param event Name of the event or events to listen to. If the same event is defined both here and in - * `rejectionEvents`, this one takes priority. - */ -declare function pEvent( - emitter: pEvent.Emitter, - event: string | symbol | Array, - options: pEvent.MultiArgsOptions -): PCancelable>; -declare function pEvent( - emitter: pEvent.Emitter, - event: string | symbol | Array, - filter: pEvent.FilterFn -): PCancelable; -declare function pEvent( - emitter: pEvent.Emitter, - event: string | symbol | Array, - options?: pEvent.Options -): PCancelable; - -declare namespace pEvent { - /** - * Wait for multiple event emissions. Returns an array. - */ - function multiple( - emitter: Emitter, - event: string | symbol | Array, - options: MultipleMultiArgsOptions - ): PCancelable>>; - function multiple( - emitter: Emitter, - event: string | symbol | Array, - options: MultipleOptions - ): PCancelable; - - /** - * Returns an [async iterator](http://2ality.com/2016/10/asynchronous-iteration.html) that lets you asynchronously - * iterate over events of `event` emitted from `emitter`. The iterator ends when `emitter` emits an event matching - * any of the events defined in `resolutionEvents`, or rejects if `emitter` emits any of the events defined in - * the `rejectionEvents` option. - */ - function iterator( - emitter: Emitter, - event: string | symbol | Array, - options: IteratorMultiArgsOptions - ): AsyncIterableIterator>; - function iterator( - emitter: Emitter, - event: string | symbol | Array, - filter: FilterFn - ): AsyncIterableIterator; - function iterator( - emitter: Emitter, - event: string | symbol | Array, - options?: IteratorOptions - ): AsyncIterableIterator; - - interface Emitter { - on?: AddRmListenerFn; - addListener?: AddRmListenerFn; - addEventListener?: AddRmListenerFn; - off?: AddRmListenerFn; - removeListener?: AddRmListenerFn; - removeEventListener?: AddRmListenerFn; - } - - type FilterFn = (el: T) => boolean; - - interface Options { - /** - * Events that will reject the promise. - * @default ['error'] - */ - rejectionEvents?: Array; - /** - * By default, the promisified function will only return the first argument from the event callback, - * which works fine for most APIs. This option can be useful for APIs that return multiple arguments - * in the callback. Turning this on will make it return an array of all arguments from the callback, - * instead of just the first argument. This also applies to rejections. - * - * @example - * const pEvent = require('p-event'); - * const emitter = require('./some-event-emitter'); - * - * (async () => { - * const [foo, bar] = await pEvent(emitter, 'finish', {multiArgs: true}); - * })(); - * - * @default false - */ - multiArgs?: boolean; - /** - * Time in milliseconds before timing out. - * @default Infinity - */ - timeout?: number; - /** - * Filter function for accepting an event. - * - * @example - * const pEvent = require('p-event'); - * const emitter = require('./some-event-emitter'); - * - * (async () => { - * const result = await pEvent(emitter, '🩄', value => value > 3); - * // Do something with first 🩄 event with a value greater than 3 - * })(); - */ - filter?: FilterFn; - } - - interface MultiArgsOptions extends Options { - multiArgs: true; - } - - interface MultipleOptions extends Options { - /** - * The number of times the event needs to be emitted before the promise resolves. - */ - count: number; - /** - * Whether to resolve the promise immediately. Emitting one of the `rejectionEvents` won't throw an error. - * - * **Note**: The returned array will be mutated when an event is emitted. - * - * @example - * const emitter = new EventEmitter(); - * - * const promise = pEvent.multiple(emitter, 'hello', { - * resolveImmediately: true, - * count: Infinity - * }); - * - * const result = await promise; - * console.log(result); - * //=> [] - * - * emitter.emit('hello', 'Jack'); - * console.log(result); - * //=> ['Jack'] - * - * emitter.emit('hello', 'Mark'); - * console.log(result); - * //=> ['Jack', 'Mark'] - * - * // Stops listening - * emitter.emit('error', new Error('😿')); - * - * emitter.emit('hello', 'John'); - * console.log(result); - * //=> ['Jack', 'Mark'] - */ - resolveImmediately?: boolean; - } - - interface MultipleMultiArgsOptions extends MultipleOptions { - multiArgs: true; - } - - interface IteratorOptions extends Options { - /** - * Maximum number of events for the iterator before it ends. When the limit is reached, the iterator will be - * marked as `done`. This option is useful to paginate events, for example, fetching 10 events per page. - * @default Infinity - */ - limit?: number; - /** - * Events that will end the iterator. - * @default [] - */ - resolutionEvents?: Array; - } - - interface IteratorMultiArgsOptions extends IteratorOptions { - multiArgs: true; - } -} - -type AddRmListenerFn = ( - event: string | symbol, - listener: (arg1: T, ...args: TRest[]) => void -) => void; diff --git a/types/p-event/p-event-tests.ts b/types/p-event/p-event-tests.ts deleted file mode 100644 index dbbe50eee7..0000000000 --- a/types/p-event/p-event-tests.ts +++ /dev/null @@ -1,110 +0,0 @@ -/// - -import pEvent = require('p-event'); -import { EventEmitter } from 'events'; -import * as fs from 'fs'; - -class NodeEmitter extends EventEmitter { - on(event: 'finish', listener: (num: number, str: string) => void) { - return this; - } - addListener(event: 'finish', listener: (num: number, str: string) => void) { - return this; - } - addEventListener(event: 'finish', listener: (num: number, str: string) => void) { - return this; - } - off(event: 'finish', listener: (num: number, str: string) => void) { - return this; - } - removeListener(event: 'finish', listener: (num: number, str: string) => void) { - return this; - } - removeEventListener(event: 'finish', listener: (num: number, str: string) => void) { - return this; - } -} - -class DomEmitter implements EventTarget { - addEventListener( - type: 'foo', - listener: EventListenerOrEventListenerObject, - options?: boolean | AddEventListenerOptions - ): void {} - - dispatchEvent(event: Event): boolean { - return false; - } - - removeEventListener( - type: 'foo', - listener: EventListenerOrEventListenerObject, - options?: boolean | AddEventListenerOptions - ): void {} -} - -pEvent(new NodeEmitter(), 'finish'); // $ExpectType PCancelable -pEvent(new NodeEmitter(), '🩄', value => value > 3); // $ExpectType PCancelable -pEvent(new DomEmitter(), 'finish'); // $ExpectType PCancelable -pEvent(document, 'DOMContentLoaded'); // $ExpectType PCancelable - -pEvent(new NodeEmitter(), 'finish', { rejectionEvents: ['error'] }); // $ExpectType PCancelable -pEvent(new NodeEmitter(), 'finish', { timeout: 1 }); // $ExpectType PCancelable -pEvent(new NodeEmitter(), 'finish', { filter: value => value > 3 }); // $ExpectType PCancelable -pEvent(new NodeEmitter(), 'finish', { multiArgs: true }); // $ExpectType PCancelable<(string | number)[]> - -pEvent(new NodeEmitter(), 'finish').cancel(); - -// $ExpectType PCancelable -pEvent.multiple(new NodeEmitter(), 'hello', { - count: Infinity, -}); -// $ExpectType PCancelable -pEvent.multiple(new NodeEmitter(), 'hello', { - resolveImmediately: true, - count: Infinity, -}); -// $ExpectType PCancelable<(string | number)[][]> -pEvent.multiple(new NodeEmitter(), 'hello', { - count: Infinity, - multiArgs: true, -}); -// $ExpectError -pEvent.multiple(new NodeEmitter(), 'hello', {}); -// $ExpectError -pEvent.multiple(new NodeEmitter(), 'hello'); - -pEvent.iterator(new NodeEmitter(), 'finish'); // $ExpectType AsyncIterableIterator -pEvent.iterator(new NodeEmitter(), '🩄', value => value > 3); // $ExpectType AsyncIterableIterator - -pEvent.iterator(new NodeEmitter(), 'finish', { limit: 1 }); // $ExpectType AsyncIterableIterator -pEvent.iterator(new NodeEmitter(), 'finish', { resolutionEvents: ['finish'] }); // $ExpectType AsyncIterableIterator -pEvent.iterator(new NodeEmitter(), 'finish', { multiArgs: true }); // $ExpectType AsyncIterableIterator<(string | number)[]> - -async function getOpenReadStream(file: string) { - const stream = fs.createReadStream(file); - await pEvent(stream, 'open'); - return stream; -} - -(async () => { - const stream = await getOpenReadStream('unicorn.txt'); - stream.pipe(process.stdout); -})().catch(console.error); - -(async () => { - try { - const result = await pEvent(new NodeEmitter(), 'finish'); - - if (result === 1) { - throw new Error('Emitter finished with an error'); - } - - // `emitter` emitted a `finish` event with an acceptable value - console.log(result); - } catch (error) { - // `emitter` emitted an `error` event or - // emitted a `finish` with 'unwanted result' - console.error(error); - } -})(); diff --git a/types/p-event/tsconfig.json b/types/p-event/tsconfig.json deleted file mode 100644 index dfde34c0e1..0000000000 --- a/types/p-event/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es2016", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "p-event-tests.ts" - ] -} diff --git a/types/p-event/tslint.json b/types/p-event/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/p-event/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" } diff --git a/types/p-event/v1/index.d.ts b/types/p-event/v1/index.d.ts deleted file mode 100644 index 0fde40d140..0000000000 --- a/types/p-event/v1/index.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -// Type definitions for p-event 1.3 -// Project: https://github.com/sindresorhus/p-event#readme -// Definitions by: BendingBender -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -export = pEvent; - -declare function pEvent(emitter: pEvent.Emitter, event: string | symbol, options: MultiArgsOptions): Promise>; -declare function pEvent(emitter: pEvent.Emitter, event: string | symbol, filter: FilterFn): Promise; -declare function pEvent(emitter: pEvent.Emitter, event: string | symbol, options?: pEvent.Options): Promise; - -declare namespace pEvent { - interface Emitter { - on?: AddRmListenerFn; - addListener?: AddRmListenerFn; - addEventListener?: AddRmListenerFn; - off?: AddRmListenerFn; - removeListener?: AddRmListenerFn; - removeEventListener?: AddRmListenerFn; - } - - interface Options { - rejectionEvents?: string[]; - multiArgs?: boolean; - timeout?: number; - filter?: FilterFn; - } -} - -type AddRmListenerFn = (event: string | symbol, listener: (arg1: T, ...args: TRest[]) => void) => void; -type FilterFn = (el: T) => boolean; - -interface MultiArgsOptions extends pEvent.Options { - multiArgs: true; -} diff --git a/types/p-event/v1/p-event-tests.ts b/types/p-event/v1/p-event-tests.ts deleted file mode 100644 index 0295cdb34b..0000000000 --- a/types/p-event/v1/p-event-tests.ts +++ /dev/null @@ -1,61 +0,0 @@ -/// - -import pEvent = require('p-event'); -import * as events from 'events'; -import * as fs from 'fs'; - -class MyEmitter extends events.EventEmitter { -} - -class MyDomEmitter implements EventTarget { - addEventListener(type: 'foo', listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void { - } - - dispatchEvent(event: Event): boolean { - return false; - } - - removeEventListener(type: 'foo', listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void { - } -} - -pEvent(new MyEmitter(), 'finish') - .then(result => { - console.log(result); - }) - .catch(error => { - console.error(error); - }); - -pEvent(new MyEmitter(), 'finish').then(result => { - const str: string = result; -}); - -pEvent(new MyDomEmitter(), 'finish').then(result => { - const e: Event | undefined = result; -}); - -pEvent(document, 'DOMContentLoaded').then(() => { - console.log('😎'); -}); - -pEvent(new MyEmitter(), 'finish', {multiArgs: true}).then(result => { - const strArr: string[] = result; -}); - -pEvent(new MyEmitter(), '🩄', value => value > 3).then(result => { - const num: number = result; -}); - -async function getOpenReadStream(file: string) { - const stream = fs.createReadStream(file); - await pEvent(stream, 'open'); - return stream; -} - -getOpenReadStream('unicorn.txt') - .then(stream => { - console.log('Is readable:', stream.readable); - stream.pipe(process.stdout); - }) - .catch(console.error); diff --git a/types/p-event/v1/tsconfig.json b/types/p-event/v1/tsconfig.json deleted file mode 100644 index e8374c9b9e..0000000000 --- a/types/p-event/v1/tsconfig.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": false, - "baseUrl": "../../", - "typeRoots": [ - "../../" - ], - "paths": { - "p-event": [ - "p-event/v1" - ] - }, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "p-event-tests.ts" - ] -} diff --git a/types/p-event/v1/tslint.json b/types/p-event/v1/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/p-event/v1/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" } From fdf8237ec0d49c60f3da62cfc53b911f07ee5224 Mon Sep 17 00:00:00 2001 From: Simon Schick Date: Fri, 1 Mar 2019 23:53:00 +0100 Subject: [PATCH 274/924] fix(node): add `Map` forward declare --- types/node/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/node/index.d.ts b/types/node/index.d.ts index 41bfd02671..1e9121044a 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -63,6 +63,7 @@ interface WeakMapConstructor { } interface SetConstructor { } interface WeakSetConstructor { } interface Set {} +interface Map {} interface ReadonlySet {} interface IteratorResult { } interface Iterable { } From cfb29cc2d2f9525e6b5706eb5b3fa73510e204eb Mon Sep 17 00:00:00 2001 From: Joel Spadin Date: Sat, 2 Mar 2019 20:16:38 -0600 Subject: [PATCH 275/924] Add types for plurals-cldr --- types/plurals-cldr/index.d.ts | 53 ++++++++++++++++++++++++ types/plurals-cldr/plurals-cldr-tests.ts | 15 +++++++ types/plurals-cldr/tsconfig.json | 23 ++++++++++ types/plurals-cldr/tslint.json | 1 + 4 files changed, 92 insertions(+) create mode 100644 types/plurals-cldr/index.d.ts create mode 100644 types/plurals-cldr/plurals-cldr-tests.ts create mode 100644 types/plurals-cldr/tsconfig.json create mode 100644 types/plurals-cldr/tslint.json diff --git a/types/plurals-cldr/index.d.ts b/types/plurals-cldr/index.d.ts new file mode 100644 index 0000000000..0d7277b52a --- /dev/null +++ b/types/plurals-cldr/index.d.ts @@ -0,0 +1,53 @@ +// Type definitions for plurals-cldr 1.0 +// Project: https://github.com/nodeca/plurals-cldr +// Definitions by: Joel Spadin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export type Form = 'zero' | 'one' | 'two' | 'few' | 'many' | 'other'; + +interface Plural { + /** + * Returns the form name for a given number. If the locale is not + * supported, returns `null`. + * + * @param locale The locale code. + * @param number The number to check. May be passed as a string to keep + * trailing zeroes. + */ + (locale: string, number: number | string): Form | null; + + /** + * Returns an array of available forms for the given locale. If the + * locale is not supported, returns `null`. + * + * @param locale The locale code. + */ + forms(locale: string): Form[] | null; + + /** + * Returns the index of the form for a given number. If the locale is + * not supported, returns `-1`. + * + * This is convenient for implementing a lookup from a compact, ordered + * list. The order of forms for all locales is `zero`, `one`, `two`, + * `few`, `many`, `other`. Remove the forms not used by a locale to get + * the indices of each. + * + * @param locale The locale code. + * @param number The number to check. May be passed as a string to keep + * trailing zeroes. + */ + indexOf(locale: string, number: number | string): number; +} + +/** + * Gets the CLDR cardinal plural forms for numbers in different locales. + */ +declare const plural: Plural & { + /** + * Gets the CLDR ordinal plural forms for numbers in different locales. + */ + ordinal: Plural; +}; + +export default plural; diff --git a/types/plurals-cldr/plurals-cldr-tests.ts b/types/plurals-cldr/plurals-cldr-tests.ts new file mode 100644 index 0000000000..f5aacbd30c --- /dev/null +++ b/types/plurals-cldr/plurals-cldr-tests.ts @@ -0,0 +1,15 @@ +import plural from 'plurals-cldr'; + +plural('en', 0); // $ExpectType "zero" | "one" | "two" | "few" | "many" | "other" | null +plural('en', ''); // $ExpectType "zero" | "one" | "two" | "few" | "many" | "other" | null + +plural.forms('en'); // $ExpectType Form[] | null +plural.indexOf('en', 0); // $ExpectType number +plural.indexOf('en', ''); // $ExpectType number + +plural.ordinal('en', 0); // $ExpectType "zero" | "one" | "two" | "few" | "many" | "other" | null +plural.ordinal('en', ''); // $ExpectType "zero" | "one" | "two" | "few" | "many" | "other" | null + +plural.ordinal.forms('en'); // $ExpectType Form[] | null +plural.ordinal.indexOf('en', 0); // $ExpectType number +plural.ordinal.indexOf('en', ''); // $ExpectType number diff --git a/types/plurals-cldr/tsconfig.json b/types/plurals-cldr/tsconfig.json new file mode 100644 index 0000000000..593fbd1545 --- /dev/null +++ b/types/plurals-cldr/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "plurals-cldr-tests.ts" + ] +} diff --git a/types/plurals-cldr/tslint.json b/types/plurals-cldr/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/plurals-cldr/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 967d0226707f2e69dc83e61ffc89f48a3f835794 Mon Sep 17 00:00:00 2001 From: loli Date: Sun, 3 Mar 2019 10:37:13 +0800 Subject: [PATCH 276/924] file update --- retinajs/index.d.ts | 42 --------------------------------- types/retinajs/LICENSE | 21 ----------------- types/retinajs/README.md | 14 ----------- types/retinajs/package.json | 28 ---------------------- types/retinajs/retinajs-test.ts | 3 +++ types/retinajs/tsconfig.json | 23 ++++++++++++++++++ types/retinajs/tslint.json | 1 + 7 files changed, 27 insertions(+), 105 deletions(-) delete mode 100644 retinajs/index.d.ts delete mode 100644 types/retinajs/LICENSE delete mode 100644 types/retinajs/README.md delete mode 100644 types/retinajs/package.json create mode 100644 types/retinajs/retinajs-test.ts create mode 100644 types/retinajs/tsconfig.json create mode 100644 types/retinajs/tslint.json diff --git a/retinajs/index.d.ts b/retinajs/index.d.ts deleted file mode 100644 index 58b3e3b653..0000000000 --- a/retinajs/index.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -export = retinajs.retina; - -export as namespace retinajs; - -declare namespace retinajs { - var hasWindow: boolean; - - var environment: number; - - var srcReplace: RegExp; - - var inlineReplace: RegExp; - - var selector: string; - - var processedAttr: string; - - var processedAttr: string; - - function arrayify(object: any): HTMLImageElement[]; - - function chooseCap(cap: number | string): number; - - function forceOriginalDimensions(image: HTMLImageElement): HTMLImageElement; - - function setSourceIfAvailable( - image: HTMLImageElement, - retinaURL: string - ): void; - - function dynamicSwapImage(image: HTMLImageElement, src: string): void; - - function manualSwapImage(image: HTMLImageElement, hdsrc: string): void; - - function getImages(images: HTMLImageElement[] | null): HTMLImageElement[]; - - function cleanBgImg(img: HTMLImageElement): HTMLImageElement; - - function retina(): void; - - function retina(images: any): void; -} diff --git a/types/retinajs/LICENSE b/types/retinajs/LICENSE deleted file mode 100644 index 21071075c2..0000000000 --- a/types/retinajs/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - MIT License - - Copyright (c) Microsoft Corporation. All rights reserved. - - 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/types/retinajs/README.md b/types/retinajs/README.md deleted file mode 100644 index d28dcdd483..0000000000 --- a/types/retinajs/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# Installation - -> `npm install --save @types/retinajs` - -# Summary - -This package contains type definitions for retinajs ( https://github.com/strues/retinajs ). - -# Details - -Additional Details - -- Last updated: Sat Mar 02 2019 15:07:39 GMT+0800 -- Dependencies: none diff --git a/types/retinajs/package.json b/types/retinajs/package.json deleted file mode 100644 index 2c3081334e..0000000000 --- a/types/retinajs/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "@types/retinajs", - "version": "2.1.3", - "description": "TypeScript definitions for retinajs", - "license": "MIT", - "contributors": [ - "senjyouhara (https://github.com/senjyouhara)" - ], - "main": "", - "types": "index", - "repository": { - "type": "git", - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git" - }, - "scripts": {}, - "dependencies": {}, - "typesPublisherContentHash": "4BCEA62CB241C5EA821904599800CBA7A5695E03776CAE7E46CC1FDE98B73069", - "typeScriptVersion": ">= 3.2", - "bugs": { - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues" - }, - "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme", - "keywords": [ - "retinajs", - "retina" - ], - "author": "senjyouhara" -} diff --git a/types/retinajs/retinajs-test.ts b/types/retinajs/retinajs-test.ts new file mode 100644 index 0000000000..9795d8922e --- /dev/null +++ b/types/retinajs/retinajs-test.ts @@ -0,0 +1,3 @@ +const retinajs = require("retinajs"); + +window.addEventListener("load", retinajs); diff --git a/types/retinajs/tsconfig.json b/types/retinajs/tsconfig.json new file mode 100644 index 0000000000..a137453eb4 --- /dev/null +++ b/types/retinajs/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "retinajs-test.ts" + ] +} diff --git a/types/retinajs/tslint.json b/types/retinajs/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/retinajs/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 6da7985a2e2700239eec572d76bb35d2625214c5 Mon Sep 17 00:00:00 2001 From: clomie Date: Sun, 3 Mar 2019 12:33:43 +0900 Subject: [PATCH 277/924] [google.script.client-side] Fix type assertion --- .../google.script.client-side-tests.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/types/google.script.client-side/google.script.client-side-tests.ts b/types/google.script.client-side/google.script.client-side-tests.ts index 5e3c059c01..b0cb508777 100644 --- a/types/google.script.client-side/google.script.client-side-tests.ts +++ b/types/google.script.client-side/google.script.client-side-tests.ts @@ -1,7 +1,7 @@ google.script.url.getLocation(location => { - location.hash; // $ExpectedType string - location.parameter; // $ExpectedType { [key: string]: string } - location.parameters; // $ExpectedType { [key: string]: ReadonlyArray } + location.hash; // $ExpectType string + location.parameter; // $ExpectType { [key: string]: string; } + location.parameters; // $ExpectType { [key: string]: ReadonlyArray; } }); google.script.history.push(null); @@ -13,10 +13,10 @@ google.script.history.replace({ timestamp: Date.now() }, { foo: 'bar', fiz: 'baz google.script.history.replace({ timestamp: Date.now() }, { foo: ['bar', 'cat'], fiz: 'baz' }, 'anchor1'); google.script.history.setChangeHandler(e => { - e.state; // $ExpectedType google.script.history.State - e.location.hash; // $ExpectedType string - e.location.parameter; // $ExpectedType { [key: string]: string } - e.location.parameters; // $ExpectedType { [key: string]: ReadonlyArray } + e.state; // $ExpectType State + e.location.hash; // $ExpectType string + e.location.parameter; // $ExpectType { [key: string]: string; } + e.location.parameters; // $ExpectType { [key: string]: ReadonlyArray; } }); google.script.host.origin; // $ExpectType string From 601b7987f0ac97e3927a53bb7f6db23d6f8b4453 Mon Sep 17 00:00:00 2001 From: clomie Date: Sun, 3 Mar 2019 13:02:12 +0900 Subject: [PATCH 278/924] [google.script.client-side] Improve type of google.script.run --- .../google.script.client-side-tests.ts | 76 +++++++++++++++++-- types/google.script.client-side/index.d.ts | 12 +-- types/google.script.client-side/tsconfig.json | 3 +- 3 files changed, 79 insertions(+), 12 deletions(-) diff --git a/types/google.script.client-side/google.script.client-side-tests.ts b/types/google.script.client-side/google.script.client-side-tests.ts index b0cb508777..57867f8456 100644 --- a/types/google.script.client-side/google.script.client-side-tests.ts +++ b/types/google.script.client-side/google.script.client-side-tests.ts @@ -25,15 +25,79 @@ google.script.host.editor.focus(); google.script.host.setHeight(450); google.script.host.setWidth(300); -google.script.run.withSuccessHandler(() => {}).executeScript({ message: 'test for google.script.run' }); +google.script.run.withSuccessHandler(() => {}); // $ExpectType Runner +google.script.run.withFailureHandler(() => {}); // $ExpectType Runner +google.script.run.withUserObject({}); // $ExpectType Runner google.script.run .withSuccessHandler(value => {}) - .withFailureHandler(error => {}) - .getEmail(); + .withFailureHandler(error => { + error; // $ExpectType Error + }); google.script.run .withSuccessHandler((value, userObject) => {}) - .withFailureHandler((error, userObject) => {}) - .withUserObject({}) - .getSomeData(Date.now(), { options: 'none' }, 'anchor1', true, null); + .withFailureHandler((error, userObject) => { + error; // $ExpectType Error + }) + .withUserObject({}); + +google.script.run.testFunctionWithoutParameter(); +google.script.run.testFunctionWithNumber(0); +google.script.run.testFunctionWithBoolean(true); +google.script.run.testFunctionWithString(""); +google.script.run.testFunctionWithNull(null); +google.script.run.testFunctionWithArray([ + 0, + true, + "", + null, + undefined, + [], + { + number: 0, + boolean: true, + string: "", + nullValue: null, + undef: undefined, + array: [0, true, "", null, undefined, [], {}], + object: {} + } +]); +google.script.run.testFunctionWithObject({ + number: 0, + boolean: true, + string: "", + nullValue: null, + undef: undefined, + array: [0, true, "", null, undefined, [], {}], + object: {} +}); +google.script.run.testFunctionWithMultipleParameters( + 0, + true, + "", + null, + undefined, + [ + 0, + true, + "", + null, + undefined, + [], + {} + ], + { + number: 0, + boolean: true, + string: "", + nullValue: null, + undef: undefined, + array: [0, true, "", null, undefined, [], {}], + object: {} + } +); +google.script.run.testFunctionWithForm(new HTMLFormElement()); +google.script.run.testFunctionWithDateError(new Date()); // $ExpectError +google.script.run.testFunctionWithFunctionError(() => {}); // $ExpectError diff --git a/types/google.script.client-side/index.d.ts b/types/google.script.client-side/index.d.ts index 7d497fd6c2..23e92255a7 100644 --- a/types/google.script.client-side/index.d.ts +++ b/types/google.script.client-side/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for non-npm package Google Apps Script Client-side API 0.0 +// Type definitions for non-npm package Google Apps Script Client-side API 0.1 // Project: https://developers.google.com/apps-script/guides/html/reference/host // Definitions by: clomie // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -118,12 +118,14 @@ declare namespace google.script { const run: Runner; - interface Runner { + type Parameter = number | boolean | string | { [index: number]: Parameter } | { [key: string]: Parameter } | null | undefined; + + type Runner = { /** * Executes the server-side Apps Script function with the corresponding name. */ - [functionName: string]: (...args: any[]) => void; - + [functionName: string]: (first?: Parameter | HTMLFormElement, ...rest: Parameter[]) => void; + } & { /** * Sets a callback function to run if the server-side function throws an exception. * Without a failure handler, failures are logged to the JavaScript console. @@ -147,5 +149,5 @@ declare namespace google.script { * User objects cannot, however, be objects constructed with the new operator */ withUserObject(object: any): Runner; - } + }; } diff --git a/types/google.script.client-side/tsconfig.json b/types/google.script.client-side/tsconfig.json index 83c99e2f06..e573df04f9 100644 --- a/types/google.script.client-side/tsconfig.json +++ b/types/google.script.client-side/tsconfig.json @@ -2,7 +2,8 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], "noImplicitAny": true, "noImplicitThis": true, From f802af39041b1b02d5d00d20c8cf4333f38e369c Mon Sep 17 00:00:00 2001 From: loli Date: Sun, 3 Mar 2019 12:03:23 +0800 Subject: [PATCH 279/924] file update --- types/retinajs/index.d.ts | 42 ++++++++++++++++---------------- types/retinajs/retinajs-test.ts | 3 --- types/retinajs/retinajs-tests.ts | 3 +++ types/retinajs/tsconfig.json | 2 +- 4 files changed, 25 insertions(+), 25 deletions(-) delete mode 100644 types/retinajs/retinajs-test.ts create mode 100644 types/retinajs/retinajs-tests.ts diff --git a/types/retinajs/index.d.ts b/types/retinajs/index.d.ts index 58b3e3b653..7d02ebc90b 100644 --- a/types/retinajs/index.d.ts +++ b/types/retinajs/index.d.ts @@ -1,42 +1,42 @@ +// Type definitions for retinajs 2.1 +// Project: https://github.com/strues/retinajs +// Definitions by: senjyouhara +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + export = retinajs.retina; export as namespace retinajs; declare namespace retinajs { - var hasWindow: boolean; + // var hasWindow: boolean; - var environment: number; + // var environment: number; - var srcReplace: RegExp; + // var srcReplace: RegExp; - var inlineReplace: RegExp; + // var inlineReplace: RegExp; - var selector: string; + // var selector: string; - var processedAttr: string; + // var processedAttr: string; - var processedAttr: string; + // var processedAttr: string; - function arrayify(object: any): HTMLImageElement[]; + // function arrayify(object: any): any[]; - function chooseCap(cap: number | string): number; + // function chooseCap(cap: number | string): number; - function forceOriginalDimensions(image: HTMLImageElement): HTMLImageElement; + // function forceOriginalDimensions(image: any): any; - function setSourceIfAvailable( - image: HTMLImageElement, - retinaURL: string - ): void; + // function setSourceIfAvailable(image: any, retinaURL: string): void; - function dynamicSwapImage(image: HTMLImageElement, src: string): void; + // function dynamicSwapImage(image: any, src: string): void; - function manualSwapImage(image: HTMLImageElement, hdsrc: string): void; + // function manualSwapImage(image: any, hdsrc: string): void; - function getImages(images: HTMLImageElement[] | null): HTMLImageElement[]; + // function getImages(images: any[] | null): any[]; - function cleanBgImg(img: HTMLImageElement): HTMLImageElement; + // function cleanBgImg(img: any): any; - function retina(): void; - - function retina(images: any): void; + function retina(images?: any): void; } diff --git a/types/retinajs/retinajs-test.ts b/types/retinajs/retinajs-test.ts deleted file mode 100644 index 9795d8922e..0000000000 --- a/types/retinajs/retinajs-test.ts +++ /dev/null @@ -1,3 +0,0 @@ -const retinajs = require("retinajs"); - -window.addEventListener("load", retinajs); diff --git a/types/retinajs/retinajs-tests.ts b/types/retinajs/retinajs-tests.ts new file mode 100644 index 0000000000..382f843e60 --- /dev/null +++ b/types/retinajs/retinajs-tests.ts @@ -0,0 +1,3 @@ +import retina = require("retinajs"); + +retina(); diff --git a/types/retinajs/tsconfig.json b/types/retinajs/tsconfig.json index a137453eb4..c022eaf6cc 100644 --- a/types/retinajs/tsconfig.json +++ b/types/retinajs/tsconfig.json @@ -18,6 +18,6 @@ }, "files": [ "index.d.ts", - "retinajs-test.ts" + "retinajs-tests.ts" ] } From bebc13ea5b1babb1bfe55d7f4ff138da7196b3ef Mon Sep 17 00:00:00 2001 From: Justin Hall Date: Sat, 2 Mar 2019 20:46:25 -0700 Subject: [PATCH 280/924] [cypress-axe] update types for v0.4.0 --- types/cypress-axe/index.d.ts | 6 ++++-- types/cypress-axe/package.json | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 types/cypress-axe/package.json diff --git a/types/cypress-axe/index.d.ts b/types/cypress-axe/index.d.ts index 507a5f773d..8231c364be 100644 --- a/types/cypress-axe/index.d.ts +++ b/types/cypress-axe/index.d.ts @@ -1,12 +1,14 @@ -// Type definitions for cypress-axe 0.3 +// Type definitions for cypress-axe 0.4 // Project: https://github.com/avanslaars/cypress-axe#readme // Definitions by: Justin Hall // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 +import { ElementContext, RunOptions } from 'axe-core'; declare namespace Cypress { interface Chainable { injectAxe(): void; - checkA11y(): void; + checkA11y(context?: ElementContext, options?: RunOptions): void; + configureAxe(options?: RunOptions): void; } } diff --git a/types/cypress-axe/package.json b/types/cypress-axe/package.json new file mode 100644 index 0000000000..71df6dd355 --- /dev/null +++ b/types/cypress-axe/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "axe-core": "^3.1.2" + } +} From 1b05c90543db62948cc508199160b9e9c4a134b8 Mon Sep 17 00:00:00 2001 From: Justin Hall Date: Sat, 2 Mar 2019 21:25:29 -0700 Subject: [PATCH 281/924] [cypress-axe] augment axe-core's Node type --- types/cypress-axe/index.d.ts | 5 +++++ types/cypress-axe/tslint.json | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/types/cypress-axe/index.d.ts b/types/cypress-axe/index.d.ts index 8231c364be..c2158fd5ec 100644 --- a/types/cypress-axe/index.d.ts +++ b/types/cypress-axe/index.d.ts @@ -3,8 +3,13 @@ // Definitions by: Justin Hall // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 + import { ElementContext, RunOptions } from 'axe-core'; +declare module "axe-core" { + interface Node {} +} + declare namespace Cypress { interface Chainable { injectAxe(): void; diff --git a/types/cypress-axe/tslint.json b/types/cypress-axe/tslint.json index 3db14f85ea..4f44991c3c 100644 --- a/types/cypress-axe/tslint.json +++ b/types/cypress-axe/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + "no-empty-interface": false + } +} From 232ae8a9252d5499d82e74d23ef64d1ae9e22a59 Mon Sep 17 00:00:00 2001 From: Jack Wilsdon Date: Sun, 3 Mar 2019 05:34:01 +0000 Subject: [PATCH 282/924] webpack-env: Make module.hot.accept callback optional --- types/webpack-env/index.d.ts | 4 ++-- types/webpack-env/webpack-env-tests.ts | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/types/webpack-env/index.d.ts b/types/webpack-env/index.d.ts index 705e776c1e..3677523927 100644 --- a/types/webpack-env/index.d.ts +++ b/types/webpack-env/index.d.ts @@ -122,13 +122,13 @@ declare namespace __WebpackModuleApi { * @param dependencies * @param callback */ - accept(dependencies: string[], callback: (updatedDependencies: ModuleId[]) => void): void; + accept(dependencies: string[], callback?: (updatedDependencies: ModuleId[]) => void): void; /** * Accept code updates for the specified dependencies. The callback is called when dependencies were replaced. * @param dependency * @param callback */ - accept(dependency: string, callback: () => void): void; + accept(dependency: string, callback?: () => void): void; /** * Accept code updates for this module without notification of parents. * This should only be used if the module doesn’t export anything. diff --git a/types/webpack-env/webpack-env-tests.ts b/types/webpack-env/webpack-env-tests.ts index 61fb3f6c55..b07a3b632a 100644 --- a/types/webpack-env/webpack-env-tests.ts +++ b/types/webpack-env/webpack-env-tests.ts @@ -19,6 +19,9 @@ require(['./someModule', './otherModule'], (someModule: SomeModule, otherModule: // check if HMR is enabled if(module.hot) { + // accept update of dependency without a callback + module.hot.accept("./handler.js"); + // accept update of dependency module.hot.accept("./handler.js", function() { //... From 6d45563a4a6a896d2c1075bc50b3458500c5a529 Mon Sep 17 00:00:00 2001 From: Justin Hall Date: Sat, 2 Mar 2019 22:50:39 -0700 Subject: [PATCH 283/924] [cypress-axe] switch to inline import() to reference axe-core types --- types/cypress-axe/index.d.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/types/cypress-axe/index.d.ts b/types/cypress-axe/index.d.ts index c2158fd5ec..628ba66397 100644 --- a/types/cypress-axe/index.d.ts +++ b/types/cypress-axe/index.d.ts @@ -4,16 +4,13 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -import { ElementContext, RunOptions } from 'axe-core'; - -declare module "axe-core" { - interface Node {} -} - declare namespace Cypress { interface Chainable { injectAxe(): void; - checkA11y(context?: ElementContext, options?: RunOptions): void; - configureAxe(options?: RunOptions): void; + checkA11y( + context?: import('axe-core').ElementContext, + options?: import('axe-core').RunOptions, + ): void; + configureAxe(options?: import('axe-core').RunOptions): void; } } From ed9e9089ca8977534278547934572e6e6006367f Mon Sep 17 00:00:00 2001 From: Justin Hall Date: Sat, 2 Mar 2019 22:57:34 -0700 Subject: [PATCH 284/924] [cypress-axe] reference dom lib and require TypeScript 3.1 --- types/cypress-axe/index.d.ts | 4 +++- types/cypress-axe/tslint.json | 7 +------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/types/cypress-axe/index.d.ts b/types/cypress-axe/index.d.ts index 628ba66397..10fc76e9f5 100644 --- a/types/cypress-axe/index.d.ts +++ b/types/cypress-axe/index.d.ts @@ -2,7 +2,9 @@ // Project: https://github.com/avanslaars/cypress-axe#readme // Definitions by: Justin Hall // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 3.1 + +/// declare namespace Cypress { interface Chainable { diff --git a/types/cypress-axe/tslint.json b/types/cypress-axe/tslint.json index 4f44991c3c..3db14f85ea 100644 --- a/types/cypress-axe/tslint.json +++ b/types/cypress-axe/tslint.json @@ -1,6 +1 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "no-empty-interface": false - } -} +{ "extends": "dtslint/dt.json" } From ca7e81b1f39cca6cb508613455af0eece498dc08 Mon Sep 17 00:00:00 2001 From: Adam Zerella Date: Sun, 3 Mar 2019 17:16:26 +1100 Subject: [PATCH 285/924] Added type defs for pretty-time --- types/pretty-time/index.d.ts | 40 ++++++++++++++++++++++++++ types/pretty-time/pretty-time-tests.ts | 13 +++++++++ types/pretty-time/tsconfig.json | 25 ++++++++++++++++ types/pretty-time/tslint.json | 3 ++ 4 files changed, 81 insertions(+) create mode 100644 types/pretty-time/index.d.ts create mode 100644 types/pretty-time/pretty-time-tests.ts create mode 100644 types/pretty-time/tsconfig.json create mode 100644 types/pretty-time/tslint.json diff --git a/types/pretty-time/index.d.ts b/types/pretty-time/index.d.ts new file mode 100644 index 0000000000..c46273abaa --- /dev/null +++ b/types/pretty-time/index.d.ts @@ -0,0 +1,40 @@ +// Type definitions for pretty-time 1.1 +// Project: https://github.com/jonschlinkert/pretty-time +// Definitions by: Adam Zerella +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.3 + +export type Increment = + | 'ns' + | 'nano' + | 'nanosecond' + | 'nanoseconds' + | 'ÎŒs' + | 'micro' + | 'microsecond' + | 'microseconds' + | 'ms' + | 'milli' + | 'millisecond' + | 'milliseconds' + | 's' + | 'sec' + | 'second' + | 'seconds' + | 'm' + | 'min' + | 'minute' + | 'minutes' + | 'h' + | 'hr' + | 'hour' + | 'hours' + | 'd' + | 'day' + | 'days' + | 'w' + | 'wk' + | 'week' + | 'weeks'; + +export default function(time: number[], smallest?: Increment, digits?: number): string; diff --git a/types/pretty-time/pretty-time-tests.ts b/types/pretty-time/pretty-time-tests.ts new file mode 100644 index 0000000000..c6f2e926ae --- /dev/null +++ b/types/pretty-time/pretty-time-tests.ts @@ -0,0 +1,13 @@ +import DateTime from "pretty-time"; + +DateTime([1200708, 795428088]); + +DateTime([0, 795428088]); + +DateTime([0, 795428088], 'h'); + +DateTime([0, 795428088], 'm'); + +DateTime([0, 795428088], 'ÎŒs', 2); + +DateTime([0, 795428088], 'ms', 1); diff --git a/types/pretty-time/tsconfig.json b/types/pretty-time/tsconfig.json new file mode 100644 index 0000000000..d18e4b1fa1 --- /dev/null +++ b/types/pretty-time/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [ + + ], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "pretty-time-tests.ts" + ] +} diff --git a/types/pretty-time/tslint.json b/types/pretty-time/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/pretty-time/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file From 874d94e03314a4b6bbc4faa03bd463bbb291776c Mon Sep 17 00:00:00 2001 From: Joel Spadin Date: Sun, 3 Mar 2019 01:21:10 -0600 Subject: [PATCH 286/924] Add types for webpack-watched-glob-entries-plugin --- .../index.d.ts | 17 +++++++++++ .../tsconfig.json | 23 +++++++++++++++ .../tslint.json | 1 + ...bpack-watched-glob-entries-plugin-tests.ts | 29 +++++++++++++++++++ 4 files changed, 70 insertions(+) create mode 100644 types/webpack-watched-glob-entries-plugin/index.d.ts create mode 100644 types/webpack-watched-glob-entries-plugin/tsconfig.json create mode 100644 types/webpack-watched-glob-entries-plugin/tslint.json create mode 100644 types/webpack-watched-glob-entries-plugin/webpack-watched-glob-entries-plugin-tests.ts diff --git a/types/webpack-watched-glob-entries-plugin/index.d.ts b/types/webpack-watched-glob-entries-plugin/index.d.ts new file mode 100644 index 0000000000..6f4c1b4a6a --- /dev/null +++ b/types/webpack-watched-glob-entries-plugin/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for webpack-watched-glob-entries-plugin 2.1 +// Project: https://github.com/Milanzor/webpack-watched-glob-entries-plugin#readme +// Definitions by: Joel Spadin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { IOptions } from 'glob'; +import { EntryFunc, Plugin } from 'webpack'; + +export interface PluginOptions { + basename_as_entry_name?: boolean; +} + +export default class WebpackWatchedGlobEntries extends Plugin { + static getEntries(globs: string[], globOptions?: IOptions, pluginOptions?: PluginOptions): EntryFunc; + static getFiles(globString: string, globOptions?: IOptions, basename_as_entry_name?: boolean): Record; +} diff --git a/types/webpack-watched-glob-entries-plugin/tsconfig.json b/types/webpack-watched-glob-entries-plugin/tsconfig.json new file mode 100644 index 0000000000..20777e1cef --- /dev/null +++ b/types/webpack-watched-glob-entries-plugin/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "webpack-watched-glob-entries-plugin-tests.ts" + ] +} diff --git a/types/webpack-watched-glob-entries-plugin/tslint.json b/types/webpack-watched-glob-entries-plugin/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/webpack-watched-glob-entries-plugin/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/webpack-watched-glob-entries-plugin/webpack-watched-glob-entries-plugin-tests.ts b/types/webpack-watched-glob-entries-plugin/webpack-watched-glob-entries-plugin-tests.ts new file mode 100644 index 0000000000..1c87b080a1 --- /dev/null +++ b/types/webpack-watched-glob-entries-plugin/webpack-watched-glob-entries-plugin-tests.ts @@ -0,0 +1,29 @@ +import GlobEntriesPlugin from 'webpack-watched-glob-entries-plugin'; + +new GlobEntriesPlugin(); // $ExpectType WebpackWatchedGlobEntries + +GlobEntriesPlugin.getEntries(['']); // $ExpectType EntryFunc + +// $ExpectType EntryFunc +GlobEntriesPlugin.getEntries([''], { + ignore: '' +}); + +// $ExpectType EntryFunc +GlobEntriesPlugin.getEntries([''], { + ignore: '', +}, { + basename_as_entry_name: true, +}); + +GlobEntriesPlugin.getFiles(''); // $ExpectType Record + +// $ExpectType Record +GlobEntriesPlugin.getFiles('', { + ignore: '', +}); + +// $ExpectType Record +GlobEntriesPlugin.getFiles('', { + ignore: '', +}, true); From 2d91880e13bf25f568bb4ac990e401afafa82122 Mon Sep 17 00:00:00 2001 From: Himenon <6715229+Himenon@users.noreply.github.com> Date: Sun, 3 Mar 2019 17:57:23 +0900 Subject: [PATCH 287/924] webpack-dev-server: add server argument --- types/webpack-dev-server/index.d.ts | 6 +++--- types/webpack-dev-server/webpack-dev-server-tests.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/types/webpack-dev-server/index.d.ts b/types/webpack-dev-server/index.d.ts index 30fd2482e7..602d23ce13 100644 --- a/types/webpack-dev-server/index.d.ts +++ b/types/webpack-dev-server/index.d.ts @@ -52,11 +52,11 @@ declare namespace WebpackDevServer { interface Configuration { /** Provides the ability to execute custom middleware after all other middleware internally within the server. */ - after?: (app: express.Application) => void; + after?: (app: express.Application, server: WebpackDevServer) => void; /** This option allows you to whitelist services that are allowed to access the dev server. */ allowedHosts?: string[]; /** Provides the ability to execute custom middleware prior to all other middleware internally within the server. */ - before?: (app: express.Application) => void; + before?: (app: express.Application, server: WebpackDevServer) => void; /** This option broadcasts the server via ZeroConf networking on start. */ bonjour?: boolean; /** @@ -150,7 +150,7 @@ declare namespace WebpackDevServer { */ quiet?: boolean; /** @deprecated Here you can access the Express app object and add your own custom middleware to it. */ - setup?: (app: express.Application) => void; + setup?: (app: express.Application, server: WebpackDevServer) => void; /** The Unix socket to listen to (instead of a host). */ socket?: string; /** It is possible to configure advanced options for serving static files from contentBase. */ diff --git a/types/webpack-dev-server/webpack-dev-server-tests.ts b/types/webpack-dev-server/webpack-dev-server-tests.ts index 755245b035..dc59d75736 100644 --- a/types/webpack-dev-server/webpack-dev-server-tests.ts +++ b/types/webpack-dev-server/webpack-dev-server-tests.ts @@ -46,7 +46,7 @@ const config: WebpackDevServer.Configuration = { "**": "http://localhost:9090" }, - setup: (app: Application) => { + setup: (app: Application, server: WebpackDevServer) => { // Here you can access the Express app object and add your own custom middleware to it. // For example, to define custom handlers for some paths: app.get('/some/path', (req, res) => { From d1b4d296b7110a5f0b9638fbbf99c2e2a9ab488a Mon Sep 17 00:00:00 2001 From: Dimitri Benin Date: Sun, 3 Mar 2019 10:16:42 +0100 Subject: [PATCH 288/924] [is-online] Remove types --- notNeededPackages.json | 6 ++++++ types/is-online/index.d.ts | 34 ------------------------------ types/is-online/is-online-tests.ts | 6 ------ types/is-online/tsconfig.json | 23 -------------------- types/is-online/tslint.json | 1 - 5 files changed, 6 insertions(+), 64 deletions(-) delete mode 100644 types/is-online/index.d.ts delete mode 100644 types/is-online/is-online-tests.ts delete mode 100644 types/is-online/tsconfig.json delete mode 100644 types/is-online/tslint.json diff --git a/notNeededPackages.json b/notNeededPackages.json index 4289393363..a82e65f606 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -834,6 +834,12 @@ "sourceRepoURL": "https://github.com/blakeembrey/is-lower-case", "asOfVersion": "1.1.2" }, + { + "libraryName": "is-online", + "typingsPackageName": "is-online", + "sourceRepoURL": "https://github.com/sindresorhus/is-online", + "asOfVersion": "8.1.0" + }, { "libraryName": "is-plain-object", "typingsPackageName": "is-plain-object", diff --git a/types/is-online/index.d.ts b/types/is-online/index.d.ts deleted file mode 100644 index 04fa123c44..0000000000 --- a/types/is-online/index.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -// Type definitions for is-online 8.0 -// Project: https://github.com/sindresorhus/is-online#readme -// Definitions by: BendingBender -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export = isOnline; - -/** - * Check if the internet connection is up. - * - * The following checks are run in parallel: - * - Retrieve [icanhazip.com](https://github.com/major/icanhaz) via HTTPS - * - Query `myip.opendns.com` on OpenDNS (Node.js only) - * - Retrieve Apple's Captive Portal test page (Node.js only) - * - * When the first check succeeds, the returned Promise is resolved to `true`. - */ -declare function isOnline(options?: isOnline.Options): Promise; - -declare namespace isOnline { - interface Options { - /** - * Milliseconds to wait for a server to respond. - * @default 5000 - */ - timeout?: number; - /** - * Internet Protocol version to use. This is an advanced option that is usually not necessary to be set, - * but it can prove useful to specifically assert IPv6 connectivity. - * @default 'v4' - */ - version?: 'v4' | 'v6'; - } -} diff --git a/types/is-online/is-online-tests.ts b/types/is-online/is-online-tests.ts deleted file mode 100644 index 74dbda5efa..0000000000 --- a/types/is-online/is-online-tests.ts +++ /dev/null @@ -1,6 +0,0 @@ -import isOnline = require('is-online'); - -isOnline(); // $ExpectType Promise -isOnline({ timeout: 10 }); // $ExpectType Promise -isOnline({ version: 'v4' }); // $ExpectType Promise -isOnline({ version: 'v6' }); // $ExpectType Promise diff --git a/types/is-online/tsconfig.json b/types/is-online/tsconfig.json deleted file mode 100644 index 7009c26024..0000000000 --- a/types/is-online/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "is-online-tests.ts" - ] -} diff --git a/types/is-online/tslint.json b/types/is-online/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/is-online/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" } From 46096ba4f75f6c76d1ea20c02f93e9829508c77b Mon Sep 17 00:00:00 2001 From: Dmitrii Sorin Date: Sun, 3 Mar 2019 19:38:04 +1100 Subject: [PATCH 289/924] Change pdfjs-dist typings to reflect the newest major version --- types/pdfjs-dist/index.d.ts | 710 +++++++++++++-------------- types/pdfjs-dist/pdfjs-dist-tests.ts | 10 +- 2 files changed, 352 insertions(+), 368 deletions(-) diff --git a/types/pdfjs-dist/index.d.ts b/types/pdfjs-dist/index.d.ts index 81de4624f9..84d40e926a 100644 --- a/types/pdfjs-dist/index.d.ts +++ b/types/pdfjs-dist/index.d.ts @@ -1,487 +1,471 @@ -// Type definitions for PDF.js v0.1.0 +// Type definitions for PDF.js v2.0 // Project: https://github.com/mozilla/pdf.js -// Definitions by: Josh Baldwin +// Definitions by: Josh Baldwin , Dmitrii Sorin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.0 -/* -Copyright (c) 2013 Josh Baldwin https://github.com/jbaldwin/pdf.d.ts - -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. -*/ +/// interface PDFPromise { - isResolved(): boolean; - isRejected(): boolean; - resolve(value: T): void; - reject(reason: string): void; - then(onResolve: (promise: T) => U, onReject?: (reason: string) => void): PDFPromise; + isResolved(): boolean; + isRejected(): boolean; + resolve(value: T): void; + reject(reason: string): void; + then(onResolve: (promise: T) => U, onReject?: (reason: string) => void): PDFPromise; } interface PDFTreeNode { - title: string; - bold: boolean; - italic: boolean; - color: number[]; // [r,g,b] - dest: any; - items: PDFTreeNode[]; + title: string; + bold: boolean; + italic: boolean; + color: number[]; // [r,g,b] + dest: any; + items: PDFTreeNode[]; } interface PDFInfo { - PDFFormatVersion: string; - IsAcroFormPresent: boolean; - IsXFAPresent: boolean; - [key: string]: any; // return type is string, typescript chokes + PDFFormatVersion: string; + IsAcroFormPresent: boolean; + IsXFAPresent: boolean; + [key: string]: any; // return type is string, typescript chokes } interface PDFMetadata { - parse(): void; - get(name: string): string; - has(name: string): boolean; + parse(): void; + get(name: string): string; + has(name: string): boolean; } interface PDFSource { - url?: string; - data?: Uint8Array; - httpHeaders?: any; - password?: string; + url?: string; + data?: Uint8Array; + httpHeaders?: any; + password?: string; } interface PDFProgressData { - loaded: number; - total: number; + loaded: number; + total: number; } interface PDFDocumentProxy { - /** - * Total number of pages the PDF contains. - **/ - numPages: number; + /** + * Total number of pages the PDF contains. + **/ + numPages: number; - /** - * A unique ID to identify a PDF. Not guaranteed to be unique. [jbaldwin: haha what] - **/ - fingerprint: string; + /** + * A unique ID to identify a PDF. Not guaranteed to be unique. [jbaldwin: haha what] + **/ + fingerprint: string; - /** - * True if embedded document fonts are in use. Will be set during rendering of the pages. - **/ - embeddedFontsUsed(): boolean; + /** + * True if embedded document fonts are in use. Will be set during rendering of the pages. + **/ + embeddedFontsUsed(): boolean; - /** - * @param number The page number to get. The first page is 1. - * @return A promise that is resolved with a PDFPageProxy. - **/ - getPage(number: number): PDFPromise; + /** + * @param number The page number to get. The first page is 1. + * @return A promise that is resolved with a PDFPageProxy. + **/ + getPage(number: number): PDFPromise; - /** - * TODO: return type of Promise - * A promise that is resolved with a lookup table for mapping named destinations to reference numbers. - **/ - getDestinations(): PDFPromise; + /** + * TODO: return type of Promise + * A promise that is resolved with a lookup table for mapping named destinations to reference numbers. + **/ + getDestinations(): PDFPromise; - /** - * A promise that is resolved with an array of all the JavaScript strings in the name tree. - **/ - getJavaScript(): PDFPromise; + /** + * A promise that is resolved with an array of all the JavaScript strings in the name tree. + **/ + getJavaScript(): PDFPromise; - /** - * A promise that is resolved with an array that is a tree outline (if it has one) of the PDF. @see PDFTreeNode - **/ - getOutline(): PDFPromise; + /** + * A promise that is resolved with an array that is a tree outline (if it has one) of the PDF. @see PDFTreeNode + **/ + getOutline(): PDFPromise; - /** - * A promise that is resolved with the info and metadata of the PDF. - **/ - getMetadata(): PDFPromise<{ info: PDFInfo; metadata: PDFMetadata }>; + /** + * A promise that is resolved with the info and metadata of the PDF. + **/ + getMetadata(): PDFPromise<{ info: PDFInfo; metadata: PDFMetadata }>; - /** - * Is the PDF encrypted? - **/ - isEncrypted(): PDFPromise; + /** + * Is the PDF encrypted? + **/ + isEncrypted(): PDFPromise; - /** - * A promise that is resolved with Uint8Array that has the raw PDF data. - **/ - getData(): PDFPromise; + /** + * A promise that is resolved with Uint8Array that has the raw PDF data. + **/ + getData(): PDFPromise; - /** - * TODO: return type of Promise - * A promise that is resolved when the document's data is loaded. - **/ - dataLoaded(): PDFPromise; + /** + * TODO: return type of Promise + * A promise that is resolved when the document's data is loaded. + **/ + dataLoaded(): PDFPromise; - /** - * - **/ - destroy(): void; + /** + * + **/ + destroy(): void; } interface PDFRef { - num: number; - gen: any; // todo + num: number; + gen: any; // todo } interface PDFPageViewportOptions { - viewBox: any; - scale: number; - rotation: number; - offsetX: number; - offsetY: number; - dontFlip: boolean; + viewBox: any; + scale: number; + rotation: number; + offsetX: number; + offsetY: number; + dontFlip: boolean; } interface PDFPageViewport { - width: number; - height: number; - fontScale: number; - transforms: number[]; + width: number; + height: number; + fontScale: number; + transforms: number[]; - clone(options: PDFPageViewportOptions): PDFPageViewport; - convertToViewportPoint(x: number, y: number): number[]; // [x, y] - convertToViewportRectangle(rect: number[]): number[]; // [x1, y1, x2, y2] - convertToPdfPoint(x: number, y: number): number[]; // [x, y] + clone(options: PDFPageViewportOptions): PDFPageViewport; + convertToViewportPoint(x: number, y: number): number[]; // [x, y] + convertToViewportRectangle(rect: number[]): number[]; // [x1, y1, x2, y2] + convertToPdfPoint(x: number, y: number): number[]; // [x, y] } interface PDFAnnotationData { - subtype: string; - rect: number[]; // [x1, y1, x2, y2] - annotationFlags: any; // todo - color: number[]; // [r,g,b] - borderWidth: number; - hasAppearance: boolean; + subtype: string; + rect: number[]; // [x1, y1, x2, y2] + annotationFlags: any; // todo + color: number[]; // [r,g,b] + borderWidth: number; + hasAppearance: boolean; } interface PDFAnnotations { - getData(): PDFAnnotationData; - hasHtml(): boolean; // always false - getHtmlElement(commonOjbs: any): HTMLElement; // throw new NotImplementedException() - getEmptyContainer(tagName: string, rect: number[]): HTMLElement; // deprecated - isViewable(): boolean; - loadResources(keys: any): PDFPromise; - getOperatorList(evaluator: any): PDFPromise; - // ... todo + getData(): PDFAnnotationData; + hasHtml(): boolean; // always false + getHtmlElement(commonOjbs: any): HTMLElement; // throw new NotImplementedException() + getEmptyContainer(tagName: string, rect: number[]): HTMLElement; // deprecated + isViewable(): boolean; + loadResources(keys: any): PDFPromise; + getOperatorList(evaluator: any): PDFPromise; + // ... todo } interface PDFRenderTextLayer { - beginLayout(): void; - endLayout(): void; - appendText(): void; + beginLayout(): void; + endLayout(): void; + appendText(): void; } interface PDFRenderImageLayer { - beginLayout(): void; - endLayout(): void; - appendImage(): void; + beginLayout(): void; + endLayout(): void; + appendImage(): void; } interface PDFRenderParams { - canvasContext: CanvasRenderingContext2D; - viewport?: PDFPageViewport; - textLayer?: PDFRenderTextLayer; - imageLayer?: PDFRenderImageLayer; - continueCallback?: (_continue: () => void) => void; + canvasContext: CanvasRenderingContext2D; + viewport?: PDFPageViewport; + textLayer?: PDFRenderTextLayer; + imageLayer?: PDFRenderImageLayer; + continueCallback?: (_continue: () => void) => void; } interface PDFViewerParams { - container: HTMLElement; - viewer?: HTMLElement; + container: HTMLElement; + viewer?: HTMLElement; } /** * RenderTask is basically a promise but adds a cancel function to termiate it. **/ -interface PDFRenderTask extends PDFPromise { +interface PDFRenderTask extends PDFLoadingTask { - /** - * Cancel the rendering task. If the task is currently rendering it will not be cancelled until graphics pauses with a timeout. The promise that this object extends will resolve when cancelled. - **/ - cancel(): void; + /** + * Cancel the rendering task. If the task is currently rendering it will not be cancelled until graphics pauses with a timeout. The promise that this object extends will resolve when cancelled. + **/ + cancel(): void; } interface PDFPageProxy { - /** - * Page number of the page. First page is 1. - **/ - pageNumber: number; + /** + * Page number of the page. First page is 1. + **/ + pageNumber: number; - /** - * The number of degrees the page is rotated clockwise. - **/ - rotate: number; + /** + * The number of degrees the page is rotated clockwise. + **/ + rotate: number; - /** - * The reference that points to this page. - **/ - ref: PDFRef; + /** + * The reference that points to this page. + **/ + ref: PDFRef; - /** - * @return An array of the visible portion of the PDF page in the user space units - [x1, y1, x2, y2]. - **/ - view: number[]; + /** + * @return An array of the visible portion of the PDF page in the user space units - [x1, y1, x2, y2]. + **/ + view: number[]; - /** - * @param scale The desired scale of the viewport. - * @param rotate Degrees to rotate the viewport. If omitted this defaults to the page rotation. - * @return - **/ - getViewport(scale: number, rotate?: number): PDFPageViewport; + /** + * @param scale The desired scale of the viewport. + * @param rotate Degrees to rotate the viewport. If omitted this defaults to the page rotation. + * @param dontFlip + * @return + **/ + getViewport(scale: number, rotate?: number, dontFlip?: boolean): PDFPageViewport; - /** - * A promise that is resolved with an array of the annotation objects. - **/ - getAnnotations(): PDFPromise; + /** + * A promise that is resolved with an array of the annotation objects. + **/ + getAnnotations(): PDFPromise; - /** - * Begins the process of rendering a page to the desired context. - * @param params Rendering options. - * @return An extended promise that is resolved when the page finishes rendering. - **/ - render(params: PDFRenderParams): PDFRenderTask; + /** + * Begins the process of rendering a page to the desired context. + * @param params Rendering options. + * @return An extended promise that is resolved when the page finishes rendering. + **/ + render(params: PDFRenderParams): PDFRenderTask; - /** - * A promise that is resolved with the string that is the text content frm the page. - **/ - getTextContent(): PDFPromise; + /** + * A promise that is resolved with the string that is the text content frm the page. + **/ + getTextContent(): PDFPromise; - /** - * marked as future feature - **/ - //getOperationList(): PDFPromise<>; + /** + * marked as future feature + **/ + //getOperationList(): PDFPromise<>; - /** - * Destroyes resources allocated by the page. - **/ - destroy(): void; + /** + * Destroyes resources allocated by the page. + **/ + destroy(): void; } interface TextContentItem { - str: string; - transform: number[]; // [0..5] 4=x, 5=y - width: number; - height: number; - dir: string; // Left-to-right (ltr), etc - fontName: string; // A lookup into the styles map of the owning TextContent + str: string; + transform: number[]; // [0..5] 4=x, 5=y + width: number; + height: number; + dir: string; // Left-to-right (ltr), etc + fontName: string; // A lookup into the styles map of the owning TextContent } interface TextContent { - items: TextContentItem[]; - styles: any; + items: TextContentItem[]; + styles: any; } /** * A PDF document and page is built of many objects. E.g. there are objects for fonts, images, rendering code and such. These objects might get processed inside of a worker. The `PDFObjects` implements some basic functions to manage these objects. **/ interface PDFObjects { - get(objId: number, callback?: any): any; - resolve(objId: number, data: any): any; - isResolved(objId: number): boolean; - hasData(objId: number): boolean; - getData(objId: number): any; - clear(): void; + get(objId: number, callback?: any): any; + resolve(objId: number, data: any): any; + isResolved(objId: number): boolean; + hasData(objId: number): boolean; + getData(objId: number): any; + clear(): void; } interface PDFJSUtilStatic { - /** - * Normalize rectangle so that (x1,y1) < (x2,y2) - * @param {number[]} rect - the rectangle with [x1,y1,x2,y2] - * - * For coordinate systems whose origin lies in the bottom-left, this - * means normalization to (BL,TR) ordering. For systems with origin in the - * top-left, this means (TL,BR) ordering. - **/ - normalizeRect(rect:number[]): number[]; + /** + * Normalize rectangle so that (x1,y1) < (x2,y2) + * @param {number[]} rect - the rectangle with [x1,y1,x2,y2] + * + * For coordinate systems whose origin lies in the bottom-left, this + * means normalization to (BL,TR) ordering. For systems with origin in the + * top-left, this means (TL,BR) ordering. + **/ + normalizeRect(rect:number[]): number[]; } export const PDFJS: PDFJSStatic; interface PDFJSStatic { - /** - * The maximum allowed image size in total pixels e.g. width * height. Images above this value will not be drawn. Use -1 for no limit. - **/ - maxImageSize: number; + /** + * The maximum allowed image size in total pixels e.g. width * height. Images above this value will not be drawn. Use -1 for no limit. + **/ + maxImageSize: number; - /** - * The url of where the predefined Adobe CMaps are located. Include trailing - * slash. - */ - cMapUrl: string; + /** + * The url of where the predefined Adobe CMaps are located. Include trailing + * slash. + */ + cMapUrl: string; - /** - * Specifies if CMaps are binary packed. - */ - cMapPacked: boolean; + /** + * Specifies if CMaps are binary packed. + */ + cMapPacked: boolean; - /** - * By default fonts are converted to OpenType fonts and loaded via font face rules. If disabled, the font will be rendered using a built in font renderer that constructs the glyphs with primitive path commands. - **/ - disableFontFace: boolean; + /** + * By default fonts are converted to OpenType fonts and loaded via font face rules. If disabled, the font will be rendered using a built in font renderer that constructs the glyphs with primitive path commands. + **/ + disableFontFace: boolean; - /** - * Path for image resources, mainly for annotation icons. Include trailing - * slash. - */ - imageResourcesPath: string; + /** + * Path for image resources, mainly for annotation icons. Include trailing + * slash. + */ + imageResourcesPath: string; - /** - * Disable the web worker and run all code on the main thread. This will happen - * automatically if the browser doesn't support workers or sending typed arrays - * to workers. - */ - disableWorker: boolean; + /** + * Disable the web worker and run all code on the main thread. This will happen + * automatically if the browser doesn't support workers or sending typed arrays + * to workers. + */ + disableWorker: boolean; - /** - * Path and filename of the worker file. Required when the worker is enabled in - * development mode. If unspecified in the production build, the worker will be - * loaded based on the location of the pdf.js file. - */ - workerSrc: string; + /** + * Path and filename of the worker file. Required when the worker is enabled in + * development mode. If unspecified in the production build, the worker will be + * loaded based on the location of the pdf.js file. + */ + workerSrc: string; - /** - * Disable range request loading of PDF files. When enabled and if the server - * supports partial content requests then the PDF will be fetched in chunks. - * Enabled (false) by default. - */ - disableRange: boolean; + /** + * Disable range request loading of PDF files. When enabled and if the server + * supports partial content requests then the PDF will be fetched in chunks. + * Enabled (false) by default. + */ + disableRange: boolean; - /** - * Disable streaming of PDF file data. By default PDF.js attempts to load PDF - * in chunks. This default behavior can be disabled. - */ - disableStream: boolean; + /** + * Disable streaming of PDF file data. By default PDF.js attempts to load PDF + * in chunks. This default behavior can be disabled. + */ + disableStream: boolean; - /** - * Disable pre-fetching of PDF file data. When range requests are enabled PDF.js - * will automatically keep fetching more data even if it isn't needed to display - * the current page. This default behavior can be disabled. - * - * NOTE: It is also necessary to disable streaming, see above, - * in order for disabling of pre-fetching to work correctly. - */ - disableAutoFetch: boolean; + /** + * Disable pre-fetching of PDF file data. When range requests are enabled PDF.js + * will automatically keep fetching more data even if it isn't needed to display + * the current page. This default behavior can be disabled. + * + * NOTE: It is also necessary to disable streaming, see above, + * in order for disabling of pre-fetching to work correctly. + */ + disableAutoFetch: boolean; - /** - * Enables special hooks for debugging PDF.js. - */ - pdfBug: boolean; + /** + * Enables special hooks for debugging PDF.js. + */ + pdfBug: boolean; - /** - * Enables transfer usage in postMessage for ArrayBuffers. - */ - postMessageTransfers: boolean; + /** + * Enables transfer usage in postMessage for ArrayBuffers. + */ + postMessageTransfers: boolean; - /** - * Disables URL.createObjectURL usage. - */ - disableCreateObjectURL: boolean; + /** + * Disables URL.createObjectURL usage. + */ + disableCreateObjectURL: boolean; - /** - * Disables WebGL usage. - */ - disableWebGL: boolean; + /** + * Disables WebGL usage. + */ + disableWebGL: boolean; - /** - * Disables fullscreen support, and by extension Presentation Mode, - * in browsers which support the fullscreen API. - */ - disableFullscreen: boolean; + /** + * Disables fullscreen support, and by extension Presentation Mode, + * in browsers which support the fullscreen API. + */ + disableFullscreen: boolean; - /** - * Disable the text layer of PDF when used PDF.js renders a canvas instead of div elements - * - */ - disableTextLayer: boolean; + /** + * Disable the text layer of PDF when used PDF.js renders a canvas instead of div elements + * + */ + disableTextLayer: boolean; - /** - * Enables CSS only zooming. - */ - useOnlyCssZoom: boolean; + /** + * Enables CSS only zooming. + */ + useOnlyCssZoom: boolean; - /** - * Controls the logging level. - * The constants from PDFJS.VERBOSITY_LEVELS should be used: - * - errors - * - warnings [default] - * - infos - */ - verbosity: number; + /** + * Controls the logging level. + * The constants from PDFJS.VERBOSITY_LEVELS should be used: + * - errors + * - warnings [default] + * - infos + */ + verbosity: number; - /** - * The maximum supported canvas size in total pixels e.g. width * height. - * The default value is 4096 * 4096. Use -1 for no limit. - */ - maxCanvasPixels: number; + /** + * The maximum supported canvas size in total pixels e.g. width * height. + * The default value is 4096 * 4096. Use -1 for no limit. + */ + maxCanvasPixels: number; - /** - * Opens external links in a new window if enabled. The default behavior opens - * external links in the PDF.js window. - */ - openExternalLinksInNewWindow: boolean; + /** + * Opens external links in a new window if enabled. The default behavior opens + * external links in the PDF.js window. + */ + openExternalLinksInNewWindow: boolean; - /** - * Determines if we can eval strings as JS. Primarily used to improve - * performance for font rendering. - */ - isEvalSupported: boolean; + /** + * Determines if we can eval strings as JS. Primarily used to improve + * performance for font rendering. + */ + isEvalSupported: boolean; - Util: PDFJSUtilStatic; - - /** - * This is the main entry point for loading a PDF and interacting with it. - * NOTE: If a URL is used to fetch the PDF data a standard XMLHttpRequest(XHR) - * is used, which means it must follow the same origin rules that any XHR does - * e.g. No corss domain requests without CORS. - * @param source - * @param pdfDataRangeTransport Used if you want to manually server range requests for data in the PDF. @ee viewer.js for an example of pdfDataRangeTransport's interface. - * @param passwordCallback Used to request a password if wrong or no password was provided. The callback receives two parameters: function that needs to be called with new password and the reason. - * @param progressCallback Progress callback. - * @return A promise that is resolved with PDFDocumentProxy object. - **/ - getDocument( - source: string, - pdfDataRangeTransport?: any, - passwordCallback?: (fn: (password: string) => void, reason: string) => string, - progressCallback?: (progressData: PDFProgressData) => void) - : PDFPromise; - - getDocument( - source: Uint8Array, - pdfDataRangeTransport?: any, - passwordCallback?: (fn: (password: string) => void, reason: string) => string, - progressCallback?: (progressData: PDFProgressData) => void) - : PDFPromise; - - getDocument( - source: PDFSource, - pdfDataRangeTransport?: any, - passwordCallback?: (fn: (password: string) => void, reason: string) => string, - progressCallback?: (progressData: PDFProgressData) => void) - : PDFPromise; - - PDFViewer(params: PDFViewerParams): void; - /** - * yet another viewer, this will render only one page at the time, reducing rendering time - * very important for mobile development - * @params {PDFViewerParams} - */ - PDFSinglePageViewer(params: PDFViewerParams): void; + PDFViewer(params: PDFViewerParams): void; + /** + * yet another viewer, this will render only one page at the time, reducing rendering time + * very important for mobile development + * @params {PDFViewerParams} + */ + PDFSinglePageViewer(params: PDFViewerParams): void; } + +interface PDFLoadingTask { + promise: PDFPromise; +} + +declare const Util: PDFJSUtilStatic; + +/** + * This is the main entry point for loading a PDF and interacting with it. + * NOTE: If a URL is used to fetch the PDF data a standard XMLHttpRequest(XHR) + * is used, which means it must follow the same origin rules that any XHR does + * e.g. No corss domain requests without CORS. + * @param source + * @param pdfDataRangeTransport Used if you want to manually server range requests for data in the PDF. @ee viewer.js for an example of pdfDataRangeTransport's interface. + * @param passwordCallback Used to request a password if wrong or no password was provided. The callback receives two parameters: function that needs to be called with new password and the reason. + * @param progressCallback Progress callback. + * @return A promise that is resolved with PDFDocumentProxy object. + **/ +declare function getDocument( + source: string, + pdfDataRangeTransport?: any, + passwordCallback?: (fn: (password: string) => void, reason: string) => string, + progressCallback?: (progressData: PDFProgressData) => void +): PDFLoadingTask; + +declare function getDocument( + source: Uint8Array, + pdfDataRangeTransport?: any, + passwordCallback?: (fn: (password: string) => void, reason: string) => string, + progressCallback?: (progressData: PDFProgressData) => void +): PDFLoadingTask; + +declare function getDocument( + source: PDFSource, + pdfDataRangeTransport?: any, + passwordCallback?: (fn: (password: string) => void, reason: string) => string, + progressCallback?: (progressData: PDFProgressData) => void +): PDFLoadingTask; diff --git a/types/pdfjs-dist/pdfjs-dist-tests.ts b/types/pdfjs-dist/pdfjs-dist-tests.ts index ef569b2fda..cb7be752af 100644 --- a/types/pdfjs-dist/pdfjs-dist-tests.ts +++ b/types/pdfjs-dist/pdfjs-dist-tests.ts @@ -1,4 +1,4 @@ -import { PDFJS, PDFDocumentProxy, PDFPromise } from 'pdfjs-dist'; +import { getDocument, PDFDocumentProxy, PDFPromise, Util } from 'pdfjs-dist'; // // Fetch the PDF document from the URL using promises @@ -6,7 +6,7 @@ import { PDFJS, PDFDocumentProxy, PDFPromise } from 'pdfjs-dist'; var pdfDoc: PDFDocumentProxy; var pageNum: number; -PDFJS.getDocument('helloworld.pdf').then(function (pdf) { +getDocument('helloworld.pdf').promise.then(function (pdf) { // Using promise to fetch the page pdfDoc = pdf; pageNum = 1; @@ -32,7 +32,7 @@ function renderPage(pageNum: number) { // https://github.com/mozilla/pdf.js/blob/master/examples/acroforms/forms.js // const rect = viewport.convertToViewportRectangle([100,100,0,0]); - const normalizedRect = PDFJS.Util.normalizeRect(rect); + const normalizedRect = Util.normalizeRect(rect); const point = viewport.convertToViewportPoint(100, 100); const pdfPoint = viewport.convertToPdfPoint(100, 100); @@ -57,6 +57,6 @@ function goNext() { // // Test PDFPromise allows return value mutation // -var promise: PDFPromise = PDFJS.getDocument('helloworld.pdf').then(pdf => { +var promise: PDFPromise = getDocument('helloworld.pdf').promise.then(pdf => { return "arbitrary string"; -}); \ No newline at end of file +}); From 1ccfa15c9a34fa05b08e8515280b8ca22acd013f Mon Sep 17 00:00:00 2001 From: Pierre Vigier Date: Sun, 3 Mar 2019 16:16:21 +0100 Subject: [PATCH 290/924] Replace nullable by optional --- types/nodegit/diff.d.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/types/nodegit/diff.d.ts b/types/nodegit/diff.d.ts index 2f1abbda62..3a02577b98 100644 --- a/types/nodegit/diff.d.ts +++ b/types/nodegit/diff.d.ts @@ -132,16 +132,16 @@ export class Diff { * * */ - static blobToBuffer(oldBlob: Blob | null, oldAsPath: string | null, - buffer: string | null, bufferAsPath: string | null, opts: DiffOptions | null, fileCb: Function | null, - binaryCb: Function | null, hunkCb: Function | null, lineCb: Function): Promise; + static blobToBuffer(oldBlob?: Blob, oldAsPath?: string, + buffer?: string, bufferAsPath?: string, opts?: DiffOptions, fileCb?: Function, + binaryCb?: Function, hunkCb?: Function, lineCb?: Function): Promise; static fromBuffer(content: string, contentLen: number): Promise; - static indexToWorkdir(repo: Repository, index: Index | null, opts?: DiffOptions): Promise; + static indexToWorkdir(repo: Repository, index?: Index, opts?: DiffOptions): Promise; static indexToIndex(repo: Repository, oldIndex: Index, newIndex: Index, opts?: DiffOptions): Promise; - static treeToIndex(repo: Repository, oldTree: Tree | null, index: Index | null, opts?: DiffOptions): Promise; - static treeToTree(repo: Repository, oldTree: Tree | null, new_tree: Tree | null, opts?: DiffOptions): Promise; - static treeToWorkdir(repo: Repository, oldTree: Tree | null, opts?: DiffOptions): Promise; - static treeToWorkdirWithIndex(repo: Repository, oldTree: Tree | null, opts?: DiffOptions): Promise; + static treeToIndex(repo: Repository, oldTree?: Tree, index?: Index, opts?: DiffOptions): Promise; + static treeToTree(repo: Repository, oldTree?: Tree, new_tree?: Tree, opts?: DiffOptions): Promise; + static treeToWorkdir(repo: Repository, oldTree?: Tree, opts?: DiffOptions): Promise; + static treeToWorkdirWithIndex(repo: Repository, oldTree?: Tree, opts?: DiffOptions): Promise; findSimilar(options?: DiffFindOptions): Promise; getDelta(idx: number): DiffDelta; From aac82565fe94b969a0dd32cf842846cbb73ca297 Mon Sep 17 00:00:00 2001 From: Pierre Vigier Date: Sun, 3 Mar 2019 16:20:35 +0100 Subject: [PATCH 291/924] Fix types in Time --- types/nodegit/time.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/nodegit/time.d.ts b/types/nodegit/time.d.ts index 575c005781..cb42ea6838 100644 --- a/types/nodegit/time.d.ts +++ b/types/nodegit/time.d.ts @@ -1,4 +1,4 @@ export class Time { - time: number; - offset: number; + time(): number; + offset(): number; } From 5ea320d9b787f01bd9f2696172a7c9c4bf5f126c Mon Sep 17 00:00:00 2001 From: Sam Date: Sun, 3 Mar 2019 11:22:50 -0600 Subject: [PATCH 292/924] Added locale option to filesize --- types/filesize/filesize-tests.ts | 1 + types/filesize/index.d.ts | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/types/filesize/filesize-tests.ts b/types/filesize/filesize-tests.ts index 6980ac892d..aadc0542fa 100644 --- a/types/filesize/filesize-tests.ts +++ b/types/filesize/filesize-tests.ts @@ -15,6 +15,7 @@ filesize(265318, {standard: "iec"}); // "259.1 KiB" filesize(265318, {standard: "iec", fullform: true}); // "259.1 kibibytes" filesize(12, {fullform: true, fullforms: ["баĐčŃ‚ĐŸĐČ"]}); // "12 баĐčŃ‚ĐŸĐČ" filesize(265318, {separator: ","}); // "259,1 KB" +filesize(265318, {locale: 'de-DE'}); // "259,1 KB" const size = filesize.partial({standard: "iec"}); size(265318); diff --git a/types/filesize/index.d.ts b/types/filesize/index.d.ts index 33d04b66ff..d53fba8641 100644 --- a/types/filesize/index.d.ts +++ b/types/filesize/index.d.ts @@ -57,6 +57,10 @@ declare namespace Filesize { * Array of full form overrides, default is [] */ fullforms?: string[]; + /** + * BCP 47 language tag to specify a locale, or true to use default locale, default is "" + */ + locale?: string | boolean; /** * Output of function (array, exponent, object, or string), default is string */ From f5b66cb1740ee4f7afb2d399525a82aace1706bd Mon Sep 17 00:00:00 2001 From: Sam Date: Sun, 3 Mar 2019 11:28:17 -0600 Subject: [PATCH 293/924] Modified file header --- types/filesize/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/filesize/index.d.ts b/types/filesize/index.d.ts index d53fba8641..cdc9031f22 100644 --- a/types/filesize/index.d.ts +++ b/types/filesize/index.d.ts @@ -1,8 +1,9 @@ -// Type definitions for filesize 4.0 +// Type definitions for filesize 4.1.2 // Project: https://github.com/avoidwork/filesize.js, https://filesizejs.com // Definitions by: Giedrius Grabauskas // Renaud Chaput // Roman Nuritdinov +// Sam Hulick // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare var fileSize: Filesize.Filesize; From 3c211fe01dc2c08a41ba77888265180340992c16 Mon Sep 17 00:00:00 2001 From: kouros51 Date: Sun, 3 Mar 2019 16:45:17 -0500 Subject: [PATCH 294/924] Add enter and exist for a context so we set and get values and keys for certain context --- types/cls-hooked/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/cls-hooked/index.d.ts b/types/cls-hooked/index.d.ts index 57e6b79c60..c81966970c 100644 --- a/types/cls-hooked/index.d.ts +++ b/types/cls-hooked/index.d.ts @@ -12,6 +12,8 @@ export interface Namespace { set(key: string, value: T): T; get(key: string): any; + enter(context: any): void; + exit(context: any): void; run(fn: (...args: any[]) => void): void; runAndReturn(fn: (...args: any[]) => T): T; runPromise(fn: (...args: any[]) => Promise): Promise; From dc27067ac0e57e4609ffcaa8f4af841cd56f404a Mon Sep 17 00:00:00 2001 From: Sam Date: Sun, 3 Mar 2019 15:46:09 -0600 Subject: [PATCH 295/924] Removed patch part from version --- types/filesize/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/filesize/index.d.ts b/types/filesize/index.d.ts index cdc9031f22..958a5e3973 100644 --- a/types/filesize/index.d.ts +++ b/types/filesize/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for filesize 4.1.2 +// Type definitions for filesize 4.1 // Project: https://github.com/avoidwork/filesize.js, https://filesizejs.com // Definitions by: Giedrius Grabauskas // Renaud Chaput From 602e04583e74ac8eaead02a1269a9a33192e1c9a Mon Sep 17 00:00:00 2001 From: Ryo Ota Date: Mon, 4 Mar 2019 06:50:19 +0900 Subject: [PATCH 296/924] Allow user to use Buffer in load() --- types/cheerio/cheerio-tests.ts | 2 ++ types/cheerio/index.d.ts | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/types/cheerio/cheerio-tests.ts b/types/cheerio/cheerio-tests.ts index 719c0c70da..89ffb9e28f 100644 --- a/types/cheerio/cheerio-tests.ts +++ b/types/cheerio/cheerio-tests.ts @@ -24,6 +24,8 @@ if ($fromElement("ul > li").length !== 3) { throw new Error("Expecting 3 elements when passing `CheerioElement` to `load()`"); } +$ = cheerio.load(Buffer.from(html)); + $ = cheerio.load(html, { normalizeWhitespace: true, xmlMode: true diff --git a/types/cheerio/index.d.ts b/types/cheerio/index.d.ts index 6c893021a3..f25c978ed0 100644 --- a/types/cheerio/index.d.ts +++ b/types/cheerio/index.d.ts @@ -1,8 +1,10 @@ // Type definitions for Cheerio v0.22.0 // Project: https://github.com/cheeriojs/cheerio -// Definitions by: Bret Little , VILIC VANE , Wayne Maurer , Umar Nizamani , LiJinyao , Chennakrishna , AzSiAz +// Definitions by: Bret Little , VILIC VANE , Wayne Maurer , Umar Nizamani , LiJinyao , Chennakrishna , AzSiAz , Ryo Ota // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + interface Cheerio { // Document References // Cheerio https://github.com/cheeriojs/cheerio @@ -266,7 +268,7 @@ interface CheerioElement { } interface CheerioAPI extends CheerioSelector, CheerioStatic { - load(html: string, options?: CheerioOptionsInterface): CheerioStatic; + load(html: string | Buffer, options?: CheerioOptionsInterface): CheerioStatic; load(element: CheerioElement, options?: CheerioOptionsInterface): CheerioStatic; } From 1c43f86f73ca178bdc96fbd98e8e8c3b6b8219d9 Mon Sep 17 00:00:00 2001 From: kouros51 Date: Sun, 3 Mar 2019 17:32:17 -0500 Subject: [PATCH 297/924] Add in the test a use case explaining the need to expose those too new functions --- types/cls-hooked/cls-hooked-tests.ts | 21 +++++++++++++++++++++ types/cls-hooked/index.d.ts | 6 +++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/types/cls-hooked/cls-hooked-tests.ts b/types/cls-hooked/cls-hooked-tests.ts index affaa6c54a..04c0789e71 100644 --- a/types/cls-hooked/cls-hooked-tests.ts +++ b/types/cls-hooked/cls-hooked-tests.ts @@ -21,3 +21,24 @@ bindLater((x: number) => { const session2 = cls.getNamespace('my session'); session2.get('user'); + +const appNamespace = cls.createNamespace('applicationNameSpace'); +const context = appNamespace.createContext(); + +function bindWithMiddleware(middlewareFn: () => void) { + return session.bind(middlewareFn, context); +} + +bindWithMiddleware(()=>{ + // Some middleware that doing something in the application +}); + +// In some place in application, we want to set value to be used elsewhere +appNamespace.enter(context); +appNamespace.set('requestId','someId'); +appNamespace.exit(context); + +// Retrieve that value set before without losing the context when chaining several middleware +appNamespace.enter(context); +appNamespace.get('requestId'); +appNamespace.exit(context); diff --git a/types/cls-hooked/index.d.ts b/types/cls-hooked/index.d.ts index c81966970c..4fa385c52f 100644 --- a/types/cls-hooked/index.d.ts +++ b/types/cls-hooked/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for cls-hooked 4.2 +// Type definitions for cls-hooked 4.3 // Project: https://github.com/jeff-lewis/cls-hooked // Definitions by: Leo Liang // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -12,14 +12,14 @@ export interface Namespace { set(key: string, value: T): T; get(key: string): any; - enter(context: any): void; - exit(context: any): void; run(fn: (...args: any[]) => void): void; runAndReturn(fn: (...args: any[]) => T): T; runPromise(fn: (...args: any[]) => Promise): Promise; bind(fn: F, context?: any): F; // tslint:disable-line: ban-types bindEmitter(emitter: EventEmitter): void; createContext(): any; + enter(context: any): void; + exit(context: any): void; } export function createNamespace(name: string): Namespace; From 405f9855ed3194061579b15253f5a616f52310b2 Mon Sep 17 00:00:00 2001 From: kouros51 Date: Sun, 3 Mar 2019 17:39:15 -0500 Subject: [PATCH 298/924] Adding missing whitespaces --- types/cls-hooked/cls-hooked-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/cls-hooked/cls-hooked-tests.ts b/types/cls-hooked/cls-hooked-tests.ts index 04c0789e71..e1552c16e2 100644 --- a/types/cls-hooked/cls-hooked-tests.ts +++ b/types/cls-hooked/cls-hooked-tests.ts @@ -29,7 +29,7 @@ function bindWithMiddleware(middlewareFn: () => void) { return session.bind(middlewareFn, context); } -bindWithMiddleware(()=>{ +bindWithMiddleware(() => { // Some middleware that doing something in the application }); From 047237d00c412b2b5b64b92938645f8ad8dfc4a0 Mon Sep 17 00:00:00 2001 From: kouros51 Date: Sun, 3 Mar 2019 17:41:08 -0500 Subject: [PATCH 299/924] Adding missing whitespaces --- types/cls-hooked/cls-hooked-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/cls-hooked/cls-hooked-tests.ts b/types/cls-hooked/cls-hooked-tests.ts index e1552c16e2..9d9e14af1b 100644 --- a/types/cls-hooked/cls-hooked-tests.ts +++ b/types/cls-hooked/cls-hooked-tests.ts @@ -35,7 +35,7 @@ bindWithMiddleware(() => { // In some place in application, we want to set value to be used elsewhere appNamespace.enter(context); -appNamespace.set('requestId','someId'); +appNamespace.set('requestId', 'someId'); appNamespace.exit(context); // Retrieve that value set before without losing the context when chaining several middleware From 1c05fef87ebbaa0fba845af52e0ac5771a130a71 Mon Sep 17 00:00:00 2001 From: kouros51 Date: Sun, 3 Mar 2019 17:43:23 -0500 Subject: [PATCH 300/924] Fixing typo in comment --- types/cls-hooked/cls-hooked-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/cls-hooked/cls-hooked-tests.ts b/types/cls-hooked/cls-hooked-tests.ts index 9d9e14af1b..60931e1253 100644 --- a/types/cls-hooked/cls-hooked-tests.ts +++ b/types/cls-hooked/cls-hooked-tests.ts @@ -33,7 +33,7 @@ bindWithMiddleware(() => { // Some middleware that doing something in the application }); -// In some place in application, we want to set value to be used elsewhere +// In some place in the application, we want to set a value to a given key to be used elsewhere appNamespace.enter(context); appNamespace.set('requestId', 'someId'); appNamespace.exit(context); From 5c54b6a4be626ccf5668c324b80cfaf01a70c0b7 Mon Sep 17 00:00:00 2001 From: Roman Paradeev Date: Mon, 4 Mar 2019 01:23:15 +0500 Subject: [PATCH 301/924] Sinon: replace Bluebird with PromiseLike object --- types/sinon/ts3.1/sinon-tests.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/types/sinon/ts3.1/sinon-tests.ts b/types/sinon/ts3.1/sinon-tests.ts index 0f07193704..d8f5170aba 100644 --- a/types/sinon/ts3.1/sinon-tests.ts +++ b/types/sinon/ts3.1/sinon-tests.ts @@ -1,5 +1,4 @@ import sinon = require("sinon"); -import Bluebird = require("bluebird"); function testSandbox() { const obj = {}; @@ -427,7 +426,7 @@ function testStub() { const obj = class { foo() { } promiseFunc() { return Promise.resolve('foo'); } - promiseLikeFunc() { return {} as any as Bluebird; } + promiseLikeFunc() { return Promise.resolve('foo') as PromiseLike; } }; const instance = new obj(); From 7df0d1be64bd73c07028fb26493b5a78c589e679 Mon Sep 17 00:00:00 2001 From: Cameron Tacklind Date: Sun, 3 Mar 2019 17:45:05 -0800 Subject: [PATCH 302/924] Add missing includeDelimiter option to SerialPort.parsers.Readline `Readline`'s arguments are passed to `Delimiter`'s, therefore `includeDelimiter` should be added as an option to `Readline`'s constructor. https://github.com/node-serialport/node-serialport/blob/a80d0b73a1d8424901ab73b314de344dad798d12/packages/parser-readline/readline.js#L16-L22 --- types/serialport/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/serialport/index.d.ts b/types/serialport/index.d.ts index c1a81376fa..2c3cbbf6b9 100644 --- a/types/serialport/index.d.ts +++ b/types/serialport/index.d.ts @@ -100,7 +100,7 @@ declare namespace SerialPort { constructor(options: {delimiter: string | Buffer | number[], includeDelimiter?: boolean}); } class Readline extends Delimiter { - constructor(options: {delimiter: string | Buffer | number[], encoding?: 'ascii'|'utf8'|'utf16le'|'ucs2'|'base64'|'binary'|'hex'}); + constructor(options: {delimiter: string | Buffer | number[], encoding?: 'ascii'|'utf8'|'utf16le'|'ucs2'|'base64'|'binary'|'hex', includeDelimiter?: boolean}); } class Ready extends Stream.Transform { constructor(options: {delimiter: string | Buffer | number[]}); From 1136cb28a384d483bfe0eabca24e4c8e6417e918 Mon Sep 17 00:00:00 2001 From: Justin Hall Date: Sun, 3 Mar 2019 19:06:56 -0700 Subject: [PATCH 303/924] [cypress-axe] fix all the things --- types/cypress-axe/index.d.ts | 23 +++++++++++++---------- types/cypress-axe/tslint.json | 7 ++++++- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/types/cypress-axe/index.d.ts b/types/cypress-axe/index.d.ts index 10fc76e9f5..3ba776e14f 100644 --- a/types/cypress-axe/index.d.ts +++ b/types/cypress-axe/index.d.ts @@ -2,17 +2,20 @@ // Project: https://github.com/avanslaars/cypress-axe#readme // Definitions by: Justin Hall // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 3.1 +// TypeScript Version: 2.3 -/// +import { ElementContext, RunOptions } from 'axe-core'; -declare namespace Cypress { - interface Chainable { - injectAxe(): void; - checkA11y( - context?: import('axe-core').ElementContext, - options?: import('axe-core').RunOptions, - ): void; - configureAxe(options?: import('axe-core').RunOptions): void; +declare module 'axe-core' { + interface Node {} +} + +declare global { + namespace Cypress { + interface Chainable { + injectAxe(): void; + checkA11y(context?: ElementContext, options?: RunOptions): void; + configureAxe(options?: RunOptions): void; + } } } diff --git a/types/cypress-axe/tslint.json b/types/cypress-axe/tslint.json index 3db14f85ea..4f44991c3c 100644 --- a/types/cypress-axe/tslint.json +++ b/types/cypress-axe/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + "no-empty-interface": false + } +} From 67b8f8b650837af05111ba8f73b4d709d77a466c Mon Sep 17 00:00:00 2001 From: Cameron Tacklind Date: Sun, 3 Mar 2019 18:33:48 -0800 Subject: [PATCH 304/924] Update tests --- types/serialport/serialport-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/serialport/serialport-tests.ts b/types/serialport/serialport-tests.ts index d6541a63c2..476199b506 100644 --- a/types/serialport/serialport-tests.ts +++ b/types/serialport/serialport-tests.ts @@ -105,8 +105,8 @@ function test_parsers() { const ByteLengthParser = new SerialPort.parsers.ByteLength({length: 8}); const CCTalkParser = new SerialPort.parsers.CCTalk(); - const DelimiterParser = new SerialPort.parsers.Delimiter({ delimiter: Buffer.from('EOL') }); - const ReadlineParser = new SerialPort.parsers.Readline({ delimiter: '\r\n' }); + const DelimiterParser = new SerialPort.parsers.Delimiter({ delimiter: Buffer.from('EOL'), includeDelimiter: true }); + const ReadlineParser = new SerialPort.parsers.Readline({ delimiter: '\r\n', includeDelimiter: false }); const ReadyParser = new SerialPort.parsers.Ready({ delimiter: 'READY' }); const RegexParser = new SerialPort.parsers.Regex({regex: /.*/}); From a72ea5ad9e85b8c1fb6f783bfb32b0f63e8c9ce6 Mon Sep 17 00:00:00 2001 From: Cameron Tacklind Date: Sun, 3 Mar 2019 18:34:39 -0800 Subject: [PATCH 305/924] Add myself to author --- types/serialport/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/serialport/index.d.ts b/types/serialport/index.d.ts index 2c3cbbf6b9..73296d82e2 100644 --- a/types/serialport/index.d.ts +++ b/types/serialport/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/EmergingTechnologyAdvisors/node-serialport // Definitions by: Jeremy Foster // Andrew Pearson +// Cameron Tacklind // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// From 31d30e337099cc7e9c3818fb9598cfeab17cf7bf Mon Sep 17 00:00:00 2001 From: Cameron Tacklind Date: Sun, 3 Mar 2019 18:34:53 -0800 Subject: [PATCH 306/924] Update v6 as well --- types/serialport/v6/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/serialport/v6/index.d.ts b/types/serialport/v6/index.d.ts index 2f5f8fc55d..2ada54c85f 100644 --- a/types/serialport/v6/index.d.ts +++ b/types/serialport/v6/index.d.ts @@ -90,7 +90,7 @@ declare namespace SerialPort { constructor(options: {delimiter: string | Buffer | number[], includeDelimiter?: boolean}); } class Readline extends Delimiter { - constructor(options: {delimiter: string | Buffer | number[], encoding?: 'ascii'|'utf8'|'utf16le'|'ucs2'|'base64'|'binary'|'hex'}); + constructor(options: {delimiter: string | Buffer | number[], encoding?: 'ascii'|'utf8'|'utf16le'|'ucs2'|'base64'|'binary'|'hex', includeDelimiter?: boolean}); } class Ready extends Stream.Transform { constructor(options: {data: string | Buffer | number[]}); From 6233e51f07941c6ac47ee86513f8c592fab56f98 Mon Sep 17 00:00:00 2001 From: Joel Spadin Date: Sun, 3 Mar 2019 20:50:48 -0600 Subject: [PATCH 307/924] Change export default to export = --- types/plurals-cldr/index.d.ts | 4 ++-- types/plurals-cldr/plurals-cldr-tests.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/types/plurals-cldr/index.d.ts b/types/plurals-cldr/index.d.ts index 0d7277b52a..a65fc4e2c8 100644 --- a/types/plurals-cldr/index.d.ts +++ b/types/plurals-cldr/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Joel Spadin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -export type Form = 'zero' | 'one' | 'two' | 'few' | 'many' | 'other'; +type Form = 'zero' | 'one' | 'two' | 'few' | 'many' | 'other'; interface Plural { /** @@ -50,4 +50,4 @@ declare const plural: Plural & { ordinal: Plural; }; -export default plural; +export = plural; diff --git a/types/plurals-cldr/plurals-cldr-tests.ts b/types/plurals-cldr/plurals-cldr-tests.ts index f5aacbd30c..7927afe761 100644 --- a/types/plurals-cldr/plurals-cldr-tests.ts +++ b/types/plurals-cldr/plurals-cldr-tests.ts @@ -1,4 +1,4 @@ -import plural from 'plurals-cldr'; +import plural = require('plurals-cldr'); plural('en', 0); // $ExpectType "zero" | "one" | "two" | "few" | "many" | "other" | null plural('en', ''); // $ExpectType "zero" | "one" | "two" | "few" | "many" | "other" | null From b1340a2e6ea4f8cc34f3c1e64ff277e3222dced4 Mon Sep 17 00:00:00 2001 From: Joel Spadin Date: Sun, 3 Mar 2019 21:13:02 -0600 Subject: [PATCH 308/924] Change export default to export = --- types/webpack-watched-glob-entries-plugin/index.d.ts | 6 ++++-- .../webpack-watched-glob-entries-plugin-tests.ts | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/types/webpack-watched-glob-entries-plugin/index.d.ts b/types/webpack-watched-glob-entries-plugin/index.d.ts index 6f4c1b4a6a..7c6110413e 100644 --- a/types/webpack-watched-glob-entries-plugin/index.d.ts +++ b/types/webpack-watched-glob-entries-plugin/index.d.ts @@ -7,11 +7,13 @@ import { IOptions } from 'glob'; import { EntryFunc, Plugin } from 'webpack'; -export interface PluginOptions { +interface PluginOptions { basename_as_entry_name?: boolean; } -export default class WebpackWatchedGlobEntries extends Plugin { +declare class WebpackWatchedGlobEntries extends Plugin { static getEntries(globs: string[], globOptions?: IOptions, pluginOptions?: PluginOptions): EntryFunc; static getFiles(globString: string, globOptions?: IOptions, basename_as_entry_name?: boolean): Record; } + +export = WebpackWatchedGlobEntries; diff --git a/types/webpack-watched-glob-entries-plugin/webpack-watched-glob-entries-plugin-tests.ts b/types/webpack-watched-glob-entries-plugin/webpack-watched-glob-entries-plugin-tests.ts index 1c87b080a1..f689c11c7b 100644 --- a/types/webpack-watched-glob-entries-plugin/webpack-watched-glob-entries-plugin-tests.ts +++ b/types/webpack-watched-glob-entries-plugin/webpack-watched-glob-entries-plugin-tests.ts @@ -1,4 +1,4 @@ -import GlobEntriesPlugin from 'webpack-watched-glob-entries-plugin'; +import GlobEntriesPlugin = require('webpack-watched-glob-entries-plugin'); new GlobEntriesPlugin(); // $ExpectType WebpackWatchedGlobEntries From ec26d5ee1235cbfd2e77b17dcbacfd304fc287f5 Mon Sep 17 00:00:00 2001 From: Akash Vishwakarma <14cse031giet@gmail.com> Date: Mon, 4 Mar 2019 10:40:34 +0530 Subject: [PATCH 309/924] Update tsconfig.json --- types/html5-history/tsconfig.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/html5-history/tsconfig.json b/types/html5-history/tsconfig.json index 08937c1353..b4bc53cbb5 100644 --- a/types/html5-history/tsconfig.json +++ b/types/html5-history/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -21,4 +21,4 @@ "index.d.ts", "html5-history-tests.ts" ] -} \ No newline at end of file +} From 8fdbc6ef465f678ae4847cd2adc7db8ecc33b290 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Mon, 4 Mar 2019 16:03:11 +1100 Subject: [PATCH 310/924] Add regtest network constant Added to the library with bitcoinjs/bitcoinjs-lib#1261 --- types/bitcoinjs-lib/bitcoinjs-lib-tests.ts | 4 ++++ types/bitcoinjs-lib/index.d.ts | 1 + 2 files changed, 5 insertions(+) diff --git a/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts b/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts index cc24c6573b..a2db324e39 100644 --- a/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts +++ b/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts @@ -20,6 +20,10 @@ keyPair3.toWIF(); bitcoin.payments.p2pkh({ pubkey: keyPair3.publicKey }); const network = keyPair3.network; +const keyPair4 = bitcoin.ECPair.makeRandom({network: bitcoin.networks.regtest, rng}); +keyPair4.toWIF(); +bitcoin.payments.p2pkh({ pubkey: keyPair4.publicKey }); + // Test TransactionBuilder and Transaction const txb = new bitcoin.TransactionBuilder(); txb.addInput('aa94ab02c182214f090e99a0d57021caffd0f195a81c24602b1028b130b63e31', 0); diff --git a/types/bitcoinjs-lib/index.d.ts b/types/bitcoinjs-lib/index.d.ts index 4fb1bb16a7..7cedbc822a 100644 --- a/types/bitcoinjs-lib/index.d.ts +++ b/types/bitcoinjs-lib/index.d.ts @@ -191,6 +191,7 @@ export class TransactionBuilder { export const networks: { bitcoin: Network; testnet: Network; + regtest: Network; }; export const opcodes: { From e5815b2853494e9f8c55e9b76510a22bcdf1b881 Mon Sep 17 00:00:00 2001 From: qiang Date: Mon, 4 Mar 2019 14:31:00 +0800 Subject: [PATCH 311/924] Added new types for html5plus --- types/html5plus/html5plus-tests.ts | 2 + types/html5plus/index.d.ts | 15476 +++++++++++++++++++++++++++ types/html5plus/tsconfig.json | 23 + types/html5plus/tslint.json | 79 + 4 files changed, 15580 insertions(+) create mode 100644 types/html5plus/html5plus-tests.ts create mode 100644 types/html5plus/index.d.ts create mode 100644 types/html5plus/tsconfig.json create mode 100644 types/html5plus/tslint.json diff --git a/types/html5plus/html5plus-tests.ts b/types/html5plus/html5plus-tests.ts new file mode 100644 index 0000000000..56dd640498 --- /dev/null +++ b/types/html5plus/html5plus-tests.ts @@ -0,0 +1,2 @@ +const webview = plus.webview.currentWebview() +const style = webview.getStyle() \ No newline at end of file diff --git a/types/html5plus/index.d.ts b/types/html5plus/index.d.ts new file mode 100644 index 0000000000..841a64f6d4 --- /dev/null +++ b/types/html5plus/index.d.ts @@ -0,0 +1,15476 @@ +// Type definitions for html5plus 1.0.0 +// Project: https://www.html5plus.org/doc/ +// Definitions by: Dcloud +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * HTML5+æŽ„ćŁïŒŒç»Ÿäž€æ”è§ˆć™šè‡Ș漚ä艿‰©ć±•ïŒŒæäŸ›ćąžćŒșçš„ćŠŸèƒœă€æ€§èƒœæ‰©ć±•è§„èŒƒïŒŒäœżćŸ—ćŒ€ć‘è€…ćŻćŒ€ć‘ć‡șè·šćčłć°çš„appćč¶æŽ„èż‘ćŽŸç”Ÿçš„ćŠŸèƒœć’Œæ€§èƒœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/h5p.html](http://www.html5plus.org/doc/h5p.html) + */ +declare const plus: Plus; + +/** + * HTML5+æŽ„ćŁïŒŒç»Ÿäž€æ”è§ˆć™šè‡Ș漚ä艿‰©ć±•ïŒŒæäŸ›ćąžćŒșçš„ćŠŸèƒœă€æ€§èƒœæ‰©ć±•è§„èŒƒïŒŒäœżćŸ—ćŒ€ć‘è€…ćŻćŒ€ć‘ć‡șè·šćčłć°çš„appćč¶æŽ„èż‘ćŽŸç”Ÿçš„ćŠŸèƒœć’Œæ€§èƒœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/accelerometer.html](http://www.html5plus.org/doc/zh_cn/accelerometer.html) + */ +interface Plus { + /** + * AccelerometeræšĄć—çźĄç†èźŸć€‡ćŠ é€ŸćșŠäŒ æ„Ÿć™šïŒŒç”šäșŽèŽ·ć–èźŸć€‡ćŠ é€ŸćșŠäżĄæŻïŒŒćŒ…æ‹ŹxïŒˆć±ć蕿°Žćčłæ–čć‘ïŒ‰ă€yïŒˆćž‚ç›Žć±ć蕿°Žćčłæ–čć‘ïŒ‰ă€zïŒˆćž‚ç›Žć±ćč•ćčłéąæ–čć‘ïŒ‰äž‰äžȘæ–č搑的抠速ćșŠäżĄæŻă€‚é€šèż‡plus.accelerometerèŽ·ć–èźŸć€‡ćŠ é€ŸćșŠäŒ æ„Ÿć™šçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/accelerometer.html](http://www.html5plus.org/doc/zh_cn/accelerometer.html) + */ + accelerometer: PlusAccelerometer; + /** + * Native.js for Androidć°èŁ…äž€æĄé€šèż‡JSèŻ­æł•ç›ŽæŽ„è°ƒç”šNative JavaæŽ„ćŁé€šé“ïŒŒé€šèż‡plus.androidćŻè°ƒç”šć‡ äčŽæ‰€æœ‰çš„çł»ç»ŸAPI。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/android.html](http://www.html5plus.org/doc/zh_cn/android.html) + */ + android: PlusAndroid; + /** + * AudioæšĄć—ç”šäșŽæäŸ›éŸłéą‘çš„ćœ•ćˆ¶ć’Œæ’­æ”ŸćŠŸèƒœïŒŒćŻè°ƒç”šçł»ç»Ÿçš„éșŠć…‹éŁŽèźŸć€‡èż›èĄŒćœ•éŸłæ“äœœïŒŒäčŸćŻè°ƒç”šçł»ç»Ÿçš„æ‰ŹćŁ°ć™šèźŸć€‡æ’­æ”ŸéŸłéą‘æ–‡ä»¶ă€‚é€šèż‡plus.audioèŽ·ć–éŸłéą‘çźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + audio: PlusAudio; + /** + * BluetoothæšĄć—ç”šäșŽçźĄç†è“ç‰™èźŸć€‡ïŒŒæœçŽąé™„èż‘è“ç‰™èźŸć€‡ă€èżžæŽ„ćźžçŽ°æ•°æźé€šäżĄç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + bluetooth: PlusBluetooth; + /** + * CameraæšĄć—çźĄç†èźŸć€‡çš„æ‘„ćƒć€ŽïŒŒćŻç”šäșŽæ‹ç…§ă€æ‘„ćƒæ“äœœïŒŒé€šèż‡plus.cameraèŽ·ć–æ‘„ćƒć€ŽçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + camera: PlusCamera; + /** + * ContactsæšĄć—çźĄç†çł»ç»Ÿé€šèźŻćœ•ïŒŒç”šäșŽćŻćŻčçł»ç»Ÿé€šèźŻćœ•èż›èĄŒćąžă€ćˆ ă€æ”čă€æŸ„ç­‰æ“äœœă€‚é€šèż‡plus.contactsèŽ·ć–çł»ç»Ÿé€šèźŻćœ•çźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + contacts: PlusContacts; + /** + * DeviceæšĄć—çźĄç†èźŸć€‡äżĄæŻïŒŒç”šäșŽèŽ·ć–æ‰‹æœșèźŸć€‡çš„ç›žć…łäżĄæŻïŒŒćŠ‚IMEI、IMSIă€ćž‹ć·ă€ćŽ‚ć•†ç­‰ă€‚é€šèż‡plus.deviceèŽ·ć–èźŸć€‡äżĄæŻçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + device: PlusDevice; + /** + * ScreenæšĄć—çźĄç†èźŸć€‡ć±ćč•äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + screen: PlusScreen; + /** + * DisplayæšĄć—çźĄç†ćș”ç”šćŻäœżç”šçš„æ˜Ÿç€șćŒșćŸŸäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + display: PlusDisplay; + /** + * networkinfoæšĄć—ç”šäșŽèŽ·ć–çœ‘ç»œäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + networkinfo: PlusNetworkinfo; + /** + * OSæšĄć—çźĄç†æ“äœœçł»ç»ŸäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + os: PlusOs; + /** + * DownloaderæšĄć—çźĄç†çœ‘ç»œæ–‡ä»¶äž‹èœœä»»ćŠĄïŒŒç”šäșŽä»ŽæœćŠĄć™šäž‹èœœć„ç§æ–‡ä»¶ïŒŒćč¶æ”ŻæŒè·šćŸŸèźżé—źæ“äœœă€‚é€šèż‡plus.downloaderèŽ·ć–äž‹èœœçźĄç†ćŻčè±Ąă€‚Downloaderäž‹èœœäœżç”šHTTP的GET/POSTæ–čćŒèŻ·æ±‚äž‹èœœæ–‡ä»¶ïŒŒçŹŠćˆæ ‡ć‡†HTTP/HTTPSäŒ èŸ“ćèźźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + downloader: PlusDownloader; + /** + * FingerprintæšĄć—çźĄç†æŒ‡çșčèŻ†ćˆ«ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ + fingerprint: PlusFingerprint; + /** + * GalleryæšĄć—çźĄç†çł»ç»Ÿç›žć†ŒïŒŒæ”ŻæŒä»Žç›žć†Œäž­é€‰æ‹©ć›Ÿç‰‡æˆ–è§†éą‘æ–‡ä»¶ă€äżć­˜ć›Ÿç‰‡æˆ–è§†éą‘æ–‡ä»¶ćˆ°ç›žć†Œç­‰ćŠŸèƒœă€‚é€šèż‡plus.galleryèŽ·ć–ç›žć†ŒçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + gallery: PlusGallery; + /** + * GeolocationæšĄć—çźĄç†èźŸć€‡äœçœźäżĄæŻïŒŒç”šäșŽèŽ·ć–ćœ°ç†äœçœźäżĄæŻïŒŒćŠ‚ç»ćșŠă€çșŹćșŠç­‰ă€‚é€šèż‡plus.geolocationćŻèŽ·ć–èźŸć€‡äœçœźçźĄç†ćŻčè±Ąă€‚è™œç„¶W3Cć·Čç»æäŸ›æ ‡ć‡†APIèŽ·ć–äœçœźäżĄæŻïŒŒäœ†ćœšæŸäș›ćčłć°ć­˜ćœšć·źćŒ‚或æœȘćźžçŽ°ïŒŒäžșäș†äżæŒć„ćčłć°çš„ç»Ÿäž€æ€§ïŒŒćźšä艿­€è§„èŒƒæŽ„ćŁèŽ·ć–äœçœźäżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + geolocation: PlusGeolocation; + /** + * iBeaconæšĄć—ç”šäșŽæœçŽąé™„ä»¶çš„iBeaconèźŸć€‡ïŒˆ*èŻ·äœżç”šHBuilderXćč¶æ›Žæ–°ćˆ°æœ€æ–°ç‰ˆæœŹ*ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) + */ + ibeacon: PlusIbeacon; + /** + * IOæšĄć—çźĄç†æœŹćœ°æ–‡ä»¶çł»ç»ŸïŒŒç”šäșŽćŻčæ–‡ä»¶çł»ç»Ÿçš„ç›źćœ•æ”è§ˆă€æ–‡ä»¶çš„èŻ»ć–ă€æ–‡ä»¶çš„ć†™ć…„ç­‰æ“äœœă€‚é€šèż‡plus.ioćŻèŽ·ć–æ–‡ä»¶çł»ç»ŸçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + io: PlusIo; + /** + * Native.js for iOSć°èŁ…äž€æĄé€šèż‡JSèŻ­æł•ç›ŽæŽ„è°ƒç”šNative Objective-CæŽ„ćŁé€šé“ïŒŒé€šèż‡plus.iosćŻè°ƒç”šć‡ äčŽæ‰€æœ‰çš„çł»ç»ŸAPI。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ios.html](http://www.html5plus.org/doc/zh_cn/ios.html) + */ + ios: PlusIos; + /** + * KeyçźĄç†èźŸć€‡æŒ‰é”źäș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ + key: PlusKey; + /** + * MessagingæšĄć—çźĄç†èźŸć€‡é€šèźŻćŠŸèƒœïŒŒćŻç”šäșŽçŸ­äżĄă€ćœ©äżĄă€é‚źä»¶ć‘é€ç­‰ă€‚é€šèż‡plus.messagingćŻèŽ·ć–èźŸć€‡é€šèźŻçźĄç†ćŻčè±Ąă€‚ćŠć€–äčŸćŻä»„ç›ŽæŽ„é€šèż‡html侭的hrefç›ŽæŽ„ćż«é€Ÿć‘é€çŸ­äżĄă€æ‹šæ‰“ç””èŻă€ć‘é€é‚źä»¶ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + messaging: PlusMessaging; + /** + * nativeObjçźĄç†çł»ç»ŸćŽŸç”ŸćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + nativeObj: PlusNativeObj; + /** + * nativeUIçźĄç†çł»ç»ŸćŽŸç”Ÿç•ŒéąïŒŒćŻç”šäșŽćŒčć‡șçł»ç»ŸćŽŸç”Ÿæç€șćŻčèŻæĄ†çȘ—ćŁă€æ—¶é—Žæ—„期选择ćŻčèŻæĄ†ă€ç­‰ćŸ…ćŻčèŻæĄ†ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + nativeUI: PlusNativeUI; + /** + * navigator甹äșŽçźĄç†æ”è§ˆć™šèżèĄŒçŽŻćąƒäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + navigator: PlusNavigator; + /** + * OrientationæšĄć—çźĄç†èźŸć€‡çš„æ–čć‘äżĄæŻïŒŒćŒ…æ‹Źalpha、beta、gamma侉äžȘæ–čć‘äżĄæŻïŒŒé€šèż‡plus.orientationćŻèŽ·ć–èźŸć€‡æ–č搑缡理ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/orientation.html](http://www.html5plus.org/doc/zh_cn/orientation.html) + */ + orientation: PlusOrientation; + /** + * ProximityæšĄć—çźĄç†èźŸć€‡è·çŠ»äŒ æ„Ÿć™šïŒŒćŻèŽ·ć–ćœ“ć‰èźŸć€‡çš„æŽ„èż‘è·çŠ»äżĄæŻïŒŒé€šèż‡plus.proximityćŻèŽ·ć–èźŸć€‡è·çŠ»äŒ æ„ŸçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/proximity.html](http://www.html5plus.org/doc/zh_cn/proximity.html) + */ + proximity: PlusProximity; + /** + * RuntimeæšĄć—çźĄç†èżèĄŒçŽŻćąƒïŒŒćŻç”šäșŽèŽ·ć–ćœ“ć‰èżèĄŒçŽŻćąƒäżĄæŻă€äžŽć…¶ćźƒçš‹ćșèż›èĄŒé€šèźŻç­‰ă€‚é€šèż‡plus.runtimećŻèŽ·ć–èżèĄŒçŽŻćąƒçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + runtime: PlusRuntime; + /** + * StorageæšĄć—çźĄç†ćș”ç”šæœŹćœ°æ•°æźć­˜ć‚šćŒș甚äșŽćș”ç”šæ•°æźçš„äżć­˜ć’ŒèŻ»ć–ă€‚ćș”ç”šæœŹćœ°æ•°æźäžŽlocalStorage、sessionStorage的ćŒșćˆ«ćœšäșŽæ•°æźæœ‰æ•ˆćŸŸäžćŒïŒŒć‰è€…ćŻćœšćș”ç”šć†…è·šćŸŸæ“äœœïŒŒæ•°æźć­˜ć‚šæœŸæ˜ŻæŒäč…ćŒ–çš„ïŒŒćč¶äž”æČĄæœ‰ćźčé‡é™ćˆ¶ă€‚é€šèż‡plus.storagećŻèŽ·ć–ćș”ç”šæœŹćœ°æ•°æźçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/storage.html](http://www.html5plus.org/doc/zh_cn/storage.html) + */ + storage: PlusStorage; + /** + * StreamæšĄć—æ“äœœæ”ćș”甚。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + stream: PlusStream; + /** + * UploaderæšĄć—çźĄç†çœ‘ç»œäžŠäŒ ä»»ćŠĄïŒŒç”šäșŽä»ŽæœŹćœ°äžŠäŒ ć„ç§æ–‡ä»¶ćˆ°æœćŠĄć™šïŒŒćč¶æ”ŻæŒè·šćŸŸèźżé—źæ“äœœă€‚é€šèż‡plus.uploaderćŻèŽ·ć–äžŠäŒ çźĄç†ćŻčè±Ąă€‚UploaderäžŠäŒ äœżç”šHTTP的POSTæ–čćŒæäș€æ•°æźïŒŒæ•°æźæ ŒćŒçŹŠćˆMultipart/form-dataè§„èŒƒïŒŒćłrfc1867Form-based File Upload in HTMLïŒ‰ćèźźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + uploader: PlusUploader; + /** + * VideoæšĄć—çźĄç†ć€šćȘ’äœ“è§†éą‘ç›žć…łèƒœćŠ›ïŒŒćŻç”šćˆ›ć»șè§†éą‘æ’­æ”ŸæŽ§ä»¶ïŒŒç›Žæ’­æŽšæ”æŽ§ä»¶ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + video: PlusVideo; + /** + * WebviewæšĄć—çźĄç†ćș”甚çȘ—ćŁç•ŒéąïŒŒćźžçŽ°ć€šçȘ—ćŁçš„é€»èŸ‘æŽ§ćˆ¶çźĄç†æ“äœœă€‚é€šèż‡plus.webviewćŻèŽ·ć–ćș”ç”šç•ŒéąçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + webview: PlusWebview; + /** + * XMLHttpRequestæšĄć—çźĄç†çœ‘ç»œèŻ·æ±‚ïŒŒäžŽæ ‡ć‡†HTML侭的XMLHttpRequestç”šé€”äž€è‡ŽïŒŒć·źćˆ«ćœšäșŽć‰è€…ćŻä»„èż›èĄŒè·šćŸŸèźżé—źă€‚é€šèż‡plus.netćŻèŽ·ć–çœ‘ç»œèŻ·æ±‚çźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + net: PlusNet; + /** + * ZipæšĄć—çźĄç†æ–‡ä»¶ćŽ‹çŒ©ć’Œè§ŁćŽ‹ïŒŒé€šèż‡plus.zipćŻèŽ·ć–ćŽ‹çŒ©çźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + zip: PlusZip; + /** + * BarcodeæšĄć—çźĄç†æĄç æ‰«æïŒŒæ”ŻæŒćžžè§çš„æĄç ïŒˆäž€ç»Žç ćŠäșŒç»Žç ïŒ‰çš„æ‰«æèŻ†ćˆ«ćŠŸèƒœă€‚ćŻè°ƒç”šèźŸć€‡çš„æ‘„ćƒć€ŽćŻčæĄç ć›Ÿç‰‡æ‰«æèż›èĄŒæ•°æźèŸ“ć…„ïŒŒè§Łç ćŽèż”ć›žç æ•°æźćŠç ç±»ćž‹ă€‚é€šèż‡plus.barcodećŻèŽ·ć–æĄç ç çźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + barcode: PlusBarcode; + /** + * MapsæšĄć—çźĄç†ćœ°ć›ŸæŽ§ä»¶ïŒŒç”šäșŽćœšwebéĄ”éąäž­æ˜Ÿç€șćœ°ć›ŸæŽ§ä»¶ïŒŒæäŸ›ć„ç§æŽ„ćŁæ“äœœćœ°ć›ŸæŽ§ä»¶ïŒŒćŠ‚æ·»ćŠ æ ‡ç‚čă€è·Żçșżç­‰ă€‚é€šèż‡plus.mapsćŻèŽ·ć–ćœ°ć›ŸçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + maps: PlusMaps; + /** + * OAuthæšĄć—çźĄç†ćźąæˆ·ç«Żçš„ç”šæˆ·ç™»ćœ•æŽˆæƒéȘŒèŻćŠŸèƒœïŒŒć…èźžćș”ç”šèźżé—źçŹŹäž‰æ–čćčłć°çš„蔄æșă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + oauth: PlusOauth; + /** + * PaymentæšĄć—çźĄç†æ”Żä»˜ćŠŸèƒœïŒŒç”šäșŽæäŸ›çœ‘éĄ”ćź‰ć…šæ”Żä»˜èƒœćŠ›ïŒŒæ”ŻæŒé€šèż‡WebæŽ„ćŁèż›èĄŒæ”Żä»˜æ“äœœă€‚é€šèż‡plus.paymentćŻèŽ·ć–æ”Żä»˜çźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + payment: PlusPayment; + /** + * PushæšĄć—çźĄç†æŽšé€æ¶ˆæŻćŠŸèƒœïŒŒćŻä»„ćźžçŽ°ćœšçșżă€çŠ»çșżçš„æ¶ˆæŻæŽšé€ïŒŒé€šèż‡plus.pushćŻèŽ·ć–æŽšé€æ¶ˆæŻçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + push: PlusPush; + /** + * ShareæšĄć—çźĄç†ćźąæˆ·ç«Żçš„ç€Ÿäș€ćˆ†äș«ćŠŸèƒœïŒŒæäŸ›è°ƒç”šç»ˆç«Żç€Ÿäș€èœŻä»¶çš„ćˆ†äș«èƒœćŠ›ă€‚é€šèż‡plus.sharećŻèŽ·ć–ç€Ÿäș€ćˆ†äș«çźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + share: PlusShare; + /** + * SpeechæšĄć—çźĄç†èŻ­éŸłèŸ“ć…„ćŠŸèƒœïŒŒæäŸ›èŻ­éŸłèŻ†ćˆ«ćŠŸèƒœïŒŒćŻæ”ŻæŒç”šæˆ·é€šèż‡éșŠć…‹éŁŽèźŸć€‡èż›èĄŒèŻ­éŸłèŸ“ć…„ć†…ćźčă€‚é€šèż‡plus.speechćŻèŽ·ć–èŻ­éŸłèŸ“ć…„çźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + speech: PlusSpeech; + /** + * StatisticæšĄć—çźĄç†ç»ŸèźĄćŠŸèƒœïŒŒç”šäșŽæäŸ›ćș”ç”šć†…ç»ŸèźĄçš„èƒœćŠ›ïŒŒæ”ŻæŒç»ŸèźĄć’Œćˆ†æžç”šæˆ·ć±žæ€§ć’Œç”šæˆ·èĄŒäžșæ•°æźă€‚é€šèż‡plus.statisticćŻèŽ·ć–ç»ŸèźĄçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/statistic.html](http://www.html5plus.org/doc/zh_cn/statistic.html) + */ + statistic: PlusStatistic; +} + +/** + * AccelerometeræšĄć—çźĄç†èźŸć€‡ćŠ é€ŸćșŠäŒ æ„Ÿć™šïŒŒç”šäșŽèŽ·ć–èźŸć€‡ćŠ é€ŸćșŠäżĄæŻïŒŒćŒ…æ‹ŹxïŒˆć±ć蕿°Žćčłæ–čć‘ïŒ‰ă€yïŒˆćž‚ç›Žć±ć蕿°Žćčłæ–čć‘ïŒ‰ă€zïŒˆćž‚ç›Žć±ćč•ćčłéąæ–čć‘ïŒ‰äž‰äžȘæ–č搑的抠速ćșŠäżĄæŻă€‚é€šèż‡plus.accelerometerèŽ·ć–èźŸć€‡ćŠ é€ŸćșŠäŒ æ„Ÿć™šçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/accelerometer.html](http://www.html5plus.org/doc/zh_cn/accelerometer.html) + */ +interface PlusAccelerometer { + /** + * èźŸć€‡ćŠ é€ŸćșŠäżĄæŻćŻčè±Ą + * JSONćŻčè±ĄïŒŒäżć­˜èŽ·ć–èźŸć€‡çš„ćŠ é€ŸćșŠäżĄæŻïŒŒćŒ…æ‹Źx、y、z侉äžȘæ–č搑的抠速ćșŠäżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/accelerometer.html](http://www.html5plus.org/doc/zh_cn/accelerometer.html) + */ + Acceleration?: PlusAccelerometerAcceleration; + /** + * ç›‘ćŹèźŸć€‡ćŠ é€ŸćșŠæ„Ÿćș”ć™šć‚æ•° + * JSONćŻčè±ĄïŒŒç”šäșŽèźŸçœźèŽ·ć–èźŸć€‡ćŠ é€ŸćșŠäżĄæŻçš„ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/accelerometer.html](http://www.html5plus.org/doc/zh_cn/accelerometer.html) + */ + AccelerometerOption?: PlusAccelerometerAccelerometerOption; + /** + * èŽ·ć–ćœ“ć‰èźŸć€‡çš„ćŠ é€ŸćșŠäżĄæŻ + * 抠速ćșŠæ˜ŻèźŸć€‡ćœšćœ“ć‰æ–čć‘äžŠæ‰€ćšç›žćŻčèżćŠšć˜ćŒ–ïŒˆćąžă€ć‡é‡ïŒ‰çš„èżćŠšäŒ æ„Ÿć™šă€‚ćŠ é€ŸćșŠäżĄæŻćŒ…æ‹Źx、y、z侉äžȘæ–čć‘çš„äżĄæŻă€‚ + * 抠速ćșŠäżĄæŻćŻé€šèż‡successCBć›žè°ƒć‡œæ•°èż”ć›žă€‚ćŠ é€ŸćșŠäżĄæŻèŽ·ć–ć€±èŽ„ćˆ™è°ƒç”šć›žè°ƒć‡œæ•°errorCB。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/accelerometer.html](http://www.html5plus.org/doc/zh_cn/accelerometer.html) + */ + getCurrentAcceleration(successCB?: (result: PlusAccelerometerAcceleration) => void, errorCB?: (result: any) => void): void; + /** + * ç›‘ćŹèźŸć€‡ćŠ é€ŸćșŠć˜ćŒ–äżĄæŻ + * 抠速ćșŠæ˜ŻèźŸć€‡ćœšćœ“ć‰æ–čć‘äžŠæ‰€ćšç›žćŻčèżćŠšć˜ćŒ–ïŒˆćąžă€ć‡é‡ïŒ‰çš„èżćŠšäŒ æ„Ÿć™šă€‚ćŠ é€ŸćșŠäżĄæŻćŒ…æ‹Źx、y、z侉äžȘæ–čć‘çš„äżĄæŻă€‚ + * watchAccelerationæŻéš”ć›șćźšæ—¶é—Žć°±èŽ·ć–äž€æŹĄèźŸć€‡çš„ćŠ é€ŸćșŠäżĄæŻïŒŒé€šèż‡successCBć›žè°ƒć‡œæ•°èż”ć›žă€‚ćŻé€šèż‡option的frequencyć‚æ•°èźŸćźšèŽ·ć–èźŸć€‡ćŠ é€ŸćșŠäżĄæŻçš„æ—¶é—Žé—Žéš”。 + * 抠速ćșŠäżĄæŻèŽ·ć–ć€±èŽ„ćˆ™è°ƒç”šć›žè°ƒć‡œæ•°errorCB。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/accelerometer.html](http://www.html5plus.org/doc/zh_cn/accelerometer.html) + */ + watchAcceleration(successCB?: (result: PlusAccelerometerAcceleration) => void, errorCB?: (result: any) => void, options?: PlusAccelerometerAccelerometerOption): number; + /** + * ć…łé—­ç›‘ćŹèźŸć€‡ćŠ é€ŸćșŠäżĄæŻ + * ć…łé—­ç›‘ćŹèźŸć€‡ćŠ é€ŸćșŠäżĄæŻïŒŒćș”ç”šć…łé—­è°ƒç”šwatchAccelerationæ–čæł•çš„ćŒ€ćŻçš„ç›‘ćŹæ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/accelerometer.html](http://www.html5plus.org/doc/zh_cn/accelerometer.html) + */ + clearWatch(watchId?: number): void; +} + +/** + * èźŸć€‡ćŠ é€ŸćșŠäżĄæŻćŻčè±Ą + * JSONćŻčè±ĄïŒŒäżć­˜èŽ·ć–èźŸć€‡çš„ćŠ é€ŸćșŠäżĄæŻïŒŒćŒ…æ‹Źx、y、z侉äžȘæ–č搑的抠速ćșŠäżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/accelerometer.html](http://www.html5plus.org/doc/zh_cn/accelerometer.html) + */ +interface PlusAccelerometerAcceleration { + /** + * x蜎æ–č搑的抠速ćșŠ + * èŽ·ć–ćœ“ć‰èźŸć€‡x蜎æ–č搑的抠速ćșŠïŒŒæ”źç‚čćž‹æ•°æźïŒŒäžŽç‰©ç†ć­Šäž­çš„ćŠ é€ŸćșŠć€Œäž€è‡Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/accelerometer.html](http://www.html5plus.org/doc/zh_cn/accelerometer.html) + */ + xAxis?: number; + /** + * y蜎æ–č搑的抠速ćșŠ + * èŽ·ć–ćœ“ć‰èźŸć€‡y蜎æ–č搑的抠速ćșŠïŒŒæ”źç‚čćž‹æ•°æźïŒŒäžŽç‰©ç†ć­Šäž­çš„ćŠ é€ŸćșŠć€Œäž€è‡Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/accelerometer.html](http://www.html5plus.org/doc/zh_cn/accelerometer.html) + */ + yAxis?: number; + /** + * z蜎æ–č搑的抠速ćșŠ + * èŽ·ć–ćœ“ć‰èźŸć€‡z蜎æ–č搑的抠速ćșŠïŒŒæ”źç‚čćž‹æ•°æźïŒŒäžŽç‰©ç†ć­Šäž­çš„ćŠ é€ŸćșŠć€Œäž€è‡Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/accelerometer.html](http://www.html5plus.org/doc/zh_cn/accelerometer.html) + */ + zAxis?: number; +} + +/** + * ç›‘ćŹèźŸć€‡ćŠ é€ŸćșŠæ„Ÿćș”ć™šć‚æ•° + * JSONćŻčè±ĄïŒŒç”šäșŽèźŸçœźèŽ·ć–èźŸć€‡ćŠ é€ŸćșŠäżĄæŻçš„ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/accelerometer.html](http://www.html5plus.org/doc/zh_cn/accelerometer.html) + */ +interface PlusAccelerometerAccelerometerOption { + /** + * æ›Žæ–°ćŠ é€ŸćșŠäżĄæŻé—Žé𔿗¶é—Ž + * ç›‘ćŹć™šèŽ·ć–ćŠ é€ŸćșŠäżĄæŻçš„æ—¶é—Žé—Žéš”ïŒŒć•äœäžșmsïŒŒé»˜èź€ć€Œäžș500ms + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/accelerometer.html](http://www.html5plus.org/doc/zh_cn/accelerometer.html) + */ + frequency?: number; +} + +/** + * Native.js for Androidć°èŁ…äž€æĄé€šèż‡JSèŻ­æł•ç›ŽæŽ„è°ƒç”šNative JavaæŽ„ćŁé€šé“ïŒŒé€šèż‡plus.androidćŻè°ƒç”šć‡ äčŽæ‰€æœ‰çš„çł»ç»ŸAPI。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/android.html](http://www.html5plus.org/doc/zh_cn/android.html) + */ +interface PlusAndroid { + /** + * Javaç±»ćŻčè±Ą + * Javaç±»ćŻčè±ĄïŒŒćŻé€šèż‡ć…¶ć±žæ€§èŽ·ć–ç±»çš„ćžžé‡ïŒŒćŻé€šèż‡æ–čæł•æ„æ“äœœç±»çš„é™æ€ć˜é‡ć’Œæ–čæł•äčŸé€šèż‡newæ–čæł•æ„ćˆ›ć»șç±»çš„ćźžäŸ‹ćŻčè±Ąă€‚ + * ćŻčäșŽç±»çš„ćžžé‡ïŒŒćˆ™ç›ŽæŽ„é€šèż‡.ćŽéąè·Ÿéšćžžé‡ćç§°è°ƒç”šćłćŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/android.html](http://www.html5plus.org/doc/zh_cn/android.html) + */ + ClassObject?: PlusAndroidClassObject; + /** + * JavaćźžäŸ‹ćŻčè±Ą + * JavaćźžäŸ‹ćŻčè±ĄïŒŒćŻé€šèż‡ć…¶æ–čæł•æ„æ“äœœćźžäŸ‹çš„ć˜é‡ć’Œæ–čæł•。 + * æłšæ„ïŒšćż…éĄ»é€šèż‡plusGetAttribute()æ–čæł•èŻ»ć–ćźžäŸ‹ćŻčè±Ąçš„ć±žæ€§ć€ŒïŒŒé€šèż‡plusSetAttribute()æ–čæł•èźŸçœźćźžäŸ‹ćŻčè±Ąçš„ć±žæ€§ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/android.html](http://www.html5plus.org/doc/zh_cn/android.html) + */ + InstanceObject?: PlusAndroidInstanceObject; + /** + * ćŻŒć…„Javaç±»ćŻčè±Ą + * ćŻŒć…„ç±»ćŻčè±ĄćŽïŒŒć°±ćŻä»„é€šèż‡.æ“äœœçŹŠç›ŽæŽ„è°ƒç”šćŻčè±ĄïŒˆç±»ćŻčè±Ą/ćźžäŸ‹ćŻčè±ĄïŒ‰çš„æ–čæł•。 + * æłšæ„ïŒšćŻŒć…„ç±»ćŻčè±Ąć°†äŒšæ¶ˆè€—èŸƒć€šçš„çł»ç»Ÿè”„æșïŒŒé€šćžžäžćș”èŻ„ćŻŒć…„èż‡ć€šçš„ç±»ćŻčè±ĄïŒŒćŻä»„äœżç”šplus.android.invoke()杄调甚æœȘćŻŒć…„ç±»ćźžäŸ‹ćŻčè±Ąçš„æ–čæł•。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/android.html](http://www.html5plus.org/doc/zh_cn/android.html) + */ + importClass(classname?: string): PlusAndroidClassObject; + /** + * 戛ć»șćźžäŸ‹ćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/android.html](http://www.html5plus.org/doc/zh_cn/android.html) + */ + newObject(classname?: string, args?: any): PlusAndroidInstanceObject; + /** + * èŽ·ć–ćŻčè±ĄïŒˆç±»ćŻčè±Ą/ćźžäŸ‹ćŻčè±ĄïŒ‰çš„ć±žæ€§ć€Œ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/android.html](http://www.html5plus.org/doc/zh_cn/android.html) + */ + getAttribute(obj?: PlusAndroidInstanceObject, name?: string): any; + /** + * èźŸçœźćŻčè±ĄïŒˆç±»ćŻčè±Ą/ćźžäŸ‹ćŻčè±ĄïŒ‰çš„ć±žæ€§ć€Œ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/android.html](http://www.html5plus.org/doc/zh_cn/android.html) + */ + setAttribute(obj?: PlusAndroidInstanceObject, name?: string, value?: any): void; + /** + * 调甚ćŻčè±ĄïŒˆç±»ćŻčè±Ą/ćźžäŸ‹ćŻčè±ĄïŒ‰çš„æ–čæł• + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/android.html](http://www.html5plus.org/doc/zh_cn/android.html) + */ + invoke(obj?: PlusAndroidInstanceObject, name?: string, args?: any): any; + /** + * 漞现Interface的æ–čæł• + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/android.html](http://www.html5plus.org/doc/zh_cn/android.html) + */ + implements(name?: string, obj?: any): PlusAndroidInstanceObject; + /** + * èŽ·ć–ćș”甚䞻ActivityćźžäŸ‹ćŻčè±Ą + * Androidćčłć°ćꌿ•ŽJavaç±»ćäžșandroid.app.ActivityïŒŒćźŒæ•ŽAPIèŻ·ć‚è€ƒAndroidćŒ€ć‘æ–‡æĄŁ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/android.html](http://www.html5plus.org/doc/zh_cn/android.html) + */ + runtimeMainActivity(): PlusAndroidInstanceObject; + /** + * èŽ·ć–ćœ“ć‰WebviewçȘ—揣ćŻčè±Ąçš„nativeć±‚ćźžäŸ‹ćŻčè±Ą + * Androidćčłć°ćꌿ•ŽJavaç±»ćäžșandroid.webkit.WebviewïŒŒćźŒæ•ŽAPIèŻ·ć‚è€ƒAndroidćŒ€ć‘æ–‡æĄŁ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/android.html](http://www.html5plus.org/doc/zh_cn/android.html) + */ + currentWebview(): PlusAndroidInstanceObject; +} + +/** + * Javaç±»ćŻčè±Ą + * Javaç±»ćŻčè±ĄïŒŒćŻé€šèż‡ć…¶ć±žæ€§èŽ·ć–ç±»çš„ćžžé‡ïŒŒćŻé€šèż‡æ–čæł•æ„æ“äœœç±»çš„é™æ€ć˜é‡ć’Œæ–čæł•äčŸé€šèż‡newæ–čæł•æ„ćˆ›ć»șç±»çš„ćźžäŸ‹ćŻčè±Ąă€‚ + * ćŻčäșŽç±»çš„ćžžé‡ïŒŒćˆ™ç›ŽæŽ„é€šèż‡.ćŽéąè·Ÿéšćžžé‡ćç§°è°ƒç”šćłćŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/android.html](http://www.html5plus.org/doc/zh_cn/android.html) + */ +interface PlusAndroidClassObject { + /** + * èŽ·ć–Javaç±»ćŻčè±Ąçš„é™æ€ć±žæ€§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/android.html](http://www.html5plus.org/doc/zh_cn/android.html) + */ + plusGetAttribute(name?: string): any; + /** + * èźŸçœźJavaç±»ćŻčè±Ąçš„é™æ€ć±žæ€§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/android.html](http://www.html5plus.org/doc/zh_cn/android.html) + */ + plusSetAttribute(name?: string, value?: any): void; +} + +/** + * JavaćźžäŸ‹ćŻčè±Ą + * JavaćźžäŸ‹ćŻčè±ĄïŒŒćŻé€šèż‡ć…¶æ–čæł•æ„æ“äœœćźžäŸ‹çš„ć˜é‡ć’Œæ–čæł•。 + * æłšæ„ïŒšćż…éĄ»é€šèż‡plusGetAttribute()æ–čæł•èŻ»ć–ćźžäŸ‹ćŻčè±Ąçš„ć±žæ€§ć€ŒïŒŒé€šèż‡plusSetAttribute()æ–čæł•èźŸçœźćźžäŸ‹ćŻčè±Ąçš„ć±žæ€§ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/android.html](http://www.html5plus.org/doc/zh_cn/android.html) + */ +interface PlusAndroidInstanceObject { + /** + * èŽ·ć–JavaćźžäŸ‹ćŻčè±Ąçš„ć±žæ€§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/android.html](http://www.html5plus.org/doc/zh_cn/android.html) + */ + plusGetAttribute(name?: string): any; + /** + * èźŸçœźJavaćźžäŸ‹ćŻčè±Ąçš„ć±žæ€§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/android.html](http://www.html5plus.org/doc/zh_cn/android.html) + */ + plusSetAttribute(name?: string, value?: any): void; +} + +/** + * AudioæšĄć—ç”šäșŽæäŸ›éŸłéą‘çš„ćœ•ćˆ¶ć’Œæ’­æ”ŸćŠŸèƒœïŒŒćŻè°ƒç”šçł»ç»Ÿçš„éșŠć…‹éŁŽèźŸć€‡èż›èĄŒćœ•éŸłæ“äœœïŒŒäčŸćŻè°ƒç”šçł»ç»Ÿçš„æ‰ŹćŁ°ć™šèźŸć€‡æ’­æ”ŸéŸłéą‘æ–‡ä»¶ă€‚é€šèż‡plus.audioèŽ·ć–éŸłéą‘çźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ +interface PlusAudio { + /** + * ćœ•éŸłćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + AudioRecorder?: PlusAudioAudioRecorder; + /** + * éŸłéą‘æ’­æ”ŸćŻčè±Ą + * éŸłéą‘æ’­æ”ŸćŻčè±ĄïŒŒç”šäșŽéŸłéą‘æ–‡ä»¶çš„æ’­æ”Ÿă€‚äžèƒœé€šèż‡newæ–čæł•ç›ŽæŽ„ćˆ›ć»șćȘèƒœé€šèż‡audio.createPlayeræ–čæł•ćˆ›ć»ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + AudioPlayer?: PlusAudioAudioPlayer; + /** + * JSONćŻčè±ĄïŒŒè°ƒç”šéșŠć…‹éŁŽèźŸć€‡èż›èĄŒćœ•éŸłçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + RecordOptions?: PlusAudioRecordOptions; + /** + * èźŸć€‡çš„æ‰ŹćŁ°ć™šéŸłéą‘èŸ“ć‡șçșżè·Ż + * éŸłéą‘èŸ“ć‡șçșżè·Żćžžé‡ïŒŒć€Œäžș0ă€‚éŸłéą‘æ’­æ”Ÿæ—¶ćœšèźŸć€‡çš„æ‰ŹćŁ°ć™šèŸ“ć‡ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + ROUTE_SPEAKER?: number; + /** + * èźŸć€‡ćŹç­’éŸłéą‘èŸ“ć‡șçșżè·Ż + * éŸłéą‘èŸ“ć‡șçșżè·Żćžžé‡ïŒŒć€Œäžș1ă€‚éŸłéą‘æ’­æ”Ÿæ—¶ćœšèźŸć€‡çš„ćŹç­’èŸ“ć‡ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + ROUTE_EARPIECE?: number; + /** + * èŽ·ć–ćœ“ć‰èźŸć€‡çš„ćœ•éŸłćŻčè±Ą + * èŽ·ć–ćœ“ć‰èźŸć€‡çš„ćœ•éŸłćŻčè±ĄïŒŒèż›èĄŒćœ•éŸłæ“äœœïŒŒćœ•éŸłćŻčè±Ąæ˜ŻèźŸć€‡çš„ç‹Źć è”„æșïŒŒćœšćŒäž€æ—¶é—Žä»…ćŻæ‰§èĄŒäž€äžȘćœ•éŸłæ“äœœïŒŒćŠćˆ™ćŻèƒœäŒšćŻŒè‡Žæ“äœœć€±èŽ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + getRecorder(): PlusAudioAudioRecorder; + /** + * 戛ć»șéŸłéą‘æ’­æ”ŸćŻčè±Ą + * 戛ć»ș侀äžȘéŸłéą‘æ–‡ä»¶æ’­æ”ŸćŻčè±ĄïŒŒç”šäșŽæ‰“ćŒ€éŸłéą‘æ–‡ä»¶ćč¶æ’­æ”Ÿă€‚ + * ćŻé€šèż‡pathć‚æ•°æŒ‡ćźšèŠæ’­æ”Ÿçš„éŸłéą‘æ–‡ä»¶ă€‚ćˆ›ć»șćŽèż”ć›žæ’­æ”ŸćŻčè±ĄïŒŒé€šèż‡Audio.playæ–čæł•ćŒ€ć§‹æ’­æ”Ÿă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + createPlayer(path?: string): PlusAudioAudioPlayer; +} + +/** + * ćœ•éŸłćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ +interface PlusAudioAudioRecorder { + /** + * æ•°ç»„ïŒŒèźŸć€‡ćœ•éŸłæ”ŻæŒçš„é‡‡ç”šçŽ‡ + * ć±žæ€§ç±»ćž‹äžșArray(String)ïŒŒè‹„äžæ”ŻæŒæ­€ć±žæ€§ćˆ™èż”ć›žç©ș数组ćŻčè±Ąă€‚æ”ŻæŒçš„ćœ•éŸłé‡‡æ ·çŽ‡ïŒŒć­—çŹŠäžČæ ŒćŒäžșâ€œé‡‡æ ·éą‘çŽ‡â€ïŒŒćŠ‚â€œ8000â€ïŒ›ć…¶ć•äœäžșHz。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + supportedSamplerates?: string; + /** + * æ•°ç»„ïŒŒèźŸć€‡ćœ•éŸłæ”ŻæŒçš„æ–‡ä»¶æ ŒćŒ + * ć±žæ€§ç±»ćž‹äžșArray(String)ïŒŒè‹„äžæ”ŻæŒæ­€ć±žæ€§ćˆ™èż”ć›žç©ș数组ćŻčè±Ąă€‚æ”ŻæŒçš„ćœ•éŸłæ–‡ä»¶çš„æ ŒćŒïŒŒć­—çŹŠäžČæ ŒćŒäžșæ–‡ä»¶æ ŒćŒćŽçŒ€ćïŒŒćŠ‚"mp3"、"aac"、"wav"等。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + supportedFormats?: string; + /** + * è°ƒç”šèźŸć€‡éșŠć…‹éŁŽèż›èĄŒćœ•éŸłæ“äœœ + * è°ƒç”šèźŸć€‡éșŠć…‹éŁŽćŒ€ć§‹ćœ•éŸłæ“äœœïŒŒćœ•éŸłćźŒæˆéœ€è°ƒç”šstopæ–čæł•ćœæ­ąă€‚ćœ•éŸłćźŒæˆćŽć°†é€šèż‡successCBć›žè°ƒèż”ć›žćœ•éŸłćŽçš„æ–‡ä»¶æ•°æźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + record(option?: PlusAudioRecordOptions, successCB?: (result: string) => void, errorCB?: (result: any) => void): void; + /** + * ç»“æŸćœ•éŸłæ“äœœ + * ç»“æŸćœ•éŸłæ“äœœïŒŒé€šçŸ„èźŸć€‡ćźŒæˆćœ•éŸłæ“äœœă€‚ćœ•éŸłćźŒæˆćŽć°†è°ƒç”šrecordæ–čæł•äž­äŒ ć…„çš„successCBć›žè°ƒèż”ć›žćœ•éŸłæ–‡ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + stop(): void; +} + +/** + * éŸłéą‘æ’­æ”ŸćŻčè±Ą + * éŸłéą‘æ’­æ”ŸćŻčè±ĄïŒŒç”šäșŽéŸłéą‘æ–‡ä»¶çš„æ’­æ”Ÿă€‚äžèƒœé€šèż‡newæ–čæł•ç›ŽæŽ„ćˆ›ć»șćȘèƒœé€šèż‡audio.createPlayeræ–čæł•ćˆ›ć»ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ +interface PlusAudioAudioPlayer { + /** + * ćŒ€ć§‹æ’­æ”ŸéŸłéą‘ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + play(successCB?: Function, errorCB?: (result: any) => void): void; + /** + * æš‚ćœæ’­æ”ŸéŸłéą‘ + * éœ€ć…ˆè°ƒç”šcreatePlayeræ–čæł•ćˆ›ć»șéŸłéą‘æ’­æ”ŸćŻčè±ĄïŒŒćč¶ćŒ€ć§‹æ’­æ”Ÿă€‚éŸłéą‘æ’­æ”ŸćŻčè±Ąćœšæ’­æ”ŸçŠ¶æ€æ‰èƒœæš‚ćœïŒŒćœšć…¶ćźƒçŠ¶æ€è°ƒç”šæ­€æ–čæł•æ— ä»»äœ•äœœç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + pause(): void; + /** + * æąć€æ’­æ”ŸéŸłéą‘ + * éŸłéą‘æ’­æ”ŸćŻčè±Ąćœšæš‚ćœçŠ¶æ€æ‰èƒœæąć€æ’­æ”ŸïŒŒćœšć…¶ćźƒçŠ¶æ€è°ƒç”šæ­€æ–čæł•æ— ä»»äœ•äœœç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + resume(): void; + /** + * ćœæ­ąæ’­æ”ŸéŸłéą‘ + * ćœæ­ąæ’­æ”ŸéŸłéą‘ïŒŒéŸłéą‘æ’­æ”ŸćŻčè±Ąćœšæ’­æ”Ÿæˆ–æš‚ćœçŠ¶æ€æ‰èƒœćœæ­ąæ’­æ”ŸïŒŒćœšć…¶ćźƒçŠ¶æ€è°ƒç”šæ­€æ–čæł•æ— ä»»äœ•äœœç”šă€‚ + * ćœæ­ąæ’­æ”ŸćŽćŠ‚æžœéœ€èŠç»§ç»­æ’­æ”ŸïŒŒćˆ™éœ€è°ƒç”šplayæ–čæł•é‡æ–°ćŒ€ć§‹æ’­æ”Ÿă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + stop(): void; + /** + * è·łćˆ°æŒ‡ćźšäœçœźæ’­æ”ŸéŸłéą‘ + * è·łćˆ°æŒ‡ćźšäœçœźæ’­æ”ŸéŸłéą‘ïŒŒéŸłéą‘æ’­æ”ŸćŻčè±Ąćœšæ’­æ”Ÿæˆ–æš‚ćœçŠ¶æ€æ‰èƒœè·łćˆ°æŒ‡ćźšæ’­æ”ŸéŸłéą‘ïŒŒćœšć…¶ćźƒçŠ¶æ€è°ƒç”šæ­€æ–čæł•æ— ä»»äœ•äœœç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + seekTo(position?: number): void; + /** + * èŽ·ć–éŸłéą‘æ”çš„æ€»é•żćșŠ + * èŽ·ć–éŸłéą‘æ”çš„æ€»é•żćșŠïŒŒć•䜍äžșç§’ïŒŒè‹„é•żćșŠæœȘçŸ„ćˆ™èż”ć›ž-1ă€‚ćŠ‚æžœèż˜æœȘèŽ·ć–ćˆ°éŸłéą‘æ”äżĄæŻćˆ™èż”ć›žNaNïŒŒæ­€æ—¶éœ€èŠć»¶èżŸèŽ·ć–æ­€äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + getDuration(): number; + /** + * èŽ·ć–éŸłéą‘æ”ćœ“ć‰æ’­æ”Ÿçš„äœçœź + * èŽ·ć–éŸłéą‘æ”ćœ“ć‰æ’­æ”Ÿçš„äœçœźïŒˆć·Čæ’­æ”Ÿçš„é•żćșŠïŒ‰ïŒŒć•䜍äžșs。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + getPosition(): number; + /** + * èźŸçœźéŸłéą‘èŸ“ć‡șçșżè·Ż + * ćŻćœšéŸłéą‘æ–‡ä»¶ćŒ€ć§‹æ’­æ”Ÿć‰æˆ–æ’­æ”Ÿçš„èż‡çš‹äž­æ”čć˜éŸłéą‘èŸ“ć‡șçșżè·ŻïŒŒé»˜èź€äœżç”šæ‰ŹćŁ°ć™šïŒˆplus.audio.ROUTE_SPEAKER蟓ć‡șçșżè·Żă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + setRoute(route?: number): void; +} + +/** + * JSONćŻčè±ĄïŒŒè°ƒç”šéșŠć…‹éŁŽèźŸć€‡èż›èĄŒćœ•éŸłçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ +interface PlusAudioRecordOptions { + /** + * ćœ•éŸłćŁ°é“ + * ćŻć–ć€ŒïŒš + * "mono" - ć•ćŁ°é“ćœ•éŸłïŒ› + * "stereo" - ç«‹äœ“ćŁ°é“ćœ•éŸłă€‚ + * é»˜èź€ć€Œäžș"mono"。 + * - mono: ć•ćŁ°é“ćœ•éŸł + * - stereo: ç«‹äœ“ćŁ°ćœ•éŸł + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + channels?: 'mono' | 'stereo'; + /** + * äżć­˜ćœ•éŸłæ–‡ä»¶çš„è·ŻćŸ„ + * ćŻèźŸçœźć…·äœ“æ–‡ä»¶ćïŒŒäčŸćŻćȘèźŸçœźè·ŻćŸ„ïŒŒćŠ‚æžœä»„â€œ/â€ç»“ć°Ÿćˆ™èĄšæ˜Žæ˜Żè·ŻćŸ„ïŒŒæ–‡ä»¶ćç”±ćœ•éŸłçš‹ćșè‡ȘćŠšç”Ÿæˆă€‚ + * 橂æœȘèźŸçœźćˆ™äœżç”šé»˜èź€ç›źćœ•ç”Ÿæˆéšæœșæ–‡ä»¶ćç§°ïŒŒé»˜èź€ç›źćœ•äžșćș”甚%APPID%例的documentsç›źćœ•ă€‚ + * - _www/: ćș”甚蔄æșç›źćœ• + * - _doc/: ćș”ç”šç§æœ‰æ–‡æĄŁç›źćœ• + * - _documents/: ć…±äș«æ–‡æĄŁç›źćœ• + * - _downloads/: ć…±äș«äž‹èœœç›źćœ• + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + filename?: '_www/' | '_doc/' | '_documents/' | '_downloads/'; + /** + * ćœ•éŸłæ–‡ä»¶çš„é‡‡æ ·çŽ‡ + * éœ€é€šèż‡supportedSampleratesć±žæ€§èŽ·ć–èźŸć€‡æ”ŻæŒçš„é‡‡æ ·çŽ‡ïŒŒè‹„èźŸçœźæ— æ•ˆçš„ć€ŒïŒŒćˆ™äœżç”šçł»ç»Ÿé»˜èź€çš„é‡‡æ ·çŽ‡ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + samplerate?: string; + /** + * ćœ•éŸłæ–‡ä»¶çš„æ ŒćŒ + * éœ€é€šèż‡supportedFormatsć±žæ€§èŽ·ć–èźŸć€‡æ”ŻæŒçš„ćœ•éŸłæ ŒćŒïŒŒè‹„èźŸçœźæ— æ•ˆçš„ć€ŒïŒŒćˆ™äœżç”šçł»ç»Ÿé»˜èź€çš„ćœ•éŸłæ ŒćŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + format?: string; +} + +/** + * BluetoothæšĄć—ç”šäșŽçźĄç†è“ç‰™èźŸć€‡ïŒŒæœçŽąé™„èż‘è“ç‰™èźŸć€‡ă€èżžæŽ„ćźžçŽ°æ•°æźé€šäżĄç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ +interface PlusBluetooth { + /** + * è“ç‰™èźŸć€‡äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + BluetoothDeviceInfo?: PlusBluetoothBluetoothDeviceInfo; + /** + * è“ç‰™èźŸć€‡æœćŠĄäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + BluetoothService?: PlusBluetoothBluetoothService; + /** + * è“ç‰™èźŸć€‡ç‰čćŸć€Œ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + Bluetoothcharacteristic?: PlusBluetoothBluetoothcharacteristic; + /** + * è“ç‰™èźŸć€‡ç‰čćŸć€Œæ”ŻæŒçš„æ“äœœç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + BluetoothcharacteristicProperties?: PlusBluetoothBluetoothcharacteristicProperties; + /** + * ć…łé—­è“ç‰™æšĄć— + * æ–­ćŒ€æ‰€æœ‰ć·Č经ć»șç«‹çš„èżžæŽ„ïŒŒé‡Šæ”Ÿçł»ç»Ÿè”„æșïŒŒèŠæ±‚ćœšè“ç‰™ćŠŸèƒœäœżç”šćźŒæˆćŽè°ƒç”šïŒˆäșŽopenBluetoothAdapter成ćŻčäœżç”šïŒ‰ă€‚ + * ć…łé—­æˆćŠŸćŽè§Šć‘optionsć‚æ•°äž­çš„successć›žè°ƒïŒŒć€±èŽ„è§Šć‘optionsć‚æ•°äž­çš„failć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + closeBluetoothAdapter(success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + /** + * èŽ·ć–æœŹæœșè“ç‰™é€‚é…ć™šçŠ¶æ€ + * èŽ·ć–æˆćŠŸćŽè§Šć‘optionsć‚æ•°äž­çš„successć›žè°ƒïŒŒć€±èŽ„è§Šć‘optionsć‚æ•°äž­çš„failć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + getBluetoothAdapterState(success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + /** + * èŽ·ć–ć·ČæœçŽąćˆ°çš„è“ç‰™èźŸć€‡ + * ćŒ…æ‹Źć·Čç»ć’ŒæœŹæœș怄äșŽèżžæŽ„çŠ¶æ€çš„èźŸć€‡ă€‚ + * èŽ·ć–æˆćŠŸćŽè§Šć‘optionsć‚æ•°äž­çš„successć›žè°ƒïŒŒć€±èŽ„è§Šć‘optionsć‚æ•°äž­çš„failć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + getBluetoothDevices(success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + /** + * æ čæźuuidèŽ·ć–ć€„äșŽć·ČèżžæŽ„çš„èźŸć€‡ + * èŽ·ć–æˆćŠŸćŽè§Šć‘optionsć‚æ•°äž­çš„successć›žè°ƒïŒŒć€±èŽ„è§Šć‘optionsć‚æ•°äž­çš„failć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + getConnectedBluetoothDevices(services?: any [], success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + /** + * ç›‘ćŹè“ç‰™é€‚é…ć™šçŠ¶æ€ć˜ćŒ–äș‹ä»¶ + * è“ç‰™é€‚é…ć™šçŠ¶æ€ć‘ç”Ÿć˜ćŒ–æ—¶è§Šć‘ć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + onBluetoothAdapterStateChange(changeCB?: (result: any) => void): void; + /** + * ç›‘ćŹæœçŽąćˆ°æ–°èźŸć€‡çš„äș‹ä»¶ + * æœçŽąćˆ°æ–°èźŸć€‡æ—¶è§Šć‘ć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + onBluetoothDeviceFound(callback?: (result: any) => void): void; + /** + * ćˆć§‹ćŒ–è“ç‰™æšĄć— + * ćˆć§‹ćŒ–æˆćŠŸćŽè§Šć‘optionsć‚æ•°äž­çš„successć›žè°ƒïŒŒć€±èŽ„è§Šć‘optionsć‚æ•°äž­çš„failć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + openBluetoothAdapter(success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + /** + * ćŒ€ć§‹æœçŽąé™„èż‘çš„è“ç‰™èźŸć€‡ + * æ­€æ“äœœæŻ”èŸƒè€—èŽčçł»ç»Ÿè”„æșïŒŒèŻ·ćœšæœçŽąćč¶èżžæŽ„ćˆ°èźŸć€‡ćŽè°ƒç”šstopBluetoothDevicesDiscoveryæ–čæł•ćœæ­ąæœçŽąă€‚ + * æœçŽąæˆćŠŸćŽè§Šć‘optionsć‚æ•°äž­çš„successć›žè°ƒïŒŒć€±èŽ„è§Šć‘optionsć‚æ•°äž­çš„failć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + startBluetoothDevicesDiscovery(services?: any [], allowDuplicatesKey?: boolean, interval?: number, success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + /** + * ćœæ­ąæœćŻ»é™„èż‘çš„è“ç‰™ć€–ć›ŽèźŸć€‡ + * è‹„ć·Čç»æ‰Ÿćˆ°éœ€èŠçš„è“ç‰™èźŸć€‡ćč¶äžéœ€èŠç»§ç»­æœçŽąæ—¶ïŒŒćș”èŻ„è°ƒç”šèŻ„æŽ„ćŁćœæ­ąè“ç‰™æœçŽąă€‚ + * ćœæ­ąæˆćŠŸćŽè§Šć‘optionsć‚æ•°äž­çš„successć›žè°ƒïŒŒć€±èŽ„è§Šć‘optionsć‚æ•°äž­çš„failć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + stopBluetoothDevicesDiscovery(success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + /** + * æ–­ćŒ€äžŽäœŽćŠŸè€—è“ç‰™èźŸć€‡çš„èżžæŽ„ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + closeBLEConnection(deviceId?: string, success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + /** + * èżžæŽ„äœŽćŠŸè€—è“ç‰™èźŸć€‡ + * è‹„äč‹ć‰ć·Čæœ‰æœçŽąèż‡æŸäžȘè“ç‰™èźŸć€‡ïŒŒćč¶æˆćŠŸć»șç«‹èżžæŽ„ïŒŒćŻç›ŽæŽ„äŒ ć…„äč‹ć‰æœçŽąèŽ·ć–çš„deviceIdć°èŻ•èżžæŽ„èŻ„èźŸć€‡ïŒŒæ— éœ€èż›èĄŒæœçŽąæ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + createBLEConnection(deviceId?: string, timeout?: number, success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + /** + * èŽ·ć–è“ç‰™èźŸć€‡æŒ‡ćźšæœćŠĄäž­æ‰€æœ‰ç‰čćŸć€Œ(characteristic) + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + getBLEDeviceCharacteristics(deviceId?: string, serviceId?: string, success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + /** + * èŽ·ć–è“ç‰™èźŸć€‡çš„æ‰€æœ‰æœćŠĄ(service) + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + getBLEDeviceServices(deviceId?: string, success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + /** + * ćŻç”šäœŽćŠŸè€—è“ç‰™èźŸć€‡ç‰čćŸć€Œć˜ćŒ–æ—¶çš„notifyćŠŸèƒœïŒŒèźąé˜…ç‰čćŸć€Œ + * è“ç‰™èźŸć€‡æœćŠĄçš„ç‰čćŸć€Œćż…éĄ»æ”ŻæŒnotify或indicateæ‰ćŻä»„æˆćŠŸè°ƒç”šă€‚ + * ćŠć€–ïŒŒćż…éĄ»ć…ˆćŻç”šnotifyBLECharacteristicValueChangeæ‰èƒœç›‘ćŹćˆ°èźŸć€‡characteristicValueChangeäș‹ä»¶,捳ç‰čćŸć€Œć‘ç”Ÿć˜ćŒ–æ—¶é€šèż‡onBLECharacteristicValueChangeæłšć†Œçš„äș‹ä»¶ć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + notifyBLECharacteristicValueChange(deviceId?: string, serviceId?: string, characteristicId?: string, state?: boolean, success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + /** + * ç›‘ćŹäœŽćŠŸè€—è“ç‰™èźŸć€‡çš„ç‰čćŸć€Œć˜ćŒ–äș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + onBLECharacteristicValueChange(callback?: (result: any) => void): void; + /** + * ç›‘ćŹäœŽćŠŸè€—è“ç‰™èźŸć€‡èżžæŽ„çŠ¶æ€ć˜ćŒ–äș‹ä»¶ + * ćŒ…æ‹ŹćŒ€ć‘è€…äž»ćŠšèżžæŽ„æˆ–æ–­ćŒ€èżžæŽ„ïŒŒèźŸć€‡äžąć€±ïŒŒèżžæŽ„ćŒ‚ćžžæ–­ćŒ€ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + onBLEConnectionStateChange(callback?: (result: any) => void): void; + /** + * èŻ»ć–äœŽćŠŸè€—è“ç‰™èźŸć€‡æŒ‡ćźšç‰čćŸć€Œçš„äșŒèż›ćˆ¶æ•°æźć€Œ + * æŒ‡ćźšçš„ç‰čćŸć€Œéœ€æ”ŻæŒreadæ“äœœæ‰ćŻä»„æˆćŠŸè°ƒç”šă€‚ + * ćč¶èĄŒè°ƒç”šć€šæŹĄćŻèƒœćŻŒè‡ŽèŻ»ć–ć€±èŽ„ïŒŒèŻ»ć–çš„æ•°æźéœ€èŠćœšonBLECharacteristicValueChangeæ–čæł•æłšć†Œçš„ć›žè°ƒäž­èŽ·ć–ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + readBLECharacteristicValue(deviceId?: string, serviceId?: string, characteristicId?: string, success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + /** + * ć‘äœŽćŠŸè€—è“ç‰™èźŸć€‡æŒ‡ćźšç‰čćŸć€Œć†™ć…„äșŒèż›ćˆ¶æ•°æź + * æŒ‡ćźšçš„ç‰čćŸć€Œéœ€æ”ŻæŒwriteæ“äœœæ‰ćŻä»„æˆćŠŸè°ƒç”šă€‚ + * ćč¶èĄŒè°ƒç”šć€šæŹĄćŻèƒœćŻŒè‡ŽèŻ»ć–ć€±èŽ„ïŒŒçł»ç»ŸćŻèƒœäŒšé™ćˆ¶ć•æŹĄäŒ èŸ“çš„æ•°æźć€§ć°ïŒŒè¶…èż‡æœ€ć€§ć­—èŠ‚æ•°ćŽćŻèƒœäŒšć‘ç”Ÿć†™ć…„é”™èŻŻïŒŒć»șèźźæŻæŹĄć†™ć…„äžè¶…èż‡20ć­—èŠ‚ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + writeBLECharacteristicValue(deviceId?: string, serviceId?: string, characteristicId?: string, value?: ArrayBuffer, success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; +} + +/** + * è“ç‰™èźŸć€‡äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ +interface PlusBluetoothBluetoothDeviceInfo { + /** + * è“ç‰™èźŸć€‡ćç§° + * 某äș›èźŸć€‡ćŻèƒœæČĄæœ‰æ­€ć­—æź”ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + name?: string; + /** + * è“ç‰™èźŸć€‡çš„id + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + deviceId?: string; + /** + * è“ç‰™èźŸć€‡çš„äżĄć·ćŒșćșŠ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + RSSI?: string; + /** + * è“ç‰™èźŸć€‡çš„ćčżæ’­æ•°æźæź”侭的ManufacturerDataæ•°æźæź” + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + advertisData?: ArrayBuffer; + /** + * è“ç‰™èźŸć€‡çš„ćčżæ’­æ•°æźæź”侭的ServiceUUIDsæ•°æźæź” + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + advertisServiceUUIDs?: any []; + /** + * è“ç‰™èźŸć€‡çš„ćčżæ’­æ•°æźæź”侭的LocalNameæ•°æźæź” + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + localName?: string; + /** + * è“ç‰™èźŸć€‡çš„ćčżæ’­æ•°æźæź”侭的ServiceDataæ•°æźæź” + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + serviceData?: any; +} + +/** + * è“ç‰™èźŸć€‡æœćŠĄäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ +interface PlusBluetoothBluetoothService { + /** + * è“ç‰™èźŸć€‡æœćŠĄçš„uuid + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + uuid?: string; + /** + * æ˜ŻćŠäžșèźŸć€‡çš„äž»æœćŠĄ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + isPrimary?: boolean; +} + +/** + * è“ç‰™èźŸć€‡ç‰čćŸć€Œ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ +interface PlusBluetoothBluetoothcharacteristic { + /** + * è“ç‰™èźŸć€‡ç‰čćŸć€Œçš„uuid + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + uuid?: string; + /** + * èźŸć€‡ç‰čćŸć€Œæ”ŻæŒçš„æ“äœœç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + properties?: PlusBluetoothBluetoothcharacteristicProperties; +} + +/** + * è“ç‰™èźŸć€‡ç‰čćŸć€Œæ”ŻæŒçš„æ“äœœç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ +interface PlusBluetoothBluetoothcharacteristicProperties { + /** + * ç‰čćŸć€Œæ˜ŻćŠæ”ŻæŒread操䜜 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + read?: boolean; + /** + * ç‰čćŸć€Œæ˜ŻćŠæ”ŻæŒwrite操䜜 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + write?: boolean; + /** + * ç‰čćŸć€Œæ˜ŻćŠæ”ŻæŒnotify操䜜 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + notify?: boolean; + /** + * ç‰čćŸć€Œæ˜ŻćŠæ”ŻæŒindicate操䜜 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + indicate?: boolean; +} + +/** + * CameraæšĄć—çźĄç†èźŸć€‡çš„æ‘„ćƒć€ŽïŒŒćŻç”šäșŽæ‹ç…§ă€æ‘„ćƒæ“äœœïŒŒé€šèż‡plus.cameraèŽ·ć–æ‘„ćƒć€ŽçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ +interface PlusCamera { + /** + * æ‘„ćƒć€ŽćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + Camera?: PlusCameraCamera; + /** + * JSONćŻčè±ĄïŒŒè°ƒç”šæ‘„ćƒć€Žçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + CameraOptions?: PlusCameraCameraOptions; + /** + * JSONćŻčè±ĄïŒŒćŒčć‡șæ‹ç…§æˆ–æ‘„ćƒç•ŒéąæŒ‡ç€șäœçœź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + PopPosition?: PlusCameraPopPosition; + /** + * èŽ·ć–æ‘„ćƒć€ŽçźĄç†ćŻčè±Ą + * èŽ·ć–éœ€èŠæ“äœœçš„æ‘„ćƒć€ŽćŻčè±ĄïŒŒćŠ‚æžœèŠèż›èĄŒæ‹ç…§æˆ–æ‘„ćƒæ“äœœïŒŒéœ€ć…ˆé€šèż‡æ­€æ–čæł•èŽ·ć–æ‘„ćƒć€ŽćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + getCamera(index?: number): PlusCameraCamera; +} + +/** + * æ‘„ćƒć€ŽćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ +interface PlusCameraCamera { + /** + * 歗笩äžČæ•°ç»„ïŒŒæ‘„ćƒć€Žæ”ŻæŒçš„æ‹ç…§ćˆ†èŸšçŽ‡ + * ć±žæ€§ç±»ćž‹äžșString[]ïŒŒè‹„äžæ”ŻæŒæ­€ć±žæ€§ćˆ™èż”ć›žç©ș数组ćŻčè±Ąă€‚ + * æ‘„ćƒć€Žæ”ŻæŒçš„æ‹ç…§ć›Ÿç‰‡ćˆ†èŸšçŽ‡ć­—çŹŠäžČćœąćŒâ€œWIDTH*Heightâ€ïŒŒćŠ‚â€œ400*800â€ïŒ›ćŠ‚æžœæ”ŻæŒä»»æ„è‡Ș漚äč‰ćˆ†èŸšçŽ‡ćˆ™â€œ*”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + supportedImageResolutions?: any []; + /** + * 歗笩äžČæ•°ç»„ïŒŒæ‘„ćƒć€Žæ”ŻæŒçš„æ‘„ćƒćˆ†èŸšçŽ‡ + * ć±žæ€§ç±»ćž‹äžșString[]ïŒŒè‹„äžæ”ŻæŒæ­€ć±žæ€§ćˆ™èż”ć›žç©ș数组ćŻčè±Ąă€‚ + * æ‘„ćƒć€Žæ”ŻæŒçš„è§†éą‘ćˆ†èŸšçŽ‡ć­—çŹŠäžČćœąćŒäžș“WIDTH*Heightâ€ïŒŒćŠ‚â€œ400*800â€ïŒ›ćŠ‚æžœæ”ŻæŒä»»æ„è‡Ș漚äč‰ćˆ†èŸšçŽ‡ćˆ™â€œ*”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + supportedVideoResolutions?: any []; + /** + * 歗笩äžČæ•°ç»„ïŒŒæ‘„ćƒć€Žæ”ŻæŒçš„æ‹ç…§æ–‡ä»¶æ ŒćŒ + * ć±žæ€§ç±»ćž‹äžșString[]ïŒŒè‹„äžæ”ŻæŒæ­€ć±žæ€§ćˆ™èż”ć›žç©ș数组ćŻčè±Ąă€‚ + * æ‘„ćƒć€Žæ”ŻæŒçš„ć›Ÿç‰‡æ–‡ä»¶æ ŒćŒć­—çŹŠäžČćœąćŒäžșæ–‡ä»¶æ ŒćŒćŽçŒ€ćïŒŒćŠ‚â€œjpg”、“png”、“bmp”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + supportedImageFormats?: any []; + /** + * 歗笩äžČæ•°ç»„ïŒŒæ‘„ćƒć€Žæ”ŻæŒçš„æ‘„ćƒæ–‡ä»¶æ ŒćŒ + * ć±žæ€§ç±»ćž‹äžșString[]ïŒŒè‹„äžæ”ŻæŒæ­€ć±žæ€§ćˆ™èż”ć›žç©ș数组ćŻčè±Ąă€‚ + * æ‘„ćƒć€Žæ”ŻæŒçš„è§†éą‘æ–‡ä»¶æ ŒćŒć­—çŹŠäžČćœąćŒäžșæ–‡ä»¶æ ŒćŒćŽçŒ€ćïŒŒćŠ‚â€œ3gp”、“mp4”、“avi”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + supportedVideoFormats?: any []; + /** + * èż›èĄŒæ‹ç…§æ“äœœ + * æ‘„ćƒć€Žè”„æșäžșç‹Źć è”„æșïŒŒćŠ‚æžœć…¶ćźƒçš‹ćșæˆ–饔靱ć·Čç»ć ç”šæ‘„ćƒć€ŽïŒŒć†æŹĄæ“äœœćˆ™ć€±èŽ„ă€‚ + * æ‹ç…§æ“äœœæˆćŠŸć°†é€šèż‡successCBèż”ć›žæ‹ç…§èŽ·ć–çš„ć›Ÿç‰‡è·ŻćŸ„ă€‚ + * ćŻé€šèż‡optionèźŸçœźæ‘„ćƒć€Žçš„ć„ç§ć±žæ€§ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + captureImage(successCB?: (result: string) => void, errorCB?: (result: any) => void, options?: PlusCameraCameraOptions): void; + /** + * è°ƒç”šæ‘„ćƒć€Žèż›èĄŒæ‘„ćƒæ“äœœ + * æ‘„ćƒć€Žè”„æșäžșç‹Źć è”„æșïŒŒćŠ‚æžœć…¶ćźƒçš‹ćșæˆ–饔靱ć·Čç»ć ç”šæ‘„ćƒć€ŽïŒŒć†æŹĄæ“äœœćˆ™ć€±èŽ„ă€‚ + * æ‹ç…§æ“äœœæˆćŠŸć°†é€šèż‡successCBèż”ć›žæ‘„ćƒèŽ·ć–çš„è§†éą‘æ–‡ä»¶è·ŻćŸ„ă€‚ + * ćŻé€šèż‡optionèźŸçœźæ‘„ćƒć€Žçš„ć„ç§ć±žæ€§ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + startVideoCapture(successCB?: (result: string) => void, errorCB?: (result: any) => void, option?: PlusCameraCameraOptions): void; + /** + * ç»“æŸæ‘„ćƒæ“äœœ + * ćŒ€ć§‹è°ƒç”šæ‘„ćƒć€Žèż›èĄŒæ‘„ćƒæ“äœœćŽïŒŒćŻćœšćŽć°ç»“æŸæ‘„ćƒæ“äœœïŒŒäžŽç”šæˆ·ćœšç•Œéąç»“æŸæ“äœœæ•ˆæžœäž€è‡Žă€‚ + * æ‘„ćƒæ“äœœæˆćŠŸć°†é€šèż‡startVideoCaptureć‡œæ•°äž­çš„successCBèż”ć›žæ‹ç…§èŽ·ć–çš„ć›Ÿç‰‡è·ŻćŸ„ă€‚ + * ç”šæˆ·ćŠ‚æžœæČĄæœ‰èż›èĄŒæ‘„ćƒæ“äœœć…łé—­æ‘„ćƒć€ŽéĄ”éąćˆ™è°ƒç”šć€±èŽ„ć›žè°ƒć‡œæ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + stopVideoCapture(): void; +} + +/** + * JSONćŻčè±ĄïŒŒè°ƒç”šæ‘„ćƒć€Žçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ +interface PlusCameraCameraOptions { + /** + * æ‹ç…§æˆ–æ‘„ćƒæ–‡ä»¶äżć­˜çš„è·ŻćŸ„ + * ćŻèźŸçœźć…·äœ“æ–‡ä»¶ćïŒˆćŠ‚"_doc/camera/a.jpg"äčŸćŻćȘèźŸçœźè·ŻćŸ„ïŒŒä»„"/"ç»“ć°Ÿćˆ™èĄšæ˜Žæ˜Żè·ŻćŸ„ïŒˆćŠ‚"_doc/camera/"ïŒ‰ă€‚ + * 橂æœȘèźŸçœźæ–‡ä»¶ćç§°æˆ–èźŸçœźçš„æ–‡ä»¶ćć†ČçȘćˆ™æ–‡ä»¶ćç”±çš‹ćșçš‹ćșè‡ȘćŠšç”Ÿæˆă€‚ + * - _doc/: ćș”ç”šç§æœ‰æ–‡æĄŁç›źćœ• + * - _documents/: ć…±äș«æ–‡æĄŁç›źćœ• + * - _downloads/: ć…±äș«äž‹èœœç›źćœ• + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + filename?: '_doc/' | '_documents/' | '_downloads/'; + /** + * æ‹ç…§æˆ–æ‘„ćƒçš„æ–‡ä»¶æ ŒćŒ + * ćŻé€šèż‡CameraćŻčè±Ąçš„supportedImageFormats或supportedVideoFormatsèŽ·ć–ïŒŒćŠ‚æžœèźŸçœźçš„ć‚æ•°æ— æ•ˆćˆ™äœżç”šçł»ç»Ÿé»˜èź€ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + format?: string; + /** + * æ‹ç…§æˆ–æ‘„ćƒé»˜èź€äœżç”šçš„æ‘„ćƒć€Ž + * æ‹ç…§æˆ–æ‘„ćƒç•Œéąé»˜èź€äœżç”šçš„æ‘„ćƒć€ŽçŒ–ć·ïŒŒ1èĄšç€șäž»æ‘„ćƒć€ŽïŒŒ2èĄšç€șèŸ…æ‘„ćƒć€Žă€‚ + * - 1: äœżç”šèźŸć€‡äž»æ‘„ćƒć€Ž + * - 2: äœżç”šèźŸć€‡èŸ…æ‘„ćƒć€Ž + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + index?: '1' | '2'; + /** + * è§†éą‘é•żćșŠ + * ć•äœäžș秒sïŒ‰ïŒŒć°äșŽç­‰äșŽ0èĄšç€șäžé™ćźšè§†éą‘é•żćșŠă€‚ + * é»˜èź€ć€Œäžș0ïŒˆäžé™ćźšè§†éą‘é•żćșŠïŒ‰ă€‚ + * æłšæ„ïŒšä»…ćœšè°ƒç”šæ‹æ‘„è§†éą‘ïŒˆstartVideoCaptureïŒ‰æ—¶æœ‰æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + videoMaximumDuration?: number; + /** + * æ˜ŻćŠäŒ˜ćŒ–ć›Ÿç‰‡ + * è‡ȘćŠšè°ƒæ•Žć›Ÿç‰‡çš„æ–čć‘ïŒŒćœšéƒšćˆ†èźŸć€‡äžŠćŻèƒœć‡șçŽ°ć›Ÿç‰‡æ–čć‘äžæ­ŁçĄźçš„é—źéą˜ïŒŒæ­€ć‚æ•°ć°†é…çœźæ˜ŻćŠè‡ȘćŠšè°ƒæ•Žć›Ÿç‰‡æ–č搑。 + * ćŻć–ć€ŒïŒš + * true - è‡ȘćŠšè°ƒæ•Žć›Ÿç‰‡æ–čć‘ïŒ› + * false - äžè°ƒæ•Žă€‚ + * é»˜èź€ć€Œäžștrue。 + * æłšæ„ïŒšè‡ȘćŠšè°ƒæ•Žć›Ÿç‰‡æ–čć‘ć°†æ¶ˆè€—éƒšćˆ†çł»ç»Ÿè”„æșïŒŒćŻèƒœäŒšćŻŒè‡Žæ‹ç…§ćŽć›žè°ƒè§Šć‘æ—¶æœșć»¶èżŸïŒŒć°†æ­€ć€ŒèźŸçœźäžșfalsećˆ™ćŻéżć…ć»¶èżŸé—źéą˜ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + optimize?: boolean; + /** + * æ‹ç…§æˆ–æ‘„ćƒäœżç”šçš„ćˆ†èŸšçŽ‡ + * ćŻé€šèż‡CameraćŻčè±Ąçš„supportedImageResolutions或supportedVideoResolutionsèŽ·ć–ïŒŒćŠ‚æžœèźŸçœźçš„ć‚æ•°æ— æ•ˆćˆ™äœżç”šçł»ç»Ÿé»˜èź€ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + resolution?: string; + /** + * æ‹ç…§æˆ–æ‘„ćƒç•ŒéąćŒčć‡ș指ç€șćŒș㟟 + * ćŻčäșŽć€§ć±ćč•èźŸć€‡ćŠ‚iPadïŒŒæ‹ç…§æˆ–æ‘„ćƒç•ŒéąäžșćŒčć‡șçȘ—ćŁïŒŒæ­€æ—¶ćŻé€šèż‡æ­€ć‚æ•°èźŸçœźćŒčć‡șçȘ—ćŁäœçœźïŒŒć…¶äžșJSONćŻčè±ĄïŒŒæ ŒćŒćŠ‚{top:"10px",left:"10px",width:"200px",height:"200px"}ïŒŒé»˜èź€ćŒčć‡șäœçœźäžșć±ćč•汅䞭。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + popover?: PlusCameraPopPosition; +} + +/** + * JSONćŻčè±ĄïŒŒćŒčć‡șæ‹ç…§æˆ–æ‘„ćƒç•ŒéąæŒ‡ç€șäœçœź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ +interface PlusCameraPopPosition { + /** + * 指ç€șćŒșćŸŸè·çŠ»ćźčć™šéĄ¶éƒšçš„è·çŠ» + * ćŒčć‡șæ‹ç…§æˆ–æ‘„ćƒçȘ—ćŁæŒ‡ç€șćŒșćŸŸè·çŠ»ćźčć™šéĄ¶éƒšçš„è·çŠ»ïŒŒæ”ŻæŒćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ć’Œç™Ÿćˆ†æŻ”ïŒˆćŠ‚"50%"ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + top?: string; + /** + * 指ç€șćŒșćŸŸè·çŠ»ćźčć™šć·ŠäŸ§çš„è·çŠ» + * ćŒčć‡șæ‹ç…§æˆ–æ‘„ćƒçȘ—ćŁæŒ‡ç€șćŒșćŸŸè·çŠ»ćźčć™šć·ŠäŸ§çš„è·çŠ»ïŒŒæ”ŻæŒćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ć’Œç™Ÿćˆ†æŻ”ïŒˆćŠ‚"50%"ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + left?: string; + /** + * 指ç€șćŒșćŸŸçš„ćźœćșŠ + * ćŒčć‡șæ‹ç…§æˆ–æ‘„ćƒçȘ—ćŁæŒ‡ç€șćŒșćŸŸçš„ćźœćșŠïŒŒæ”ŻæŒćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ć’Œç™Ÿćˆ†æŻ”ïŒˆćŠ‚"50%"ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + width?: string; + /** + * 指ç€șćŒșćŸŸçš„é«˜ćșŠ + * ćŒčć‡șæ‹ç…§æˆ–æ‘„ćƒçȘ—ćŁæŒ‡ç€șćŒșćŸŸçš„é«˜ćșŠïŒŒæ”ŻæŒćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ć’Œç™Ÿćˆ†æŻ”ïŒˆćŠ‚"50%"ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + height?: string; +} + +/** + * ContactsæšĄć—çźĄç†çł»ç»Ÿé€šèźŻćœ•ïŒŒç”šäșŽćŻćŻčçł»ç»Ÿé€šèźŻćœ•èż›èĄŒćąžă€ćˆ ă€æ”čă€æŸ„ç­‰æ“äœœă€‚é€šèż‡plus.contactsèŽ·ć–çł»ç»Ÿé€šèźŻćœ•çźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ +interface PlusContacts { + /** + * é€šèźŻćœ•ćŻčè±Ą + * é€šèźŻćœ•çźĄç†ćŻčè±ĄïŒŒćŻćŻčçł»ç»Ÿé€šèźŻćœ•èż›èĄŒè”çł»äșș的汞、戠、æ”čă€æŸ„æ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + AddressBook?: PlusContactsAddressBook; + /** + * è”çł»äșșćŻčè±Ą + * è”çł»äșșćŻčè±ĄïŒŒćŒ…æ‹Źè”çł»äșșçš„ć„ç§äżĄæŻïŒŒćŠ‚ćç§°ă€ç””èŻć·ç ă€ćœ°ć€ç­‰ă€‚äčŸćŒ…æ‹Źæ–°ćąžă€ćˆ é™€è”çł»äșș的操䜜æ–čæł•。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + Contact?: PlusContactsContact; + /** + * JSONćŻčè±ĄïŒŒè”çł»äșșćŸŸæ•°æźćŻčè±Ą + * è”çł»äșșćŸŸæ•°æźćŻčè±ĄïŒŒäżć­˜è”çł»äșșç‰čćźšćŸŸäżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + ContactField?: PlusContactsContactField; + /** + * JSONćŻčè±ĄïŒŒè”çł»äșș損称ćŻčè±Ą + * è”çł»äșș損称ćŻčè±ĄïŒŒäżć­˜è”çł»äșșćç§°äżĄæŻïŒŒćŠ‚ć§“ă€ćç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + ContactName?: PlusContactsContactName; + /** + * JSONćŻčè±ĄïŒŒè”çł»äșș朰杀ćŻčè±Ą + * è”çł»äșș朰杀ćŻčè±ĄïŒŒäżć­˜è”çł»äșșćœ°ć€äżĄæŻïŒŒćŠ‚ć›œćź¶ă€çœä»œă€ćŸŽćž‚ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + ContactAddress?: PlusContactsContactAddress; + /** + * JSONćŻčè±ĄïŒŒè”çł»äșșæ‰€ć±žç»„ç»‡äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + ContactOrganization?: PlusContactsContactOrganization; + /** + * JSONćŻčè±ĄïŒŒæŸ„æ‰Ÿè”çł»äșșć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + ContactFindOption?: PlusContactsContactFindOption; + /** + * JSONćŻčè±ĄïŒŒè”çł»äșșæŸ„æ‰Ÿèż‡æ»€ć™š + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + ContactFindFilter?: PlusContactsContactFindFilter; + /** + * 手æœșé€šèźŻćœ• + * é€šèźŻćœ•ç±»ćž‹ćžžé‡ïŒŒæ•°ć€Œç±»ćž‹ïŒŒć›șćźšć€Œäžș0甚äșŽèŽ·ć–çł»ç»Ÿçš„è”çł»äșșäżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + ADDRESSBOOK_PHONE?: number; + /** + * SIMćĄé€šèźŻćœ• + * é€šèźŻćœ•ç±»ćž‹ćžžé‡ïŒŒæ•°ć€Œç±»ćž‹ïŒŒć›șćźšć€Œäžș1甚äșŽèŽ·ć–SIMćĄäžŠçš„è”çł»äșșäżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + ADDRESSBOOK_SIM?: number; + /** + * èŽ·ć–é€šèźŻćœ•ćŻčè±Ą + * æ čæźæŒ‡ćźšé€šèźŻćœ•ç±»ćž‹èŽ·ć–é€šèźŻćœ•ćŻčè±ĄïŒŒèŽ·ć–é€šèźŻćœ•ćŻčè±ĄćŽćŻćŻčć…¶èż›èĄŒćąžă€ćˆ ă€æ”čæ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + getAddressBook(type?: number, successCB?: (result: PlusContactsAddressBook) => void, errorCB?: (result: any) => void): void; +} + +/** + * é€šèźŻćœ•ćŻčè±Ą + * é€šèźŻćœ•çźĄç†ćŻčè±ĄïŒŒćŻćŻčçł»ç»Ÿé€šèźŻćœ•èż›èĄŒè”çł»äșș的汞、戠、æ”čă€æŸ„æ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ +interface PlusContactsAddressBook { + /** + * 戛ć»șè”çł»äșș + * 戛ć»ș侀äžȘçł»ç»Ÿè”çł»äșșćč¶èż”ć›žè”çł»äșșćŻčè±ĄïŒŒćŻćŻčè”çł»äșșćŻčè±Ąèż›èĄŒæ“äœœèźŸçœźè”çł»äșșäżĄæŻïŒŒćŠ‚ćç§°ă€ćœ°ć€ă€ç””èŻç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + create(): PlusContactsContact; + /** + * ćœšé€šèźŻćœ•äž­æŸ„æ‰Ÿè”çł»äșș + * ćœšé€šèźŻćœ•äž­ćź‰èŁ…æŒ‡ćźšçš„è§„ćˆ™æŸ„æ‰Ÿè”çł»äșșcontactFieldsćŻèźŸćźšæŸ„æ‰Ÿèż”ć›žçš„è”çł»äșșäž­ćŒ…ć«çš„ć­—æź”ć€ŒïŒŒæŸ„æ‰Ÿè”çł»äșșæˆćŠŸæ—¶é€šèż‡successCBć›žè°ƒèż”ć›žïŒŒæŸ„æ‰Ÿè”çł»äșșć€±èŽ„ćˆ™é€šèż‡errorCBć›žè°ƒèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + find(contactFields?: String[], successCB?: (result: PlusContactsContact) => void, errorCB?: (result: any) => void, findOptions?: PlusContactsContactFindOption): void; +} + +/** + * è”çł»äșșćŻčè±Ą + * è”çł»äșșćŻčè±ĄïŒŒćŒ…æ‹Źè”çł»äșșçš„ć„ç§äżĄæŻïŒŒćŠ‚ćç§°ă€ç””èŻć·ç ă€ćœ°ć€ç­‰ă€‚äčŸćŒ…æ‹Źæ–°ćąžă€ćˆ é™€è”çł»äșș的操䜜æ–čæł•。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ +interface PlusContactsContact { + /** + * è”çł»äșș的id + * è”çł»äșșidç”±çł»ç»Ÿćˆ†é…ç»ŽæŠ€ïŒŒä»Žçł»ç»ŸèŽ·ć–è”çł»äșș时è‡ȘćŠšè”‹ć€ŒïŒŒć†æŹĄæŸ„èŻąæ—¶ćŻäœżç”šæ­€idć€Œèż›èĄŒæŁ€çŽąă€‚ + * æłšæ„ïŒšæ­€ć€ŒäžșćȘèŻ»ć±žæ€§ïŒŒæ”čć†™æ­€ć€ŒćŻèƒœäŒšćŻŒè‡Žæ— æł•éą„æœŸçš„é”™èŻŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + id?: string; + /** + * è”çł»äșș星ç€ș的損歗 + * è”çł»äșș星ç€șçš„ćć­—é€šćžžç”±ć…¶ć§“ć’Œćç»„ćˆè€Œæˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + displayName?: string; + /** + * è”çł»äșș的損称 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + name?: PlusContactsContactName; + /** + * è”çł»äșș的昔称 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + nickname?: string; + /** + * æ•°ç»„ïŒŒè”çł»äșșçš„ç””èŻ + * ćŠ‚æžœè”çł»äșșäž­æœȘäżć­˜ç””èŻäżĄæŻïŒŒćˆ™èż”ć›žç©șæ•°ç»„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + phoneNumbers?: PlusContactsContactField; + /** + * æ•°ç»„ïŒŒè”çł»äșș的邟矱 + * ćŠ‚æžœè”çł»äșșäž­æœȘäżć­˜é‚źçź±äżĄæŻïŒŒćˆ™èż”ć›žç©șæ•°ç»„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + emails?: PlusContactsContactField; + /** + * æ•°ç»„ïŒŒè”çł»äșș的朰杀 + * ćŠ‚æžœè”çł»äșșäž­æœȘäżć­˜ćœ°ć€äżĄæŻïŒŒćˆ™èż”ć›žç©șæ•°ç»„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + addresses?: PlusContactsContactAddress; + /** + * æ•°ç»„ïŒŒè”çł»äșșçš„ćłæ—¶é€šèźŻćœ°ć€ + * ćŠ‚æžœè”çł»äșșäž­æœȘäżć­˜ćłæ—¶é€šèźŻćœ°ć€äżĄæŻïŒŒćˆ™èż”ć›žç©șæ•°ç»„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + ims?: PlusContactsContactField; + /** + * æ•°ç»„ïŒŒè”çł»äșșæ‰€ć±žç»„ç»‡äżĄæŻ + * ćŠ‚æžœè”çł»äșșäž­æœȘäżć­˜æ‰€ć±žç»„ç»‡äżĄæŻïŒŒćˆ™èż”ć›žç©șæ•°ç»„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + organizations?: PlusContactsContactOrganization; + /** + * è”çł»äșș的生旄 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + birthday?: Date; + /** + * è”çł»äșșçš„ć€‡æłš + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + note?: string; + /** + * æ•°ç»„ïŒŒè”çł»äșșçš„ć€Žćƒ + * ć…¶ć€Œäžșć€Žćƒć›Ÿç‰‡urlćœ°ć€æˆ–ć›Ÿç‰‡æ•°æźïŒš + * urlćœ°ć€ïŒšä»…æ”ŻæŒæœŹćœ°ć›Ÿç‰‡ćœ°ć€ïŒŒćŻä»„æ˜Żç»ćŻčè·ŻćŸ„æˆ–ç›žćŻčè·ŻćŸ„ïŒŒćŠ‚â€œ_doc/a.png” + * ć›Ÿç‰‡æ•°æźïŒšćż…éĄ»çŹŠćˆData URI schemeRFC2397ïŒ‰æ ŒćŒçš„æ•°æźïŒŒćŠ‚â€œimage/png;base64,XXXXâ€ïŒŒć…¶äž­XXXXäžșbase64çŒ–ç çš„ć›Ÿç‰‡æ•°æźă€‚ćœšèŽ·ć–è”çł»äșșæ—¶é»˜èź€èż”ć›žæ­€ç±»ćž‹çš„æ•°æźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + photos?: PlusContactsContactField; + /** + * æ•°ç»„ïŒŒè”çł»äșșçš„ç»„ć + * ćŠ‚æžœè”çł»äșșäž­æœȘäżć­˜ç»„ćäżĄæŻïŒŒćˆ™èż”ć›žç©șæ•°ç»„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + categories?: PlusContactsContactField; + /** + * æ•°ç»„ïŒŒè”çł»äșșçš„çœ‘ć€ + * ćŠ‚æžœè”çł»äșșäž­æœȘäżć­˜çœ‘ć€äżĄæŻïŒŒćˆ™èż”ć›žç©șæ•°ç»„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + urls?: PlusContactsContactField; + /** + * ć…‹éš†è”çł»äșș + * ć…‹éš†è”çł»äșșïŒŒćˆ›ć»șć‡ș侀äžȘæ–°çš„è”çł»äșșćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + clone(): PlusContactsContact; + /** + * ćˆ é™€è”çł»äșș + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + remove(successCB?: Function, errorCB?: (result: any) => void): void; + /** + * äżć­˜è”çł»äșș + * ć°†è”çł»äșșæ•°æźäżć­˜ćˆ°é€šèźŻćœ•äž­ïŒŒæ“äœœæˆćŠŸć°†é€šèż‡successCBć›žè°ƒć‡œæ•°èż”ć›žäżć­˜ç»“æžœïŒŒæ“äœœć€±èŽ„ć°†é€šèż‡é€šèż‡errorCBć›žè°ƒć‡œæ•°èż”ć›žé”™èŻŻäżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + save(successCB?: Function, errorCB?: (result: any) => void): void; +} + +/** + * JSONćŻčè±ĄïŒŒè”çł»äșșćŸŸæ•°æźćŻčè±Ą + * è”çł»äșșćŸŸæ•°æźćŻčè±ĄïŒŒäżć­˜è”çł»äșșç‰čćźšćŸŸäżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ +interface PlusContactsContactField { + /** + * è”çł»äșșćŸŸç±»ćž‹ïŒŒćŠ‚ç””èŻć·ç äž­çš„â€œmobile”、“home”、“company” + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + type?: string; + /** + * è”çł»äșșćŸŸć€Œ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + value?: string; + /** + * æ˜ŻćŠäžș驖选éĄč + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + preferred?: boolean; +} + +/** + * JSONćŻčè±ĄïŒŒè”çł»äșș損称ćŻčè±Ą + * è”çł»äșș損称ćŻčè±ĄïŒŒäżć­˜è”çł»äșșćç§°äżĄæŻïŒŒćŠ‚ć§“ă€ćç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ +interface PlusContactsContactName { + /** + * è”çł»äșșçš„ćźŒæ•Žćç§°ïŒŒç”±ć…¶ćźƒć­—æź”ç»„ćˆç”Ÿæˆ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + formatted?: string; + /** + * è”çł»äșș的槓 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + familyName?: string; + /** + * è”çł»äșș的損 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + givenName?: string; + /** + * è”çł»äșș的侭问損 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + middleName?: string; + /** + * è”çł»äșșçš„ć‰çŒ€ïŒˆćŠ‚Mr.或Dr. + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + honorificPrefix?: string; + /** + * è”çł»äșșçš„ćŽçŒ€ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + honorificSuffix?: string; +} + +/** + * JSONćŻčè±ĄïŒŒè”çł»äșș朰杀ćŻčè±Ą + * è”çł»äșș朰杀ćŻčè±ĄïŒŒäżć­˜è”çł»äșșćœ°ć€äżĄæŻïŒŒćŠ‚ć›œćź¶ă€çœä»œă€ćŸŽćž‚ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ +interface PlusContactsContactAddress { + /** + * è”çł»äșșćœ°ć€ç±»ćž‹ïŒŒćŠ‚â€œhomeâ€èĄšç€șćź¶ćș­ćœ°ć€ă€â€œcompanyâ€èĄšç€șć•äœćœ°ć€ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + type?: string; + /** + * ćźŒæ•Žćœ°ć€ïŒŒç”±ć…¶ćźƒć­—æź”ç»„ćˆè€Œæˆ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + formatted?: string; + /** + * ćźŒæ•Žçš„èĄ—é“ćœ°ć€ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + streetAddress?: string; + /** + * ćŸŽćž‚æˆ–ćœ°ćŒș + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + locality?: string; + /** + * çœæˆ–ćœ°ćŒș + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + region?: string; + /** + * ć›œćź¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + country?: string; + /** + * é‚źæ”żçŒ–ç  + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + postalCode?: string; + /** + * æ˜ŻćŠäžș驖选éĄč + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + preferred?: boolean; +} + +/** + * JSONćŻčè±ĄïŒŒè”çł»äșșæ‰€ć±žç»„ç»‡äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ +interface PlusContactsContactOrganization { + /** + * è”çł»äșșæ‰€ć±žç»„ç»‡ç±»ćž‹ïŒŒćŠ‚"company" + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + type?: string; + /** + * è”çł»äșșæ‰€ć±žç»„ç»‡ćç§° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + name?: string; + /** + * è”çł»äșșæ‰€ć±žç»„ç»‡éƒšé—š + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + department?: string; + /** + * è”çł»äșșćœšç»„ç»‡äž­çš„èŒäœ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + title?: string; + /** + * æ˜ŻćŠäžș驖选éĄč + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + preferred?: boolean; +} + +/** + * JSONćŻčè±ĄïŒŒæŸ„æ‰Ÿè”çł»äșșć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ +interface PlusContactsContactFindOption { + /** + * æ•°ç»„ïŒŒæŸ„æ‰Ÿæ—¶çš„èż‡æ»€ć™š + * ćŻèźŸçœźäžșç©șïŒŒèĄšç€șäžèż‡æ»€ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + filter?: PlusContactsContactFindFilter; + /** + * æ˜ŻćŠæŸ„æ‰Ÿć€šäžȘè”çł»äșșïŒŒé»˜èź€ć€Œäžștrue + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + multiple?: boolean; +} + +/** + * JSONćŻčè±ĄïŒŒè”çł»äșșæŸ„æ‰Ÿèż‡æ»€ć™š + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ +interface PlusContactsContactFindFilter { + /** + * ćŒș配的逻蟑 + * 揯揖“and”、“or”、“notâ€ïŒŒé»˜èź€ć€Œäžș“and”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + logic?: string; + /** + * ćŒșé…çš„è”çł»äșșćŸŸïŒŒćŻć–è”çł»äșșçš„ć±žæ€§ćç§° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + field?: string; + /** + * ćŒșé…çš„è”çł»äșșć€ŒïŒŒćŻäœżç”šćŒșé…çŹŠć·â€œ?”撌“*” + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + value?: string; +} + +/** + * DeviceæšĄć—çźĄç†èźŸć€‡äżĄæŻïŒŒç”šäșŽèŽ·ć–æ‰‹æœșèźŸć€‡çš„ç›žć…łäżĄæŻïŒŒćŠ‚IMEI、IMSIă€ćž‹ć·ă€ćŽ‚ć•†ç­‰ă€‚é€šèż‡plus.deviceèŽ·ć–èźŸć€‡äżĄæŻçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ +interface PlusDevice { + /** + * èźŸć€‡çš„ć›œé™…ç§»ćŠšèźŸć€‡èș«ä»œç  + * è°ƒç”šæ­€ć±žæ€§èŽ·ć–èźŸć€‡çš„ć›œé™…ç§»ćŠšèźŸć€‡èș«ä»œç ă€‚ + * ćŠ‚æžœèźŸć€‡äžæ”ŻæŒćˆ™èż”ć›žç©ș歗笩äžČ。 + * ćŠ‚æžœèźŸć€‡ć­˜ćœšć€šäžȘèș«ä»œç ïŒŒćˆ™ä»„“,”歗笩戆ć‰Čæ‹ŒæŽ„ïŒŒćŠ‚â€œ862470039452950,862470039452943”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + imei?: string; + /** + * èźŸć€‡çš„ć›œé™…ç§»ćŠšç”šæˆ·èŻ†ćˆ«ç  + * 歗笩äžČæ•°ç»„ç±»ćž‹ïŒŒèŽ·ć–èźŸć€‡äžŠæ’ć…„SIMçš„ć›œé™…ç§»ćŠšèźŸć€‡èș«ä»œç ă€‚ + * ćŠ‚æžœèźŸć€‡æ”ŻæŒć€šćĄæšĄćŒćˆ™èż”ć›žæ‰€æœ‰SIMèș«ä»œç ă€‚ + * ćŠ‚æžœèźŸć€‡äžæ”ŻæŒæˆ–æČĄæœ‰æ’ć…„SIMćĄćˆ™èż”ć›žç©șæ•°ç»„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + imsi?: any []; + /** + * èźŸć€‡çš„ćž‹ć· + * è°ƒç”šæ­€ć±žæ€§èŽ·ć–èźŸć€‡çš„ćž‹ć·äżĄæŻă€‚ + * ćŠ‚æžœèźŸć€‡äžæ”ŻæŒćˆ™èż”ć›žç©ș歗笩äžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + model?: string; + /** + * èźŸć€‡çš„ç”Ÿäș§ćނ㕆 + * è°ƒç”šæ­€ć±žæ€§èŽ·ć–èźŸć€‡çš„ç”Ÿäș§ćŽ‚ć•†äżĄæŻă€‚ + * ćŠ‚æžœèźŸć€‡äžæ”ŻæŒćˆ™èż”ć›žç©ș歗笩äžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + vendor?: string; + /** + * èźŸć€‡çš„ć”Żäž€æ ‡èŻ† + * è°ƒç”šæ­€ć±žæ€§èŽ·ć–èźŸć€‡çš„ć”Żäž€æ ‡èŻ†ć·ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + uuid?: string; + /** + * æ‹šæ‰“ç””èŻ + * è°ƒç”šçł»ç»Ÿçš‹ćșæ‹šæ‰“ç””èŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + dial(number?: string, confirm?: boolean): void; + /** + * 揑ć‡șèœ‚éžŁćŁ° + * 调甚歀æ–čæł•äœżćŸ—èźŸć€‡ć‘ć‡șèœ‚éžŁćŁ°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + beep(times?: number): void; + /** + * èźŸć€‡æŒŻćŠš + * 调甚歀æ–čæł•äœżćŸ—èźŸć€‡æŒŻćŠšă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + vibrate(milliseconds?: number): void; + /** + * èźŸçœźćș”ç”šæ˜ŻćŠäżæŒć”€é†’ïŒˆć±ćč•ćžžäșźïŒ‰çŠ¶æ€ + * 调甚歀æ–čæł•èźŸçœźćș”ç”šæ˜ŻćŠäž€ç›ŽäżæŒć”€é†’çŠ¶æ€ïŒŒäżæŒć”€é†’çŠ¶æ€ć°†äŒšćŻŒè‡Žçš‹ćșć±ćč•ćžžäșźă€çł»ç»ŸäžäŒšè‡ȘćŠšé”ć±ïŒŒä»Žè€ŒćŻŒè‡Žæ¶ˆè€—æ›Žć€šçš„ç””é‡ă€‚è‹„æœȘèźŸçœźäž€ç›ŽäżæŒć”€é†’çŠ¶æ€ćˆ™äŒšæ čæźçł»ç»ŸèźŸçœźè‡ȘćŠšé”ćźšć±ćč•。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + setWakelock(lock?: boolean): void; + /** + * èŽ·ć–çš‹ćșæ˜ŻćŠäž€ç›ŽäżæŒć”€é†’ïŒˆć±ćč•ćžžäșźïŒ‰çŠ¶æ€ + * 调甚歀æ–čæł•èŽ·ć–çš‹ćșæ˜ŻćŠäž€è‡ŽäżæŒć”€é†’çŠ¶æ€ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + isWakelock(): boolean; + /** + * èźŸçœźèźŸć€‡çš„çł»ç»ŸéŸłé‡ + * 调甚歀æ–čæł•è°ƒèŠ‚èźŸć€‡çš„çł»ç»ŸéŸłé‡ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + setVolume(volume?: number): void; + /** + * èŽ·ć–èźŸć€‡çš„çł»ç»ŸéŸłé‡ + * çł»ç»ŸéŸłé‡ć€ŒèŒƒć›Žäžș0戰10èĄšç€șé™éŸłïŒŒ1èĄšç€șæœ€ć€§éŸłé‡ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + getVolume(): number; +} + +/** + * ScreenæšĄć—çźĄç†èźŸć€‡ć±ćč•äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ +interface PlusScreen { + /** + * èźŸć€‡ć±ćč•高ćșŠćˆ†èŸšçއ + * èźŸć€‡ć±ćč•ćŒșćŸŸćŒ…æ‹Źçł»ç»ŸçŠ¶æ€æ æ˜Ÿç€șćŒș柟撌ćș”甚星ç€șćŒșćŸŸïŒŒscreenèŽ·ć–çš„æ˜ŻèźŸć€‡ć±ć蕿€»ćŒșćŸŸçš„é€»èŸ‘ćˆ†èŸšçŽ‡ïŒŒć•äœäžșpx。 + * ćŠ‚æžœéœ€èŠèŽ·ć–ćźžé™…ćˆ†èŸšçŽ‡ćˆ™éœ€èŠäč˜ä»„æŻ”äŸ‹ć€Œscale。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + resolutionHeight?: number; + /** + * èźŸć€‡ć±ćč•ćźœćșŠćˆ†èŸšçއ + * èźŸć€‡ć±ćč•ćŒșćŸŸćŒ…æ‹Źçł»ç»ŸçŠ¶æ€æ æ˜Ÿç€șćŒș柟撌ćș”甚星ç€șćŒșćŸŸïŒŒscreenèŽ·ć–çš„æ˜ŻèźŸć€‡ć±ć蕿€»ćŒșćŸŸçš„ćˆ†èŸšçŽ‡ïŒŒć•äœäžșpx。 + * ćŠ‚æžœéœ€èŠèŽ·ć–ćźžé™…ćˆ†èŸšçŽ‡ćˆ™éœ€èŠäč˜ä»„æŻ”äŸ‹ć€Œscale。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + resolutionWidth?: number; + /** + * é€»èŸ‘ćˆ†èŸšçŽ‡äžŽćźžé™…ćˆ†èŸšçŽ‡çš„æŻ”äŸ‹ + * ć±ćč•ćˆ†èŸšçŽ‡ćˆ†é€»èŸ‘ćˆ†èŸšçŽ‡çŽ‡ć’Œćźžé™…ćˆ†èŸšçŽ‡ïŒŒćœšhtmléĄ”éąäž­äœżç”šçš„ćƒçŽ ć€Œéƒœæ˜Żç›žćŻčäșŽé€»èŸ‘ćˆ†èŸšçŽ‡ïŒŒæ­€ć€Œć°±æ˜Żé€»èŸ‘ćˆ†èŸšçŽ‡ć’Œćźžé™…ćˆ†èŸšçŽ‡çš„æŻ”äŸ‹ïŒŒćźžé™…ćˆ†èŸšçŽ‡=é€»èŸ‘ćˆ†èŸšçŽ‡*æŻ”äŸ‹ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + scale?: number; + /** + * èźŸć€‡ć±ć蕿°Žćčłæ–č搑的毆ćșŠ + * èźŸć€‡ć±ćč•çš„ć݆ćșŠäžșæŻè‹±ćŻžæ‰€æ˜Ÿç€ș的惏箠ç‚čæ•°ïŒŒć݆ćșŠè¶Šé«˜æ˜Ÿç€șæž…æ™°ćșŠè¶Šé«˜ïŒŒć•䜍äžșdpi。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + dpiX?: number; + /** + * èźŸć€‡ć±ćč•枂盎æ–č搑的毆ćșŠ + * èźŸć€‡ć±ćč•çš„ć݆ćșŠäžșæŻè‹±ćŻžæ‰€æ˜Ÿç€ș的惏箠ç‚čæ•°ïŒŒć݆ćșŠè¶Šé«˜æ˜Ÿç€șæž…æ™°ćșŠè¶Šé«˜ïŒŒć•䜍äžșdpi。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + dpiY?: number; + /** + * èźŸçœźć±ćč•äșźćșŠ + * 调甚歀æ–čæł•è°ƒèŠ‚èźŸć€‡ć±ćč•äșźćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + setBrightness(brightness?: number): void; + /** + * èŽ·ć–ć±ćč•äșźćșŠć€Œ + * ć±ćč•äșźćșŠć€ŒèŒƒć›Žäžș0戰10èĄšç€ș最䜎äșźćșŠć€ŒïŒŒ1èĄšç€ș最高äșźćșŠć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + getBrightness(): number; + /** + * é”ćźšć±ć蕿–č搑 + * é”ćźšć±ć蕿–čć‘ćŽć±ćč•ćȘèƒœæŒ‰é”ćźšçš„ć±ć蕿–čć‘æ˜Ÿç€șïŒŒć…łé—­ćœ“ć‰éĄ”éąćŽä»ç„¶æœ‰æ•ˆă€‚ + * ćŻć†æŹĄè°ƒç”šæ­€æ–čæł•äżźæ”čć±ćč•锁ćꚿ–čć‘æˆ–è°ƒç”šunlockOrientation()æ–čæł•æąć€ćˆ°ćș”ç”šçš„é»˜èź€ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + lockOrientation(orientation?: string): void; + /** + * è§Łé™€é”ćźšć±ć蕿–č搑 + * è§Łé™€é”ćźšć±ć蕿–čć‘ćŽć°†æąć€ćș”ç”šé»˜èź€çš„ć±ć蕿˜Ÿç€șæ–čć‘ïŒˆé€šćžžäžșćș”ç”šæ‰“ćŒ…ć‘ćžƒæ—¶èźŸçœźçš„æ–čć‘ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + unlockOrientation(): void; +} + +/** + * DisplayæšĄć—çźĄç†ćș”ç”šćŻäœżç”šçš„æ˜Ÿç€șćŒșćŸŸäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ +interface PlusDisplay { + /** + * ćș”ç”šćŻäœżç”šçš„ć±ćč•高ćșŠé€»èŸ‘ćˆ†èŸšçŽ‡ + * èźŸć€‡ć±ćč•ćŒșćŸŸćŒ…æ‹Źçł»ç»ŸçŠ¶æ€æ æ˜Ÿç€șćŒș柟撌ćș”甚星ç€șćŒșćŸŸïŒŒdisplayèŽ·ć–çš„æ˜Żćș”甚星ç€șćŒșćŸŸçš„é€»èŸ‘ćˆ†èŸšçŽ‡ïŒŒć•äœäžșpx。 + * ćŠ‚æžœéœ€èŠèŽ·ć–ćźžé™…ćˆ†èŸšçŽ‡ćˆ™éœ€èŠäč˜ä»„æŻ”äŸ‹ć€Œscale。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + resolutionHeight?: number; + /** + * ćș”ç”šćŻäœżç”šçš„ć±ćč•ćźœćșŠé€»èŸ‘ćˆ†èŸšçŽ‡ + * èźŸć€‡ć±ćč•ćŒșćŸŸćŒ…æ‹Źçł»ç»ŸçŠ¶æ€æ æ˜Ÿç€șćŒș柟撌ćș”甚星ç€șćŒșćŸŸïŒŒdisplayèŽ·ć–çš„æ˜Żćș”甚星ç€șćŒșćŸŸçš„é€»èŸ‘ćˆ†èŸšçŽ‡ïŒŒć•äœäžșpx。 + * ćŠ‚æžœéœ€èŠèŽ·ć–ćźžé™…ćˆ†èŸšçŽ‡ćˆ™éœ€èŠäč˜ä»„æŻ”äŸ‹ć€Œscale。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + resolutionWidth?: number; +} + +/** + * networkinfoæšĄć—ç”šäșŽèŽ·ć–çœ‘ç»œäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ +interface PlusNetworkinfo { + /** + * çœ‘ç»œèżžæŽ„çŠ¶æ€æœȘ矄 + * çœ‘ç»œçŠ¶æ€ćžžé‡ïŒŒèĄšç€șćœ“ć‰èźŸć€‡çœ‘ç»œçŠ¶æ€æœȘ矄ć›șćźšć€Œäžș0。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + CONNECTION_UNKNOW?: number; + /** + * æœȘèżžæŽ„çœ‘ç»œ + * çœ‘ç»œçŠ¶æ€ćžžé‡ïŒŒćœ“ć‰èźŸć€‡çœ‘ç»œæœȘèżžæŽ„çœ‘ç»œïŒŒć›șćźšć€Œäžș1。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + CONNECTION_NONE?: number; + /** + * 有çșżçœ‘络 + * çœ‘ç»œçŠ¶æ€ćžžé‡ïŒŒćœ“ć‰èźŸć€‡èżžæŽ„ćˆ°æœ‰çșżçœ‘络ć›șćźšć€Œäžș2。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + CONNECTION_ETHERNET?: number; + /** + * 无çșżWIFI眑络 + * çœ‘ç»œçŠ¶æ€ćžžé‡ïŒŒćœ“ć‰èźŸć€‡èżžæŽ„ćˆ°æ— çșżWIFI眑络ć›șćźšć€Œäžș3。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + CONNECTION_WIFI?: number; + /** + * 蜂çȘç§»ćŠš2G眑络 + * çœ‘ç»œçŠ¶æ€ćžžé‡ïŒŒćœ“ć‰èźŸć€‡èżžæŽ„ćˆ°èœ‚çȘç§»ćŠš2G眑络ć›șćźšć€Œäžș4。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + CONNECTION_CELL2G?: number; + /** + * 蜂çȘç§»ćŠš3G眑络 + * çœ‘ç»œçŠ¶æ€ćžžé‡ïŒŒćœ“ć‰èźŸć€‡èżžæŽ„ćˆ°èœ‚çȘç§»ćŠš3G眑络ć›șćźšć€Œäžș5。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + CONNECTION_CELL3G?: number; + /** + * 蜂çȘç§»ćŠš4G眑络 + * çœ‘ç»œçŠ¶æ€ćžžé‡ïŒŒćœ“ć‰èźŸć€‡èżžæŽ„ćˆ°èœ‚çȘç§»ćŠš4G眑络ć›șćźšć€Œäžș6。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + CONNECTION_CELL4G?: number; + /** + * èŽ·ć–èźŸć€‡ćœ“ć‰èżžæŽ„çš„çœ‘ç»œç±»ćž‹ + * èŽ·ć–ćœ“ć‰èźŸć€‡èżžæŽ„çš„çœ‘ç»œç±»ćž‹ïŒŒèż”ć›žć€Œäžșçœ‘ç»œç±»ćž‹ćžžé‡ïŒŒćŻć–ć€ŒCONNECTION_*澾量。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + getCurrentType(): number; +} + +/** + * OSæšĄć—çźĄç†æ“äœœçł»ç»ŸäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ +interface PlusOs { + /** + * çł»ç»ŸèŻ­èš€äżĄæŻ + * èŽ·ć–ćœ“ć‰æ“äœœçł»ç»ŸèźŸçœźçš„çł»ç»ŸèŻ­èš€ïŒŒć­—çŹŠäžČç±»ćž‹æ•°æźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + language?: string; + /** + * çł»ç»Ÿç‰ˆæœŹäżĄæŻ + * èŽ·ć–ćœ“ć‰æ“äœœçł»ç»Ÿçš„ç‰ˆæœŹäżĄæŻïŒŒć­—çŹŠäžČç±»ćž‹æ•°æźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + version?: string; + /** + * çł»ç»Ÿçš„ćç§° + * èŽ·ć–ćœ“ć‰æ“äœœçł»ç»Ÿçš„ćç§°ïŒŒć­—çŹŠäžČç±»ćž‹æ•°æźă€‚ + * - iOS: + * iOSçł»ç»Ÿă€‚ + * + * - Android: + * Androidçł»ç»Ÿă€‚ + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + name?: 'iOS' | 'Android'; + /** + * çł»ç»Ÿçš„äŸ›ćș”ć•†äżĄæŻ + * èŽ·ć–ćœ“ć‰æ“äœœçł»ç»Ÿçš„äŸ›ćș”ć•†ćç§°ïŒŒć­—çŹŠäžČç±»ćž‹æ•°æźă€‚ + * - Apple: + * iOSèźŸć€‡ïŒŒćŒ…æ‹ŹiPhone、iPad、iTouch。 + * + * - Google: + * AndroidèźŸć€‡ă€‚ + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + vendor?: 'Apple' | 'Google'; +} + +/** + * DownloaderæšĄć—çźĄç†çœ‘ç»œæ–‡ä»¶äž‹èœœä»»ćŠĄïŒŒç”šäșŽä»ŽæœćŠĄć™šäž‹èœœć„ç§æ–‡ä»¶ïŒŒćč¶æ”ŻæŒè·šćŸŸèźżé—źæ“äœœă€‚é€šèż‡plus.downloaderèŽ·ć–äž‹èœœçźĄç†ćŻčè±Ąă€‚Downloaderäž‹èœœäœżç”šHTTP的GET/POSTæ–čćŒèŻ·æ±‚äž‹èœœæ–‡ä»¶ïŒŒçŹŠćˆæ ‡ć‡†HTTP/HTTPSäŒ èŸ“ćèźźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ +interface PlusDownloader { + /** + * DownloadćŻčè±ĄçźĄç†äž€äžȘäž‹èœœä»»ćŠĄ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + Download?: PlusDownloaderDownload; + /** + * äž‹èœœä»»ćŠĄäș‹ä»¶ç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + DownloadEvent?: PlusDownloaderDownloadEvent; + /** + * äž‹èœœä»»ćŠĄçŠ¶æ€ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + DownloadState?: PlusDownloaderDownloadState; + /** + * äž‹èœœä»»ćŠĄć‚æ•° + * 朹戛ć»șäž‹èœœä»»ćŠĄæ—¶èźŸçœźçš„ć‚æ•°ïŒŒćŠ‚èźŸçœźäž‹èœœä»»ćŠĄäœżç”šçš„HTTPćèźźç±»ćž‹ă€äŒ˜ć…ˆçș§ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + DownloadOptions?: PlusDownloaderDownloadOptions; + /** + * 新ć»șäž‹èœœä»»ćŠĄ + * èŻ·æ±‚äž‹èœœçźĄç†ćˆ›ć»șæ–°çš„äž‹èœœä»»ćŠĄïŒŒćˆ›ć»șæˆćŠŸćˆ™èż”ć›žDownloadćŻčè±ĄïŒŒç”šäșŽçźĄç†äž‹èœœä»»ćŠĄă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + createDownload(url?: string, options?: PlusDownloaderDownloadOptions, completedCB?: (result0: PlusDownloaderDownload, result1: number) => void): PlusDownloaderDownload; + /** + * æžšäžŸäž‹èœœä»»ćŠĄ + * æžšäžŸæŒ‡ćźšçŠ¶æ€çš„äž‹èœœä»»ćŠĄćˆ—èĄšïŒŒé€šèż‡enumCBć›žè°ƒć‡œæ•°èż”ć›žç»“æžœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + enumerate(enumCB?: (result: any []) => void, state?: PlusDownloaderDownloadState): void; + /** + * æž…é™€äž‹èœœä»»ćŠĄ + * æž…é™€æŒ‡ćźšçŠ¶æ€çš„äž‹èœœä»»ćŠĄă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + clear(state?: PlusDownloaderDownloadState): void; + /** + * ćŒ€ć§‹æ‰€æœ‰äž‹èœœä»»ćŠĄ + * ćŒ€ć§‹æ‰€æœ‰ć€„äșŽäžșćŒ€ć§‹è°ƒćșŠæˆ–æš‚ćœçŠ¶æ€çš„äž‹èœœä»»ćŠĄă€‚ + * è‹„äž‹èœœä»»ćŠĄæ•°è¶…èż‡ćŻćč¶ć‘ć€„ç†çš„æ€»æ•°ïŒŒè¶…ć‡ș的任报怄äșŽè°ƒćșŠçŠ¶æ€ïŒˆç­‰ćŸ…äž‹èœœïŒ‰ïŒŒćœ“æœ‰ä»»ćŠĄćꌿˆæ—¶æ čæźè°ƒćșŠçŠ¶æ€ä»»ćŠĄçš„äŒ˜ć…ˆçș§é€‰æ‹©ä»»ćŠĄćŒ€ć§‹äž‹èœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + startAll(): void; +} + +/** + * DownloadćŻčè±ĄçźĄç†äž€äžȘäž‹èœœä»»ćŠĄ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ +interface PlusDownloaderDownload { + /** + * äž‹èœœä»»ćŠĄçš„æ ‡èŻ† + * 朹戛ć»șä»»ćŠĄæ—¶çł»ç»Ÿè‡ȘćŠšćˆ†é…ïŒŒç”šäșŽæ ‡èŻ†äž‹èœœä»»ćŠĄçš„ć”Żäž€æ€§ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + id?: string; + /** + * äž‹èœœæ–‡ä»¶çš„ćœ°ć€ + * 调甚plus.donwloader.createDownload()æ–čæł•ćˆ›ć»șäž‹èœœä»»ćŠĄæ—¶èźŸçœźçš„ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + url?: string; + /** + * ä»»ćŠĄçš„çŠ¶æ€ + * èĄšç€șćœ“ć‰äž‹èœœä»»ćŠĄçš„çŠ¶æ€ïŒŒćŻé€šèż‡addEventListener()æ–čæł•监搏statechangedäș‹ä»¶ç›‘ćŹä»»ćŠĄçŠ¶æ€çš„ć˜ćŒ–ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + state?: PlusDownloaderDownloadState; + /** + * äž‹èœœä»»ćŠĄçš„ć‚æ•° + * 调甚plus.donwloader.createDownload()æ–čæł•ćˆ›ć»șäž‹èœœä»»ćŠĄæ—¶èźŸçœźçš„ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + options?: PlusDownloaderDownloadOptions; + /** + * äž‹èœœçš„æ–‡ä»¶ćç§° + * äž‹èœœä»»ćŠĄćœšæœŹćœ°äżć­˜çš„æ–‡ä»¶è·ŻćŸ„ïŒŒäž‹èœœä»»ćŠĄćźŒæˆæ—¶æ›Žæ–°ïŒŒćŻé€šèż‡æ­€ć€Œèźżé—źäž‹èœœçš„æ–‡ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + filename?: string; + /** + * ć·ČćźŒæˆäž‹èœœæ–‡ä»¶çš„ć€§ć° + * æ•Žæ•°ç±»ćž‹ïŒŒć•äœäžșć­—èŠ‚ïŒˆbyteïŒ‰ïŒŒäž‹èœœä»»ćŠĄćŒ€ć§‹äŒ èŸ“æ•°æźæ—¶ïŒŒæŻæŹĄè§Šć‘statechangedäș‹ä»¶æˆ–äž‹èœœä»»ćŠĄćꌿˆæ—¶æ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + downloadedSize?: number; + /** + * äž‹èœœä»»ćŠĄæ–‡ä»¶çš„æ€»ć€§ć° + * æ•Žæ•°ç±»ćž‹ïŒŒć•äœäžșć­—èŠ‚ïŒˆbyteïŒ‰ïŒŒäž‹èœœä»»ćŠĄćŒ€ć§‹äŒ èŸ“æ•°æźæ—¶æ›Žæ–°ïŒŒćœšæ­€äč‹ć‰ć…¶ć€Œäžș0。 + * æ­€ć€Œæ˜Żä»ŽHTTPèŻ·æ±‚ć€Žäž­èŽ·ć–ïŒŒćŠ‚æžœæœćŠĄć™šæœȘèż”ć›žćˆ™æ­€ć€Œć§‹ç»ˆäžș0。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + totalSize?: number; + /** + * ć–æ¶ˆäž‹èœœä»»ćŠĄ + * ćŠ‚æžœä»»ćŠĄæœȘćźŒæˆïŒŒćˆ™ç»ˆæ­ąäž‹èœœïŒŒćč¶ä»Žä»»ćŠĄćˆ—èĄšäž­ćˆ é™€ă€‚ + * ćŠ‚äž‹èœœæœȘćźŒæˆïŒŒć°†ćˆ é™€ć·Čäž‹èœœçš„äžŽæ—¶æ–‡ä»¶ïŒŒćŠ‚æžœäž‹èœœć·ČćźŒæˆïŒŒć°†äžćˆ é™€ć·Čäž‹èœœçš„æ–‡ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + abort(): void; + /** + * æ·»ćŠ äž‹èœœä»»ćŠĄäș‹ä»¶ç›‘搏晚 + * äž‹èœœä»»ćŠĄæ·»ćŠ äș‹ä»¶ç›‘ćŹć™šćŽïŒŒćœ“ç›‘ćŹçš„äș‹ä»¶ć‘ç”Ÿæ—¶è§Šć‘listenerć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + addEventListener(type?: string, listener?: (result0: PlusDownloaderDownload, result1: number) => void, capture?: boolean): void; + /** + * èŽ·ć–äž‹èœœèŻ·æ±‚HTTP操ćș”ć€ŽéƒšäżĄæŻ + * HTTP操ćș”ć€Žéƒšć…šéƒšć†…ćźč䜜äžșæœȘè§Łæžçš„ć­—çŹŠäžČèż”ć›žïŒŒćŠ‚æžœæČĄæœ‰æŽ„æ”¶ćˆ°èż™äžȘHTTP操ćș”ć€Žæ•°æźæˆ–è€…äž‹èœœèŻ·æ±‚æœȘćźŒæˆćˆ™äžșç©ș歗笩äžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + getAllResponseHeaders(): string; + /** + * èŽ·ć–äž‹èœœèŻ·æ±‚æŒ‡ćźšçš„HTTP操ćș”ć€Žéƒšçš„ć€Œ + * ć…¶ć‚æ•°æ˜ŻèŠèż”ć›žçš„HTTP操ćș”ć€Žéƒšçš„ćç§°ïŒŒćŻä»„äœżç”šä»»äœ•ć€§ć°ć†™æ„ćˆ¶ćźšèż™äžȘć€Žéƒšćć­—ïŒŒć’Œć“ćș”ć€Žéƒšçš„æŻ”èŸƒæ˜ŻäžćŒșćˆ†ć€§ć°ć†™çš„ă€‚ + * ćŠ‚æžœæČĄæœ‰æŽ„æ”¶ćˆ°èż™äžȘć€Žéƒšæˆ–è€…äž‹èœœèŻ·æ±‚æœȘćźŒæˆćˆ™äžșç©ș歗笩äžČïŒ›ćŠ‚æžœæŽ„æ”¶ćˆ°ć€šäžȘæœ‰æŒ‡ćźšćç§°çš„ć€ŽéƒšïŒŒèż™äžȘć€Žéƒšçš„ć€Œèą«èżžæŽ„è”·æ„ćč¶èż”ć›žïŒŒäœżç”šé€—ć·ć’Œç©șæ Œćˆ†éš”ćŒ€ć„äžȘć€Žéƒšçš„ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + getResponseHeader(headerName?: string): string; + /** + * æš‚ćœäž‹èœœä»»ćŠĄ + * æš‚ćœäž‹èœœä»»ćŠĄïŒŒćŠ‚æžœä»»ćŠĄć·Čç»ć€„äșŽćˆć§‹çŠ¶æ€æˆ–æš‚ćœçŠ¶æ€ćˆ™æ— ä»»äœ•ć“ćș”。 + * é€šćžžćœšä»»ćŠĄć·ČćŒ€ć§‹ćŽæš‚ćœä»»ćŠĄă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + pause(): void; + /** + * æąć€æš‚ćœçš„äž‹èœœä»»ćŠĄ + * ç»§ç»­æš‚ćœçš„äž‹èœœä»»ćŠĄïŒŒćŠ‚æžœä»»ćŠĄć€„äșŽéžæš‚ćœçŠ¶æ€ćˆ™æ— ä»»äœ•ć“ćș”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + resume(): void; + /** + * èźŸçœźäž‹èœœèŻ·æ±‚çš„HTTPć€Žæ•°æź + * Http的Headerćș”èŻ„ćŒ…ć«ćœšé€šèż‡ćŽç»­start()è°ƒç”šè€Œć‘è”·çš„èŻ·æ±‚äž­ïŒŒæ­€æ–čæł•ćż…éœ€ćœšè°ƒç”šstart()äč‹ć‰èźŸçœźæ‰èƒœç”Ÿæ•ˆă€‚ + * ćŠ‚æžœćžŠæœ‰æŒ‡ćźšćç§°çš„ć€Žéƒšć·Čç»èą«æŒ‡ćźšäș†ïŒŒèż™äžȘć€Žéƒšçš„æ–°ć€Œć°±æ˜ŻïŒšäč‹ć‰æŒ‡ćźšçš„ć€ŒïŒŒćŠ äžŠé€—ć·ă€ä»„ćŠèż™äžȘè°ƒç”šæŒ‡ćźšçš„ć€ŒïŒˆćœąæˆäž€äžȘæ•°ç»„ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + setRequestHeader(headerName?: string, headerValue?: string): void; + /** + * ćŒ€ć§‹äž‹èœœä»»ćŠĄ + * ćŒ€ć§‹äž‹èœœä»»ćŠĄïŒŒćŠ‚æžœä»»ćŠĄć·Čç»ć€„äșŽćŒ€ć§‹çŠ¶æ€ćˆ™æ— ä»»äœ•ć“ćș”。 + * 朹戛ć»șä»»ćŠĄæˆ–ä»»ćŠĄäž‹èœœć€±èŽ„ćŽè°ƒç”šćŻé‡æ–°ćŒ€ć§‹äž‹èœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + start(): void; +} + +/** + * äž‹èœœä»»ćŠĄäș‹ä»¶ç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ +interface PlusDownloaderDownloadEvent { + /** + * äž‹èœœä»»ćŠĄçŠ¶æ€ć˜ćŒ–äș‹ä»¶ + * ćœ“äž‹èœœä»»ćŠĄçŠ¶æ€ć‘ç”Ÿć˜ćŒ–æ—¶è§Šć‘æ­€äș‹ä»¶ïŒŒäș‹ä»¶ćŽŸćž‹ć‚è€ƒDownloadStateChangedCallback。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + statechanged?: string; +} + +/** + * äž‹èœœä»»ćŠĄçŠ¶æ€ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ +type PlusDownloaderDownloadState = undefined | 0 | 1 | 2 | 3 | 4 | 5 | -1; + +/** + * äž‹èœœä»»ćŠĄć‚æ•° + * 朹戛ć»șäž‹èœœä»»ćŠĄæ—¶èźŸçœźçš„ć‚æ•°ïŒŒćŠ‚èźŸçœźäž‹èœœä»»ćŠĄäœżç”šçš„HTTPćèźźç±»ćž‹ă€äŒ˜ć…ˆçș§ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ +interface PlusDownloaderDownloadOptions { + /** + * çœ‘ç»œèŻ·æ±‚ç±»ćž‹ + * æ”ŻæŒhttpćèźźçš„â€œGET”、“POSTâ€ïŒŒé»˜èź€äžș“GETâ€èŻ·æ±‚ă€‚ + * - GET: GETèŻ·æ±‚ + * - POST: POSTèŻ·æ±‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + method?: 'GET' | 'POST'; + /** + * POSTèŻ·æ±‚æ—¶æäș€çš„æ•°æź + * ä»…ćœšçœ‘ç»œèŻ·æ±‚ç±»ćž‹methodèźŸçœźäžș"POST"时有效"GET"èŻ·æ±‚æ—¶ćżœç•„æ­€æ•°æźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + data?: string; + /** + * äž‹èœœæ–‡ä»¶äżć­˜çš„è·ŻćŸ„ + * äżć­˜æ–‡ä»¶è·ŻćŸ„ä»…æ”ŻæŒä»„"_downloads/"、"_doc/"、"_documents/"ćŒ€ć€Žçš„ć­—çŹŠäžČ。 + * æ–‡ä»¶è·ŻćŸ„ä»„æ–‡ä»¶ćŽçŒ€ćç»“ć°ŸïŒˆćŠ‚"_doc/download/a.doc"ïŒ‰èĄšæ˜ŽæŒ‡ćźšäżć­˜æ–‡ä»¶ç›źćœ•ćŠćç§°ïŒŒä»„â€œ/â€ç»“ć°Ÿćˆ™èź€äžșæŒ‡ćźšäżć­˜æ–‡ä»¶çš„ç›źćœ•ïŒˆæ­€æ—¶çš‹ćșè‡ȘćŠšç”Ÿæˆæ–‡ä»¶ćïŒ‰ă€‚ + * ćŠ‚æžœæŒ‡ćźšçš„æ–‡ä»¶ć·Čç»ć­˜ćœšïŒŒćˆ™è‡ȘćŠšćœšæ–‡ä»¶ććŽéąćŠ "(i)"ïŒŒć…¶äž­iäžșæ•°ć­—ïŒŒćŠ‚æžœæ–‡ä»¶ćç§°ćŽéąć·Čç»æ˜Żæ­€æ ŒćŒïŒŒćˆ™æ•°ć­—ié€’ćąžïŒŒćŠ‚"download(1).doc"。 + * é»˜èź€äżć­˜ç›źćœ•äžș"_downloads"ćč¶è‡ȘćŠšç”Ÿæˆæ–‡ä»¶ćç§°ă€‚ + * - _doc/: ćș”ç”šç§æœ‰æ–‡æĄŁç›źćœ• + * - _documents/: ć…±äș«æ–‡æĄŁç›źćœ• + * - _downloads/: ć…±äș«äž‹èœœç›źćœ• + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + filename?: '_doc/' | '_documents/' | '_downloads/'; + /** + * äž‹èœœä»»ćŠĄçš„äŒ˜ć…ˆçș§ + * æ•°ć€Œç±»ćž‹ïŒŒæ•°ć€Œè¶Šć€§äŒ˜ć…ˆçș§è¶Šé«˜ïŒŒé»˜èź€äŒ˜ć…ˆçș§ć€Œäžș0。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + priority?: number; + /** + * äž‹èœœä»»ćŠĄè¶…æ—¶æ—¶é—Ž + * æ•°ć€Œç±»ćž‹ïŒŒć•äœäžșs(秒)ïŒŒé»˜èź€ć€Œäžș120s。 + * è¶…æ—¶æ—¶é—ŽäžșæœćŠĄć™šć“ćș”èŻ·æ±‚çš„æ—¶é—ŽïŒˆäžæ˜Żäž‹èœœä»»ćŠĄćźŒæˆçš„æ€»æ—¶é—ŽïŒ‰ïŒŒćŠ‚æžœèźŸçœźäžș0ćˆ™èĄšç€șæ°žèżœäžè¶…æ—¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + timeout?: number; + /** + * äž‹èœœä»»ćŠĄé‡èŻ•æŹĄæ•° + * æ•°ć€Œç±»ćž‹ïŒŒé»˜èź€äžșé‡èŻ•3æŹĄă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + retry?: number; + /** + * äž‹èœœä»»ćŠĄé‡èŻ•é—Žéš”æ—¶é—Ž + * æ•°ć€Œç±»ćž‹ïŒŒć•äœäžșs(秒)ïŒŒé»˜èź€ć€Œäžș30s。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + retryInterval?: number; +} + +/** + * FingerprintæšĄć—çźĄç†æŒ‡çșčèŻ†ćˆ«ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ +interface PlusFingerprint { + /** + * JSONćŻčè±ĄïŒŒæŒ‡çșčèŻ†ćˆ«èź€èŻć‚æ•° + * 甹äșŽèźŸçœźæŒ‡çșčèŻ†ćˆ«èź€èŻç•Œéąæ˜Ÿç€ș的提ç€șäżĄæŻç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ + AuthenticateOptions?: PlusFingerprintAuthenticateOptions; + /** + * JSONćŻčè±ĄïŒŒæŒ‡çșčèŻ†ćˆ«é”™èŻŻäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ + FingerprintError?: PlusFingerprintFingerprintError; + /** + * ćœ“ć‰èźŸć€‡çŽŻćąƒæ˜ŻćŠæ”ŻæŒæŒ‡çșčèŻ†ćˆ« + * ç›źć‰èż˜æœ‰ćŸˆć€šèźŸć€‡æČĄæœ‰æŒ‡çșčèŻ†ćˆ«æšĄć—ïŒŒéœ€èŠè°ƒç”šæ­€æ–čæł•ćˆ€æ–­æ˜ŻćŠćŻäœżç”šæŒ‡çșčèŻ†ćˆ«ćŠŸèƒœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ + isSupport(): boolean; + /** + * ćœ“ć‰èźŸć€‡æ˜ŻćŠèźŸçœźćŻ†ç é”ć± + * ćŠ‚æžœèźŸć€‡æČĄæœ‰èźŸçœźćŻ†ç é”ć±ïŒŒćˆ™æ— æł•äœżç”šæŒ‡çșčèŻ†ćˆ«ćŠŸèƒœïŒŒć»șèźźè°ƒç”šæŒ‡çșčèŻ†ćˆ«ć‰ć…ˆäœżç”šæ­€æŽ„ćŁæŁ€æŸ„ă€‚ + * 调甚plus.fingerprint.authenticateäŒšèż”ć›žć€±èŽ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ + isKeyguardSecure(): boolean; + /** + * ćœ“ć‰èźŸć€‡æ˜ŻćŠć·Čç»ćœ•ć…„æŒ‡çșč + * ćŠ‚æžœèźŸć€‡æČĄæœ‰ćœ•ć…„指çșčïŒŒćˆ™æ— æł•äœżç”šæŒ‡çșčèŻ†ćˆ«ćŠŸèƒœïŒŒć»șèźźè°ƒç”šæŒ‡çșčèŻ†ćˆ«ć‰ć…ˆäœżç”šæ­€æŽ„ćŁæŁ€æŸ„ă€‚ + * 调甚plus.fingerprint.authenticateäŒšèż”ć›žć€±èŽ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ + isEnrolledFingerprints(): boolean; + /** + * 指çșčèŻ†ćˆ«èź€èŻ + * ç”šæˆ·ćŻä»„ćŒ€ć§‹èŸ“ć…„æŒ‡çșčèż›èĄŒèŻ†ćˆ«ïŒŒćŠ‚æžœèź€èŻæˆćŠŸćˆ™è§Šć‘successCBć›žè°ƒïŒŒèŻ†ćˆ«ć€±èŽ„ćˆ™è§Šć‘errorCBć›žè°ƒèż”ć›žé”™èŻŻäżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ + authenticate(successCB?: Function, errorCB?: (result: PlusFingerprintFingerprintError) => void, options?: PlusFingerprintAuthenticateOptions): void; + /** + * ć–æ¶ˆæŒ‡çșčèŻ†ćˆ«èź€èŻ + * ć–æ¶ˆćœ“ć‰æ­Łćœšć€„ç†çš„æŒ‡çșčèŻ†ćˆ«èź€èŻæ“äœœă€‚ + * ćŠ‚æžœćœ“ć‰æČĄæœ‰èż›èĄŒæŒ‡çșčèŻ†ćˆ«ćˆ™äžèż›èĄŒä»»äœ•æ“äœœïŒ›ćŠ‚æžœćœ“ć‰æ­Łćœšèż›èĄŒæŒ‡çșčèŻ†ćˆ«ćˆ™è§Šć‘é”™èŻŻć›žè°ƒïŒˆé”™èŻŻç äžș“CANCELâ€ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ + cancel(): void; +} + +/** + * JSONćŻčè±ĄïŒŒæŒ‡çșčèŻ†ćˆ«èź€èŻć‚æ•° + * 甹äșŽèźŸçœźæŒ‡çșčèŻ†ćˆ«èź€èŻç•Œéąæ˜Ÿç€ș的提ç€șäżĄæŻç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ +interface PlusFingerprintAuthenticateOptions { + /** + * ćœšæŒ‡çșčèŻ†ćˆ«èż‡çš‹äž­æ˜Ÿç€șćœšç•ŒéąäžŠçš„æç€șäżĄæŻ + * ćŠ‚æžœæŒ‡çșčèŻ†ćˆ«èź€èŻèż‡çš‹äž­äžæ˜Ÿç€ș提ç€șæĄ†ïŒŒćˆ™äžæ˜Ÿç€șæ­€äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ + message?: string; +} + +/** + * JSONćŻčè±ĄïŒŒæŒ‡çșčèŻ†ćˆ«é”™èŻŻäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ +interface PlusFingerprintFingerprintError { + /** + * äžæ”ŻæŒæŒ‡çșčèŻ†ćˆ« + * ćœ“ć‰èźŸć€‡äžæ”ŻæŒæŒ‡çșčèŻ†ćˆ«ćŠŸèƒœæ—¶èż”ć›žæ­€é”™èŻŻïŒŒé”™èŻŻä»Łç ćžžé‡ć€Œäžș1。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ + UNSUPPORT?: number; + /** + * èźŸć€‡æœȘèźŸçœźćŻ†ç é”ć± + * ćœ“ć‰èźŸć€‡äžșèźŸçœźćŻ†ç é”ć±ćŻŒè‡Žæ— æł•äœżç”šæŒ‡çșčèŻ†ćˆ«ćŠŸèƒœæ—¶èż”ć›žæ­€é”™èŻŻïŒŒé”™èŻŻä»Łç ćžžé‡ć€Œäžș2。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ + KEYGUARD_INSECURE?: number; + /** + * æœȘćœ•ć…„æŒ‡çșčèŻ†ćˆ« + * ćœ“ć‰èźŸć€‡æœȘćœ•ć…„æŒ‡çșčćŻŒè‡Žæ— æł•äœżç”šæŒ‡çșčèŻ†ćˆ«ćŠŸèƒœæ—¶èż”ć›žæ­€é”™èŻŻïŒŒé”™èŻŻä»Łç ćžžé‡ć€Œäžș3。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ + FINGERPRINT_UNENROLLED?: number; + /** + * 指çșčèŻ†ćˆ«äžćŒč配 + * 甚户指çșčèŻ†ćˆ«èź€èŻäžé€šèż‡æ—¶èż”ć›žæ­€é”™èŻŻïŒŒé”™èŻŻä»Łç ćžžé‡ć€Œäžș4。 + * ç”šæˆ·æŻæŹĄć°èŻ•æŒ‡çșčèŻ†ćˆ«èź€èŻæœȘé€šèż‡éƒœäŒšè§Šć‘æ­€é”™èŻŻïŒŒæ­€æ—¶èż˜ćŻä»„ç»§ç»­èŻ†ćˆ«èź€èŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ + AUTHENTICATE_MISMATCH?: number; + /** + * 指çșčèŻ†ćˆ«æŹĄæ•°è¶…èż‡é™ćˆ¶ + * ç”šæˆ·ć€šæŹĄæŒ‡çșčèŻ†ćˆ«èź€èŻäžé€šèż‡æ—¶èż”ć›žæ­€é”™èŻŻïŒŒé”™èŻŻä»Łç ćžžé‡ć€Œäžș5。 + * 通澾ć‡șçŽ°æ­€é”™èŻŻćŽçł»ç»ŸäŒšé”ćźšäž€æź”æ—¶é—ŽçŠæ­ąäœżç”šæŒ‡çșčèŻ†ćˆ«ïŒŒćŠ‚æžœć†æŹĄè°ƒç”šæŒ‡çșčèŻ†ćˆ«èź€èŻäŒšç«‹ćłèż”ć›žæ­€é”™èŻŻïŒŒć› æ­€ć‡șçŽ°æ­€é”™èŻŻæ—¶ćș”èŻ„æç€șç”šæˆ·äœżç”šć…¶ćźƒæ–čćŒèż›èĄŒèź€èŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ + AUTHENTICATE_OVERLIMIT?: number; + /** + * ć–æ¶ˆæŒ‡çșčèŻ†ćˆ« + * ç”šæˆ·ć–æ¶ˆæŒ‡çșčèŻ†ćˆ«èź€èŻæ—¶èż”ć›žæ­€é”™èŻŻïŒŒé”™èŻŻä»Łç ćžžé‡ć€Œäžș6。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ + CANCEL?: number; + /** + * æœȘçŸ„é”™èŻŻ + * ć…¶ćźƒæœȘçŸ„é”™èŻŻïŒŒé”™èŻŻä»Łç ćžžé‡ć€Œäžș7。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ + UNKNOWN_ERROR?: number; + /** + * é”™èŻŻä»Łç  + * ć–ć€ŒèŒƒć›ŽäžșFingerprintErrorćŻčè±Ąçš„é”™èŻŻćžžé‡ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ + code?: number; + /** + * é”™èŻŻæèż°äżĄæŻ + * èŻŠç»†é”™èŻŻæèż°äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ + message?: string; +} + +/** + * GalleryæšĄć—çźĄç†çł»ç»Ÿç›žć†ŒïŒŒæ”ŻæŒä»Žç›žć†Œäž­é€‰æ‹©ć›Ÿç‰‡æˆ–è§†éą‘æ–‡ä»¶ă€äżć­˜ć›Ÿç‰‡æˆ–è§†éą‘æ–‡ä»¶ćˆ°ç›žć†Œç­‰ćŠŸèƒœă€‚é€šèż‡plus.galleryèŽ·ć–ç›žć†ŒçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ +interface PlusGallery { + /** + * JSONćŻčè±ĄïŒŒä»Žç›žć†Œäž­é€‰æ‹©æ–‡ä»¶çš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + GalleryOptions?: PlusGalleryGalleryOptions; + /** + * ç›žć†Œé€‰æ‹©æ–‡ä»¶èż‡æ»€ç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + GalleryFilter?: PlusGalleryGalleryFilter; + /** + * äżć­˜ć›Ÿç‰‡ćˆ°ç›žć†ŒæˆćŠŸäș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + GallerySaveEvent?: PlusGalleryGallerySaveEvent; + /** + * JSONćŻčè±ĄïŒŒćŒčć‡șæ‹ç…§æˆ–æ‘„ćƒç•ŒéąæŒ‡ç€șäœçœź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + PopPosition?: PlusGalleryPopPosition; + /** + * ä»Žçł»ç»Ÿç›žć†Œé€‰æ‹©æ–‡ä»¶ïŒˆć›Ÿç‰‡æˆ–è§†éą‘ïŒ‰ + * ä»Žçł»ç»Ÿç›žć†Œäž­é€‰æ‹©ć›Ÿç‰‡æˆ–è§†éą‘æ–‡ä»¶ă€‚æŻæŹĄä»…èƒœé€‰æ‹©äž€äžȘæ–‡ä»¶ïŒŒé€‰æ‹©ćŽć°†èż”ć›žé€‰æ‹©çš„æ–‡ä»¶è·ŻćŸ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + pick(succesCB?: (result: string) => void, errorCB?: (result: any) => void, options?: PlusGalleryGalleryOptions): void; + /** + * äżć­˜æ–‡ä»¶ćˆ°çł»ç»Ÿç›žć†Œäž­ + * äżć­˜æ–‡ä»¶ćˆ°çł»ç»Ÿç›žć†Œäž­ă€‚ + * æŻæŹĄä»…èƒœäżć­˜äž€äžȘæ–‡ä»¶ïŒŒæ”ŻæŒć›Ÿç‰‡ç±»ćž‹ïŒˆjpg/jpeg、png、bmpç­‰æ ŒćŒïŒ‰ć’Œè§†éą‘æ–‡ä»¶ïŒˆ3gp、movç­‰æ ŒćŒïŒ‰ă€‚ + * è‹„äżć­˜çš„æ–‡ä»¶çł»ç»Ÿäžæ”ŻæŒïŒŒćˆ™é€šèż‡errorCBèż”ć›žé”™èŻŻäżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + save(path ?: string, succesCB?: (result: PlusGalleryGallerySaveEvent) => void, errorCB?: (result: any) => void): void; +} + +/** + * JSONćŻčè±ĄïŒŒä»Žç›žć†Œäž­é€‰æ‹©æ–‡ä»¶çš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ +interface PlusGalleryGalleryOptions { + /** + * æ˜ŻćŠæ˜Ÿç€șçł»ç»Ÿç›žć†Œæ–‡ä»¶é€‰æ‹©ç•Œéąçš„ćŠšç”» + * ćŻć–ć€Œtrue、falseïŒŒé»˜èź€ć€Œäžștrue。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + animation?: boolean; + /** + * é€‰æ‹©æ–‡ä»¶äżć­˜çš„è·ŻćŸ„ + * 某äș›çł»ç»Ÿäžèƒœç›ŽæŽ„äœżç”šçł»ç»Ÿç›žć†Œçš„è·ŻćŸ„ïŒŒèż™æ—¶éœ€èŠć°†é€‰æ‹©çš„æ–‡ä»¶äżć­˜ćˆ°ćș”ç”šćŻèźżé—źçš„ç›źćœ•äž­ïŒŒćŻé€šèż‡æ­€ć‚æ•°èźŸçœźäżć­˜æ–‡ä»¶çš„è·ŻćŸ„ă€‚ + * ćŠ‚æžœè·ŻćŸ„äž­ćŒ…æ‹Źæ–‡ä»¶ćŽçŒ€ćç§°ïŒŒćˆ™èĄšæ˜ŽæŒ‡ćźšæ–‡ä»¶è·ŻćŸ„ćŠćç§°ïŒŒćŠćˆ™ä»…æŒ‡ćźšæ–‡ä»¶äżć­˜ç›źćœ•ïŒŒæ–‡ä»¶ćç§°è‡ȘćŠšç”Ÿæˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + filename?: string; + /** + * ç›žć†Œäž­é€‰æ‹©æ–‡ä»¶ç±»ćž‹èż‡æ»€ć™š + * çł»ç»Ÿç›žć†Œé€‰æ‹©ć™šäž­ćŻé€‰æ‹©çš„æ–‡ä»¶ç±»ćž‹ïŒŒćŻèźŸçœźäžșä»…é€‰æ‹©ć›Ÿç‰‡æ–‡ä»¶ïŒˆâ€œimageâ€ïŒ‰ă€è§†éą‘æ–‡ä»¶ïŒˆâ€œvideo”或所有文件“noneâ€ïŒ‰ïŒŒé»˜èź€ć€Œäžș“image”。 + * - image: ä»…ćŻé€‰æ‹©ć›Ÿç‰‡æ–‡ä»¶ + * - video: ä»…ćŻé€‰æ‹©è§†éą‘æ–‡ä»¶ + * - none: ćŻé€‰æ‹©ć›Ÿç‰‡æˆ–è§†éą‘æ–‡ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + filter?: 'image' | 'video' | 'none'; + /** + * æœ€ć€šé€‰æ‹©çš„ć›Ÿç‰‡æ•°é‡ + * ä»…ćœšæ”ŻæŒć€šé€‰æ—¶æœ‰æ•ˆïŒŒć–ć€ŒèŒƒć›Žäžș1戰InfinityïŒŒé»˜èź€ć€ŒäžșInfinityïŒŒćłäžé™ćˆ¶é€‰æ‹©çš„ć›Ÿç‰‡æ•°ă€‚ + * ćŠ‚æžœèźŸçœźçš„ć€Œéžæł•ćˆ™äœżç”šé»˜èź€ć€ŒInfinity。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + maximum?: number; + /** + * æ˜ŻćŠæ”ŻæŒć€šé€‰ć›Ÿç‰‡ + * ćŻä»Žçł»ç»Ÿç›žć†Œäž­é€‰æ‹©ć€šćŒ ć›Ÿç‰‡ïŒŒé€‰æ‹©ć›Ÿç‰‡ćŽé€šèż‡GalleryMultiplePickSuccessCallbackć›žè°ƒèż”ć›žé€‰æ‹©çš„ć›Ÿç‰‡ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + multiple?: boolean; + /** + * è¶…èż‡æœ€ć€šé€‰æ‹©ć›Ÿç‰‡æ•°é‡äș‹ä»¶ + * äœżç”šç›žć†Œć€šé€‰ć›Ÿç‰‡æ—¶ïŒŒćŻé€šèż‡maximumć±žæ€§èźŸçœźæœ€ć€šé€‰æ‹©çš„ć›Ÿç‰‡æ•°é‡ïŒŒćœ“ç”šæˆ·æ“äœœé€‰æ‹©çš„æ•°é‡ć€§äșŽæ­€æ—¶è§Šć‘æ­€äș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + onmaxed?: Function; + /** + * ç›žć†Œé€‰æ‹©ç•ŒéąćŒčć‡ș指ç€șćŒș㟟 + * ćŻčäșŽć€§ć±ćč•èźŸć€‡ćŠ‚iPadïŒŒç›žć†Œé€‰æ‹©ç•ŒéąäžșćŒčć‡șçȘ—ćŁïŒŒæ­€æ—¶ćŻé€šèż‡æ­€ć‚æ•°èźŸçœźćŒčć‡șçȘ—ćŁäœçœźă€‚ + * ć…¶äžșJSONćŻčè±ĄïŒŒæ ŒćŒćŠ‚{top:"10px",left:"10px",width:"200px",height:"200px"}ïŒŒæ‰€æœ‰ć€ŒäžșćƒçŽ ć€ŒïŒŒć·ŠäžŠćæ ‡ç›žćŻčäșŽćźčć™šçš„äœçœźïŒŒé»˜èź€ćŒčć‡șäœçœźäžșć±ćč•汅䞭。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + popover?: PlusGalleryPopPosition; + /** + * ć·Čé€‰æ‹©çš„ć›Ÿç‰‡è·ŻćŸ„ćˆ—èĄš + * ä»…ćœšć€šć›Ÿç‰‡é€‰æ‹©æ—¶ç”Ÿæ•ˆïŒŒç›žć†Œé€‰æ‹©ç•Œéąć°†é€‰äž­æŒ‡ćźšçš„ć›Ÿç‰‡è·ŻćŸ„ćˆ—èĄšă€‚ + * ćŠ‚æžœæŒ‡ćźšçš„è·ŻćŸ„æ— æ•ˆïŒŒćˆ™ćżœç•„æ­€éĄčïŒ›ćŠ‚æžœæŒ‡ćźšçš„è·ŻćŸ„æ•°è¶…èż‡maximumć±žæ€§æŒ‡ćźšçš„æœ€ć€§é€‰æ‹©æ•°ç›źćˆ™è¶…ć‡șçš„ć›Ÿç‰‡äžé€‰äž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + selected?: any []; + /** + * æ˜ŻćŠäœżç”šçł»ç»Ÿç›žć†Œæ–‡ä»¶é€‰æ‹©ç•Œéą + * multipleć±žæ€§èźŸçœźäžștrueæ—¶ïŒŒćŠ‚æžœçł»ç»Ÿè‡ȘćžŠç›žć†Œé€‰æ‹©æŽ§ä»¶æ—¶ćˆ™äŒ˜ć…ˆäœżç”šïŒŒćŠćˆ™äœżç”š5+ç»Ÿäž€ç›žć†Œé€‰æ‹©æŽ§ä»¶ïŒ›èźŸçœźäžșfalsećˆ™äžäœżç”šçł»ç»Ÿè‡ȘćžŠç›žć†Œé€‰æ‹©æŽ§ä»¶ïŒŒç›ŽæŽ„äœżç”š5+ç»Ÿäž€ç›žć†Œé€‰æ‹©ç•Œéąă€‚ + * é»˜èź€ć€Œäžștrue。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + system?: boolean; +} + +/** + * ç›žć†Œé€‰æ‹©æ–‡ä»¶èż‡æ»€ç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ +interface PlusGalleryGalleryFilter { + /** + * ä»…ćŻé€‰æ‹©ć›Ÿç‰‡æ–‡ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + image?: string; + /** + * ä»…ćŻé€‰æ‹©è§†éą‘æ–‡ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + video?: string; + /** + * äžèż‡æ»€ïŒŒćŻé€‰æ‹©ć›Ÿç‰‡æˆ–è§†éą‘æ–‡ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + none?: string; +} + +/** + * äżć­˜ć›Ÿç‰‡ćˆ°ç›žć†ŒæˆćŠŸäș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ +interface PlusGalleryGallerySaveEvent { + /** + * äżć­˜ćˆ°ç›žć†Œçš„ć›Ÿç‰‡è·ŻćŸ„ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + path?: string; +} + +/** + * JSONćŻčè±ĄïŒŒćŒčć‡șæ‹ç…§æˆ–æ‘„ćƒç•ŒéąæŒ‡ç€șäœçœź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ +interface PlusGalleryPopPosition { + /** + * 指ç€șćŒșćŸŸè·çŠ»ćźčć™šéĄ¶éƒšçš„è·çŠ» + * ćŒčć‡șæ‹ç…§æˆ–æ‘„ćƒçȘ—ćŁæŒ‡ç€șćŒșćŸŸè·çŠ»ćźčć™šéĄ¶éƒšçš„è·çŠ»ïŒŒć•äœæ”ŻæŒćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ć’Œç™Ÿćˆ†æŻ”ïŒˆćŠ‚"50%"ïŒ‰ïŒŒćŠ‚äžć†™ć•äœćˆ™äžșćƒçŽ ć€Œć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + top?: string; + /** + * 指ç€șćŒșćŸŸè·çŠ»ćźčć™šć·ŠäŸ§çš„è·çŠ» + * ćŒčć‡șæ‹ç…§æˆ–æ‘„ćƒçȘ—ćŁæŒ‡ç€șćŒșćŸŸè·çŠ»ćźčć™šć·ŠäŸ§çš„è·çŠ»ïŒŒć•äœæ”ŻæŒćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ć’Œç™Ÿćˆ†æŻ”ïŒˆćŠ‚"50%"ïŒ‰ïŒŒćŠ‚äžć†™ć•äœćˆ™äžșćƒçŽ ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + left?: string; + /** + * 指ç€șćŒșćŸŸçš„ćźœćșŠ + * ćŒčć‡șæ‹ç…§æˆ–æ‘„ćƒçȘ—ćŁæŒ‡ç€șćŒșćŸŸçš„ćźœćșŠïŒŒć•äœæ”ŻæŒćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ć’Œç™Ÿćˆ†æŻ”ïŒˆćŠ‚"50%"ïŒ‰ïŒŒćŠ‚äžć†™ć•äœćˆ™äžșćƒçŽ ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + width?: string; + /** + * 指ç€șćŒșćŸŸçš„é«˜ćșŠ + * ćŒčć‡șæ‹ç…§æˆ–æ‘„ćƒçȘ—ćŁæŒ‡ç€șćŒșćŸŸçš„é«˜ćșŠïŒŒć•äœæ”ŻæŒćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ć’Œç™Ÿćˆ†æŻ”ïŒˆćŠ‚"50%"ïŒ‰ïŒŒćŠ‚äžć†™ć•äœćˆ™äžșćƒçŽ ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + height?: string; +} + +/** + * GeolocationæšĄć—çźĄç†èźŸć€‡äœçœźäżĄæŻïŒŒç”šäșŽèŽ·ć–ćœ°ç†äœçœźäżĄæŻïŒŒćŠ‚ç»ćșŠă€çșŹćșŠç­‰ă€‚é€šèż‡plus.geolocationćŻèŽ·ć–èźŸć€‡äœçœźçźĄç†ćŻčè±Ąă€‚è™œç„¶W3Cć·Čç»æäŸ›æ ‡ć‡†APIèŽ·ć–äœçœźäżĄæŻïŒŒäœ†ćœšæŸäș›ćčłć°ć­˜ćœšć·źćŒ‚或æœȘćźžçŽ°ïŒŒäžșäș†äżæŒć„ćčłć°çš„ç»Ÿäž€æ€§ïŒŒćźšä艿­€è§„èŒƒæŽ„ćŁèŽ·ć–äœçœźäżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ +interface PlusGeolocation { + /** + * JSONćŻčè±ĄïŒŒèźŸć€‡äœçœźäżĄæŻæ•°æź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + Position?: PlusGeolocationPosition; + /** + * JSONćŻčè±ĄïŒŒćœ°ć€äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + Address?: PlusGeolocationAddress; + /** + * JSONćŻčè±ĄïŒŒćœ°ç†ćæ ‡äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + Coordinates?: PlusGeolocationCoordinates; + /** + * JSONćŻčè±ĄïŒŒç›‘ćŹèźŸć€‡äœçœźäżĄæŻć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + PositionOptions?: PlusGeolocationPositionOptions; + /** + * JSONćŻčè±ĄïŒŒćźšäœé”™èŻŻäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + GeolocationError?: PlusGeolocationGeolocationError; + /** + * èŽ·ć–ćœ“ć‰èźŸć€‡äœçœźäżĄæŻ + * äœçœźäżĄæŻć°†é€šèż‡æ‰‹æœșGPSèźŸć€‡æˆ–ć…¶ćźƒäżĄæŻćŠ‚IPćœ°ć€ă€ç§»ćŠšçœ‘ç»œäżĄć·èŽ·ć–ïŒŒç”±äșŽèŽ·ć–äœçœźäżĄæŻćŻèƒœéœ€èŠèŸƒé•żçš„æ—¶é—ŽïŒŒćœ“æˆćŠŸèŽ·ć–äœçœźäżĄæŻćŽć°†é€šèż‡successCBć›žè°ƒć‡œæ•°èż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + getCurrentPosition(successCB?: (result: PlusGeolocationPosition) => void, errorCB?: (result: PlusGeolocationGeolocationError) => void, options?: PlusGeolocationPositionOptions): void; + /** + * ç›‘ćŹèźŸć€‡äœçœźć˜ćŒ–äżĄæŻ + * äœçœźäżĄæŻć°†é€šèż‡æ‰‹æœșGPSèźŸć€‡æˆ–ć…¶ćźƒäżĄæŻćŠ‚IPćœ°ć€ă€ç§»ćŠšçœ‘ç»œäżĄć·èŽ·ć–ă€‚ + * ćœ“äœçœźäżĄæŻæ›Žæ–°ćŽć°†é€šèż‡successCBć›žè°ƒć‡œæ•°èż”ć›žă€‚ + * äœçœźäżĄæŻèŽ·ć–ć€±èŽ„ćˆ™è°ƒç”šć›žè°ƒć‡œæ•°errorCB。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + watchPosition(successCB?: (result: PlusGeolocationPosition) => void, errorCB?: (result: PlusGeolocationGeolocationError) => void, option?: PlusGeolocationPositionOptions): number; + /** + * ć…łé—­ç›‘ćŹèźŸć€‡äœçœźäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + clearWatch(watchId?: number): void; +} + +/** + * JSONćŻčè±ĄïŒŒèźŸć€‡äœçœźäżĄæŻæ•°æź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ +interface PlusGeolocationPosition { + /** + * ćœ°ç†ćæ ‡äżĄæŻïŒŒćŒ…æ‹Źç»çșŹćșŠă€æ”·æ‹”ă€é€ŸćșŠç­‰äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + coords?: PlusGeolocationCoordinates; + /** + * èŽ·ć–ćˆ°ćœ°ç†ćæ ‡äżĄæŻçš„ćæ ‡çł»ç±»ćž‹ + * ćŻć–ä»„äž‹ćæ ‡çł»ç±»ćž‹ïŒš + * "gps"ïŒšèĄšç€șWGS-84ćæ ‡çł»ïŒ› + * "gcj02"ïŒšèĄšç€șć›œæ”‹ć±€ç»çșŹćșŠćæ ‡çł»ïŒ› + * "bd09"ïŒšèĄšç€ș癟ćșŠćąšćĄæ‰˜ćæ ‡çł»ïŒ› + * "bd09ll"ïŒšèĄšç€ș癟ćșŠç»çșŹćșŠćæ ‡çł»ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + coordsType?: string; + /** + * èŽ·ć–ćˆ°ćœ°ç†ćæ ‡çš„æ—¶é—ŽæˆłäżĄæŻ + * æ—¶é—Žæˆłć€Œäžș从1970ćčŽ1月1æ—„è‡łä»Šçš„æŻ«ç§’æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + timestamp?: number; + /** + * èŽ·ć–ćˆ°ćœ°ç†äœçœźćŻčćș”çš„ćœ°ć€äżĄæŻ + * èŽ·ć–ćœ°ć€äżĄæŻéœ€èŠèżžæŽ„ćˆ°æœćŠĄć™šèż›èĄŒè§ŁæžïŒŒæ‰€ä»„äŒšæ¶ˆè€—æ›Žć€šçš„è”„æșïŒŒćŠ‚æžœäžéœ€èŠèŽ·ć–ćœ°ć€äżĄæŻćŻé€šèż‡èźŸçœźPositionOptionsć‚æ•°çš„geocodeć±žæ€§ć€Œäžșfalseéżć…èŽ·ć–ćœ°ć€äżĄæŻă€‚ + * ćŠ‚æžœæČĄæœ‰èŽ·ć–ćˆ°ćœ°ć€äżĄæŻćˆ™èż”ć›žundefined。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + address?: PlusGeolocationAddress; + /** + * èŽ·ć–ćźŒæ•Žćœ°ć€æèż°äżĄæŻ + * ćŠ‚æžœæČĄæœ‰èŽ·ć–ćˆ°ćœ°ć€äżĄæŻćˆ™èż”ć›žundefined。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + addresses?: string; +} + +/** + * JSONćŻčè±ĄïŒŒćœ°ć€äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ +interface PlusGeolocationAddress { + /** + * ć›œćź¶ + * ćŠ‚â€œäž­ć›œâ€ïŒŒćŠ‚æžœæ— æł•èŽ·ć–æ­€äżĄæŻćˆ™èż”ć›žundefined。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + country?: string; + /** + * çœä»œćç§° + * 橂“挗äșŹćž‚â€ïŒŒćŠ‚æžœæ— æł•èŽ·ć–æ­€äżĄæŻćˆ™èż”ć›žundefined。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + province?: string; + /** + * 柎澂損称 + * 橂“挗äșŹćž‚â€ïŒŒćŠ‚æžœæ— æł•èŽ·ć–æ­€äżĄæŻćˆ™èż”ć›žundefined。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + city?: string; + /** + * ćŒșïŒˆćŽżïŒ‰ćç§° + * ćŠ‚â€œæœé˜łćŒșâ€ïŒŒćŠ‚æžœæ— æł•èŽ·ć–æ­€äżĄæŻćˆ™èż”ć›žundefined。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + district?: string; + /** + * èĄ—é“äżĄæŻ + * ćŠ‚â€œé…’ä»™æĄ„è·Żâ€ïŒŒćŠ‚æžœæ— æł•èŽ·ć–æ­€äżĄæŻćˆ™èż”ć›žundefined。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + street?: string; + /** + * èŽ·ć–èĄ—é“é—šç‰Œć·äżĄæŻ + * 橂“3ć·â€ïŒŒćŠ‚æžœæ— æł•èŽ·ć–æ­€äżĄæŻćˆ™èż”ć›žundefined。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + streetNum?: string; + /** + * POIäżĄæŻ + * ćŠ‚â€œç””ć­ćŸŽïŒŽć›œé™…ç””ć­æ€»éƒšâ€ïŒŒćŠ‚æžœæ— æł•èŽ·ć–æ­€äżĄæŻćˆ™èż”ć›žundefined。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + poiName?: string; + /** + * é‚źæ”żçŒ–ç  + * 橂“100016â€ïŒŒćŠ‚æžœæ— æł•èŽ·ć–æ­€äżĄæŻćˆ™èż”ć›žundefined。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + postalCode?: string; + /** + * ćŸŽćž‚ä»Łç  + * 橂“010â€ïŒŒćŠ‚æžœæ— æł•èŽ·ć–æ­€äżĄæŻćˆ™èż”ć›žundefined。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + cityCode?: string; +} + +/** + * JSONćŻčè±ĄïŒŒćœ°ç†ćæ ‡äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ +interface PlusGeolocationCoordinates { + /** + * ćæ ‡çșŹćșŠć€Œ + * æ•°æźç±»ćž‹ćŻčè±ĄïŒŒćœ°ç†ćæ ‡äž­çš„çșŹćșŠć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + latitude?: number; + /** + * ćæ ‡ç»ćșŠć€Œ + * æ•°æźç±»ćž‹ćŻčè±ĄïŒŒćœ°ç†ćæ ‡äž­çš„ç»ćșŠć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + longitude?: number; + /** + * æ”·æ‹”äżĄæŻ + * æ•°æźç±»ćž‹ćŻčè±ĄïŒŒćŠ‚æžœæ— æł•èŽ·ć–æ­€äżĄæŻïŒŒćˆ™æ­€ć€Œäžșç©șnullïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + altitude?: number; + /** + * ćœ°ç†ćæ ‡äżĄæŻçš„çČŸçĄźćșŠäżĄæŻ + * æ•°æźç±»ćž‹ćŻčè±ĄïŒŒć•äœäžșç±łïŒŒć…¶æœ‰æ•ˆć€Œćż…éĄ»ć€§äșŽ0。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + accuracy?: number; + /** + * 攷拔的çČŸçĄźćșŠäżĄæŻ + * æ•°æźç±»ćž‹ćŻčè±ĄïŒŒć•äœäžșç±łïŒŒć…¶æœ‰æ•ˆć€Œćż…éĄ»ć€§äșŽ0ă€‚ćŠ‚æžœæ— æł•èŽ·ć–æ”·æ‹”äżĄæŻïŒŒćˆ™æ­€ć€Œäžșç©șnullïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + altitudeAccuracy?: number; + /** + * èĄšç€șèźŸć€‡ç§»ćŠšçš„æ–č搑 + * æ•°æźç±»ćž‹ćŻčè±ĄïŒŒèŒƒć›Žäžș0戰360ïŒŒèĄšç€ș盾ćŻčäșŽæ­ŁćŒ—æ–čć‘çš„è§’ćșŠă€‚ćŠ‚æžœæ— æł•èŽ·ć–æ­€äżĄæŻïŒŒćˆ™æ­€ć€Œäžșç©șnullïŒ‰ă€‚ćŠ‚æžœèźŸć€‡æČĄæœ‰ç§»ćŠšćˆ™æ­€ć€ŒäžșNaN。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + heading?: number; + /** + * èĄšç€șèźŸć€‡ç§»ćŠšçš„é€ŸćșŠ + * æ•°æźç±»ćž‹ćŻčè±ĄïŒŒć•äœäžșç±łæŻç§’ïŒˆm/sïŒ‰ïŒŒć…¶æœ‰æ•ˆć€Œćż…éĄ»ć€§äșŽ0ă€‚ćŠ‚æžœæ— æł•èŽ·ć–é€ŸćșŠäżĄæŻïŒŒćˆ™æ­€ć€Œäžșç©șnullïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + speed?: number; +} + +/** + * JSONćŻčè±ĄïŒŒç›‘ćŹèźŸć€‡äœçœźäżĄæŻć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ +interface PlusGeolocationPositionOptions { + /** + * æ˜ŻćŠé«˜çČŸçĄźćșŠèŽ·ć–äœçœźäżĄæŻ + * 高çČŸćșŠèŽ·ć–èĄšç€șéœ€èŠäœżç”šæ›Žć€šçš„çł»ç»Ÿè”„æșïŒŒé»˜èź€ć€Œäžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + enableHighAccuracy?: boolean; + /** + * èŽ·ć–äœçœźäżĄæŻçš„è¶…æ—¶æ—¶é—Ž + * ć•äœäžșæŻ«ç§’ïŒˆmsïŒ‰ïŒŒé»˜èź€ć€Œäžșäžè¶…æ—¶ă€‚ćŠ‚æžœćœšæŒ‡ćźšçš„æ—¶é—Žć†…æČĄæœ‰èŽ·ć–ćˆ°äœçœźäżĄæŻćˆ™è§Šć‘é”™èŻŻć›žè°ƒć‡œæ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + timeout?: number; + /** + * èŽ·ć–äœçœźäżĄæŻçš„é—Žéš”æ—¶é—Ž + * ć•äœäžșæŻ«ç§’ïŒˆmsïŒ‰ïŒŒé»˜èź€ć€Œäžș5000ïŒˆćł5ç§’ïŒ‰ă€‚è°ƒç”šplus.geolocation.watchPosition时äžșæ›Žæ–°äœçœźäżĄæŻçš„é—Žéš”æ—¶é—Žă€‚ + * æłšæ„ïŒšćœšäžćŒćźšäœæšĄć—äž‹æ”ŻæŒèŒƒć›Žć€ŒćŻèƒœäžćŒïŒŒćŠ‚ç™ŸćșŠćźšäœæšĄć—çš„é—Žéš”èŒƒć›Žäžș性äșŽç­‰äșŽ1ç§’ïŒŒćŠ‚æžœèźŸçœźçš„ć€Œć°äșŽæœ€ć°ć€Œćˆ™äœżç”šæœ€ć°ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + maximumAge?: number; + /** + * äŒ˜ć…ˆäœżç”šçš„ćźšäœæšĄć— + * ćŻć–ä»„äž‹äŸ›ćș”者 + * "system"ïŒšèĄšç€șçł»ç»ŸćźšäœæšĄć—ïŒŒæ”ŻæŒwgs84ćæ ‡çł»ïŒ› + * "baidu"ïŒšèĄšç€ș癟ćșŠćźšäœæšĄć—ïŒŒæ”ŻæŒgcj02/bd09/bd09llćæ ‡çł»ïŒ› + * "amap"ïŒšèĄšç€șé«˜ćŸ·ćźšäœæšĄæżïŒŒæ”ŻæŒgcj02ćæ ‡çł»ă€‚ + * é»˜èź€ć€ŒæŒ‰ä»„äž‹äŒ˜ć…ˆéĄșćșèŽ·ć–ïŒˆamap>baidu>systemïŒ‰ïŒŒè‹„æŒ‡ćźšçš„provideräžć­˜ćœšæˆ–æ— æ•ˆćˆ™èż”ć›žé”™èŻŻć›žè°ƒă€‚ + * æłšæ„ïŒšç™ŸćșŠ/é«˜ćŸ·ćźšäœæšĄć—éœ€èŠé…çœźç™ŸćșŠ/é«˜ćŸ·ćœ°ć›Ÿç›žć…łć‚æ•°æ‰èƒœæ­Łćžžäœżç”šă€‚ + * - system: äŒ˜ć…ˆäœżç”šçł»ç»ŸćźšäœæšĄć— + * - baidu: äŒ˜ć…ˆäœżç”šç™ŸćșŠćźšäœæšĄć— + * - amap: äŒ˜ć…ˆäœżç”šé«˜ćŸ·ćźšäœæšĄć— + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + provider?: 'system' | 'baidu' | 'amap'; + /** + * æŒ‡ćźšèŽ·ć–çš„ćźšäœæ•°æźćæ ‡çł»ç±»ćž‹ + * ćŻć–ä»„äž‹ćæ ‡çł»ç±»ćž‹ïŒš + * "wgs84"ïŒšèĄšç€șWGS-84ćæ ‡çł»ïŒ› + * "gcj02"ïŒšèĄšç€șć›œæ”‹ć±€ç»çșŹćșŠćæ ‡çł»ïŒ› + * "bd09"ïŒšèĄšç€ș癟ćșŠćąšćĄæ‰˜ćæ ‡çł»ïŒ› + * "bd09ll"ïŒšèĄšç€ș癟ćșŠç»çșŹćșŠćæ ‡çł»ïŒ› + * provideräžș"system"æ—¶ïŒŒé»˜èź€äœżç”š"wgs84"ćæ ‡çł»ïŒ›provideräžș"baidu"æ—¶ïŒŒé»˜èź€äœżç”š"gcj02"ćæ ‡çł»ïŒ›provideräžș"amap"æ—¶ïŒŒé»˜èź€äœżç”š"gcj02"ćæ ‡çł»ă€‚ + * ćŠ‚æžœèźŸçœźçš„ćæ ‡çł»ç±»ćž‹provideräžæ”ŻæŒïŒŒćˆ™èż”ć›žé”™èŻŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + coordsType?: string; + /** + * æ˜ŻćŠè§Łæžćœ°ć€äżĄæŻ + * è§Łæžçš„ćœ°ć€äżĄæŻäżć­˜ćˆ°PositionćŻčè±Ąçš„address、addressesć±žæ€§äž­ïŒŒtrueèĄšç€șè§Łæžćœ°ć€äżĄæŻïŒŒfalseèĄšç€șäžè§Łæžćœ°ć€äżĄæŻïŒŒèż”ć›žçš„PositionćŻčè±Ąçš„address、addressesć±žæ€§ć€ŒäžșundefinedïŒŒé»˜èź€ć€Œäžștrue。 + * ćŠ‚æžœè§Łæžćœ°ć€äżĄæŻć€±èŽ„ćˆ™èż”ć›žçš„PositionćŻčè±Ąçš„address、addressesć±žæ€§ć€Œäžșnull。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + geocode?: boolean; +} + +/** + * JSONćŻčè±ĄïŒŒćźšäœé”™èŻŻäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ +interface PlusGeolocationGeolocationError { + /** + * èźżé—źæƒé™èą«æ‹’ç» + * çł»ç»Ÿäžć…èźžçš‹ćșèŽ·ć–ćźšäœćŠŸèƒœïŒŒé”™èŻŻä»Łç ćžžé‡ć€Œäžș1。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + PERMISSION_DENIED?: number; + /** + * äœçœźäżĄæŻäžćŻç”š + * æ— æł•èŽ·ć–æœ‰æ•ˆçš„äœçœźäżĄæŻïŒŒé”™èŻŻä»Łç ćžžé‡ć€Œäžș2。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + POSITION_UNAVAILABLE?: number; + /** + * èŽ·ć–äœçœźäżĄæŻè¶…æ—¶ + * æ— æł•ćœšæŒ‡ćźšçš„æ—¶é—Žć†…èŽ·ć–äœçœźäżĄæŻïŒŒé”™èŻŻä»Łç ćžžé‡ć€Œäžș3。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + TIMEOUT?: number; + /** + * æœȘçŸ„é”™èŻŻ + * ć…¶ćźƒæœȘçŸ„é”™èŻŻćŻŒè‡Žæ— æł•èŽ·ć–äœçœźäżĄæŻïŒŒé”™èŻŻä»Łç ćžžé‡ć€Œäžș4。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + UNKNOWN_ERROR?: number; + /** + * é”™èŻŻä»Łç  + * ć–ć€ŒèŒƒć›ŽäžșGeolocationErrorćŻčè±Ąçš„ćžžé‡ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + code?: number; + /** + * é”™èŻŻæèż°äżĄæŻ + * èŻŠç»†é”™èŻŻæèż°äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + message?: string; +} + +/** + * iBeaconæšĄć—ç”šäșŽæœçŽąé™„ä»¶çš„iBeaconèźŸć€‡ïŒˆ*èŻ·äœżç”šHBuilderXćč¶æ›Žæ–°ćˆ°æœ€æ–°ç‰ˆæœŹ*ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) + */ +interface PlusIbeacon { + /** + * iBeaconèźŸć€‡äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) + */ + IBeaconInfo?: PlusIbeaconIBeaconInfo; + /** + * ćŒ€ć§‹æœçŽąé™„èż‘çš„iBeaconèźŸć€‡ + * æœçŽąæˆćŠŸćŽè§Šć‘successCBć›žè°ƒïŒŒć€±èŽ„è§Šć‘errorCBć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) + */ + startBeaconDiscovery(uuids?: any [], ignoretoothAvailable?: boolean, success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + /** + * ćœæ­ąæœçŽąé™„èż‘çš„iBeaconèźŸć€‡ + * ć–æ¶ˆæˆćŠŸćŽè§Šć‘successCBć›žè°ƒïŒŒć€±èŽ„è§Šć‘errorCBć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) + */ + stopBeaconDiscovery(success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + /** + * èŽ·ć–ć·ČæœçŽąćˆ°çš„iBeaconèźŸć€‡ + * èŽ·ć–æˆćŠŸćŽè§Šć‘successCBć›žè°ƒïŒŒć€±èŽ„è§Šć‘errorCBć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) + */ + getBeacons(success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + /** + * 监搬iBeaconèźŸć€‡æ›Žæ–° + * iBeaconèźŸć€‡æ›Žæ–°ćŽè§Šć‘updateCBć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) + */ + onBeaconUpdate(updateCB?: (result: any) => void): void; + /** + * 监搬iBeaconæœćŠĄçŠ¶æ€ć˜ćŒ– + * iBeaconæœćŠĄçŠ¶æ€ć˜ćŒ–æ—¶è§Šć‘changeCBć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) + */ + onBeaconServiceChange(changeCB?: (result: any) => void): void; +} + +/** + * iBeaconèźŸć€‡äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) + */ +interface PlusIbeaconIBeaconInfo { + /** + * iBeaconèźŸć€‡ćčżæ’­çš„uuid + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) + */ + uuid?: string; + /** + * iBeaconèźŸć€‡çš„äž»id + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) + */ + major?: string; + /** + * iBeaconèźŸć€‡çš„æŹĄid + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) + */ + minor?: string; + /** + * iBeaconèźŸć€‡çš„è·çŠ» + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) + */ + proximity?: number; + /** + * iBeaconèźŸć€‡çš„è·çŠ»çČŸćșŠäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) + */ + accuracy?: number; + /** + * iBeaconèźŸć€‡çš„äżĄć·ćŒșćșŠ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) + */ + rssi?: string; +} + +/** + * IOæšĄć—çźĄç†æœŹćœ°æ–‡ä»¶çł»ç»ŸïŒŒç”šäșŽćŻčæ–‡ä»¶çł»ç»Ÿçš„ç›źćœ•æ”è§ˆă€æ–‡ä»¶çš„èŻ»ć–ă€æ–‡ä»¶çš„ć†™ć…„ç­‰æ“äœœă€‚é€šèż‡plus.ioćŻèŽ·ć–æ–‡ä»¶çł»ç»ŸçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ +interface PlusIo { + /** + * æ–‡ä»¶çł»ç»Ÿäž­çš„ç›źćœ•ćŻčè±ĄïŒŒç”šäșŽçźĄç†ç‰čćźšçš„æœŹćœ°ç›źćœ• + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + DirectoryEntry?: PlusIoDirectoryEntry; + /** + * èŻ»ć–ç›źćœ•äżĄæŻćŻčè±ĄïŒŒç”šäșŽèŽ·ć–ç›źćœ•äž­ćŒ…ć«çš„æ–‡ä»¶ćŠć­ç›źćœ• + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + DirectoryReader?: PlusIoDirectoryReader; + /** + * æ–‡ä»¶çł»ç»Ÿäž­çš„æ–‡ä»¶æ•°æźćŻčè±ĄïŒŒç”šäșŽèŽ·ć–æ–‡ä»¶çš„æ•°æź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + File?: PlusIoFile; + /** + * æ–‡ä»¶çł»ç»Ÿäž­çš„æ–‡ä»¶ćŻčè±ĄïŒŒç”šäșŽçźĄç†ç‰čćźšçš„æœŹćœ°æ–‡ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + FileEntry?: PlusIoFileEntry; + /** + * æ–‡ä»¶çł»ç»Ÿäž­çš„èŻ»ć–æ–‡ä»¶ćŻčè±ĄïŒŒç”šäșŽèŽ·ć–æ–‡ä»¶çš„ć†…ćźč + * FileReaderćŻčè±Ąæ˜Żä»ŽèźŸć€‡æ–‡ä»¶çł»ç»ŸèŻ»ć–æ–‡ä»¶FileReaderćŻčè±Ąæ˜Żä»ŽèźŸć€‡æ–‡ä»¶çł»ç»ŸèŻ»ć–æ–‡ä»¶çš„äž€ç§æ–čćŒïŒŒæ–‡ä»¶ä»„æ–‡æœŹæˆ–è€…Base64çŒ–ç çš„ć­—çŹŠäžČćœąćŒèŻ»ć‡șæ„ă€‚ + * ç”šæˆ·æłšć†Œè‡Ș深的äș‹ä»¶ç›‘ćŹć™šæ„掄收loadstart、progress、load、loadend、error撌abortäș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + FileReader?: PlusIoFileReader; + /** + * æ–‡ä»¶çł»ç»Ÿäž­çš„ć†™æ–‡ä»¶ćŻčè±ĄïŒŒç”šäșŽć†™ć…„æ–‡ä»¶ć†…ćźč + * FileWriterćŻčè±Ąæ˜Żä»ŽèźŸć€‡æ–‡ä»¶çł»ç»Ÿć†™ć…„æ–‡ä»¶FileWriterćŻčè±Ąæ˜Żä»ŽèźŸć€‡æ–‡ä»¶çł»ç»Ÿć†™ć…„æ–‡ä»¶çš„äž€ç§æ–čćŒïŒŒç”šæˆ·æłšć†Œè‡Ș深的äș‹ä»¶ç›‘ćŹć™šæ„掄收writestart、progress、write、writeend、error撌abortäș‹ä»¶ă€‚ + * 侀äžȘFileWriterćŻčè±Ąæ˜Żäžș捕äžȘæ–‡ä»¶çš„æ“äœœè€Œćˆ›ć»șă€‚äœ ćŻä»„äœżç”šèŻ„ćŻčè±Ąć€šæŹĄćŻč盾ćș”æ–‡ä»¶èż›èĄŒć†™ć…„æ“äœœă€‚FileWriterç»ŽæŠ€èŻ„æ–‡ä»¶çš„æŒ‡é’ˆäœçœźćŠé•żćșŠć±žæ€§ïŒŒèż™æ ·äœ ć°±ćŻä»„ćŻ»æ‰Ÿć’Œć†™ć…„æ–‡ä»¶çš„ä»»äœ•ćœ°æ–č。 + * é»˜èź€æƒ…ć†”äž‹ïŒŒFileWriterä»Žæ–‡ä»¶çš„ćŒ€ć€ŽćŒ€ć§‹ć†™ć…„ïŒˆć°†èŠ†ç›–çŽ°æœ‰æ•°æźïŒ‰ă€‚FileWriterćŻčè±Ąçš„seekæ–čæł•ćŻèźŸçœźæ–‡ä»¶æ“äœœæŒ‡ćźšäœçœźïŒŒćŠ‚fw.seek(fw.length-1)ć†™ć…„æ“äœœć°±äŒšä»Žæ–‡ä»¶çš„æœ«ć°ŸćŒ€ć§‹ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + FileWriter?: PlusIoFileWriter; + /** + * æ–‡ä»¶çł»ç»ŸćŻčè±ĄïŒŒç”šäșŽçźĄç†ç‰čćźšæœŹćœ°æ–‡ä»¶ç›źćœ• + * æ–‡ä»¶çł»ç»ŸćŻčè±ĄèĄšç€ș侀äžȘćș”ç”šćŻèźżé—źçš„æ čç›źćœ•ă€‚nameć±žæ€§ç”šäșŽæ ‡èŻ†æ­€æ čç›źćœ•çš„ćç§°ïŒŒäžŽLocalFileSystemäž­çš„æ–‡ä»¶çł»ç»Ÿç±»ćž‹äž€äž€ćŻčćș”。rootć±žæ€§äžșæ–‡ä»¶ç›źćœ•ćŻčè±ĄïŒŒç”šäșŽćźžé™…æ“äœœæ–‡ä»¶çł»ç»ŸïŒŒć‚è€ƒDirectoryEntry。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + FileSystem?: PlusIoFileSystem; + /** + * JSONćŻčè±ĄïŒŒèŽ·ć–æ–‡ä»¶æ“äœœçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + Flags?: PlusIoFlags; + /** + * JSONćŻčè±ĄïŒŒäżć­˜æ–‡ä»¶æˆ–ç›źćœ•çš„çŠ¶æ€äżĄæŻćŻčè±Ą + * ćŻé€šèż‡DirectoryEntry或FileEntryćŻčè±Ąçš„getMetaDataæ–čæł•èŽ·ć– + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + Metadata?: PlusIoMetadata; + /** + * æ–‡ä»¶æˆ–ç›źćœ•æ“äœœäș‹ä»¶ćŻčè±Ą + * æ‰€æœ‰æ–‡ä»¶æˆ–ç›źćœ•æ“äœœäș‹ä»¶ć›žè°ƒć‡œæ•°äž­éƒœćˆ›ć»șèŻ„ćŻčè±Ąçš„ćźžäŸ‹ă€‚ + * èŻ„ćŻčè±Ąä»ŽDOMEventç»§æ‰żè€Œæ„ïŒŒćŻé€šèż‡èŻ„ć…¶targetć±žæ€§èŽ·ć–äș‹ä»¶è§Šć‘çš„æ–‡ä»¶æˆ–ç›źćœ•æ“äœœćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + FileEvent?: PlusIoFileEvent; + /** + * æ–‡ä»¶è·ŻćŸ„ç±»ćž‹ + * ćœšæ–‡ä»¶çł»ç»Ÿäž­çš„æ–‡ä»¶è·ŻćŸ„éœ€èœŹæąæˆURLæ ŒćŒïŒŒć·Čæ–čäŸżruntimećż«é€ŸćŠ èœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + URLType?: PlusIoURLType; + /** + * 盾ćŻčè·ŻćŸ„URL + * ćȘèƒœćœšæ‰©ć±•APIäž­äœżç”šïŒŒç›žćŻčäșŽćŸșćș§æäŸ›çš„ç‰čćźšç›źćœ•ïŒŒä»„â€œ_â€ćŒ€ć€Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + RelativeURL?: PlusIoRelativeURL; + /** + * æœŹćœ°è·ŻćŸ„URL + * 揯朹htmléĄ”éąäž­ç›ŽæŽ„èźżé—źæœŹćœ°è”„æșïŒŒä»„“file:///â€ćŒ€ć€ŽïŒŒćŽéąè·Ÿéšçł»ç»Ÿçš„ç»ćŻčè·ŻćŸ„ă€‚ + * 橂ç€ș䟋“file:///D:/res/hello.html”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + LocalURL?: PlusIoLocalURL; + /** + * çœ‘ç»œè·ŻćŸ„URL + * 揯朹htmléĄ”éąäž­ä»„çœ‘ç»œè”„æșæšĄćŒèźżé—źæœŹćœ°è”„æșïŒŒä»„“http://â€ćŒ€ć€ŽïŒŒćŽéąè·Ÿéšç›žćŻčè·ŻćŸ„ă€‚ + * 橂ç€ș䟋“http://localhost:13131/_www/res/icon.pngâ€ïŒŒć…¶äž­â€œ_wwwâ€ć­—æź”ćŻæ”ŻæŒç±»ćž‹äžŽç›žćŻčè·ŻćŸ„URLäž€è‡Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + RemoteURL?: PlusIoRemoteURL; + /** + * ćș”ç”šèżèĄŒè”„æșç›źćœ•ćžžé‡ + * æœŹćœ°æ–‡ä»¶çł»ç»Ÿćžžé‡ïŒŒNumberç±»ćž‹ïŒŒć›șćźšć€Œ1。ćș”ç”šèżèĄŒè”„æșç›źćœ•ïŒŒä»…æœŹćș”ç”šćŻèźżé—źă€‚ + * äžșäș†çĄźäżćș”甚蔄æșçš„ćź‰ć…šæ€§ïŒŒæ­€ç›źćœ•ćȘćŻèŻ»ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + PRIVATE_WWW?: number; + /** + * ćș”ç”šç§æœ‰æ–‡æĄŁç›źćœ•ćžžé‡ + * æœŹćœ°æ–‡ä»¶çł»ç»Ÿćžžé‡ïŒŒNumberç±»ćž‹ïŒŒć›șćźšć€Œ2。ćș”ç”šç§æœ‰æ–‡æĄŁç›źćœ•ïŒŒä»…æœŹćș”ç”šćŻèŻ»ć†™ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + PRIVATE_DOC?: number; + /** + * 繋ćșć…Źç”šæ–‡æĄŁç›źćœ•ćžžé‡ + * æœŹćœ°æ–‡ä»¶çł»ç»Ÿćžžé‡ïŒŒNumberç±»ćž‹ïŒŒć›șćźšć€Œ3。繋ćșć…Źç”šæ–‡æĄŁç›źćœ•ïŒŒæ‰€æœ‰ćș”ç”šćŻèŻ»ć†™ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + PUBLIC_DOCUMENTS?: number; + /** + * 繋ćșć…Źç”šäž‹èœœç›źćœ•ćžžé‡ + * æœŹćœ°æ–‡ä»¶çł»ç»Ÿćžžé‡ïŒŒNumberç±»ćž‹ïŒŒć›șćźšć€Œ4。繋ćșć…Źç”šäž‹èœœç›źćœ•所有ćș”ç”šćŻèŻ»ć†™ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + PUBLIC_DOWNLOADS?: number; + /** + * èŻ·æ±‚æœŹćœ°æ–‡ä»¶çł»ç»ŸćŻčè±Ą + * èŽ·ć–æŒ‡ćźšçš„æ–‡ä»¶çł»ç»ŸïŒŒćŻé€šèż‡typeæŒ‡ćźšèŽ·ć–æ–‡ä»¶çł»ç»Ÿçš„ç±»ćž‹ă€‚ + * èŽ·ć–æŒ‡ćźšçš„æ–‡ä»¶çł»ç»ŸćŻčè±ĄæˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + requestFileSystem(type?: number, succesCB?: (result: PlusIoFileSystem) => void, errorCB?: (result: any) => void): void; + /** + * é€šèż‡URLć‚æ•°èŽ·ć–ç›źćœ•ćŻčè±Ąæˆ–æ–‡ä»¶ćŻčè±Ą + * ćż«é€ŸèŽ·ć–æŒ‡ćźšçš„ç›źćœ•æˆ–æ–‡ä»¶æ“äœœćŻčè±ĄïŒŒćŠ‚é€šèż‡URLć€Œâ€œ_www/test.htmlâ€ćŻç›ŽæŽ„èŽ·ć–æ–‡ä»¶æ“äœœćŻčè±Ąă€‚ + * urlć€ŒćŻæ”ŻæŒç›žćŻčè·ŻćŸ„URLă€æœŹćœ°è·ŻćŸ„URL。 + * èŽ·ć–æŒ‡ćźšçš„æ–‡ä»¶æˆ–ç›źćœ•æ“äœœćŻčè±ĄæˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒćŠ‚æžœæŒ‡ćźšURLè·ŻćŸ„æˆ–æ–‡ä»¶äžć­˜ćœšćˆ™ć€±èŽ„é€šèż‡errorCBć›žè°ƒèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + resolveLocalFileSystemURL(url ?: string, succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; + /** + * ć°†æœŹćœ°URLè·ŻćŸ„èœŹæąæˆćčłć°ç»ćŻčè·ŻćŸ„ + * 绝ćŻčè·ŻćŸ„çŹŠćˆć„ćčłć°æ–‡ä»¶è·ŻćŸ„æ ŒćŒïŒŒé€šćžžç”šäșŽNative.JSè°ƒç”šçł»ç»ŸćŽŸç”Ÿæ–‡ä»¶æ“äœœAPIäčŸćŻä»„ćœšć‰éąæ·»ćŠ â€œfile://”搎朹htmléĄ”éąäž­ç›ŽæŽ„äœżç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + convertLocalFileSystemURL(url?: string): string; + /** + * 氆ćčłć°ç»ćŻčè·ŻćŸ„èœŹæąæˆæœŹćœ°URLè·ŻćŸ„ + * 绝ćŻčè·ŻćŸ„çŹŠćˆć„ćčłć°æ–‡ä»¶è·ŻćŸ„æ ŒćŒïŒŒèœŹæąćŽć˜æˆRelativeURLç±»ćž‹æ ŒćŒă€‚ + * ćŠŸèƒœäžŽconvertLocalFileSystemURLæ–čæł•ç›žćïŒŒć°†ç»ćŻčè·ŻćŸ„èœŹæąæˆç›žćŻčè·ŻćŸ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + convertAbsoluteFileSystem(path?: string): string; +} + +/** + * æ–‡ä»¶çł»ç»Ÿäž­çš„ç›źćœ•ćŻčè±ĄïŒŒç”šäșŽçźĄç†ç‰čćźšçš„æœŹćœ°ç›źćœ• + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ +interface PlusIoDirectoryEntry { + /** + * 操䜜ćŻčè±Ąçš„æ˜ŻćŠäžș文件DirectoryEntryćŻčè±Ąć›șćźšć…¶ć€Œäžșfalse + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + isFile?: boolean; + /** + * 操䜜ćŻčè±Ąæ˜ŻćŠäžșç›źćœ•ïŒŒDirectoryEntryćŻčè±Ąć›șćźšć…¶ć€Œäžștrue + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + isDirectory?: boolean; + /** + * ç›źćœ•æ“äœœćŻčè±Ąçš„ćç§°ïŒŒäžćŒ…æ‹Źè·ŻćŸ„ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + name?: string; + /** + * ç›źćœ•æ“äœœćŻčè±Ąçš„ćźŒæ•Žè·ŻćŸ„ïŒŒæ–‡ä»¶çł»ç»Ÿçš„ç»ćŻčè·ŻćŸ„ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + fullPath?: string; + /** + * 文件操䜜ćŻčè±Ąæ‰€ć±žçš„æ–‡ä»¶çł»ç»ŸćŻčè±ĄïŒŒć‚è€ƒFileSystem + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + fileSystem?: PlusIoFileSystem; + /** + * èŽ·ć–ç›źćœ•çš„ć±žæ€§ + * 甹äșŽèŽ·ć–æ–‡ä»¶æˆ–ç›źćœ•çš„ć±žæ€§äżĄæŻă€‚ + * èŽ·ć–ć±žæ€§äżĄæŻæˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + getMetadata(succesCB?: (result: PlusIoMetadata) => void, errorCB?: (result: any) => void, recursive?: boolean): void; + /** + * ç§»ćŠšç›źćœ• + * ä»„äž‹æƒ…ć†”ç§»ćŠšç›źćœ•ć°†äŒšćŻŒè‡Žć€±èŽ„ïŒš + * ć°†çˆ¶ç›źćœ•ç§»ćŠšćˆ°ć­ç›źćœ•äž­ïŒ› + * èŠç§»ćŠšćˆ°çš„ç›źæ ‡ç›źćœ•æ— æ•ˆïŒ› + * èŠç§»ćŠšćˆ°çš„ç›źæ ‡è·ŻćŸ„èą«æ–‡ä»¶ć ç”šïŒ› + * èŠç§»ćŠšćˆ°çš„ç›źæ ‡ç›źćœ•ć·Čç»ć­˜ćœšćč¶äž”䞍äžșç©ș。 + * ç§»ćŠšç›źćœ•æˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + moveTo(parent?: PlusIoDirectoryEntry, newName?: string, succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; + /** + * æ‹·èŽç›źćœ• + * ä»„äž‹æƒ…ć†”æ‹·èŽç›źćœ•ć°†äŒšćŻŒè‡Žć€±èŽ„ïŒš + * ć°†çˆ¶ç›źćœ•æ‹·èŽćˆ°ć­ç›źćœ•äž­ïŒ› + * èŠæ‹·èŽćˆ°çš„ç›źæ ‡ç›źćœ•æ— æ•ˆïŒ› + * èŠæ‹·èŽćˆ°çš„ç›źæ ‡è·ŻćŸ„èą«æ–‡ä»¶ć ç”šïŒ› + * èŠæ‹·èŽćˆ°çš„ç›źæ ‡ç›źćœ•ć·Čç»ć­˜ćœšćč¶äž”䞍äžșç©ș。 + * æ‹·èŽç›źćœ•æˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + copyTo(parent?: PlusIoDirectoryEntry, newName?: string, succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; + /** + * èŽ·ć–ç›źćœ•è·ŻćŸ„èœŹæąäžșURL朰杀 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + toURL(): string; + /** + * èŽ·ć–ç›źćœ•è·ŻćŸ„èœŹæąäžșæœŹćœ°è·ŻćŸ„URL朰杀 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + toLocalURL(): string; + /** + * èŽ·ć–ç›źćœ•è·ŻćŸ„èœŹæąäžșçœ‘ç»œè·ŻćŸ„URL朰杀 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + toRemoteURL(): string; + /** + * ćˆ é™€ç›źćœ• + * ä»„äž‹æƒ…ć†”ćˆ é™€ç›źćœ•ć°†äŒšćŻŒè‡Žć€±èŽ„ïŒš + * ç›źćœ•äž­ć­˜ćœšæ–‡ä»¶ïŒ› + * ćˆ é™€æ čç›źćœ•ïŒ› + * ćˆ é™€ç›źćœ•æˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + remove(succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; + /** + * èŽ·ć–ç›źćœ•æ‰€ć±žçš„çˆ¶ç›źćœ• + * èŽ·ć–çˆ¶ç›źćœ•æˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + getParent(succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; + /** + * 戛ć»șç›źćœ•èŻ»ć–ćŻčè±Ą + * 戛ć»ș侀äžȘç›źćœ•èŻ»ć–ćŻčè±ĄïŒŒç”šæˆ·èŻ»ć–ç›źäž‹çš„æ–‡ä»¶ćŠć­ç›źćœ•ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + createReader(): PlusIoDirectoryReader; + /** + * 戛ć»șæˆ–æ‰“ćŒ€ć­ç›źćœ• + * 戛ć»șæˆ–æ‰“ćŒ€ćœ“ć‰ç›źćœ•æŒ‡ćźšçš„ç›źćœ•ă€‚ + * 戛ć»șæˆ–æ‰“ćŒ€ç›źćœ•æ“äœœæˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + getDirectory(path?: string, flag?: PlusIoFlags, succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; + /** + * 戛ć»șæˆ–æ‰“ćŒ€æ–‡ä»¶ + * 戛ć»șæˆ–æ‰“ćŒ€ćœ“ć‰ç›źćœ•äž‹æŒ‡ćźšçš„æ–‡ä»¶ă€‚ + * 戛ć»șæˆ–æ‰“ćŒ€æ–‡ä»¶æ“äœœćŻčè±ĄæˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + getFile(path?: string, flag?: PlusIoFlags, succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; + /** + * é€’ćœ’ćˆ é™€ç›źćœ• + * ćˆ é™€ç›źćœ•ć°†äŒšćˆ é™€ć…¶äž‹çš„æ‰€æœ‰æ–‡ä»¶ćŠć­ç›źćœ• + * äžèƒœćˆ é™€æ čç›źćœ•ïŒŒćŠ‚æžœæ“äœœćˆ é™€æ čç›źćœ•ć°†äŒšćˆ é™€ç›źćœ•äž‹çš„æ–‡ä»¶ćŠć­ç›źćœ•ïŒŒäžäŒšćˆ é™€æ čç›źćœ•è‡Șèș«ă€‚ + * ćˆ é™€ç›źćœ•æˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + removeRecursively(succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; +} + +/** + * èŻ»ć–ç›źćœ•äżĄæŻćŻčè±ĄïŒŒç”šäșŽèŽ·ć–ç›źćœ•äž­ćŒ…ć«çš„æ–‡ä»¶ćŠć­ç›źćœ• + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ +interface PlusIoDirectoryReader { + /** + * èŽ·ć–ćœ“ć‰ç›źćœ•äž­çš„æ‰€æœ‰æ–‡ä»¶ć’Œć­ç›źćœ• + * èŽ·ć–ćœ“ć‰ç›źćœ•äž‹çš„æ‰€æœ‰æ–‡ä»¶ć’Œć­ç›źćœ•ă€‚ + * èŽ·ć–æ“äœœæˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + readEntries(succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; +} + +/** + * æ–‡ä»¶çł»ç»Ÿäž­çš„æ–‡ä»¶æ•°æźćŻčè±ĄïŒŒç”šäșŽèŽ·ć–æ–‡ä»¶çš„æ•°æź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ +interface PlusIoFile { + /** + * æ–‡ä»¶æ•°æźćŻčè±Ąçš„æ•°æźć€§ć°ïŒŒć•äœäžșć­—èŠ‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + size?: number; + /** + * æ–‡ä»¶æ•°æźćŻčè±ĄMIME类枋 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + type?: string; + /** + * æ–‡ä»¶æ•°æźćŻčè±Ąçš„ćç§°ïŒŒäžćŒ…æ‹Źè·ŻćŸ„ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + name?: string; + /** + * 文件ćŻčè±Ąçš„æœ€ćŽäżźæ”čæ—¶é—Ž + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + lastModifiedDate?: Date; + /** + * èŽ·ć–æ–‡ä»¶æŒ‡ćźšçš„æ•°æźć†…ćźč + * èŽ·ć–æ–‡ä»¶æŒ‡ćźšçš„æ•°æźć†…ćźčïŒŒć…¶äž­end濅饻性äșŽstart。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + slice(start?: number, end?: number): PlusIoFile; + /** + * ć…łé—­æ–‡ä»¶æ•°æźćŻčè±Ą + * ćœ“æ–‡ä»¶æ•°æźćŻčè±Ąäžć†äœżç”šæ—¶ïŒŒćŻé€šèż‡æ­€æ–čæł•ć…łé—­ïŒŒé‡Šæ”Ÿçł»ç»Ÿè”„æșă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + close(): void; +} + +/** + * æ–‡ä»¶çł»ç»Ÿäž­çš„æ–‡ä»¶ćŻčè±ĄïŒŒç”šäșŽçźĄç†ç‰čćźšçš„æœŹćœ°æ–‡ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ +interface PlusIoFileEntry { + /** + * 文件操䜜ćŻčè±Ąçš„æ˜ŻćŠäžș文件FileEntryćŻčè±Ąć›șćźšć…¶ć€Œäžștrue + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + isFile?: boolean; + /** + * 文件操䜜ćŻčè±Ąæ˜ŻćŠäžșç›źćœ•ïŒŒFileEntryćŻčè±Ąć›șćźšć…¶ć€Œäžșfalse + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + isDirectory?: boolean; + /** + * 文件操䜜ćŻčè±Ąçš„ćç§°ïŒŒäžćŒ…æ‹Źè·ŻćŸ„ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + name?: string; + /** + * 文件操䜜ćŻčè±Ąçš„ćźŒæ•Žè·ŻćŸ„ïŒŒæ–‡ä»¶çł»ç»Ÿçš„ç»ćŻčè·ŻćŸ„ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + fullPath?: string; + /** + * 文件操䜜ćŻčè±Ąæ‰€ć±žçš„æ–‡ä»¶çł»ç»ŸćŻčè±ĄïŒŒć‚è€ƒFileSystem + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + fileSystem?: PlusIoFileSystem; + /** + * èŽ·ć–æ–‡ä»¶çš„ć±žæ€§äżĄæŻ + * 甹äșŽèŽ·ć–æ–‡ä»¶çš„ć±žæ€§äżĄæŻă€‚ + * èŽ·ć–ć±žæ€§äżĄæŻæˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + getMetadata(succesCB?: (result: PlusIoMetadata) => void, errorCB?: (result: any) => void): void; + /** + * ç§»ćŠšæ–‡ä»¶ + * ä»„äž‹æƒ…ć†”ç§»ćŠšç›źćœ•ć°†äŒšćŻŒè‡Žć€±èŽ„ïŒš + * èŠç§»ćŠšćˆ°çš„ç›źæ ‡ç›źćœ•æ— æ•ˆïŒ› + * èŠç§»ćŠšćˆ°çš„ç›źæ ‡è·ŻćŸ„èą«ć…¶ćźƒæ–‡ä»¶ć ç”šïŒ› + * ç§»ćŠšæ–‡ä»¶æˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + moveTo(parent?: PlusIoDirectoryEntry, newName?: string, succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; + /** + * 拷莝文件 + * ä»„äž‹æƒ…ć†”æ‹·èŽæ–‡ä»¶ć°†äŒšćŻŒè‡Žć€±èŽ„ïŒš + * èŠæ‹·èŽćˆ°çš„ç›źæ ‡ç›źćœ•æ— æ•ˆïŒ› + * èŠæ‹·èŽćˆ°çš„ç›źæ ‡è·ŻćŸ„èą«ć…¶ćźƒæ–‡ä»¶ć ç”šïŒ› + * æ‹·èŽæ–‡ä»¶æˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + copyTo(parent?: PlusIoDirectoryEntry, newName?: string, succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; + /** + * èŽ·ć–æ–‡ä»¶è·ŻćŸ„èœŹæąäžșURL朰杀 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + toURL(): string; + /** + * èŽ·ć–æ–‡ä»¶è·ŻćŸ„èœŹæąäžșæœŹćœ°è·ŻćŸ„URL朰杀 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + toLocalURL(): string; + /** + * èŽ·ć–æ–‡ä»¶è·ŻćŸ„èœŹæąäžșçœ‘ç»œè·ŻćŸ„URL朰杀 + * URLćœ°ć€æ ŒćŒäžș仄“http://localhost:13131/â€ćŒ€ć€Žçš„çœ‘ç»œè·ŻćŸ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + toRemoteURL(): string; + /** + * ćˆ é™€æ–‡ä»¶ + * ćˆ é™€æ–‡ä»¶æˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + remove(succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; + /** + * èŽ·ć–æ–‡ä»¶æ‰€ć±žçš„çˆ¶ç›źćœ• + * èŽ·ć–çˆ¶ç›źćœ•æˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + getParent(succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; + /** + * èŽ·ć–æ–‡ä»¶ć…łè”çš„ć†™æ–‡ä»¶æ“äœœćŻčè±ĄFileWriter + * èŽ·ć–ć†™æ–‡ä»¶æ“äœœćŻčè±ĄæˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + createWriter(succesCB?: (result: PlusIoFileWriter) => void, errorCB?: (result: any) => void): void; + /** + * èŽ·ć–æ–‡ä»¶æ•°æźćŻčè±Ą + * èŽ·ć–æ–‡ä»¶æ•°æźćŻčè±ĄæˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + file(succesCB?: (result: PlusIoFile) => void, errorCB?: (result: any) => void): void; +} + +/** + * æ–‡ä»¶çł»ç»Ÿäž­çš„èŻ»ć–æ–‡ä»¶ćŻčè±ĄïŒŒç”šäșŽèŽ·ć–æ–‡ä»¶çš„ć†…ćźč + * FileReaderćŻčè±Ąæ˜Żä»ŽèźŸć€‡æ–‡ä»¶çł»ç»ŸèŻ»ć–æ–‡ä»¶FileReaderćŻčè±Ąæ˜Żä»ŽèźŸć€‡æ–‡ä»¶çł»ç»ŸèŻ»ć–æ–‡ä»¶çš„äž€ç§æ–čćŒïŒŒæ–‡ä»¶ä»„æ–‡æœŹæˆ–è€…Base64çŒ–ç çš„ć­—çŹŠäžČćœąćŒèŻ»ć‡șæ„ă€‚ + * ç”šæˆ·æłšć†Œè‡Ș深的äș‹ä»¶ç›‘ćŹć™šæ„掄收loadstart、progress、load、loadend、error撌abortäș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ +interface PlusIoFileReader { + /** + * ć€Œäžș0ïŒŒćŒ€ć§‹èŻ»ć–æ–‡ä»¶çŠ¶æ€ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + EMPTY?: number; + /** + * ć€Œäžș1ïŒŒæ­ŁćœšèŻ»ć–æ–‡ä»¶çŠ¶æ€ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + LOADING?: number; + /** + * ć€Œäžș2ïŒŒèŻ»æ–‡ä»¶æ“äœœćźŒæˆçŠ¶æ€ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + DONE?: number; + /** + * ćœ“ć‰èŻ»ć–æ–‡ä»¶æ‰€ć€„çš„çŠ¶æ€ + * 揯揖侊靱漚äč‰çš„ćžžé‡ć€ŒïŒŒEMPTY0ïŒ‰ă€LOADING1ïŒ‰ă€DONE2ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + readyState?: number; + /** + * ć·ČèŻ»ć–æ–‡ä»¶çš„ć†…ćźč + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + result?: string; + /** + * æ–‡ä»¶æ“äœœé”™èŻŻä»Łç  + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + error?: number; + /** + * èŻ»ć–æ–‡ä»¶ćŒ€ć§‹æ—¶çš„ć›žè°ƒć‡œæ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + onloadstart?: (result: PlusIoFileEvent) => void; + /** + * èŻ»ć–æ–‡ä»¶èż‡çš‹äž­çš„ć›žè°ƒć‡œæ•° + * 甹äșŽèŽ·ć–æ–‡ä»¶èŻ»ć–èż›ćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + onprogress?: (result: PlusIoFileEvent) => void; + /** + * èŻ»ć–æ–‡ä»¶æˆćŠŸćźŒæˆçš„ć›žè°ƒć‡œæ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + onload?: (result: PlusIoFileEvent) => void; + /** + * ć–æ¶ˆèŻ»ć–æ–‡ä»¶æ—¶çš„ć›žè°ƒć‡œæ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + onabort?: (result: PlusIoFileEvent) => void; + /** + * æ–‡ä»¶èŻ»ć–æ“äœœć€±èŽ„æ—¶è°ƒç”šçš„ć›žè°ƒć‡œæ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + onerror?: (result: PlusIoFileEvent) => void; + /** + * æ–‡ä»¶èŻ»ć–æ“äœœćźŒæˆæ—¶çš„ć›žè°ƒć‡œæ•° + * äžçźĄæˆćŠŸæˆ–ć€±èŽ„éƒœäŒšè§Šć‘ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + onloadend?: (result: PlusIoFileEvent) => void; + /** + * ç»ˆæ­ąæ–‡ä»¶èŻ»ć–æ“äœœ + * èŻ»ć–æ–‡ä»¶æ“äœœćŒ€ć§‹ćŽïŒŒćŻé€šèż‡æ­€æ–čæł•ć–æ¶ˆèŻ»ć–æ–‡ä»¶ă€‚ + * 调甚歀æ–čæł•ćŽć°†è§Šć‘æ–‡ä»¶èŻ»ć–ćŻčè±Ąçš„onabortäș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + abort(): void; + /** + * 仄URLçŒ–ç æ ŒćŒèŻ»ć–æ–‡ä»¶æ•°æźć†…ćźč + * èŻ»ć–æ–‡ä»¶çš„æ•°æźć†…ćźčćč¶ć°†æ•°æźć†…ćźčèż›èĄŒURLçŒ–ç ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + readAsDataURL(file?: PlusIoFile, encoding ?: string): void; + /** + * ä»„æ–‡æœŹæ ŒćŒèŻ»ć–æ–‡ä»¶æ•°æźć†…ćźč + * èŻ»ć–æ–‡ä»¶çš„æ•°æźć†…ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + readAsText(file?: PlusIoFile, encoding ?: string): void; +} + +/** + * æ–‡ä»¶çł»ç»Ÿäž­çš„ć†™æ–‡ä»¶ćŻčè±ĄïŒŒç”šäșŽć†™ć…„æ–‡ä»¶ć†…ćźč + * FileWriterćŻčè±Ąæ˜Żä»ŽèźŸć€‡æ–‡ä»¶çł»ç»Ÿć†™ć…„æ–‡ä»¶FileWriterćŻčè±Ąæ˜Żä»ŽèźŸć€‡æ–‡ä»¶çł»ç»Ÿć†™ć…„æ–‡ä»¶çš„äž€ç§æ–čćŒïŒŒç”šæˆ·æłšć†Œè‡Ș深的äș‹ä»¶ç›‘ćŹć™šæ„掄收writestart、progress、write、writeend、error撌abortäș‹ä»¶ă€‚ + * 侀äžȘFileWriterćŻčè±Ąæ˜Żäžș捕äžȘæ–‡ä»¶çš„æ“äœœè€Œćˆ›ć»șă€‚äœ ćŻä»„äœżç”šèŻ„ćŻčè±Ąć€šæŹĄćŻč盾ćș”æ–‡ä»¶èż›èĄŒć†™ć…„æ“äœœă€‚FileWriterç»ŽæŠ€èŻ„æ–‡ä»¶çš„æŒ‡é’ˆäœçœźćŠé•żćșŠć±žæ€§ïŒŒèż™æ ·äœ ć°±ćŻä»„ćŻ»æ‰Ÿć’Œć†™ć…„æ–‡ä»¶çš„ä»»äœ•ćœ°æ–č。 + * é»˜èź€æƒ…ć†”äž‹ïŒŒFileWriterä»Žæ–‡ä»¶çš„ćŒ€ć€ŽćŒ€ć§‹ć†™ć…„ïŒˆć°†èŠ†ç›–çŽ°æœ‰æ•°æźïŒ‰ă€‚FileWriterćŻčè±Ąçš„seekæ–čæł•ćŻèźŸçœźæ–‡ä»¶æ“äœœæŒ‡ćźšäœçœźïŒŒćŠ‚fw.seek(fw.length-1)ć†™ć…„æ“äœœć°±äŒšä»Žæ–‡ä»¶çš„æœ«ć°ŸćŒ€ć§‹ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ +interface PlusIoFileWriter { + /** + * ć€Œäžș0ïŒŒć†™æ–‡ä»¶ćˆć§‹ćŒ–çŠ¶æ€ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + INIT?: number; + /** + * ć€Œäžș1ïŒŒæ­Łćœšć†™ć…„æ–‡ä»¶çŠ¶æ€ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + WRITING?: number; + /** + * ć€Œäžș2ïŒŒć†™æ–‡ä»¶æ“äœœćźŒæˆçŠ¶æ€ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + DONE?: number; + /** + * ćœ“ć‰ć†™ć…„æ–‡ä»¶æ‰€ć€„çš„çŠ¶æ€ + * 揯揖侊靱漚äč‰çš„ćžžé‡ć€ŒïŒŒINIT(0)、WRITING1ïŒ‰ă€DONE2ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + readyState?: number; + /** + * æ–‡ä»¶ćœ“ć‰çš„é•żćșŠïŒŒć•䜍äžșć­—èŠ‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + length?: number; + /** + * æ–‡ä»¶ćœ“ć‰æ“äœœçš„æŒ‡é’ˆäœçœź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + position?: number; + /** + * æ–‡ä»¶ć†™ć…„æ“äœœé”™èŻŻä»Łç  + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + error?: number; + /** + * ć†™ć…„æ–‡ä»¶ćŒ€ć§‹æ—¶çš„ć›žè°ƒć‡œæ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + onwritestart?: (result: PlusIoFileEvent) => void; + /** + * ć†™ć…„æ–‡ä»¶èż‡çš‹äž­çš„ć›žè°ƒć‡œæ•° + * 甹äșŽèŽ·ć–æ–‡ä»¶èŻ»ć–èż›ćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + onprogress?: (result: PlusIoFileEvent) => void; + /** + * ć†™ć…„æ–‡ä»¶æˆćŠŸćźŒæˆçš„ć›žè°ƒć‡œæ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + onwrite?: (result: PlusIoFileEvent) => void; + /** + * ć–æ¶ˆć†™ć…„æ–‡ä»¶æ—¶çš„ć›žè°ƒć‡œæ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + onabort?: (result: PlusIoFileEvent) => void; + /** + * æ–‡ä»¶ć†™ć…„æ“äœœć€±èŽ„æ—¶è°ƒç”šçš„ć›žè°ƒć‡œæ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + onerror?: (result: PlusIoFileEvent) => void; + /** + * æ–‡ä»¶ć†™ć…„æ“äœœćźŒæˆæ—¶çš„ć›žè°ƒć‡œæ•° + * äžçźĄæˆćŠŸæˆ–ć€±èŽ„éƒœäŒšè§Šć‘ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + onwriteend?: (result: PlusIoFileEvent) => void; + /** + * ç»ˆæ­ąæ–‡ä»¶ć†™ć…„æ“äœœ + * ć†™ć…„æ–‡ä»¶æ•°æźæ“äœœćŒ€ć§‹ćŽïŒŒćŻé€šèż‡æ­€æ–čæł•ć–æ¶ˆć†™ć…„æ–‡ä»¶æ•°æźæ“äœœă€‚ + * 调甚歀æ–čæł•ćŽć°†è§Šć‘æ–‡ä»¶ć†™ć…„ćŻčè±Ąçš„onabortäș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + abort(): void; + /** + * ćźšäœæ–‡ä»¶æ“äœœäœçœź + * ćźšäœæ–‡ä»¶çš„æ“äœœäœçœźïŒŒæœ‰æ•ˆć€Œäžș0ćˆ°æ–‡ä»¶çš„æ€»é•żćșŠć‡1。 + * 0èĄšç€șæ–‡ä»¶çš„è”·ć§‹äœçœźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + seek(position?: number): void; + /** + * æŒ‰ç…§æŒ‡ćźšé•żćșŠæˆȘ断文件 + * ä»Žæ–‡ä»¶ćœ“ć‰ćźšäœçš„äœçœźćŒ€ć§‹ïŒŒæŒ‰ç…§æŒ‡ćźšé•żćșŠæˆȘæ–­æ–‡ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + truncate(length ?: number): void; + /** + * ć‘æ–‡ä»¶äž­ć†™ć…„æ•°æź + * ä»Žæ–‡ä»¶ćœ“ć‰ćźšäœçš„äœçœźćŒ€ć§‹ïŒŒć†™ć…„æ•°æźćˆ°æ–‡ä»¶äž­ă€‚ + * ćŠ‚æžœæ–‡ä»¶äž­ć·Čç»ć­˜ćœšæ•°æźïŒŒæ–°ć†™ć…„çš„æ•°æźć°†èŠ†ç›–ć·Čæœ‰æ•°æźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + write(data ?: string): void; +} + +/** + * æ–‡ä»¶çł»ç»ŸćŻčè±ĄïŒŒç”šäșŽçźĄç†ç‰čćźšæœŹćœ°æ–‡ä»¶ç›źćœ• + * æ–‡ä»¶çł»ç»ŸćŻčè±ĄèĄšç€ș侀äžȘćș”ç”šćŻèźżé—źçš„æ čç›źćœ•ă€‚nameć±žæ€§ç”šäșŽæ ‡èŻ†æ­€æ čç›źćœ•çš„ćç§°ïŒŒäžŽLocalFileSystemäž­çš„æ–‡ä»¶çł»ç»Ÿç±»ćž‹äž€äž€ćŻčćș”。rootć±žæ€§äžșæ–‡ä»¶ç›źćœ•ćŻčè±ĄïŒŒç”šäșŽćźžé™…æ“äœœæ–‡ä»¶çł»ç»ŸïŒŒć‚è€ƒDirectoryEntry。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ +interface PlusIoFileSystem { + /** + * æ–‡ä»¶çł»ç»Ÿçš„ćç§° + * ć€Œäžșæ–‡ä»¶çł»ç»Ÿç±»ćž‹ćžžé‡ć€Œć­—çŹŠäžČïŒŒćŠ‚â€œPRIVATE_WWW”、“PRIVATE_DOCUMENTS”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + name?: string; + /** + * æ–‡ä»¶çł»ç»Ÿçš„æ čç›źćœ• + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + root?: PlusIoDirectoryEntry; +} + +/** + * JSONćŻčè±ĄïŒŒèŽ·ć–æ–‡ä»¶æ“äœœçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ +interface PlusIoFlags { + /** + * æ˜ŻćŠćˆ›ć»șćŻčè±Ąæ ‡èź° + * 指ç€șćŠ‚æžœæ–‡ä»¶æˆ–ç›źćœ•äžć­˜ćœšæ—¶æ˜ŻćŠèż›èĄŒćˆ›ć»șïŒŒé»˜èź€ć€Œäžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + create?: boolean; + /** + * ćć‘æ“äœœæ ‡èź° + * ć…¶æœŹèș«æČĄæœ‰ä»»äœ•效果需䞎createć±žæ€§ć€ŒèźŸçœźäžștrueæ—¶äž€è”·äœżç”šïŒŒćŠ‚æžœç›źæ ‡æ–‡ä»¶æˆ–ç›źćœ•ć·Čç»ć­˜ćœšćˆ™äŒšćŻŒè‡Žæ–‡ä»¶æˆ–ç›źćœ•æ‰“ćŒ€ć€±èŽ„ïŒŒé»˜èź€ć€Œäžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + exclusive?: boolean; +} + +/** + * JSONćŻčè±ĄïŒŒäżć­˜æ–‡ä»¶æˆ–ç›źćœ•çš„çŠ¶æ€äżĄæŻćŻčè±Ą + * ćŻé€šèż‡DirectoryEntry或FileEntryćŻčè±Ąçš„getMetaDataæ–čæł•èŽ·ć– + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ +interface PlusIoMetadata { + /** + * æ–‡ä»¶æˆ–ç›źćœ•çš„æœ€ćŽäżźæ”čæ—¶é—Ž + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + modificationTime?: Date; + /** + * æ–‡ä»¶çš„ć€§ć° + * è‹„èŽ·ć–çš„æ˜Żç›źćœ•ćŻčè±Ąçš„ć±žæ€§ćˆ™ć€Œäžș0。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + size?: number; + /** + * ćŒ…ć«çš„ć­ç›źćœ•æ•° + * è‹„è‡Șèș«æ˜Żæ–‡ä»¶ćˆ™ć…¶ć€Œäžș0。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + directoryCount?: number; + /** + * ç›źćœ•çš„æ–‡ä»¶æ•° + * è‹„è‡Șèș«æ˜Żæ–‡ä»¶ćˆ™ć…¶ć€Œäžș0。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + fileCount?: number; +} + +/** + * æ–‡ä»¶æˆ–ç›źćœ•æ“äœœäș‹ä»¶ćŻčè±Ą + * æ‰€æœ‰æ–‡ä»¶æˆ–ç›źćœ•æ“äœœäș‹ä»¶ć›žè°ƒć‡œæ•°äž­éƒœćˆ›ć»șèŻ„ćŻčè±Ąçš„ćźžäŸ‹ă€‚ + * èŻ„ćŻčè±Ąä»ŽDOMEventç»§æ‰żè€Œæ„ïŒŒćŻé€šèż‡èŻ„ć…¶targetć±žæ€§èŽ·ć–äș‹ä»¶è§Šć‘çš„æ–‡ä»¶æˆ–ç›źćœ•æ“äœœćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ +interface PlusIoFileEvent { + /** + * æ–‡ä»¶æˆ–ç›źćœ•æ“äœœćŻčè±Ą + * ćœšäžćŒçš„ć›žè°ƒäž­æŒ‡ć‘çš„ćŻčè±ĄäžćŒïŒŒćŻæŒ‡ć‘çš„ćŻčè±ĄćŒ…æ‹ŹïŒšFileEntry、DirectoryEntry、FileReader、FileWriter。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + target?: PlusIoDirectoryEntry; +} + +/** + * æ–‡ä»¶è·ŻćŸ„ç±»ćž‹ + * ćœšæ–‡ä»¶çł»ç»Ÿäž­çš„æ–‡ä»¶è·ŻćŸ„éœ€èœŹæąæˆURLæ ŒćŒïŒŒć·Čæ–čäŸżruntimećż«é€ŸćŠ èœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ +interface PlusIoURLType { + /** + * 盾ćŻčè·ŻćŸ„URL + * ćȘèƒœćœšæ‰©ć±•APIäž­äœżç”šïŒŒç›žćŻčäșŽćŸșćș§æäŸ›çš„ç‰čćźšç›źćœ•ïŒŒä»„â€œ_â€ćŒ€ć€Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + RelativeURL?: PlusIoRelativeURL; + /** + * æœŹćœ°è·ŻćŸ„URL + * 揯朹htmléĄ”éąäž­ç›ŽæŽ„èźżé—źæœŹćœ°è”„æșïŒŒä»„“file:///â€ćŒ€ć€ŽïŒŒćŽéąè·Ÿéšçł»ç»Ÿçš„ç»ćŻčè·ŻćŸ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + LocalURL?: PlusIoLocalURL; + /** + * çœ‘ç»œè·ŻćŸ„URL + * 揯朹htmléĄ”éąäž­ä»„çœ‘ç»œè”„æșæšĄćŒèźżé—źæœŹćœ°è”„æșïŒŒä»„“http://â€ćŒ€ć€ŽïŒŒćŽéąè·Ÿéšç›žćŻčè·ŻćŸ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + RomoteURL?: string; +} + +/** + * 盾ćŻčè·ŻćŸ„URL + * ćȘèƒœćœšæ‰©ć±•APIäž­äœżç”šïŒŒç›žćŻčäșŽćŸșćș§æäŸ›çš„ç‰čćźšç›źćœ•ïŒŒä»„â€œ_â€ćŒ€ć€Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ +interface PlusIoRelativeURL { + /** + * ćș”甚蔄æșç›źćœ• + * 保歘ćș”甚的所有html、css、js等蔄æșæ–‡ä»¶ïŒŒäžŽæ–‡ä»¶çł»ç»Ÿäž­æ čç›źćœ•PRIVATE_WWWäž€è‡ŽïŒŒćŽéąćŠ ç›žćŻčè·ŻćŸ„ćŠ‚â€œ_www/res/icon.png”。 + * æłšæ„ïŒšćș”甚蔄æșç›źćœ•æ˜ŻćȘèŻ»ç›źćœ•ïŒŒćȘèƒœèŻ»ć–æŹĄç›źćœ•äž‹çš„æ–‡ä»¶ïŒŒäžèƒœäżźæ”č或新ć»ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + _www?: string; + /** + * ćș”ç”šç§æœ‰æ–‡æĄŁç›źćœ• + * 甹äșŽäżć­˜ćș”ç”šèżèĄŒæœŸäžšćŠĄé€»èŸ‘æ•°æźïŒŒäžŽæ–‡ä»¶çł»ç»Ÿäž­æ čç›źćœ•PRIVATE_DOCUMENTSïŒŒćŠ‚â€œ_doc/userdata.xml”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + _doc?: string; + /** + * 繋ćșć…Źç”šæ–‡æĄŁç›źćœ• + * 甹äșŽäżć­˜çš‹ćșäž­ć„ćș”ç”šé—ŽćŻć…±äș«æ–‡ä»¶çš„ç›źćœ•ïŒŒäžŽæ–‡ä»¶çł»ç»Ÿäž­æ čç›źćœ•PUBLIC_DOCUMENTSïŒŒćŠ‚â€œ_document/share.doc”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + _documents?: string; + /** + * 繋ćșć…Źç”šäž‹èœœç›źćœ• + * 甹äșŽäżć­˜çš‹ćșäž‹èœœæ–‡ä»¶çš„ç›źćœ•ïŒŒäžŽæ–‡ä»¶çł»ç»Ÿäž­æ čç›źćœ•PUBLIC_DOWNLOADSïŒŒćŠ‚â€œ_download/mydoc.doc”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + _downloads?: string; +} + +/** + * æœŹćœ°è·ŻćŸ„URL + * 揯朹htmléĄ”éąäž­ç›ŽæŽ„èźżé—źæœŹćœ°è”„æșïŒŒä»„“file:///â€ćŒ€ć€ŽïŒŒćŽéąè·Ÿéšçł»ç»Ÿçš„ç»ćŻčè·ŻćŸ„ă€‚ + * 橂ç€ș䟋“file:///D:/res/hello.html”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ +interface PlusIoLocalURL { +} + +/** + * çœ‘ç»œè·ŻćŸ„URL + * 揯朹htmléĄ”éąäž­ä»„çœ‘ç»œè”„æșæšĄćŒèźżé—źæœŹćœ°è”„æșïŒŒä»„“http://â€ćŒ€ć€ŽïŒŒćŽéąè·Ÿéšç›žćŻčè·ŻćŸ„ă€‚ + * 橂ç€ș䟋“http://localhost:13131/_www/res/icon.pngâ€ïŒŒć…¶äž­â€œ_wwwâ€ć­—æź”ćŻæ”ŻæŒç±»ćž‹äžŽç›žćŻčè·ŻćŸ„URLäž€è‡Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ +interface PlusIoRemoteURL { +} + +/** + * Native.js for iOSć°èŁ…äž€æĄé€šèż‡JSèŻ­æł•ç›ŽæŽ„è°ƒç”šNative Objective-CæŽ„ćŁé€šé“ïŒŒé€šèż‡plus.iosćŻè°ƒç”šć‡ äčŽæ‰€æœ‰çš„çł»ç»ŸAPI。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ios.html](http://www.html5plus.org/doc/zh_cn/ios.html) + */ +interface PlusIos { + /** + * Objective-Cç±»ćŻčè±Ą + * Objective-Cç±»ćŻčè±ĄïŒŒćŻé€šèż‡ć…¶ć±žæ€§èŽ·ć–ç±»çš„ćžžé‡ïŒŒćŻé€šèż‡æ–čæł•杄操䜜类的静态æ–čæł•äčŸé€šèż‡newæ–čæł•æ„ćˆ›ć»șç±»çš„ćźžäŸ‹ćŻčè±Ąă€‚ + * ćŻčäșŽç±»çš„静态æ–čæł•ïŒŒćˆ™ç›ŽæŽ„é€šèż‡.ćŽéąè·Ÿéšæ–čæł•ćç§°è°ƒç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ios.html](http://www.html5plus.org/doc/zh_cn/ios.html) + */ + ClassObject?: PlusIosClassObject; + /** + * Objective-CćźžäŸ‹ćŻčè±Ą + * Objective-CćźžäŸ‹ćŻčè±ĄïŒŒćŻé€šèż‡ć…¶æ–čæł•杄操䜜ç€șäŸ‹çš„ć˜é‡ć’Œæ–čæł•。 + * æłšæ„ïŒšćż…éĄ»é€šèż‡plusGetAttribute()æ–čæł•èŻ»ć–ç€ș䟋ćŻčè±Ąçš„ć±žæ€§ć€ŒïŒŒé€šèż‡plusSetAttribute()æ–čæł•èźŸçœźç€ș䟋ćŻčè±Ąçš„ć±žæ€§ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ios.html](http://www.html5plus.org/doc/zh_cn/ios.html) + */ + InstanceObject?: PlusIosInstanceObject; + /** + * ćŻŒć…„Objective-Cç±»ćŻčè±Ą + * ćŻŒć…„ç±»ćŻčè±ĄćŽïŒŒć°±ćŻä»„é€šèż‡.æ“äœœçŹŠç›ŽæŽ„è°ƒç”šćŻčè±ĄïŒˆç±»ćŻčè±Ą/ćźžäŸ‹ćŻčè±ĄïŒ‰çš„æ–čæł•。 + * é€šèż‡.æ“äœœçŹŠć·è°ƒç”šæ–čæł•æ—¶ïŒŒäžéœ€èŠäœżç”š":"æ„ćˆ†ć‰Čć‚æ•°ă€‚ + * æłšæ„ïŒšćŻŒć…„ç±»ćŻčè±Ąć°†äŒšæ¶ˆè€—èŸƒć€šçš„çł»ç»Ÿè”„æșïŒŒäžćș”èŻ„ćŻŒć…„èż‡ć€šçš„ç±»ćŻčè±ĄïŒŒćŻä»„äœżç”šplus.ios.invoke()杄调甚æœȘćŻŒć…„ç±»ćźžäŸ‹ćŻčè±Ąçš„æ–čæł•。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ios.html](http://www.html5plus.org/doc/zh_cn/ios.html) + */ + importClass(classname?: string): PlusIosClassObject; + /** + * 戛ć»șćźžäŸ‹ćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ios.html](http://www.html5plus.org/doc/zh_cn/ios.html) + */ + newObject(classname?: string, args?: any): PlusIosInstanceObject; + /** + * é”€æŻćźžäŸ‹ćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ios.html](http://www.html5plus.org/doc/zh_cn/ios.html) + */ + deleteObject(obj?: any): void; + /** + * 调甚ćŻčè±ĄïŒˆç±»ćŻčè±Ą/ç€ș䟋ćŻčè±ĄïŒ‰çš„æ–čæł• + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ios.html](http://www.html5plus.org/doc/zh_cn/ios.html) + */ + invoke(obj?: PlusIosInstanceObject, name?: string, args?: any): any; + /** + * 柞现代理的æ–čæł• + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ios.html](http://www.html5plus.org/doc/zh_cn/ios.html) + */ + implements(name?: string, obj?: any): PlusIosInstanceObject; + /** + * èŽ·ć–ćœ“ć‰WebviewçȘ—揣ćŻčè±Ąçš„native求UIWebviewćźžäŸ‹ćŻčè±Ą + * UIWebviewćŻčè±Ąçš„APIèŻ·ć‚è€ƒApplećŒ€ć‘æ–‡æĄŁ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ios.html](http://www.html5plus.org/doc/zh_cn/ios.html) + */ + currentWebview(): PlusIosInstanceObject; +} + +/** + * Objective-Cç±»ćŻčè±Ą + * Objective-Cç±»ćŻčè±ĄïŒŒćŻé€šèż‡ć…¶ć±žæ€§èŽ·ć–ç±»çš„ćžžé‡ïŒŒćŻé€šèż‡æ–čæł•杄操䜜类的静态æ–čæł•äčŸé€šèż‡newæ–čæł•æ„ćˆ›ć»șç±»çš„ćźžäŸ‹ćŻčè±Ąă€‚ + * ćŻčäșŽç±»çš„静态æ–čæł•ïŒŒćˆ™ç›ŽæŽ„é€šèż‡.ćŽéąè·Ÿéšæ–čæł•ćç§°è°ƒç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ios.html](http://www.html5plus.org/doc/zh_cn/ios.html) + */ +interface PlusIosClassObject { +} + +/** + * Objective-CćźžäŸ‹ćŻčè±Ą + * Objective-CćźžäŸ‹ćŻčè±ĄïŒŒćŻé€šèż‡ć…¶æ–čæł•杄操䜜ç€șäŸ‹çš„ć˜é‡ć’Œæ–čæł•。 + * æłšæ„ïŒšćż…éĄ»é€šèż‡plusGetAttribute()æ–čæł•èŻ»ć–ç€ș䟋ćŻčè±Ąçš„ć±žæ€§ć€ŒïŒŒé€šèż‡plusSetAttribute()æ–čæł•èźŸçœźç€ș䟋ćŻčè±Ąçš„ć±žæ€§ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ios.html](http://www.html5plus.org/doc/zh_cn/ios.html) + */ +interface PlusIosInstanceObject { + /** + * èŽ·ć–Objective-CćźžäŸ‹ćŻčè±Ąçš„ć±žæ€§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ios.html](http://www.html5plus.org/doc/zh_cn/ios.html) + */ + plusGetAttribute(name?: string): any; + /** + * èźŸçœźObjective-Cç€ș䟋ćŻčè±Ąçš„ć±žæ€§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ios.html](http://www.html5plus.org/doc/zh_cn/ios.html) + */ + plusSetAttribute(name?: string, value?: any): void; +} + +/** + * KeyçźĄç†èźŸć€‡æŒ‰é”źäș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ +interface PlusKey { + /** + * æŒ‰é”źç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ + KeyType?: PlusKeyKeyType; + /** + * æŒ‰é”źäș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ + KeyEvent?: PlusKeyKeyEvent; + /** + * æ·»ćŠ æŒ‰é”źäș‹ä»¶ç›‘搏晚 + * æ·»ćŠ æŒ‰é”źäș‹ä»¶ç›‘ćŹć™šïŒŒćœ“æŒ‡ćźšçš„æŒ‰é”źäș‹ä»¶ć‘ç”Ÿæ—¶ïŒŒć›žè°ƒć‡œæ•°ć°†è§Šć‘ă€‚ + * ćș”ç”šäž­ć­˜ćœšć€šäžȘWebviewçȘ—ćŁæ—¶ïŒŒæŒ‰ç…§çȘ—ćŁçš„æ˜Ÿç€ș栈éĄșćșä»ŽćŽćŸ€ć‰æŸ„æ‰ŸïŒŒæŸ„æ‰Ÿćˆ°æ·»ćŠ æŒ‰é”źäș‹ä»¶ç›‘搏晚的çȘ—ćŁćŽćœæ­ąïŒˆäž­æ–­ć‰éąWebviewçȘ—揣ćŻčæŒ‰é”źäș‹ä»¶çš„ç›‘ćŹïŒ‰ïŒŒćč¶ć‘çȘ—ćŁè§Šć‘æ‰§èĄŒæŒ‰é”źć›žè°ƒäș‹ä»¶ă€‚ + * 朹搌侀WebviewçȘ—ćŁäž­ćŻć€šæŹĄè°ƒç”šæ­€æ–čæł•ćŻč搌侀äș‹ä»¶æ·»ćŠ ć€šäžȘç›‘ćŹć™šïŒŒè§Šć‘æ—¶æŒ‰ç…§æ·»ćŠ çš„éĄșćșć…ˆćŽè°ƒç”šă€‚ + * æłšæ„ïŒšæ­€æ–čæł•æ— æł•ç›‘ćŹèœŻé”źç›˜çš„æŒ‰é”źäș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ + addEventListener(event?: PlusKeyKeyType, listener?: (result: PlusKeyKeyEvent) => void, capture?: boolean): void; + /** + * éšè—èœŻé”źç›˜ + * 隐藏ć·Č经星ç€șçš„èœŻé”źç›˜ïŒŒćŠ‚æžœèœŻé”źç›˜æČĄæœ‰æ˜Ÿç€șćˆ™äžćšä»»äœ•æ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ + hideSoftKeybord(): void; + /** + * èźŸçœźèŸ…ćŠ©èŸ“ć…„ç±»ćž‹ + * input的type类枋äžștextèŽ·ć–ç„Šç‚čæ—¶ïŒŒćœšèœŻé”źç›˜äžŠæ–č星ç€șèŸ…ćŠ©èŸ“ć…„æĄæ–čäŸżç”šæˆ·ćż«é€ŸèŸ“ć…„ă€‚ + * ćœšéĄ”éąäž­inputçŒ–èŸ‘æĄ†typeç±»ćž‹äžäžș"tel"、"email"时生效typeäžștelç±»ćž‹æ—¶äž€ćźšæ˜Ÿç€ștelçš„èŸ…ćŠ©èŸ“ć…„æĄïŒŒtypeäžșemailæ—¶äž€ćźšæ˜Ÿç€șemailçš„èŸ…ćŠ©èŸ“ć…„æĄïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ + setAssistantType(type?: string): void; + /** + * 星ç€șèœŻé”źç›˜ + * ćŒșćˆ¶æ˜Ÿç€șçł»ç»ŸèœŻé”źç›˜ïŒŒćŠ‚æžœèœŻé”źç›˜ć·Č经星ç€șćˆ™äžćšä»»äœ•æ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ + showSoftKeybord(): void; + /** + * ç§»é™€æŒ‰é”źäș‹ä»¶ç›‘搏晚 + * 从çȘ—ćŁç§»é™€æŒ‡ćźšçš„äș‹ä»¶ç›‘ćŹć™šă€‚è‹„æČĄæœ‰æŸ„æ‰Ÿćˆ°ćŻčćș”çš„äș‹ä»¶ç›‘ćŹć™šïŒŒćˆ™æ— ä»»äœ•äœœç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ + removeEventListener(event?: PlusKeyKeyType, listener?: (result: PlusKeyKeyEvent) => void): void; +} + +/** + * æŒ‰é”źç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ +interface PlusKeyKeyType { + /** + * èźŸć€‡â€œèż”ć›žâ€æŒ‰é’źæŒ‰é”źäș‹ä»¶ + * ćŠ‚æžœéœ€èŠæ”čć˜é»˜èź€â€œèż”ć›žâ€æŒ‰é’źçš„ć€„ç†é€»èŸ‘ïŒŒćˆ™ćŻé€šèż‡plus.key.addEventListeneræ„æłšć†Œç›‘ćŹ"backbutton"äș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ + backbutton?: string; + /** + * é”źæŒ‰äž‹äș‹ä»¶ + * ćŠ‚æžœéœ€èŠæ”čć˜é»˜èź€é”źæŒ‰äž‹çš„ć€„ç†é€»èŸ‘ïŒŒćˆ™ćŻé€šèż‡plus.key.addEventListeneræ„æłšć†Œç›‘ćŹ"keydown"äș‹ä»¶ă€‚ + * ćŻé€šèż‡ć›žè°ƒć‡œæ•°äž­KeyEventćŻčè±Ąçš„keyCodeæ„èŽ·ć–æŒ‰äž‹çš„é”źć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ + keydown?: string; + /** + * é”źæŸćŒ€äș‹ä»¶ + * ćŠ‚æžœéœ€èŠæ”čć˜é»˜èź€é”źæŸćŒ€çš„ć€„ç†é€»èŸ‘ïŒŒćˆ™ćŻé€šèż‡plus.key.addEventListeneræ„æłšć†Œç›‘ćŹ"keyup"äș‹ä»¶ă€‚ + * ćŻé€šèż‡ć›žè°ƒć‡œæ•°äž­KeyEventćŻčè±Ąçš„keyCodeæ„èŽ·ć–æŸćŒ€çš„é”źć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ + keyup?: string; + /** + * é•żæŒ‰é”źäș‹ä»¶ + * ćŠ‚æžœéœ€èŠæ”čć˜é»˜èź€é•żæŒ‰é”źçš„ć€„ç†é€»èŸ‘ïŒŒćˆ™ćŻé€šèż‡plus.key.addEventListeneræ„æłšć†Œç›‘ćŹ"longpressed"äș‹ä»¶ă€‚ + * é•żæŒ‰é”źæ—¶äŒšć€šæŹĄè§Šć‘ć›žè°ƒć‡œæ•°ïŒŒé€šèż‡ć›žè°ƒć‡œæ•°äž­KeyEventćŻčè±Ąçš„keyCodeæ„èŽ·ć–é•żæŒ‰çš„é”źć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ + longpressed?: string; + /** + * èźŸć€‡â€œèœć•â€æŒ‰é’źæŒ‰é”źäș‹ä»¶ + * ćŠ‚æžœéœ€èŠæ”čć˜é»˜èź€â€œèœć•â€æŒ‰é’źçš„ć€„ç†é€»èŸ‘ïŒŒćˆ™ćŻé€šèż‡plus.key.addEventListeneræ„æłšć†Œç›‘ćŹ"menubutton"äș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ + menubutton?: string; + /** + * èźŸć€‡â€œæœçŽąâ€æŒ‰é’źæŒ‰é”źäș‹ä»¶ + * ćŠ‚æžœéœ€èŠæ”čć˜é»˜èź€â€œæœçŽąâ€æŒ‰é’źçš„ć€„ç†é€»èŸ‘ïŒŒćˆ™ćŻé€šèż‡plus.key.addEventListeneræ„æłšć†Œç›‘ćŹ"searchbutton"äș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ + searchbutton?: string; + /** + * èźŸć€‡â€œéŸłé‡+â€æŒ‰é’źæŒ‰é”źäș‹ä»¶ + * ćŠ‚æžœéœ€èŠæ”čć˜é»˜èź€â€œéŸłé‡+â€æŒ‰é’źçš„ć€„ç†é€»èŸ‘ïŒŒćˆ™ćŻé€šèż‡plus.key.addEventListeneræ„æłšć†Œç›‘ćŹ"volumeupbutton"äș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ + volumeupbutton?: string; + /** + * èźŸć€‡â€œéŸłé‡-â€æŒ‰é’źæŒ‰é”źäș‹ä»¶ + * ćŠ‚æžœéœ€èŠæ”čć˜é»˜èź€â€œéŸłé‡-â€æŒ‰é’źçš„ć€„ç†é€»èŸ‘ïŒŒćˆ™ćŻé€šèż‡plus.key.addEventListeneræ„æłšć†Œç›‘ćŹ"volumedownbutton"äș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ + volumedownbutton?: string; +} + +/** + * æŒ‰é”źäș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ +interface PlusKeyKeyEvent { + /** + * è§Šć‘æŒ‰é”źäș‹ä»¶çš„é”źć€Œ + * é”źć€Œç”±ć„çł»ç»Ÿćčłć°ćźšäč‰ïŒŒäž€äș›ç‰čæźŠæŒ‰é”źćœšäžćŒçš„èźŸć€‡äžŠćŻèƒœć­˜ćœšć·źćŒ‚ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ + keyCode?: number; + /** + * æŒ‰é”źäș‹ä»¶ç±»ćž‹ + * 甹äșŽèĄšæ˜Žè§Šć‘æ­€æŒ‰é”źäș‹ä»¶çš„ç±»ćž‹ïŒŒć€ŒäžșKeyType侭漚äč‰çš„ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ + keyType?: PlusKeyKeyType; +} + +/** + * MessagingæšĄć—çźĄç†èźŸć€‡é€šèźŻćŠŸèƒœïŒŒćŻç”šäșŽçŸ­äżĄă€ćœ©äżĄă€é‚źä»¶ć‘é€ç­‰ă€‚é€šèż‡plus.messagingćŻèŽ·ć–èźŸć€‡é€šèźŻçźĄç†ćŻčè±Ąă€‚ćŠć€–äčŸćŻä»„ç›ŽæŽ„é€šèż‡html侭的hrefç›ŽæŽ„ćż«é€Ÿć‘é€çŸ­äżĄă€æ‹šæ‰“ç””èŻă€ć‘é€é‚źä»¶ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ +interface PlusMessaging { + /** + * æ¶ˆæŻćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + Message?: PlusMessagingMessage; + /** + * æ¶ˆæŻäœ“ć†…ćźč类枋 + * 甹äșŽèźŸćꚿ¶ˆæŻçš„æ¶ˆæŻäœ“憅ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + BodyType?: PlusMessagingBodyType; + /** + * çź€ć•çŸ­äżĄç±»ćž‹ćžžé‡ + * æ¶ˆæŻç±»ćž‹ćžžé‡ïŒŒNumberç±»ćž‹ïŒŒć›șćźšć€Œäžș1甚äșŽćˆ›ć»șćč¶ć‘é€çŸ­äżĄă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + TYPE_SMS?: number; + /** + * ćœ©äżĄç±»ćž‹ćžžé‡ + * æ¶ˆæŻç±»ćž‹ćžžé‡ïŒŒNumberç±»ćž‹ïŒŒć›șćźšć€Œäžș2甚äșŽćˆ›ć»șćč¶ć‘送怚ćȘ’äœ“çŸ­äżĄïŒˆćœ©äżĄïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + TYPE_MMS?: number; + /** + * é‚źä»¶ç±»ćž‹ćžžé‡ + * æ¶ˆæŻç±»ćž‹ćžžé‡ïŒŒNumberç±»ćž‹ïŒŒć›șćźšć€Œäžș3甚äșŽćˆ›ć»șćč¶ć‘送邟件。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + TYPE_EMAIL?: number; + /** + * 戛ć»șæ¶ˆæŻćŻčè±Ą + * 戛ć»șæŒ‡ćźšç±»ćž‹çš„æ¶ˆæŻïŒŒæ¶ˆæŻç±»ćž‹ćŻć–plus.messaging.TYPE_SMS、plus.messaging.TYPE_MMS、plus.messaging.TYPE_EMAIL。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + createMessage(type ?: number): PlusMessagingMessage; + /** + * ć‘é€æ¶ˆæŻ + * ć‘é€æ¶ˆæŻïŒŒć‘é€æˆćŠŸć›žè°ƒsuccessCBć‡œæ•°ïŒŒć‘é€ć€±èŽ„ć›žè°ƒerrorCBć‡œæ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + sendMessage(msg?: PlusMessagingMessage, successCB?: Function, errorCB?: (result: any) => void): void; +} + +/** + * æ¶ˆæŻćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ +interface PlusMessagingMessage { + /** + * 收件äșșäżĄæŻ + * 歗笩äžČæ•°ç»„ç±»ćž‹ïŒŒèŸ“ć…„çš„ćœ°ć€æ”¶ä»¶äșșäżĄæŻćż…éĄ»çŹŠćˆæ¶ˆæŻç±»ćž‹æ ŒćŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + to?: any []; + /** + * 抄送äșșäżĄæŻ + * 歗笩äžČæ•°ç»„ç±»ćž‹ïŒŒä»…ć‘é€é‚źä»¶æ—¶æœ‰æ•ˆïŒŒèŸ“ć…„çš„ćœ°ć€æ”¶ä»¶äșșäżĄæŻćż…éĄ»çŹŠćˆæ¶ˆæŻç±»ćž‹æ ŒćŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + cc?: any []; + /** + * 暗送äșșäżĄæŻ + * 歗笩äžČæ•°ç»„ç±»ćž‹ïŒŒä»…ć‘é€é‚źä»¶æ—¶æœ‰æ•ˆïŒŒèŸ“ć…„çš„ćœ°ć€æ”¶ä»¶äșșäżĄæŻćż…éĄ»çŹŠćˆæ¶ˆæŻç±»ćž‹æ ŒćŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + bcc?: any []; + /** + * ć‘ä»¶äșșäżĄæŻ + * ä»…ćœšç›‘ćŹæŽ„æ”¶ćˆ°çš„äżĄæŻæ—¶æœ‰æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + from?: string; + /** + * ć‘é€æ¶ˆæŻäž»éą˜ + * 歗笩äžČç±»ćž‹ïŒŒä»…ć‘é€é‚źä»¶æ—¶æœ‰æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + subject?: string; + /** + * ć‘é€æ¶ˆæŻć†…ćźč + * 歗笩äžČç±»ćž‹ïŒŒèŠć‘é€çš„æ¶ˆæŻäœ“ć†…ćźčïŒŒć…¶æ ŒćŒćż…éĄ»äžŽbodyTypeæŒ‡ćźšçš„äž€è‡Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + body?: string; + /** + * ć‘é€æ¶ˆæŻć†…ćźč类枋 + * èŠć‘é€æ¶ˆæŻäœ“ć†…ćźčçš„ç±»ćž‹ïŒŒćŻć–ć€Œ"text"èĄšç€șæ–‡æœŹć†…ćźč"html"èĄšç€șäžșhtmléĄ”éąïŒŒé»˜èź€ć€Œäžș"text"。 + * - text/plain: çșŻæ–‡æœŹç±»ćž‹æ¶ˆæŻäœ“憅ćźč + * - text/html: çœ‘éĄ”æ•°æźç±»ćž‹æ¶ˆæŻäœ“ć†…ćźč(甹äșŽć‘送邟件) + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + bodyType?: 'text/plain' | 'text/html'; + /** + * æ˜ŻćŠé‡‡ç”šé™é»˜æ–čćŒć‘é€æ¶ˆæŻ + * ćžƒć°”ç±»ćž‹ïŒŒćŻć–ć€Œäžștrue或falsetrueèĄšç€ș静默æ–čćŒć‘é€ïŒŒäžćŒčć‡șç•ŒéąïŒ›falseèĄšç€ș非静默æ–čćŒć‘é€ă€‚é»˜èź€é‡‡ç”šéžé™é»˜æ–čćŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + silent?: boolean; + /** + * æ·»ćŠ é™„ä»¶ + * ć‘æ¶ˆæŻäž­æ·»ćŠ é™„ä»¶ïŒŒä»…é‚źä»¶ç±»ćž‹æ¶ˆæŻæ”ŻæŒïŒŒć…¶ćźƒç±»ćž‹æ¶ˆæŻäžæ”ŻæŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + addAttachment(url?: string): void; +} + +/** + * æ¶ˆæŻäœ“ć†…ćźč类枋 + * 甹äșŽèźŸćꚿ¶ˆæŻçš„æ¶ˆæŻäœ“憅ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ +interface PlusMessagingBodyType { + /** + * æ–‡æœŹç±»ćž‹ + * çșŻæ–‡æœŹç±»ćž‹æ¶ˆæŻäœ“憅ćźčïŒŒé»˜èź€æ¶ˆæŻäœ“ć†…ćźč类枋。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + 'text/plain'?: string; + /** + * Html类枋 + * çœ‘éĄ”æ•°æźç±»ćž‹æ¶ˆæŻäœ“ć†…ćźčïŒŒćŻç”šäșŽć‘送邟件。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + 'text/html'?: string; +} + +/** + * nativeObjçźĄç†çł»ç»ŸćŽŸç”ŸćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObj { + /** + * ćŽŸç”ŸćŠšç”»ć‚æ•° + * æŒ‡ćźšćŠšç”»çš„ç±»ćž‹ă€æŒç»­æ—¶é—Žç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + AnimationOptions?: PlusNativeObjAnimationOptions; + /** + * ćŽŸç”ŸćŠšç”»çȘ—ćŁæ ·ćŒ + * æŒ‡ćźšćŠšç”»çȘ—ćŁçš„æ ·ćŒïŒŒćŠ‚èƒŒæ™Żć›Ÿç‰‡ïŒŒç»˜ćˆ¶çš„æ–‡ć­—ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + AnimationViewStyles?: PlusNativeObjAnimationViewStyles; + /** + * ćŽŸç”Ÿć›Ÿç‰‡ćŻčè±Ą + * ćŽŸç”Ÿć›Ÿç‰‡ćŻčè±ĄäŒšć ç”šèŸƒć€§çš„ć†…ć­˜è”„æșïŒŒćœšäœżç”šæ—¶éœ€è°šæ…ŽçźĄç†ïŒŒćœ“ć›Ÿç‰‡äžć†äœżç”šæ—¶ćș”èŻ„ćŠæ—¶è°ƒç”šclearæ–čæł•èż›èĄŒé”€æŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + Bitmap?: PlusNativeObjBitmap; + /** + * JSONćŻčè±ĄïŒŒäżć­˜ć›Ÿç‰‡çš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + BitmapSaveOptions?: PlusNativeObjBitmapSaveOptions; + /** + * ćŽŸç”Ÿć›Ÿç‰‡èœźæ’­æŽ§ä»¶ćŻčè±Ą + * ćŽŸç”Ÿć›Ÿç‰‡èœźæ’­æŽ§ä»¶ćŻčè±Ąä»ŽćŽŸç”ŸView控件plus.nativeObj.ViewïŒ‰ç»§æ‰żè€Œæ„ïŒŒç”šäșŽç»˜ćˆ¶ć›Ÿç‰‡èœźæ’­ć†…ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + ImageSlider?: PlusNativeObjImageSlider; + /** + * ć›Ÿç‰‡èœźæ’­æŽ§ä»¶æ ·ćŒ + * 从ViewStylesç»§æ‰żè€Œæ„ïŒŒæ‰©ć±•æ”ŻæŒèœźæ’­ć›Ÿç‰‡ç­‰é…çœźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + ImageSliderStyles?: PlusNativeObjImageSliderStyles; + /** + * ć›Ÿç‰‡èœźæ’­æŽ§ä»¶äž­ć›Ÿç‰‡éĄčé…çœźć‚æ•° + * 甹äșŽæŒ‡ćźšć›Ÿç‰‡ćœ°ć€ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + ImageSliderImageStyles?: PlusNativeObjImageSliderImageStyles; + /** + * èŸ“ć…„æĄ†æ ·ćŒ + * 甹äșŽćźšäč‰èŸ“ć…„æĄ†çš„æ˜Ÿç€șæ ·ćŒïŒŒćŠ‚ć­—äœ“ć€§ć°ïŒŒæç€ș憅ćźčç­‰äżĄæŻă€‚ + * èŸ“ć…„æ–‡æœŹć†…ćźčćœšæŒ‡ćźšćŒșćŸŸæ°Žćčłć±…ć·ŠïŒŒćž‚ç›Žć±…äž­æ˜Ÿç€ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + InputStyles?: PlusNativeObjInputStyles; + /** + * ćŒșćŸŸäżĄæŻćŻčè±Ą + * ćŒ…æ‹Źäœçœźă€ć€§ć°ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + Rect?: PlusNativeObjRect; + /** + * 绘戶ćŒșćŸŸæ ·ćŒćŻčè±Ą + * 甹äșŽćźšäč‰çŸ©ćœąćŒșćŸŸçš„æ˜Ÿç€șæ ·ćŒïŒŒćŠ‚ç©ș濃/ćźžćżƒæ ·ćŒă€ćœ†è§’ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + RectStyles?: PlusNativeObjRectStyles; + /** + * ćŻŒæ–‡æœŹæ ·ćŒ + * 甹äșŽćźšäč‰ćŻŒæ–‡æœŹäœżç”šçš„é»˜èź€äœżç”šçš„ć­—äœ“ćç§°ă€ć­—äœ“æ–‡ä»¶è·ŻćŸ„ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + RichTextStyles?: PlusNativeObjRichTextStyles; + /** + * ćŒșćŸŸäżĄæŻćŻčè±Ą + * ćŒ…æ‹Źäœçœźă€ć€§ć°ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + Position?: PlusNativeObjPosition; + /** + * ç»˜ćˆ¶æ–‡æœŹæ ·ćŒćŻčè±Ą + * 甹äșŽćźšä艿–‡æœŹçš„æ˜Ÿç€șæ ·ćŒïŒŒćŠ‚ć­—äœ“ć€§ć°ă€ć­—äœ“éąœè‰Čă€ć­—äœ“çČ—ç»†ă€ć­—äœ“æ ·ćŒă€ć­—äœ“ćç§°ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + TextStyles?: PlusNativeObjTextStyles; + /** + * ćŽŸç”ŸæŽ§ä»¶ćŻčè±Ą + * ćŽŸç”ŸæŽ§ä»¶ćŻčè±ĄćŻç”šäșŽćœšć±ćč•äžŠç»˜ćˆ¶ć›Ÿç‰‡æˆ–æ–‡æœŹć†…ćźčïŒŒćœ“æŽ§ä»¶äžć†äœżç”šæ—¶éœ€èŠè°ƒç”šcloseæ–čæł•é”€æŻæŽ§ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + View?: PlusNativeObjView; + /** + * ViewæŽ§ä»¶ćŠšç”»ć‚æ•° + * æŒ‡ćźšćŠšç”»çš„ç±»ćž‹ă€æŒç»­æ—¶é—Žç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + ViewAnimationOptions?: PlusNativeObjViewAnimationOptions; + /** + * ViewæŽ§ä»¶ç»˜ćˆ¶ć…ƒçŽ ć‚æ•° + * æŒ‡ćźšç»˜ćˆ¶ć›Ÿç‰‡ă€çŸ©ćœąćŒșćŸŸă€æ–‡æœŹć†…ćźčç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + ViewDrawTagStyles?: PlusNativeObjViewDrawTagStyles; + /** + * View控件äș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + ViewEvents?: PlusNativeObjViewEvents; + /** + * JSONćŻčè±ĄïŒŒViewæŽ§ä»¶çš„çł»ç»ŸçŠ¶æ€æ ćŒșćŸŸæ ·ćŒ + * ä»…ćœšćș”ç”šèźŸçœźäžșæČ‰æ”žćŒçŠ¶æ€æ æ ·ćŒäž‹æœ‰æ•ˆïŒŒéžæČ‰æ”žćŒçŠ¶æ€æ æ ·ćŒäž‹ćżœç•„æ­€ć±žæ€§ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + ViewStatusbarStyles?: PlusNativeObjViewStatusbarStyles; + /** + * ViewæŽ§ä»¶æ ·ćŒ + * ćŒ…æ‹Źäœçœźă€ć€§ć°ç­‰äżĄæŻç­‰ïŒŒć…¶äž­äœçœźäżĄæŻç›žćŻčäșŽçˆ¶ćźčć™šæŽ§ä»¶èż›èĄŒèźĄçź—ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + ViewStyles?: PlusNativeObjViewStyles; +} + +/** + * ćŽŸç”ŸćŠšç”»ć‚æ•° + * æŒ‡ćźšćŠšç”»çš„ç±»ćž‹ă€æŒç»­æ—¶é—Žç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjAnimationOptions { + /** + * 抚画类枋 + * ćŻć–ć€ŒïŒš + * "pop-in" - ä»ŽćłäŸ§ćčłç§»ć…„æ ˆćŠšç”»æ•ˆæžœïŒˆć‰ŻçȘ—ćŁä»ŽćłäŸ§ć‘ć·Šćčłç§»æ»‘ć‡ș星ç€ș䞻çȘ—ćŁä»Žćœ“ć‰ć±ćč•ćŒșćŸŸć‘ć·ŠäŸ§ćčłç§»æ»‘ć‡șèą«éźç›–ïŒ‰ïŒŒćŠ‚æžœä»…äŒ ć…„äž€äžȘView控件ćŻčè±Ąćˆ™è‡Ș抹降çș§äžșslide-in-rightćŠšç”»ïŒ› + * "pop-out" - ä»ŽćłäŸ§ćčłç§»ć‡șæ ˆćŠšç”»æ•ˆæžœïŒˆć‰ŻçȘ—ćŁä»Žćœ“ć‰ć±ćč•ćŒșćŸŸć‘ćłäŸ§ćčłç§»ć‡șćŻè§†ćŒșćŸŸïŒŒäž»çȘ—ćŁä»Žć·ŠäŸ§ć‘ćłćčłç§»æ»‘ć‡ș星ç€șïŒ‰ïŒŒćŠ‚æžœä»…ć‡ș慄䞀äžȘView控件ćŻčè±Ąćˆ™è‡Ș抹降çș§äžșslide-out-rightćŠšç”»ïŒ› + * "slide-in-right" - ä»ŽćłäŸ§æšȘć‘æ»‘ćŠšæ•ˆæžœïŒˆäž»çȘ—ćŁä»Žćœ“ć‰ć±ćč•ćłäŸ§ć€–ć‘ć†…æšȘć‘æ»‘ćŠšæ˜Ÿç€ș + * "slide-out-right - æšȘć‘ć‘ćłäŸ§æ»‘ć‡șć±ćč•ćŠšç”»ïŒˆäž»çȘ—ćŁä»Žć±ćč•äž­æšȘć‘ć‘ćłäŸ§æ»‘ćŠšćˆ°ć±ćč•ć€–ïŒ‰ă€‚ + * - pop-in: + * ä»ŽćłäŸ§ćčłç§»ć…„æ ˆćŠšç”»æ•ˆæžœïŒˆć‰ŻçȘ—ćŁä»ŽćłäŸ§ć‘ć·Šćčłç§»æ»‘ć‡ș星ç€ș䞻çȘ—ćŁä»Žćœ“ć‰ć±ćč•ćŒșćŸŸć‘ć·ŠäŸ§ćčłç§»æ»‘ć‡șèą«éźç›–ïŒ‰ă€‚ + * + * - pop-out: + * ä»ŽćłäŸ§ćčłç§»ć‡șæ ˆćŠšç”»æ•ˆæžœïŒˆć‰ŻçȘ—ćŁä»Žćœ“ć‰ć±ćč•ćŒșćŸŸć‘ćłäŸ§ćčłç§»ć‡șćŻè§†ćŒșćŸŸïŒŒäž»çȘ—ćŁä»Žć·ŠäŸ§ć‘ćłćčłç§»æ»‘ć‡ș星ç€șïŒ‰ă€‚ + * + * - slide-in-right: + * ä»ŽćłäŸ§æšȘć‘æ»‘ćŠšæ•ˆæžœïŒˆäž»çȘ—ćŁä»Žćœ“ć‰ć±ćč•ćłäŸ§ć€–ć‘ć†…æšȘć‘æ»‘ćŠšæ˜Ÿç€șïŒ‰ă€‚ + * + * - slide-out-right: + * æšȘć‘ć‘ćłäŸ§æ»‘ć‡șć±ćč•ćŠšç”»ïŒˆäž»çȘ—ćŁä»Žć±ćč•äž­æšȘć‘ć‘ćłäŸ§æ»‘ćŠšćˆ°ć±ćč•ć€–ïŒ‰ă€‚ + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + type?: 'pop-in' | 'pop-out' | 'slide-in-right' | 'slide-out-right'; + /** + * ćŠšç”»æŒç»­æ—¶é—Ž + * ć•äœäžșæŻ«ç§’ïŒŒé»˜èź€ć€Œäžș200ms。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + duration?: number; +} + +/** + * ćŽŸç”ŸćŠšç”»çȘ—ćŁæ ·ćŒ + * æŒ‡ćźšćŠšç”»çȘ—ćŁçš„æ ·ćŒïŒŒćŠ‚èƒŒæ™Żć›Ÿç‰‡ïŒŒç»˜ćˆ¶çš„æ–‡ć­—ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjAnimationViewStyles { + /** + * 抚画çȘ—ćŁäžŠç»˜ćˆ¶çš„èƒŒæ™Żć›Ÿç‰‡ + * ć›Ÿç‰‡ćŻä»„é€šèż‡WebviewćŻčè±Ąçš„drawæ–čæł•æˆȘć›ŸïŒŒäčŸćŻä»„é€šèż‡Bitmap的APIä»ŽæœŹćœ°æ–‡ä»¶äž­ćŠ èœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + bitmap?: PlusNativeObjBitmap; + /** + * 抚画çȘ—ćŁäžŠç»˜ćˆ¶çš„æ–‡æœŹć†…ćźč + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + text?: string; + /** + * 抚画çȘ—ćŁäžŠç»˜ćˆ¶çš„æ–‡æœŹæ ·ćŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + textStyles?: PlusNativeObjTextStyles; + /** + * 抚画çȘ—ćŁäžŠç»˜ćˆ¶çš„æ–‡æœŹćŒș㟟 + * é»˜èź€ć€Œäžș{top:'0px',left:'0px',width:'100%',height:'44px'}。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + textRect?: PlusNativeObjRect; +} + +/** + * ćŽŸç”Ÿć›Ÿç‰‡ćŻčè±Ą + * ćŽŸç”Ÿć›Ÿç‰‡ćŻčè±ĄäŒšć ç”šèŸƒć€§çš„ć†…ć­˜è”„æșïŒŒćœšäœżç”šæ—¶éœ€è°šæ…ŽçźĄç†ïŒŒćœ“ć›Ÿç‰‡äžć†äœżç”šæ—¶ćș”èŻ„ćŠæ—¶è°ƒç”šclearæ–čæł•èż›èĄŒé”€æŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjBitmap { + /** + * BitmapćŻčè±Ąçš„æ ‡èŻ† + * 朹戛ć»șBitmapćŻčè±Ąæ—¶èźŸçœźïŒŒćŠ‚æžœæČĄæœ‰èźŸçœźæ ‡èŻ†ïŒŒæ­€ć±žæ€§ć€Œäžșnull。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + id?: string; + /** + * 静态æ–čæł•ïŒŒèŽ·ć–æ‰€æœ‰Bitmapć›Ÿç‰‡ćŻčè±Ą + * èŽ·ć–ćș”ç”šèżèĄŒæœŸćˆ›ć»ș的所有Bitmapć›Ÿç‰‡ćŻčè±ĄïŒŒćŒ…ć«æ‰€æœ‰ç©șBitmapćŻčè±ĄïŒŒäžćŒ…ć«ć·Čç»é”€æŻçš„BitmapćŻčè±Ąă€‚èż”ć›žçš„BitmapćŻčè±Ąćœšæ•°ç»„äž­æŒ‰ćˆ›ć»șçš„ć±žæ€§æŽ’ćˆ—ïŒŒćŠæ•°ç»„äž­çŹŹäž€äžȘæ˜Żæœ€ć…ˆćˆ›ć»ș的BitmapćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + getItems(): PlusNativeObj []; + /** + * 静态æ–čæł•ïŒŒèŽ·ć–æŒ‡ćźšæ ‡èŻ†çš„Bitmapć›Ÿç‰‡ćŻčè±Ą + * 朹ćș”甚䞭ć·Č戛ć»șçš„ć›Ÿç‰‡ćŻčè±Ąäž­æŸ„æ‰ŸæŒ‡ćźšæ ‡èŻ†çš„BitmapćŻčè±Ąćč¶èż”曞。 + * è‹„ć­˜ćœšć€šäžȘç›žćŒæ ‡èŻ†çš„Bitmapć›Ÿç‰‡ïŒŒćˆ™èż”ć›žçŹŹäž€äžȘ戛ć»ș的Bitmapć›Ÿç‰‡ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + getBitmapById(id?: string): PlusNativeObjBitmap; + /** + * é”€æŻBitmapć›Ÿç‰‡ + * 释攟Bitmapć›Ÿç‰‡ć ç”šçš„ć†…ć­˜è”„æșïŒŒé”€æŻćŽć›Ÿç‰‡ćŻčè±Ąć°†äžćŻäœżç”šïŒŒć…¶idć±žæ€§ć€ŒäžșundefinedïŒŒè°ƒç”šć…¶æ‰€æœ‰æ–čæł•æ“äœœéƒœäŒšć€±èŽ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + clear(): void; + /** + * ćŠ èœœBitmapć›Ÿç‰‡ + * ä»ŽæŒ‡ćźšçš„è·ŻćŸ„ïŒˆä»…æ”ŻæŒæœŹćœ°æ–‡ä»¶çł»ç»ŸïŒ‰äž­ćŠ èœœć›Ÿç‰‡ïŒŒæ­€æ“äœœć°†èŠ†ç›–äč‹ć‰çš„ć›Ÿç‰‡ć†…ćźč + * ćŠ‚æžœćŠ èœœć›Ÿç‰‡ć€±èŽ„ćˆ™äżç•™äč‹ć‰çš„ć›Ÿç‰‡ć†…ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + load(path?: string, successCallback?: Function, errorCallback?: (result: any) => void): void; + /** + * ćŠ èœœBase64çŒ–ç æ ŒćŒć›Ÿç‰‡ćˆ°BitmapćŻčè±Ą + * 从Base64çŒ–ç æ ŒćŒć›Ÿç‰‡æ•°æźäž­ćŠ èœœć›Ÿç‰‡ïŒŒæ­€æ“äœœć°†èŠ†ç›–äč‹ć‰çš„ć›Ÿç‰‡ć†…ćźč + * ćŠ‚æžœćŠ èœœć›Ÿç‰‡ć€±èŽ„ćˆ™äżç•™äč‹ć‰çš„ć›Ÿç‰‡ć†…ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + loadBase64Data(data?: string, successCallback?: Function, errorCallback?: (result: any) => void): void; + /** + * ć›žæ”¶Bitmapć›Ÿç‰‡ć†…ć­˜ + * 释攟Bitmapć›Ÿç‰‡ć ç”šçš„ć†…ć­˜è”„æșïŒŒäœ†äžé”€æŻć›Ÿç‰‡ćŻčè±ĄïŒŒäŸç„¶ćŻä»„ç»§ç»­äœżç”šć›Ÿç‰‡ćŻčè±Ąă€‚ + * ćœ“ć›Ÿç‰‡ćŻčè±Ąć†æŹĄèą«äœżç”šæ—¶äŒšè‡ȘćŠšä»ŽèźŸçœźçš„è·ŻćŸ„ïŒˆæž„é€ ć‡œæ•°æˆ–load/saveæ–čæł•èźŸçœźïŒ‰ćŠ èœœćˆ°ć†…ć­˜äž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + recycle(): void; + /** + * äżć­˜ć›Ÿç‰‡ + * ć°†ć›Ÿç‰‡äżć­˜ćˆ°æŒ‡ćźšçš„è·ŻćŸ„ïŒˆä»…æ”ŻæŒæœŹćœ°æ–‡ä»¶çł»ç»ŸïŒ‰ïŒŒćŠ‚æžœć›Ÿç‰‡äžșç©șæˆ–è€…æŒ‡ćźšçš„è·ŻćŸ„æ–‡ä»¶ć·Čç»ć­˜ćœšćˆ™èż”ć›žć€±èŽ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + save(path?: string, options?: PlusNativeObjBitmapSaveOptions, successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; + /** + * èŽ·ć–ć›Ÿç‰‡çš„Base64çŒ–ç æ•°æź + * èŻ»ć–ć›Ÿç‰‡çš„æ•°æźć†…ćźčćč¶èœŹæąäžșBase64çŒ–ç æ ŒćŒć­—çŹŠäžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + toBase64Data(): string; +} + +/** + * JSONćŻčè±ĄïŒŒäżć­˜ć›Ÿç‰‡çš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjBitmapSaveOptions { + /** + * èŠ†ç›–äżć­˜ć›Ÿç‰‡æ–‡ä»¶ + * ä»…ćœšäżć­˜çš„ć›Ÿç‰‡è·ŻćŸ„æ–‡ä»¶ć­˜ćœšæ—¶æœ‰æ•ˆïŒš + * trueèĄšç€șèŠ†ç›–ć­˜ćœšçš„æ–‡ä»¶ïŒ› + * falseèĄšç€șäžèŠ†ç›–ïŒŒćŠ‚æžœæ–‡ä»¶ć­˜ćœšïŒŒćˆ™èż”ć›žć€±èŽ„ă€‚ + * é»˜èź€ć€Œäžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + overwrite?: boolean; + /** + * äżć­˜ć›Ÿç‰‡çš„æ ŒćŒ + * æ”ŻæŒ"jpg"、"png"ïŒŒćŠ‚æžœæœȘæŒ‡ćźšćˆ™é»˜èź€äœżç”šæŒ‡ćźšçš„äżć­˜è·ŻćŸ„ćŽçŒ€ćŻčćș”çš„æ–‡ä»¶æ ŒćŒïŒŒćŠ‚æžœćŽçŒ€æ–‡ä»¶æ ŒćŒæ— æ•ˆćˆ™äœżç”šjpgæ ŒćŒă€‚ + * - jpg: JPGæ ŒćŒć›Ÿç‰‡ + * - png: PNGæ ŒćŒć›Ÿç‰‡ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + format?: 'jpg' | 'png'; + /** + * äżć­˜ć›Ÿç‰‡çš„èŽšé‡ + * ć–ć€ŒèŒƒć›Žäžș1-1001èĄšç€șäœżç”šæœ€äœŽçš„ć›Ÿç‰‡èŽšé‡ïŒˆäżć­˜ćŽçš„ć›Ÿç‰‡æ–‡ä»¶æœ€ć°ïŒ‰ă€100èĄšç€șäœżç”šæœ€é«˜çš„ć›Ÿç‰‡èŽšé‡ïŒˆäżć­˜ćŽçš„ć›Ÿç‰‡æ–‡ä»¶æœ€ć€§ïŒ‰ïŒ› + * é»˜èź€ć€Œäžș50。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + quality?: number; + /** + * æŒ‡ćźšèŁć‰ȘćŒșćŸŸäżć­˜ć›Ÿç‰‡ + * 盾ćŻčäșŽć›Ÿç‰‡çš„ćŒșćŸŸäżĄæŻïŒŒé»˜èź€ć€Œäžș{top:'0px',left:'0px',width:'100%',height:'100%'}。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + clip?: PlusNativeObjRect; +} + +/** + * ćŽŸç”Ÿć›Ÿç‰‡èœźæ’­æŽ§ä»¶ćŻčè±Ą + * ćŽŸç”Ÿć›Ÿç‰‡èœźæ’­æŽ§ä»¶ćŻčè±Ąä»ŽćŽŸç”ŸView控件plus.nativeObj.ViewïŒ‰ç»§æ‰żè€Œæ„ïŒŒç”šäșŽç»˜ćˆ¶ć›Ÿç‰‡èœźæ’­ć†…ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjImageSlider { + /** + * æ·»ćŠ ć›Ÿç‰‡èœźæ’­æŽ§ä»¶çš„ć›Ÿç‰‡ + * ćŠšæ€æ·»ćŠ ć›Ÿç‰‡èœźæ’­æŽ§ä»¶æ˜Ÿç€șçš„ć›Ÿç‰‡ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + addImages(images?: PlusNativeObj []): void; + /** + * èŽ·ć–ćœ“ć‰ć›Ÿç‰‡èœźæ’­æŽ§ä»¶æ˜Ÿç€șçš„ć›Ÿç‰‡çŽąćŒ•ć€Œ + * çŽąćŒ•ć€Œä»Ž0ćŒ€ć§‹ïŒŒćł0èĄšç€șć›Ÿç‰‡èœźæ’­æŽ§ä»¶ćœ“ć‰æ˜Ÿç€șçŹŹäž€ćŒ ć›Ÿç‰‡ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + currentImageIndex(): number; + /** + * èźŸçœźć›Ÿç‰‡èœźæ’­æŽ§ä»¶çš„ć›Ÿç‰‡ + * ćŠšæ€æ›Žæ–°ć›Ÿç‰‡èœźæ’­æŽ§ä»¶æ˜Ÿç€șçš„ć›Ÿç‰‡ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + setImages(images?: PlusNativeObj []): void; +} + +/** + * ć›Ÿç‰‡èœźæ’­æŽ§ä»¶æ ·ćŒ + * 从ViewStylesç»§æ‰żè€Œæ„ïŒŒæ‰©ć±•æ”ŻæŒèœźæ’­ć›Ÿç‰‡ç­‰é…çœźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjImageSliderStyles { + /** + * æ˜ŻćŠè‡ȘćŠšæ’­æ”Ÿ + * ćŻć–ć€ŒïŒš + * "true" - è‡ȘćŠšæ’­æ”ŸïŒ› + * "false" - 䞍è‡ȘćŠšæ’­æ”Ÿă€‚ + * é»˜èź€ć€Œäžș"false"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + autoplay?: boolean; + /** + * æ˜ŻćŠćŻć…šć±æ˜Ÿç€ș + * ćŻć–ć€ŒïŒš + * "true" - èĄšç€șćŻć…šć±æ˜Ÿç€ș甚户ç‚čć‡»èœźæ’­ć›Ÿç‰‡æ—¶ć…šć±æ˜Ÿç€ș + * "false" - èĄšç€șäžćŻć…šć±æ˜Ÿç€ș甚户ç‚čć‡»èœźæ’­ć›Ÿç‰‡æ—¶æ— ć“ćș”。 + * é»˜èź€ć€Œäžș"true"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + fullscreen?: boolean; + /** + * æ˜ŻćŠćŻćŸȘçŽŻèœźæ’­ + * ćŻć–ć€ŒïŒš + * "true" - æ”ŻæŒćŸȘçŽŻèœźæ’­ïŒ› + * "false" - äžæ”ŻæŒćŸȘçŽŻèœźæ’­ă€‚ + * é»˜èź€ć€Œäžș"false"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + loop?: boolean; + /** + * èœźæ’­çš„ć›Ÿç‰‡ + * è‡łć°‘ćż…éĄ»èźŸçœźäž€ćŒ ć›Ÿç‰‡çš„ćœ°ć€äżĄæŻïŒŒćŠćˆ™ćŻèƒœćŻŒè‡Žć›Ÿç‰‡èœźæ’­æŽ§ä»¶æ˜Ÿç€șäžæ­Łćžžă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + images?: PlusNativeObj []; + /** + * è‡ȘćŠšæ’­æ”Ÿćˆ‡æąæ—¶é—Ž + * ćœ“autoplayć±žæ€§ć€Œäžștrueæ—¶ç”Ÿæ•ˆïŒŒć•äœäžșæŻ«ç§’ă€‚é»˜èź€ć€Œäžș30003ç§’ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + interval?: number; +} + +/** + * ć›Ÿç‰‡èœźæ’­æŽ§ä»¶äž­ć›Ÿç‰‡éĄčé…çœźć‚æ•° + * 甹äșŽæŒ‡ćźšć›Ÿç‰‡ćœ°ć€ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjImageSliderImageStyles { + /** + * ć›Ÿç‰‡ćœ°ć€ + * æ”ŻæŒæœŹćœ°ćœ°ć€ïŒˆç›žćŻčćœ°ć€ă€ç»ćŻčè·ŻćŸ„ă€RelativeURLă€æœŹćœ°è·ŻćŸ„URL + * ä蟿”ŻæŒçœ‘ç»œćœ°ć€ïŒˆhttp://或https://ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + src?: string; + /** + * ć›Ÿç‰‡æ°ŽćčłćŻč霐æ–čćŒ + * ä»…ćœšć›Ÿç‰‡æ˜Ÿç€șçš„ćźœćșŠäžŽć›Ÿç‰‡èœźæ’­æŽ§ä»¶ćźœćșŠäžäž€è‡Žæ—¶æœ‰æ•ˆïŒŒćŻć–ć€ŒïŒš + * "left" - ć›Ÿç‰‡ćœšèœźæ’­æŽ§ä»¶äž­æ°Žćčłć±…ć·ŠćŻč霐 + * "center" - ć›Ÿç‰‡ćœšèœźæ’­æŽ§ä»¶äž­æ°Žćčłć±…äž­ćŻč霐 + * "right" - ć›Ÿç‰‡ćœšèœźæ’­æŽ§ä»¶äž­æ°Žćčłć±…揳ćŻčéœă€‚ + * é»˜èź€ć€Œäžș"center"。 + * - left: ć›Ÿç‰‡ćœšèœźæ’­æŽ§ä»¶äž­æ°Žćčłć±…ć·ŠćŻč霐 + * - center: ć›Ÿç‰‡ćœšèœźæ’­æŽ§ä»¶äž­æ°Žćčłć±…äž­ćŻč霐 + * - right: ć›Ÿç‰‡ćœšèœźæ’­æŽ§ä»¶äž­æ°Žćčłć±…揳ćŻč霐 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + align?: 'left' | 'center' | 'right'; + /** + * ć›Ÿç‰‡æ˜Ÿç€ș的高ćșŠ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"现ćŻčäșŽć›Ÿç‰‡èœźæ’­æŽ§ä»¶çš„高ćșŠïŒ› + * è‡ȘćŠšèźĄçź—"auto"ïŒŒćŠ‚æžœæŒ‡ćźšć›Ÿç‰‡ćźœćșŠïŒˆwidthïŒ‰ïŒŒćˆ™æŒ‰ć›Ÿç‰‡ćźžé™…ć€§ć°ç­‰æŻ”çŒ©æ”Ÿć›Ÿç‰‡é«˜ćșŠć€ŒïŒŒćŠ‚æžœæČĄæœ‰æŒ‡ćźšćźœćșŠïŒˆwidthć€Œäžș"auto"ïŒ‰ćˆ™è‡ȘćŠšçŒ©æ”Ÿć›Ÿç‰‡è‡łćŻćźŒæ•Žæ˜Ÿç€ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + height?: string; + /** + * ć›Ÿç‰‡æ˜Ÿç€șçš„ćźœćșŠ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽć›Ÿç‰‡èœźæ’­æŽ§ä»¶çš„ćźœćșŠïŒ› + * è‡ȘćŠšèźĄçź—"auto"ïŒŒćŠ‚æžœæŒ‡ćźšć›Ÿç‰‡é«˜ćșŠïŒˆheightïŒ‰ïŒŒćˆ™æŒ‰ć›Ÿç‰‡ćźžé™…ć€§ć°ç­‰æŻ”çŒ©æ”Ÿć›Ÿç‰‡ćźœćșŠć€ŒïŒŒćŠ‚æžœæČĄæœ‰æŒ‡ćźšé«˜ćșŠïŒˆheightć€Œäžș"auto"ïŒ‰ćˆ™è‡ȘćŠšçŒ©æ”Ÿć›Ÿç‰‡è‡łćŻćźŒæ•Žæ˜Ÿç€ș。 + * é»˜èź€ć€Œäžș"auto"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + width?: string; + /** + * ć›Ÿç‰‡ćž‚ç›ŽćŻč霐æ–čćŒ + * ä»…ćœšć›Ÿç‰‡æ˜Ÿç€ș的高ćșŠäžŽć›Ÿç‰‡èœźæ’­æŽ§ä»¶ćźœćșŠäžäž€è‡Žæ—¶æœ‰æ•ˆïŒŒćŻć–ć€ŒïŒš + * "top" - ć›Ÿç‰‡ćœšèœźæ’­æŽ§ä»¶äž­ćž‚ç›Žć±…éĄ¶ćŻč霐 + * "middle" - ć›Ÿç‰‡ćœšèœźæ’­æŽ§ä»¶äž­ćž‚ç›Žć±…äž­ćŻč霐 + * "bottom" - ć›Ÿç‰‡ćœšèœźæ’­æŽ§ä»¶äž­ćž‚ç›Žć±…ćș•ćŻčéœă€‚ + * é»˜èź€ć€Œäžș"middle"。 + * - top: ć›Ÿç‰‡ćœšèœźæ’­æŽ§ä»¶äž­ćž‚ç›Žć±…éĄ¶ćŻč霐 + * - middle: ć›Ÿç‰‡ćœšèœźæ’­æŽ§ä»¶äž­ćž‚ç›Žć±…äž­ćŻč霐 + * - bottom: ć›Ÿç‰‡ćœšèœźæ’­æŽ§ä»¶äž­ćž‚ç›Žć±…ćș•ćŻč霐 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + verticalAlign?: 'top' | 'middle' | 'bottom'; +} + +/** + * èŸ“ć…„æĄ†æ ·ćŒ + * 甹äșŽćźšäč‰èŸ“ć…„æĄ†çš„æ˜Ÿç€șæ ·ćŒïŒŒćŠ‚ć­—äœ“ć€§ć°ïŒŒæç€ș憅ćźčç­‰äżĄæŻă€‚ + * èŸ“ć…„æ–‡æœŹć†…ćźčćœšæŒ‡ćźšćŒșćŸŸæ°Žćčłć±…ć·ŠïŒŒćž‚ç›Žć±…äž­æ˜Ÿç€ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjInputStyles { + /** + * èŸ“ć…„æĄ†ç±»ćž‹ + * ćŻć–ć€ŒïŒš + * "email" - é‚źçź±ćœ°ć€èŸ“ć…„æĄ†ïŒ› + * "number" - æ•°ć­—èŸ“ć…„æĄ†ïŒ› + * "search" - æœçŽąæ–‡æœŹèŸ“ć…„æĄ†ïŒ› + * "tel" - ç””èŻć·ç èŸ“ć…„æĄ†ïŒ› + * "text" - æ™źé€šæ–‡æœŹèŸ“ć…„æĄ†ïŒ› + * "url" - URLćœ°ć€èŸ“ć…„æĄ†ă€‚ + * é»˜èź€äžștextïŒˆćłæ™źé€šæ–‡æœŹèŸ“ć…„æĄ†ïŒ‰ă€‚ + * - email: é‚źçź±ćœ°ć€èŸ“ć…„æĄ† + * - number: æ•°ć­—èŸ“ć…„æĄ† + * - search: æœçŽąæ–‡æœŹèŸ“ć…„æĄ† + * - tel: ç””èŻć·ç èŸ“ć…„æĄ† + * - text: æ™źé€šæ–‡æœŹèŸ“ć…„æĄ† + * - url: URLćœ°ć€èŸ“ć…„æĄ† + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + type?: 'email' | 'number' | 'search' | 'tel' | 'text' | 'url'; + /** + * èŸ“ć…„æĄ†çš„æç€șæ–‡æœŹ + * ćœ“ç”šæˆ·æœȘèŸ“ć…„ć†…ćźč时星ç€șćœšçŒ–èŸ‘æĄ†äž­ïŒˆç°è‰Čæ–‡ć­—ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + placeholder?: string; + /** + * èŸ“ć…„æĄ†çš„ć­—äœ“ć€§ć° + * ćŻć–ć€ŒïŒšć­—äœ“é«˜ćșŠćƒçŽ ć€ŒïŒŒæ•°ć­—ćŠ "px"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"12px"。 + * é»˜èź€ć€Œäžș"16px"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + fontSize?: string; + /** + * èŸ“ć…„æĄ†çš„èŸčæĄ†éąœè‰Č + * ćŻć–ć€ŒïŒš "#RRGGBB"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"#FF0000"èĄšç€șçșąè‰ČèŸčæĄ†ă€‚é»˜èź€ć€Œäžș"#000000"黑è‰ČïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + borderColor?: string; + /** + * èŸ“ć…„æĄ†èŸčæĄ†ćœ†è§’ćŠćŸ„ + * ćŻć–ć€ŒïŒšćœ†è§’ćŠćŸ„ćƒçŽ ć€ŒïŒŒæ•°ć­—ćŠ "px"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"6px"。 + * é»˜èź€ć€Œäžș"0px"èŸčæĄ†æ— ćœ†è§’ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + borderRadius?: string; + /** + * èŸ“ć…„æĄ†çš„èŸčæĄ†ćźœćșŠ + * ćŻć–ć€ŒïŒšćƒçŽ ć€ŒïŒŒæ•°ć­—ćŠ "px"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"2px"。 é»˜èź€ć€Œäžș"1px"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + borderWidth?: string; + /** + * èŸ“ć…„æĄ†ćźŒæˆèŸ“ć…„äș‹ä»¶ + * ćŒčć‡șèœŻé”źç›˜ćźŒæˆèŸ“ć…„ćŽïŒŒç‚čć‡»èœŻé”źç›˜äžŠçš„â€œćźŒæˆâ€ă€â€œć‰ćŸ€â€æŒ‰é’źæ—¶è§Šć‘ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + onComplete?: (result: any) => void; + /** + * èŸ“ć…„æĄ†èŽ·ć–ç„Šç‚čäș‹ä»¶ + * ćœ“çŒ–èŸ‘æĄ†èŽ·ć–ç„Šç‚čæ—¶è§Šć‘。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + onFocus?: (result: any) => void; + /** + * èŸ“ć…„æĄ†ć€±ćŽ»ç„Šç‚čäș‹ä»¶ + * ćœ“çŒ–èŸ‘æĄ†ć€±ćŽ»ç„Šç‚čæ—¶è§Šć‘。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + onBlur?: (result: any) => void; +} + +/** + * ćŒșćŸŸäżĄæŻćŻčè±Ą + * ćŒ…æ‹Źäœçœźă€ć€§ć°ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjRect { + /** + * ćŒșćŸŸć·ŠäžŠè§’çš„ćž‚ç›Žćç§»é‡ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽäœœç”šćŻčè±Ąçš„é«˜ćșŠïŒ› + * è‡ȘćŠšèźĄçź—ïŒŒćŠ‚"auto",æ čæźheightć€Œè‡ȘćŠšèźĄçź—ïŒŒç›žćŻčäșŽäœœç”šćŻčè±Ąćž‚ç›Žć±…äž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + top?: string; + /** + * ćŒșćŸŸć·ŠäžŠè§’çš„æ°Žćčłćç§»é‡ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽäœœç”šćŻčè±Ąçš„ćźœćșŠïŒ› + * è‡ȘćŠšèźĄçź—ïŒŒćŠ‚"auto",æ čæźwidthć€Œè‡ȘćŠšèźĄçź—ïŒŒç›žćŻčäșŽäœœç”šćŻčè±Ąæ°Žćčłć±…䞭。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + left?: string; + /** + * ćŒșćŸŸçš„ćźœćșŠ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽäœœç”šćŻčè±Ąçš„ćźœćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + width?: string; + /** + * ćŒșćŸŸçš„é«˜ćșŠ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽäœœç”šćŻčè±Ąçš„é«˜ćșŠă€‚ + * 憅ćźčè‡Ș适ćș”ïŒŒćŠ‚"wrap_content"æ čæźć†…ćźčèźĄçź—é«˜ćșŠïŒˆćŠ‚è°ƒç”šdrawTextç»˜ćˆ¶æ–‡æœŹæ—¶æ”ŻæŒïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + height?: string; +} + +/** + * 绘戶ćŒșćŸŸæ ·ćŒćŻčè±Ą + * 甹äșŽćźšäč‰çŸ©ćœąćŒșćŸŸçš„æ˜Ÿç€șæ ·ćŒïŒŒćŠ‚ç©ș濃/ćźžćżƒæ ·ćŒă€ćœ†è§’ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjRectStyles { + /** + * ç»˜ćˆ¶éąœè‰Č + * çŸ©ćœąćĄ«ć……ćŒș柟的鱜è‰ČïŒŒćŻć–ć€ŒïŒš + * "#RRGGBB"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"#FF0000"èĄšç€ș绘戶çșąè‰ČćŒșćŸŸïŒ› + * "rgba(R,G,B,A)"ïŒŒć…¶äž­R/G/Bćˆ†ćˆ«ä»ŁèĄšçșąè‰Čć€Œ/绿è‰Čć€Œ/蓝è‰Čć€ŒïŒŒæ­Łæ•Žæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-255Aäžș透明ćșŠïŒŒæ”źç‚čæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-10äžșć…šé€æ˜ŽïŒŒ1äžșäžé€æ˜ŽïŒ‰ïŒŒćŠ‚"rgba(255,0,0,0.5)"ïŒŒèĄšç€șçșąè‰ČćŠé€æ˜Žă€‚ + * é»˜èź€ć€Œäžș"#FFFFFF"癜è‰ČïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + color?: string; + /** + * çŸ©ćœąćŒșćŸŸçš„ćœ†è§’ćŠćŸ„ + * ćŻć–ć€ŒïŒšćœ†è§’ćŠćŸ„ćƒçŽ ć€ŒïŒŒæ•°ć­—ćŠ "px"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"6px"。 + * é»˜èź€ć€Œäžș"0px"ïŒˆçŸ©ćœąæ— ćœ†è§’ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + radius?: string; + /** + * çŸ©ćœąèŸčæĄ†éąœè‰Č + * ç»˜ćˆ¶çŸ©ćœąèŸčæĄ†çš„éąœè‰ČïŒŒćŻć–ć€ŒïŒš + * "#RRGGBB"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"#FF0000"èĄšç€ș绘戶çșąè‰ČćŒșćŸŸïŒ› + * "rgba(R,G,B,A)"ïŒŒć…¶äž­R/G/Bćˆ†ćˆ«ä»ŁèĄšçșąè‰Čć€Œ/绿è‰Čć€Œ/蓝è‰Čć€ŒïŒŒæ­Łæ•Žæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-255Aäžș透明ćșŠïŒŒæ”źç‚čæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-10äžșć…šé€æ˜ŽïŒŒ1äžșäžé€æ˜ŽïŒ‰ïŒŒćŠ‚"rgba(255,0,0,0.5)"ïŒŒèĄšç€șçșąè‰ČćŠé€æ˜Žă€‚ + * é»˜èź€ć€ŒäžșçŸ©ćœąćĄ«ć……ćŒș柟鱜è‰Čcolorć±žæ€§ć€ŒïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + borderColor?: string; + /** + * çŸ©ćœąèŸčæĄ†ćźœćșŠ + * ćŻć–ć€ŒïŒšćƒçŽ ć€ŒïŒŒæ•°ć­—ćŠ "px"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"2px"。 + * é»˜èź€ć€Œäžș"0px"无èŸčæĄ†ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + borderWidth?: string; +} + +/** + * ćŻŒæ–‡æœŹæ ·ćŒ + * 甹äșŽćźšäč‰ćŻŒæ–‡æœŹäœżç”šçš„é»˜èź€äœżç”šçš„ć­—äœ“ćç§°ă€ć­—äœ“æ–‡ä»¶è·ŻćŸ„ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjRichTextStyles { + /** + * ćŻŒæ–‡æœŹć†…ćźč的氎ćčłćŻč霐æ–čćŒ + * ćŻčæ•Žäœ“ć†…ćźčæœ‰æ•ˆïŒŒæ— æł•ć•ç‹ŹæŽ§ćˆ¶æŻèĄŒçš„ć†…ćźč。 + * ćŻć–ć€ŒïŒš + * "left"-ć­—äœ“ćœšæŒ‡ćźšçš„ćŒșćŸŸäž­æ°Žćčłć±…ć·ŠćŻč霐 + * "center"-ć­—äœ“ćœšæŒ‡ćźšçš„ćŒșćŸŸäž­æ°Žćčłć±…äž­ćŻč霐 + * "right"-ć­—äœ“ćœšæŒ‡ćźšçš„ćŒșćŸŸäž­æ°Žćčłć±…揳ćŻčéœă€‚ + * é»˜èź€ć€Œäžș"left"。 + * - left: ćŻŒæ–‡æœŹć†…ćźčæ°Žćčłć±…ć·ŠćŻč霐 + * - center: ćŻŒæ–‡æœŹć†…ćźčæ°Žćčłć±…äž­ćŻč霐 + * - right: ćŻŒæ–‡æœŹć†…ćźčæ°Žćčłć±…揳ćŻč霐 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + align?: 'left' | 'center' | 'right'; + /** + * ćŻŒæ–‡æœŹé»˜èź€äœżç”šçš„ć­—äœ“ćç§° + * äŸ‹ćŠ‚"Times New Roman" ćŠ‚æžœæŒ‡ćźšćç§°çš„ć­—äœ“äžć­˜ćœšïŒŒćˆ™äœżç”šçł»ç»Ÿé»˜èź€ć­—äœ“ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + family?: string; + /** + * ćŻŒæ–‡æœŹé»˜èź€äœżç”šçš„ć­—äœ“æ–‡ä»¶è·ŻćŸ„ + * ćŠ èœœć­—äœ“æ–‡ä»¶è·ŻćŸ„ïŒŒćż…éĄ»äžșæœŹćœ°è·ŻćŸ„ïŒŒćŠ‚æžœæŒ‡ćźšçš„æ–‡ä»¶è·ŻćŸ„æ— æ•ˆïŒŒćˆ™äœżç”šçł»ç»Ÿé»˜èź€ć­—äœ“ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + fontSrc?: string; + /** + * ç‚č懻äș‹ä»¶ć›žè°ƒć‡œæ•° + * ćŠ‚æžœèźŸçœźæ­€ć±žæ€§ïŒŒćˆ™èĄšç€ș拊æˆȘ所有RichText侊的ç‚č懻äș‹ä»¶ïŒˆäžé€äŒ äș‹ä»¶ïŒ‰ă€‚ + * ćŠ‚æžœæČĄæœ‰èźŸçœźæ­€ć±žæ€§ïŒŒćˆ™ä»…拊æˆȘæ“äœœćŒ…ć«onclickć±žæ€§çš„a/img标筟的ç‚č懻äș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + onClick?: (result: any) => void; +} + +/** + * ćŒșćŸŸäżĄæŻćŻčè±Ą + * ćŒ…æ‹Źäœçœźă€ć€§ć°ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjPosition { + /** + * ćŒșćŸŸéĄ¶éƒšç›žćŻčäșŽäœœç”šćŻčè±ĄïŒˆæˆ–ćźčć™šïŒ‰ć‘äž‹çš„ćç§»é‡ + * ćŻć–ć€ŒïŒšćƒçŽ ć€ŒïŒŒćŠ‚"100px"ïŒ›ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽäœœç”šćŻčè±ĄïŒˆæˆ–ćźčć™šïŒ‰çš„é«˜ćșŠïŒ› + * è‡ȘćŠšèźĄçź—ïŒŒćŠ‚"auto",æ čæźheightć€Œè‡ȘćŠšèźĄçź—ïŒŒç›žćŻčäșŽäœœç”šćŻčè±ĄïŒˆæˆ–ćźčć™šïŒ‰ćž‚ç›Žć±…äž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + top?: string; + /** + * ćŒșćŸŸć·ŠäŸ§ç›žćŻčäșŽäœœç”šćŻčè±ĄïŒˆæˆ–ćźčć™šïŒ‰ć‘ćłçš„ćç§»é‡ + * ćŻć–ć€ŒïŒšćƒçŽ ć€ŒïŒŒćŠ‚"100px"ïŒ›ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽäœœç”šćŻčè±ĄïŒˆæˆ–ćźčć™šïŒ‰çš„ćźœćșŠïŒ› + * è‡ȘćŠšèźĄçź—ïŒŒćŠ‚"auto",æ čæźwidthć€Œè‡ȘćŠšèźĄçź—ïŒŒç›žćŻčäșŽäœœç”šćŻčè±ĄïŒˆæˆ–ćźčć™šïŒ‰æ°Žćčłć±…䞭。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + left?: string; + /** + * ćŒșćŸŸçš„ćźœćșŠ + * ćŻć–ć€ŒïŒšćƒçŽ ć€ŒïŒŒćŠ‚"100px";ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽäœœç”šćŻčè±ĄïŒˆæˆ–ćźčć™šïŒ‰çš„ćźœćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + width?: string; + /** + * ćŒșćŸŸçš„é«˜ćșŠ + * ćŻć–ć€ŒïŒšćƒçŽ ć€ŒïŒŒćŠ‚"100px";ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽäœœç”šćŻčè±ĄïŒˆæˆ–ćźčć™šïŒ‰çš„é«˜ćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + height?: string; + /** + * ćŒș㟟ćș•郚盞ćŻčäșŽäœœç”šćŻčè±ĄïŒˆæˆ–ćźčć™šïŒ‰ć‘äžŠçš„ćç§»é‡ + * ćŻć–ć€ŒïŒšćƒçŽ ć€ŒïŒŒćŠ‚"100px";ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽäœœç”šćŻčè±ĄïŒˆæˆ–ćźčć™šïŒ‰çš„é«˜ćșŠă€‚ + * ćœ“èźŸçœźäș†top撌heightć€Œæ—¶ïŒŒćżœç•„æ­€ć±žæ€§ć€ŒïŒ› + * ćœ“æœȘèźŸçœźtopć€Œæ—¶ïŒŒćŻé€šèż‡bottomć±žæ€§ć€Œæ„çĄźćźšćŒșćŸŸçš„ćž‚ç›ŽäœçœźïŒ› + * ćœ“æœȘèźŸçœźheightć€Œæ—¶ïŒŒćŻé€šèż‡top撌bottomć±žæ€§ć€Œæ„çĄźćźšćŒșćŸŸçš„é«˜ćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + bottom?: string; + /** + * ćŒșćŸŸćłäŸ§ç›žćŻčäșŽäœœç”šćŻčè±ĄïŒˆæˆ–ćźčć™šïŒ‰ć‘ć·Šçš„ćç§»é‡ + * ćŻć–ć€ŒïŒšćƒçŽ ć€ŒïŒŒćŠ‚"100px";ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽäœœç”šćŻčè±ĄïŒˆæˆ–ćźčć™šïŒ‰çš„ćźœćșŠă€‚ + * ćœ“èźŸçœźäș†left撌widthć€Œæ—¶ïŒŒćżœç•„æ­€ć±žæ€§ć€ŒïŒ› + * ćœ“æœȘèźŸçœźleftć€Œæ—¶ïŒŒćŻé€šèż‡rightć±žæ€§ć€Œæ„çĄźćźšćŒșćŸŸçš„æ°ŽćčłäœçœźïŒ› + * ćœ“æœȘèźŸçœźwidthć€Œæ—¶ïŒŒćŻé€šèż‡left撌rightć±žæ€§ć€Œæ„çĄźćźšćŒșćŸŸçš„ćźœćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + right?: string; +} + +/** + * ç»˜ćˆ¶æ–‡æœŹæ ·ćŒćŻčè±Ą + * 甹äșŽćźšä艿–‡æœŹçš„æ˜Ÿç€șæ ·ćŒïŒŒćŠ‚ć­—äœ“ć€§ć°ă€ć­—äœ“éąœè‰Čă€ć­—äœ“çČ—ç»†ă€ć­—äœ“æ ·ćŒă€ć­—äœ“ćç§°ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjTextStyles { + /** + * æ°ŽćčłćŻč霐æ–čćŒ + * ćŻć–ć€ŒïŒš + * "left"-ć­—äœ“ćœšæŒ‡ćźšçš„ćŒșćŸŸäž­æ°Žćčłć±…ć·ŠćŻč霐 + * "center"-ć­—äœ“ćœšæŒ‡ćźšçš„ćŒșćŸŸäž­æ°Žćčłć±…äž­ćŻč霐 + * "right"-ć­—äœ“ćœšæŒ‡ćźšçš„ćŒșćŸŸäž­æ°Žćčłć±…揳ćŻčéœă€‚ + * é»˜èź€ć€Œäžș"center"。 + * - left: ć­—äœ“ćœšæŒ‡ćźšçš„ćŒșćŸŸäž­æ°Žćčłć±…ć·ŠćŻč霐 + * - center: ć­—äœ“ćœšæŒ‡ćźšçš„ćŒșćŸŸäž­æ°Žćčłć±…äž­ćŻč霐 + * - right: ć­—äœ“ćœšæŒ‡ćźšçš„ćŒșćŸŸäž­æ°Žćčłć±…揳ćŻč霐 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + align?: 'left' | 'center' | 'right'; + /** + * ć­—äœ“éąœè‰Č + * ćŻć–ć€ŒïŒš + * "#RRGGBB"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"#FF0000"èĄšç€ș绘戶çșąè‰ČćŒșćŸŸïŒ› + * "rgba(R,G,B,A)"ïŒŒć…¶äž­R/G/Bćˆ†ćˆ«ä»ŁèĄšçșąè‰Čć€Œ/绿è‰Čć€Œ/蓝è‰Čć€ŒïŒŒæ­Łæ•Žæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-255Aäžș透明ćșŠïŒŒæ”źç‚čæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-10äžșć…šé€æ˜ŽïŒŒ1äžșäžé€æ˜ŽïŒ‰ïŒŒćŠ‚"rgba(255,0,0,0.5)"ïŒŒèĄšç€șçșąè‰ČćŠé€æ˜Žă€‚ + * é»˜èź€ć€Œäžș"#000000"黑è‰ČïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + color?: string; + /** + * æ–‡æœŹèŁ…é„° + * ćŻć–ć€ŒïŒš + * "none" - æ— èŁ…é„°æ•ˆæžœïŒ› + * "underline" - æ–‡æœŹćžŠäž‹ćˆ’çșżæ•ˆæžœïŒ› + * "line-through" - æ–‡æœŹćžŠèŽŻç©żçșżïŒˆćˆ é™€çșżïŒ‰æ•ˆæžœă€‚ + * é»˜èź€ć€Œäžș"none"。 + * - none: + * æ— èŁ…é„°æ•ˆæžœ + * + * - underline: + * æ–‡æœŹćžŠäž‹ćˆ’çșżæ•ˆæžœ + * + * - line-through: + * æ–‡æœŹćžŠèŽŻç©żçșżïŒˆćˆ é™€çșżïŒ‰æ•ˆæžœ + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + decoration?: 'none' | 'underline' | 'line-through'; + /** + * ć­—äœ“ćç§° + * äŸ‹ćŠ‚"Times New Roman" ćŠ‚æžœæŒ‡ćźšćç§°çš„ć­—äœ“äžć­˜ćœšïŒŒćˆ™äœżç”šé»˜èź€ć­—äœ“ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + family?: string; + /** + * ć­—äœ“æ–‡ä»¶è·ŻćŸ„ + * ćŠ èœœć­—äœ“æ–‡ä»¶è·ŻćŸ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + fontSrc?: string; + /** + * æ–‡æœŹçš„èĄŒé—Žè· + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px"ïŒ›ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽć­—䜓的高ćșŠïŒˆsizeć±žæ€§ïŒ‰ïŒ› + * é»˜èź€ć€Œäžș"20%"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + lineSpacing?: string; + /** + * ć­—äœ“çš„èŸč距 + * 甹äșŽèźŸçœźć­—äœ“ćœšç»˜ćˆ¶ç›źæ ‡ćŒș柟曛äžȘæ–čć‘ïŒˆtop/right/bottom/left的èŸčè·ïŒŒćŻć–ć€ŒïŒšćƒçŽ ć€ŒïŒŒćŠ‚"10px"ïŒ›ç™Ÿćˆ†æŻ”ïŒŒç›žćŻčäșŽç»˜ćˆ¶ç›źæ ‡ćŒșćŸŸïŒŒćŠ‚"5%" + * é»˜èź€ć€Œäžș"0px"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + margin?: string; + /** + * æ–‡æœŹć†…ćźč超ć‡ș星ç€șćŒșćŸŸæ—¶ć€„ç†æ–čćŒ + * ćŻć–ć€ŒïŒš + * "clip" - 超ć‡ș星ç€șćŒșćŸŸæ—¶ć†…ćźčèŁć‰Ș + * "ellipsis" - 超ć‡ș星ç€șćŒșćŸŸæ—¶ć°Ÿéƒšæ˜Ÿç€șçœç•„æ ‡èź°ïŒˆ...ïŒ‰ă€‚ + * é»˜èź€ć€Œäžș"clip"。 + * - clip: + * + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + overflow?: 'clip'; + /** + * ć­—äœ“ć€§ć° + * ćŻć–ć€ŒïŒšć­—äœ“é«˜ćșŠćƒçŽ ć€ŒïŒŒæ•°ć­—ćŠ "px"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"12px"。 + * é»˜èź€ć€Œäžș"16px"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + size?: string; + /** + * ć­—äœ“æ ·ćŒ + * ćŻć–ć€ŒïŒš"normal" - æ­Łćžžć­—äœ“æ ·ćŒïŒ›"italic" - æ–œäœ“æ ·ćŒă€‚é»˜èź€ć€Œäžș"normal"。 + * - normal: æ­Łćžžć­—äœ“æ ·ćŒ + * - italic: æ–œäœ“æ ·ćŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + style?: 'normal' | 'italic'; + /** + * 枂目ćŻč霐æ–čćŒ + * æ–‡æœŹć†…ćźčćœšæŒ‡ćźšç»˜ćˆ¶ćŒș柟侭的枂目ćŻč霐æ–čćŒïŒŒćŻć–ć€ŒïŒš + * "top" - 枂盎汅饶ćŻč霐 + * "middle" - 枂盎汅䞭ćŻč霐 + * "bottom" - 枂盎汅ćș•ćŻčéœă€‚ + * é»˜èź€ć€Œäžș"middle"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + verticalAlign?: string; + /** + * ć­—äœ“çȗ细 + * ćŻć–ć€ŒïŒš"normal" - æ™źé€šć­—äœ“ïŒ›"bold" - çČ—ć­—äœ“ă€‚é»˜èź€ć€Œäžș"normal"。 + * - normal: æ™źé€šć­—äœ“ + * - bold: çČ—ć­—äœ“ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + weight?: 'normal' | 'bold'; + /** + * æ–‡æœŹæąèĄŒæšĄćŒ + * ćŻć–ć€ŒïŒš + * "nowrap" - äžæąèĄŒïŒŒć°†æ‰€æœ‰æ–‡æœŹćœšäž€èĄŒäž­ç»˜ćˆ¶ïŒŒćżœç•„æąèĄŒçŹŠ("\n") + * "normal" - è‡ȘćŠšæąèĄŒïŒŒćœ“æŒ‡ćźšçš„ćźœćșŠæ— æł•ç»˜ćˆ¶æ‰€æœ‰æ–‡æœŹæ—¶è‡ȘćŠšæąèĄŒç»˜ćˆ¶ïŒŒçą°ćˆ°'\n'ć­—çŹŠæ—¶ćŒșćˆ¶æąèĄŒă€‚ + * é»˜èź€ć€Œäžș"nowrap"。 + * - nowrap: + * äžæąèĄŒïŒŒć°†æ‰€æœ‰æ–‡æœŹćœšäž€èĄŒäž­ç»˜ćˆ¶ïŒŒćżœç•„æąèĄŒçŹŠ("\n") + * + * - normal: + * è‡ȘćŠšæąèĄŒïŒŒćœ“æŒ‡ćźšçš„ćźœćșŠæ— æł•ç»˜ćˆ¶æ‰€æœ‰æ–‡æœŹæ—¶è‡ȘćŠšæąèĄŒç»˜ćˆ¶ïŒŒçą°ćˆ°'\n'ć­—çŹŠæ—¶ćŒșćˆ¶æąèĄŒ + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + whiteSpace?: 'nowrap' | 'normal'; +} + +/** + * ćŽŸç”ŸæŽ§ä»¶ćŻčè±Ą + * ćŽŸç”ŸæŽ§ä»¶ćŻčè±ĄćŻç”šäșŽćœšć±ćč•äžŠç»˜ćˆ¶ć›Ÿç‰‡æˆ–æ–‡æœŹć†…ćźčïŒŒćœ“æŽ§ä»¶äžć†äœżç”šæ—¶éœ€èŠè°ƒç”šcloseæ–čæł•é”€æŻæŽ§ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjView { + /** + * ViewćŻčè±Ąçš„æ ‡èŻ† + * 朹戛ć»șćŽŸç”ŸæŽ§ä»¶ViewćŻčè±Ąæ—¶èźŸçœźïŒŒćŠ‚æžœæČĄæœ‰èźŸçœźæ ‡èŻ†ïŒŒæ­€ć±žæ€§ć€Œäžșnull。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + id?: string; + /** + * 静态æ–čæł•ïŒŒćŒ€ć§‹ćŽŸç”ŸćŠšç”» + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + startAnimation(options?: PlusNativeObjAnimationOptions, view?: PlusNativeObjAnimationViewStyles, otherview?: PlusNativeObjAnimationViewStyles, callback?: Function): void; + /** + * 静态æ–čæł•ïŒŒć…łé—­ćŽŸç”ŸćŠšç”»çȘ—揣 + * é€šèż‡plus.nativeObj.View.startAnimationæ–čæł•ćŒ€ć§‹ćŽŸç”ŸćŠšç”»ćŽïŒŒäžäŒšè‡ȘćŠšć…łé—­ćŽŸç”ŸćŠšç”»çȘ—揣ćŻčè±ĄïŒŒéœ€èŠè°ƒç”šæ­€æ–čæł•ć…łé—­ćŽŸç”ŸćŠšç”»ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + clearAnimation(type?: string): void; + /** + * 静态æ–čæł•ïŒŒèŽ·ć–æŒ‡ćźšæ ‡èŻ†çš„View控件ćŻčè±Ą + * ćŠ‚æžœć­˜ćœšć€šäžȘæŒ‡ćźšidæ ‡èŻ†çš„ViewćŻčè±ĄïŒŒćˆ™èż”ć›žçŹŹäž€äžȘ戛ć»ș的View控件ćŻčè±Ąă€‚ + * ćŠ‚æžœäžć­˜ćœšæŒ‡ćźšidæ ‡èŻ†çš„ViewćŻčè±ĄïŒŒćˆ™èż”ć›žnull。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + getViewById(id?: string): PlusNativeObjView; + /** + * æ·»ćŠ äș‹ä»¶ç›‘搏晚 + * 搑ViewæŽ§ä»¶æ·»ćŠ äș‹ä»¶ç›‘ćŹć™šïŒŒćœ“æŒ‡ćźšçš„äș‹ä»¶ć‘ç”Ÿæ—¶ïŒŒć°†è§Šć‘listenerć‡œæ•°çš„æ‰§èĄŒă€‚ + * ćŻć€šæŹĄè°ƒç”šæ­€æ–čæł•搑Webviewæ·»ćŠ ć€šäžȘç›‘ćŹć™šïŒŒćœ“ç›‘ćŹçš„äș‹ä»¶ć‘ç”Ÿæ—¶ïŒŒć°†æŒ‰ç…§æ·»ćŠ çš„ć…ˆćŽéĄșćșæ‰§èĄŒă€‚ + * ćŻé€šèż‡setTouchEventRectæ–čæł•æŒ‡ćźšç›‘ćŹè§Šć±æ“äœœçš„ćŒș柟。 + * æłšæ„ïŒšé»˜èź€View控件拊æˆȘć€„ç†è§Šć±äș‹ä»¶ïŒŒćŻè°ƒç”šview.interceptTouchEvent(false)æ”č揘äžș䞍拊æˆȘć€„ç†è§Šć±äș‹ä»¶ïŒˆé€äŒ ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + addEventListener(event?: PlusNativeObjViewEvents, listener?: (result: any) => void, capture?: boolean): void; + /** + * ViewæŽ§ä»¶ć†…ćźč抚画 + * ćŠšç”»ćŽćŻèƒœäŒšćŻŒè‡ŽView控件星ç€ș憅ćźčæ”čć˜ïŒŒćŻé€šèż‡è°ƒç”šrestoreæ–čæł•æąć€ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + animate(options?: PlusNativeObjViewAnimationOptions, callback?: Function): void; + /** + * 慳闭View控件 + * 释攟View控件蔄æșïŒŒViewćŻčè±ĄäžćŻć†æ“äœœïŒŒćŠ‚æžœView控件ć·Č经星ç€ș戙è‡ȘćŠšéšè—ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + close(): void; + /** + * æž…ç©șçŸ©ćœąćŒș㟟 + * æž…é™€æŒ‡ćźšçŸ©ćœąćŒș柟憅ćźč透明星ç€șć…¶ćŽéąçš„ć†…ćźč。 + * ćŻć€šæŹĄè°ƒç”šèźŸçœźć€šäžȘćŒșćŸŸé€æ˜Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + clearRect(position?: PlusNativeObjPosition, id?: string): void; + /** + * ç»˜ćˆ¶ć†…ćźč + * ćœšćœ“ć‰View控件äč‹äžŠç»˜ćˆ¶æŒ‡ćźšçš„憅ćźčïŒŒćŻäž€æŹĄæŒ‡ćźšç»˜ćˆ¶ć€šäžȘć…ƒçŽ ïŒŒç»˜ćˆ¶ć…ƒçŽ ćŻä»„æ˜Żć›Ÿç‰‡/çŸ©ćœąćŒș㟟/æ–‡æœŹïŒŒ + * ćłć°†ć€šæŹĄè°ƒç”šdrawBitmap/drawRect/drawTextæ–čæł•ćˆćč¶è°ƒç”šäž€æŹĄdrawæ–čæł•æ„ćźžçŽ°ïŒŒ + * æŽšèäœżç”šdrawæ–čæł•æ„æ›żæąć€šæŹĄè°ƒç”šdrawBitmap/drawRect/drawText。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + draw(tags?: PlusNativeObj []): void; + /** + * ç»˜ćˆ¶ć›Ÿç‰‡ + * ćœšćœ“ć‰View控件äč‹äžŠç»˜ćˆ¶æŒ‡ćźšçš„ć›Ÿç‰‡ïŒŒćŠ‚æžœć›Ÿç‰‡æ— æ•ˆćˆ™äžćšä»»äœ•æ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + drawBitmap(src?: string, sprite?: PlusNativeObjPosition, position?: PlusNativeObjPosition, id?: string): void; + /** + * ç»˜ćˆ¶çŸ©ćœąćŒș㟟 + * ćœšćœ“ć‰View控件äč‹äžŠç»˜ćˆ¶æŒ‡ćźšéąœè‰Čçš„çŸ©ćœąćŒș柟。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + drawRect(styles?: PlusNativeObjRectStyles, position?: PlusNativeObjPosition, id?: string): void; + /** + * ç»˜ćˆ¶æ–‡æœŹ + * ćœšćœ“ć‰View控件äč‹äžŠç»˜ćˆ¶æŒ‡ćźšçš„æ–‡æœŹć†…ćźčïŒŒćŠ‚æžœæ–‡æœŹäžșç©șćˆ™äžćšä»»äœ•æ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + drawText(text?: string, position?: PlusNativeObjPosition, styles?: PlusNativeObjTextStyles, id?: string): void; + /** + * ç»˜ćˆ¶ćŻŒæ–‡æœŹ + * ćœšćœ“ć‰View控件äč‹äžŠç»˜ćˆ¶æŒ‡ćźšçš„æ–‡æœŹć†…ćźčïŒŒćŠ‚æžœæ–‡æœŹäžșç©șćˆ™äžćšä»»äœ•æ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + drawRichText(text?: string, position?: PlusNativeObjPosition, styles?: PlusNativeObjRichTextStyles, id?: string): void; + /** + * ç»˜ćˆ¶èŸ“ć…„æĄ† + * ćœšćœ“ć‰View控件äč‹äžŠç»˜ćˆ¶èŸ“ć…„æĄ†ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + drawInput(position?: PlusNativeObjPosition, styles?: PlusNativeObjInputStyles, id?: string): void; + /** + * èŽ·ć–çŒ–èŸ‘æĄ†çš„ç„Šç‚č状态 + * é€šèż‡idæŸ„æ‰Ÿćˆ°æŒ‡ćźšçš„çŒ–èŸ‘æĄ†ïŒŒèŽ·ć–ć…¶ç„Šç‚čçŠ¶æ€ă€‚ + * ćŠ‚æžœæŒ‡ćźšçš„idæ— æ•ˆćˆ™èż”ć›žnull。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + getInputFocusById(id?: string): boolean; + /** + * èŽ·ć–çŒ–èŸ‘æĄ†çš„ć†…ćźč + * é€šèż‡idæŸ„æ‰Ÿćˆ°æŒ‡ćźšçš„çŒ–èŸ‘æĄ†ïŒŒèŽ·ć–ć…¶èŸ“ć…„çš„ć­—çŹŠäžČ。 + * ćŠ‚æžœæŒ‡ćźšçš„idæ— æ•ˆćˆ™èż”ć›žnull。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + getInputValueById(id?: string): string; + /** + * é‡çœźview控件星ç€ș憅ćźč + * 枅陀调甚drawBitmap、drawTextæ–čæł•ç»˜ćˆ¶çš„ć†…ćźčïŒŒć°†ViewæŽ§ä»¶é‡çœźäžșç©ș憅ćźčïŒˆé€æ˜ŽäžćŻè§ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + reset(): void; + /** + * æąć€View控件星ç€ș憅ćźč + * æąć€è°ƒç”šanimateæ–čæł•æ”č揘ViewæŽ§ä»¶çš„ć†…ćźčïŒŒæ›Žæ–°è‡łćŠšç”»ć‰çš„ć†…ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + restore(): void; + /** + * 星ç€șView控件 + * 氆View控件星ç€șćˆ°ć±ćč•星ç€șćœšæ‰€æœ‰WebviewçȘ—揣äč‹äžŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + show(): void; + /** + * èźŸçœźçŒ–èŸ‘æĄ†çš„ç„Šç‚č状态 + * é€šèż‡idæŸ„æ‰Ÿćˆ°æŒ‡ćźšçš„çŒ–èŸ‘æĄ†ïŒŒćč¶èźŸçœźçŒ–èŸ‘æĄ†çš„ç„Šç‚čçŠ¶æ€ă€‚ + * ćŠ‚æžœæŒ‡ćźšçš„idæ— æ•ˆćˆ™æ“äœœæ— æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + setInputFocusById(id?: string, focusable?: boolean): string; + /** + * èźŸçœźViewæŽ§ä»¶çš„æ ·ćŒ + * ćŠšæ€æ›Žæ–°ViewæŽ§ä»¶æ ·ćŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + setStyle(styles?: PlusNativeObjViewStyles): void; + /** + * æŒ‡ćźšç›‘ćŹè§Šć±äș‹ä»¶ćŒș㟟 + * ćœ“è°ƒç”šaddEventListener监搬View控件äș‹ä»¶æ—¶ïŒŒćŻè°ƒç”šæ­€æ–čæł•限柚监搏äș‹ä»¶çš„ćŒșćŸŸïŒŒä»…ćœ“ç”šæˆ·è§Šć±æ“äœœćœšæŒ‡ćźšćŒșćŸŸæ—¶æ‰è§Šć‘ç›‘ćŹäș‹ä»¶ă€‚ + * 非限漚监搬äș‹ä»¶çš„ćŒșćŸŸćˆ™äžæ‹ŠæˆȘïŒŒé€äŒ ç»™ć…¶ćźƒçȘ—ćŁć€„ç†ă€‚ + * æłšæ„ïŒšæ­€æ“äœœèŠ†ç›–äč‹ć‰èźŸçœźçš„ćŒș柟。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + setTouchEventRect(rect?: PlusNativeObj []): void; + /** + * 隐藏View控件 + * 氆ViewæŽ§ä»¶ä»Žć±ćč•éšè—ïŒŒćŠ‚æžœView控件æœȘ星ç€șćˆ™äžćšä»»äœ•æ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + hide(): void; + /** + * æ˜ŻćŠæ‹ŠæˆȘViewæŽ§ä»¶çš„è§Šć±äș‹ä»¶ + * èźŸçœźäžș拊æˆȘ搎ViewæŽ§ä»¶äžŠçš„è§Šć±äș‹ä»¶äžć†äŒ é€’ïŒˆćłäžé€äŒ ïŒ‰ïŒŒćŠćˆ™è§Šć±äș‹ä»¶ć°†ç»§ç»­äŒ é€’ç»™ViewæŽ§ä»¶äž‹çš„ć…¶ćźƒçȘ—ćŁć€„ç†ïŒˆćłé€äŒ ïŒ‰ă€‚ + * æłšæ„ïŒšViewæŽ§ä»¶é»˜èź€æ‹ŠæˆȘè§Šć±äș‹ä»¶ïŒˆäžé€äŒ ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + interceptTouchEvent(intercept?: boolean): void; + /** + * èŽ·ć–View控件的星ç€ș状态 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + isVisible(): boolean; +} + +/** + * ViewæŽ§ä»¶ćŠšç”»ć‚æ•° + * æŒ‡ćźšćŠšç”»çš„ç±»ćž‹ă€æŒç»­æ—¶é—Žç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjViewAnimationOptions { + /** + * 抚画类枋 + * ćŻć–ć€ŒïŒš"shrink" - ä»ŽäžŠćˆ°äž‹ćˆ†ć—æ”¶çŒ©æž…é™€çȘ—ćŁćŠšç”»ă€‚ + * - shrink: ä»ŽäžŠćˆ°äž‹ćˆ†ć—æž…é™€ćŠšç”» + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + type?: 'shrink'; + /** + * ćŠšç”»æŒç»­æ—¶é—Ž + * ć•äœäžșæŻ«ç§’ïŒŒé»˜èź€ć€Œäžș200ms。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + duration?: number; + /** + * ćŠšç”»ćž§æ•° + * 濅饻äžș性äșŽ0çš„æ•Žæ•°ïŒŒé»˜èź€ć€Œäžș12。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + frames?: number; + /** + * ćŠšç”»äœœç”šćŒș㟟 + * æ”ŻæŒä»„äž‹ć±žæ€§ïŒš + * top - ćŒșćŸŸè·çŠ»æŽ§ä»¶éĄ¶éƒšçš„ćç§»é‡ïŒŒć±žæ€§ć€ŒćŻć–ćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ïŒŒç™Ÿćˆ†æŻ”ïŒˆćŠ‚"10%"盞ćŻčäșŽæŽ§ä»¶çš„é«˜ćșŠïŒ‰,é»˜èź€ć€Œäžș'0px' + * bottom - ćŒșćŸŸè·çŠ»æŽ§ä»¶ćș•éƒšçš„ćç§»é‡ïŒŒć±žæ€§ć€ŒćŻć–ćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ïŒŒç™Ÿćˆ†æŻ”ïŒˆćŠ‚"10%"盞ćŻčäșŽæŽ§ä»¶çš„é«˜ćșŠïŒ‰,é»˜èź€ć€Œäžș'0px' + * left - ćŒșćŸŸè·çŠ»æŽ§ä»¶ć·ŠäŸ§çš„ćç§»é‡ïŒŒć±žæ€§ć€ŒćŻć–ćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ïŒŒç™Ÿćˆ†æŻ”ïŒˆćŠ‚"10%"盞ćŻčäșŽæŽ§ä»¶çš„ćźœćșŠïŒ‰,é»˜èź€ć€Œäžș'0px' + * right - ćŒșćŸŸè·çŠ»æŽ§ä»¶ćłäŸ§çš„ćç§»é‡ïŒŒć±žæ€§ć€ŒćŻć–ćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ïŒŒç™Ÿćˆ†æŻ”ïŒˆćŠ‚"10%"盞ćŻčäșŽæŽ§ä»¶çš„ćźœćșŠïŒ‰,é»˜èź€ć€Œäžș'0px'。 + * 橂“{top:'44px',bottom:'48px'}”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + region?: PlusNativeObjRect; +} + +/** + * ViewæŽ§ä»¶ç»˜ćˆ¶ć…ƒçŽ ć‚æ•° + * æŒ‡ćźšç»˜ćˆ¶ć›Ÿç‰‡ă€çŸ©ćœąćŒșćŸŸă€æ–‡æœŹć†…ćźčç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjViewDrawTagStyles { + /** + * ç»˜ćˆ¶æ“äœœæ ‡èŻ† + * ćŻé€šèż‡viewćŻčè±Ąçš„drawBitmap/drawRect/drawText/clearRectæ–čæł•èż›èĄŒæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + id?: string; + /** + * ç»˜ćˆ¶æ“äœœç±»ćž‹ + * ćŻć–ć€ŒïŒš + * "img" - ç»˜ćˆ¶ć›Ÿç‰‡ïŒŒäžŽdrawBitmap操䜜䞀臎歀时id、src、position、spriteć±žæ€§ć€Œæœ‰æ•ˆïŒ› + * "rect" - ç»˜ćˆ¶çŸ©ćœąćŒșćŸŸïŒŒäžŽdrawRect操䜜䞀臎歀时id、color、position、rectStylesć±žæ€§ć€Œæœ‰æ•ˆïŒ› + * "font" - ç»˜ćˆ¶æ–‡æœŹć†…ćźč䞎drawText操䜜䞀臎歀时id、position、text、textStylesć±žæ€§ć€Œæœ‰æ•ˆïŒ› + * "richtext" - ç»˜ćˆ¶ćŻŒæ–‡æœŹć†…ćźč䞎drawRichText操䜜䞀臎歀时id、position、text、richTextStylesć±žæ€§ć€Œæœ‰æ•ˆïŒ› + * "input" - ç»˜ćˆ¶èŸ“ć…„æĄ†ć†…ćźč歀时id、position、inputStylesć±žæ€§ć€Œæœ‰æ•ˆă€‚ + * - img: ç»˜ćˆ¶ć›Ÿç‰‡ + * - rect: ç»˜ćˆ¶çŸ©ćœąćŒș㟟 + * - font: ç»˜ćˆ¶æ–‡æœŹć†…ćźč + * - richtext: ç»˜ćˆ¶ćŻŒæ–‡æœŹć†…ćźč + * - input: ç»˜ćˆ¶èŸ“ć…„æĄ†ć†…ćźč + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + tag?: 'img' | 'rect' | 'font' | 'richtext' | 'input'; + /** + * çŸ©ćœąćŒș柟鱜è‰Č + * äžæŽšèäœżç”šïŒˆæŽšèäœżç”šrectStylesïŒ‰ïŒŒćŻć–ć€ŒïŒš + * "#RRGGBB"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚çșąè‰Čäžș"#FF0000"。 + * "rgba(R,G,B,A)"ïŒŒć…¶äž­R/G/Bćˆ†ćˆ«ä»ŁèĄšçșąè‰Čć€Œ/绿è‰Čć€Œ/蓝è‰Čć€ŒïŒŒæ­Łæ•Žæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-255Aäžș透明ćșŠïŒŒæ”źç‚čæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-10äžșć…šé€æ˜ŽïŒŒ1äžșäžé€æ˜ŽïŒ‰ïŒŒćŠ‚"rgba(255,0,0,0.5)"ïŒŒèĄšç€șçșąè‰ČćŠé€æ˜Žă€‚ + * ćœ“tagć±žæ€§ć€Œäžș"rect"时有效甚äșŽæŒ‡ćźšçŸ©ćœąćŒș柟鱜è‰ČïŒŒé»˜èź€ć€Œäžș"#FFFFFF"癜è‰ČïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + color?: string; + /** + * ç»˜ćˆ¶èŸ“ć…„æĄ†çš„æ ·ćŒ + * ćœ“tagć±žæ€§ć€Œäžș"input"时有效甚äșŽæŒ‡ćźšç»˜ćˆ¶èŸ“ć…„æĄ†çš„æ ·ćŒă€ć€§ć°äœçœźç­‰äżĄæŻă€‚ïŒŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + inputStyles?: PlusNativeObjInputStyles; + /** + * ç»˜ćˆ¶ć†…ćźčćŒș㟟 + * ćœ“tagć±žæ€§ć€Œäžș"img"时甚äșŽæŒ‡ćźšç»˜ćˆ¶ć›Ÿç‰‡çš„ç›źæ ‡ćŒșćŸŸïŒ› + * ćœ“tagć±žæ€§ć€Œäžș"rect"时甚äșŽæŒ‡ćźšç»˜ćˆ¶çš„çŸ©ćœąćŒșćŸŸïŒ› + * ćœ“tagć±žæ€§ć€Œäžș"font"时甚äșŽæŒ‡ćźšç»˜ćˆ¶æ–‡æœŹçš„ç›źæ ‡ćŒșćŸŸïŒŒæ­€æ—¶heightć±žæ€§ć€Œæ”ŻæŒèźŸçœźäžș"wrap_content"ïŒŒèĄšç€șæ–‡æœŹé«˜ćșŠæ čæźć†…ćźčè‡ȘćŠšèźĄçź—ïŒŒæ­€æ—¶é€šèż‡topæ„ćźšäœæ–‡æœŹç»˜ćˆ¶çš„è”·ć§‹äœçœźă€‚ + * 盾ćŻčäșŽView控件的ćŒșćŸŸäżĄæŻïŒŒé»˜èź€ć€Œäžș{top:'0px',left:'0px',width:'100%',height:'100%'}。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + position?: PlusNativeObjPosition; + /** + * 绘戶ćŒșćŸŸçš„æ ·ćŒ + * ćœ“tagć±žæ€§ć€Œäžș"rect"时有效甚äșŽæŒ‡ćźšç»˜ćˆ¶ćŒșćŸŸçš„æ ·ćŒă€ćĄ«ć……éąœè‰Čă€ćœ†è§’ć€§ć°ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + rectStyles?: PlusNativeObjRectStyles; + /** + * ç»˜ćˆ¶çš„ć›Ÿç‰‡è”„æș + * ćœ“tagć±žæ€§ć€Œäžș"img"æ—¶æœ‰æ•ˆïŒŒćŻä»„æ˜Żć›Ÿç‰‡è”„æșè·ŻćŸ„ïŒˆć­—çŹŠäžČç±»ćž‹ïŒ‰æˆ–è€…ć›Ÿç‰‡ćŻčè±ĄïŒˆplus.nativeObj.BitmapćŻčè±ĄïŒ‰ă€‚ + * srcè·ŻćŸ„æ”ŻæŒgifć›Ÿç‰‡ïŒŒäœ†èźŸçœźçš„ć›Ÿç‰‡è·ŻćŸ„æ–‡ä»¶äœżç”š".gif"ćŽçŒ€æ—¶ćˆ™èź€äžșæ˜Żgifć›Ÿç‰‡ïŒŒćŠ‚"_www/loading.gif"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + src?: string; + /** + * ć›Ÿç‰‡æșçš„ç»˜ćˆ¶ćŒș㟟 + * ćœ“tagć±žæ€§ć€Œäžș"img"时有效甚äșŽæŒ‡ćźšć›Ÿç‰‡æșçš„ç»˜ćˆ¶ćŒșćŸŸïŒŒç›žćŻčäșŽć›Ÿç‰‡çš„ćŒșćŸŸäżĄæŻïŒŒé»˜èź€ć€Œäžș{top:'0px',left:'0px',width:'100%',height:'100%'}。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + sprite?: PlusNativeObjPosition; + /** + * ç»˜ćˆ¶çš„æ–‡æœŹć†…ćźč + * ćœ“tagć±žæ€§ć€Œäžș"font"时有效甚äșŽäżć­˜ç»˜ćˆ¶çš„æ–‡æœŹć†…ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + text?: string; + /** + * ç»˜ćˆ¶æ–‡æœŹçš„æ ·ćŒ + * ćœ“tagć±žæ€§ć€Œäžș"font"时有效甚äșŽæŒ‡ćźšç»˜ćˆ¶æ–‡æœŹć†…ćźčçš„ć­—äœ“ć€§ć°ă€ć­—äœ“éąœè‰Čă€ć­—äœ“ç±»ćž‹ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + textStyles?: PlusNativeObjTextStyles; + /** + * ç»˜ćˆ¶ćŻŒæ–‡æœŹçš„æ ·ćŒ + * ćœ“tagć±žæ€§ć€Œäžș"richtext"时有效甚äșŽæŒ‡ćźšç»˜ćˆ¶ćŻŒæ–‡æœŹć†…ćźčçš„é»˜èź€ć­—äœ“éąœè‰Čă€ć­—äœ“ç±»ćž‹ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + richTextStyles?: PlusNativeObjRichTextStyles; +} + +/** + * View控件äș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjViewEvents { + /** + * ćŒć‡»äș‹ä»¶ + * ćŒć‡»ć±ć蕿—¶è§Šć‘。 + * æłšæ„ïŒšćŠ‚æžœć°†ViewæŽ§ä»¶èźŸçœźäžș䞍拊æˆȘè§Šć±äș‹ä»¶ïŒˆview.interceptTouchEvent(false)ïŒ‰ćˆ™äžäŒšè§Šć‘æ­€äș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + doubleclick?: string; + /** + * ç‚č懻äș‹ä»¶ + * ćœ“æ‰‹æŒ‡ç‚čć‡»ć±ć蕿—¶è§Šć‘。 + * æłšæ„ïŒšćŠ‚æžœć°†ViewæŽ§ä»¶èźŸçœźäžș䞍拊æˆȘè§Šć±äș‹ä»¶ïŒˆview.interceptTouchEvent(false)ïŒ‰ćˆ™äžäŒšè§Šć‘æ­€äș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + click?: string; + /** + * ćŒ€ć§‹è§Šć±äș‹ä»¶ + * ćœ“æ‰‹æŒ‡è§Šæ‘žć±ć蕿—¶ć€™è§Šć‘。 + * æłšæ„ïŒšćŠ‚æžœć°†ViewæŽ§ä»¶èźŸçœźäžș䞍拊æˆȘè§Šć±äș‹ä»¶ïŒˆview.interceptTouchEvent(false)ïŒ‰ćˆ™äžäŒšè§Šć‘æ­€äș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + touchstart?: string; + /** + * è§Šæ‘žæ»‘ć±äș‹ä»¶ + * ćœ“æ‰‹æŒ‡ćœšć±ćč•äžŠæ»‘ćŠšçš„æ—¶ć€™èżžç»­ćœ°è§Šć‘ă€‚ + * æłšæ„ïŒšćŠ‚æžœć°†ViewæŽ§ä»¶èźŸçœźäžș䞍拊æˆȘè§Šć±äș‹ä»¶ïŒˆview.interceptTouchEvent(false)ïŒ‰ćˆ™äžäŒšè§Šć‘æ­€äș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + touchmove?: string; + /** + * ç»“æŸè§Šć±äș‹ä»¶ + * ćœ“æ‰‹æŒ‡ä»Žć±ćč•äžŠçŠ»ćŒ€çš„æ—¶ć€™è§Šć‘ă€‚ + * æłšæ„ïŒšćŠ‚æžœć°†ViewæŽ§ä»¶èźŸçœźäžș䞍拊æˆȘè§Šć±äș‹ä»¶ïŒˆview.interceptTouchEvent(false)ïŒ‰ćˆ™äžäŒšè§Šć‘æ­€äș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + touchend?: string; +} + +/** + * JSONćŻčè±ĄïŒŒViewæŽ§ä»¶çš„çł»ç»ŸçŠ¶æ€æ ćŒșćŸŸæ ·ćŒ + * ä»…ćœšćș”ç”šèźŸçœźäžșæČ‰æ”žćŒçŠ¶æ€æ æ ·ćŒäž‹æœ‰æ•ˆïŒŒéžæČ‰æ”žćŒçŠ¶æ€æ æ ·ćŒäž‹ćżœç•„æ­€ć±žæ€§ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjViewStatusbarStyles { + /** + * çł»ç»ŸçŠ¶æ€æ ćŒșćŸŸèƒŒæ™Żéąœè‰Č + * 鱜è‰Čć€Œæ ŒćŒäžș"#RRGGBB"ïŒŒćŠ‚"#FF0000"èĄšç€șäžșçșąè‰ČèƒŒæ™ŻïŒŒé»˜èź€ć€Œäžșćș”甚manifest.jsonäž­plus->statusbar->backgroundć±žæ€§é…çœźçš„ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + background?: string; +} + +/** + * ViewæŽ§ä»¶æ ·ćŒ + * ćŒ…æ‹Źäœçœźă€ć€§ć°ç­‰äżĄæŻç­‰ïŒŒć…¶äž­äœçœźäżĄæŻç›žćŻčäșŽçˆ¶ćźčć™šæŽ§ä»¶èż›èĄŒèźĄçź—ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjViewStyles { + /** + * ćŒșćŸŸèƒŒæ™Żéąœè‰Č + * ćŻć–ć€ŒïŒš + * #RRGGBB"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"#FF0000"èĄšç€ș绘戶çșąè‰ČćŒșćŸŸïŒ› + * "rgba(R,G,B,A)"ïŒŒć…¶äž­R/G/Bćˆ†ćˆ«ä»ŁèĄšçșąè‰Čć€Œ/绿è‰Čć€Œ/蓝è‰Čć€ŒïŒŒæ­Łæ•Žæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-255Aäžș透明ćșŠïŒŒæ”źç‚čæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-10äžșć…šé€æ˜ŽïŒŒ1äžșäžé€æ˜ŽïŒ‰ïŒŒćŠ‚"rgba(255,0,0,0.5)"ïŒŒèĄšç€șçșąè‰ČćŠé€æ˜Žă€‚ é»˜èź€ć€Œäžș"#FFFFFF"癜è‰ČïŒ‰ă€‚ "rgba(R,G,B,A)"ïŒŒć…¶äž­R/G/Bćˆ†ćˆ«ä»ŁèĄšçșąè‰Čć€Œ/绿è‰Čć€Œ/蓝è‰Čć€ŒïŒŒæ­Łæ•Žæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-255Aäžș透明ćșŠïŒŒæ”źç‚čæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-10äžșć…šé€æ˜ŽïŒŒ1äžșäžé€æ˜ŽïŒ‰ïŒŒćŠ‚"rgba(255,0,0,0.5)"ïŒŒèĄšç€șçșąè‰ČćŠé€æ˜Žă€‚ é»˜èź€ć€Œäžș"#FFFFFF"癜è‰ČïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + backgroundColor?: string; + /** + * ViewæŽ§ä»¶ćž‚ç›Žć‘äžŠçš„ćç§»é‡ + * 现ćŻčäșŽçˆ¶ćźč晹ćș•éƒšçš„è·çŠ»ïŒŒćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶ćźčć™šçš„é«˜ćșŠïŒŒćŠ‚æžœæČĄæœ‰çˆ¶ćźč晹戙盾ćŻčäșŽć±ćč•高ćșŠă€‚ + * ćœ“èźŸçœźäș†top撌heightć€Œæ—¶ïŒŒćżœç•„æ­€ć±žæ€§ć€ŒïŒ› + * æœȘèźŸçœźheightć€Œæ—¶ïŒŒćŻé€šèż‡top撌bottomć±žæ€§ć€Œæ„çĄźćźšView控件的高ćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + bottom?: string; + /** + * ViewæŽ§ä»¶çš„ćœé æ–čćŒ + * ä»…ćœ“ViewæŽ§ä»¶æ·»ćŠ ćˆ°WebviewçȘ—揣ćŻčè±Ąäž­ćč¶äž”positionć±žæ€§ć€ŒèźŸçœźäžș"dock"时才生效歀时ViewæŽ§ä»¶æŒ€ćŽ‹WebviewçȘ—ćŁçš„ć€§ć°ă€‚ + * ćŻć–ć€ŒïŒš + * "top"ïŒŒæŽ§ä»¶ćœé ćˆ™éĄ”éąéĄ¶éƒšïŒ› + * "bottom"ïŒŒæŽ§ä»¶ćœé ćœšéĄ”éąćș•郚 + * "right"ïŒŒæŽ§ä»¶ćœé ćœšéĄ”éąćłäŸ§ïŒ› + * "left"ïŒŒæŽ§ä»¶ćœé ćœšéĄ”éąć·ŠäŸ§ă€‚ + * é»˜èź€ć€Œäžș"top"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + dock?: string; + /** + * ćŒșćŸŸçš„é«˜ćșŠ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶ćźčć™šçš„é«˜ćșŠïŒŒćŠ‚æžœæČĄæœ‰çˆ¶ćźč晹戙盾ćŻčäșŽć±ćč•高ćșŠïŒ› + * 憅ćźčè‡Ș适ćș”ïŒŒćŠ‚"wrap_content"æ čæźć†…ćźčèźĄçź—æŽ§ä»¶çš„é«˜ćșŠă€‚ + * é»˜èź€ć€Œäžș"100%"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + height?: string; + /** + * ćŒșćŸŸć·ŠäžŠè§’çš„æ°Žćčłćç§»é‡ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶æŽ§ä»¶çš„ćźœćșŠïŒ› + * è‡ȘćŠšèźĄçź—ïŒŒćŠ‚"auto"æ čæźwidthć€Œè‡ȘćŠšèźĄçź—ïŒŒç›žćŻčäșŽçˆ¶æŽ§ä»¶æ°Žćčłć±…䞭。 + * é»˜èź€ć€Œäžș"0px"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + left?: string; + /** + * View控件的䞍透明ćșŠ + * ć–ć€ŒèŒƒć›Žäžș0-10äžșć…šé€æ˜ŽïŒŒ1äžșäžé€æ˜ŽïŒŒé»˜èź€ć€Œäžș1ïŒŒćłäžé€æ˜Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + opacity?: number; + /** + * View控件的排版æ–čćŒ + * ä»…ćœ“ViewæŽ§ä»¶æ·»ćŠ ćˆ°WebviewçȘ—揣ćŻčè±Ąäž­æ—¶æ‰ç”Ÿæ•ˆă€‚ + * ćŻć–ć€ŒïŒš + * "static"ViewæŽ§ä»¶ćœšéĄ”éąäž­æ­ŁćžžćźšäœïŒŒćŠ‚æžœéĄ”éąć­˜ćœšæ»šćŠšæĄćˆ™éšçȘ—ćŁć†…ćźčæ»šćŠšïŒ› + * "absolute"VeiwæŽ§ä»¶ćœšéĄ”éąäž­ç»ćŻčćźšäœïŒŒćŠ‚æžœéĄ”éąć­˜ćœšæ»šćŠšæĄäžéšçȘ—ćŁć†…ćźčæ»šćŠšïŒ› + * "dock"ViewæŽ§ä»¶ćœšéĄ”éąäž­ćœé ïŒŒćœé çš„äœçœźç”±dockć±žæ€§ć€Œć†łćźšă€‚ + * é»˜èź€ć€Œäžș"absolute"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + position?: string; + /** + * ViewæŽ§ä»¶çš„çŠ¶æ€æ æ ·ćŒ + * ä»…ćœšćș”ç”šèźŸçœźäžșæČ‰æ”žćŒçŠ¶æ€æ æ ·ćŒäž‹æœ‰æ•ˆïŒŒèźŸçœźæ­€ć±žæ€§ćŽć°†è‡ȘćŠšäżç•™çł»ç»ŸçŠ¶æ€æ ćŒșćŸŸäžèą«ViewæŽ§ä»¶ć ç”šïŒˆćłView控件非æČ‰æ”žćŒæ ·ćŒæ˜Ÿç€șïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + statusbar?: PlusNativeObjViewStatusbarStyles; + /** + * ViewæŽ§ä»¶ć·ŠäžŠè§’çš„ćž‚ç›Žćç§»é‡ + * ćŻć–ć€ŒïŒšćƒçŽ ć€ŒïŒŒćŠ‚"100px"ïŒ›ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶æŽ§ä»¶çš„高ćșŠïŒ›è‡ȘćŠšèźĄçź—ïŒŒćŠ‚"auto",æ čæźheightć€Œè‡ȘćŠšèźĄçź—ïŒŒç›žćŻčäșŽçˆ¶æŽ§ä»¶ćž‚盎汅䞭。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + top?: string; + /** + * ćŒșćŸŸçš„ćźœćșŠ + * ćŻć–ć€ŒïŒšćƒçŽ ć€ŒïŒŒćŠ‚"100px";ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶æŽ§ä»¶çš„ćźœćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + width?: string; +} + +/** + * nativeUIçźĄç†çł»ç»ŸćŽŸç”Ÿç•ŒéąïŒŒćŻç”šäșŽćŒčć‡șçł»ç»ŸćŽŸç”Ÿæç€șćŻčèŻæĄ†çȘ—ćŁă€æ—¶é—Žæ—„期选择ćŻčèŻæĄ†ă€ç­‰ćŸ…ćŻčèŻæĄ†ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ +interface PlusNativeUI { + /** + * JSONćŻčè±ĄïŒŒćŽŸç”Ÿé€‰æ‹©æŒ‰é’źæĄ†äžŠæŒ‰é’źçš„æ ·ćŒć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + ActionButtonStyles?: PlusNativeUIActionButtonStyles; + /** + * JSONćŻčè±ĄïŒŒćŽŸç”Ÿé€‰æ‹©æŒ‰é’źæĄ†çš„æ ·ćŒć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + ActionSheetStyles?: PlusNativeUIActionSheetStyles; + /** + * çĄźèź€ćŻčèŻæĄ†çš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + ConfirmOptions?: PlusNativeUIConfirmOptions; + /** + * JSONćŻčè±ĄïŒŒć›Ÿç‰‡éą„è§ˆçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + PreviewImageOptions?: PlusNativeUIPreviewImageOptions; + /** + * 旄期选择ćŻčèŻæĄ†çš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + PickDateOption?: PlusNativeUIPickDateOption; + /** + * JSONćŻčè±ĄïŒŒæ—¶é—Žé€‰æ‹©ćŻčèŻæĄ†çš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + PickTimeOption?: PlusNativeUIPickTimeOption; + /** + * çł»ç»ŸćŽŸç”Ÿç•ŒéąćŸșç±»ćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + NativeUIObj?: PlusNativeUINativeUIObj; + /** + * çł»ç»Ÿç­‰ćŸ…ćŻčèŻæĄ†ćŻčè±Ą + * 从NativeUIObjćŻčè±Ąç»§æ‰żè€Œæ„ïŒŒé€šèż‡plus.nativeUI.showWaitingæ–čæł•ćˆ›ć»șæ—¶èż”ć›žă€‚ + * 甹äșŽæŽ§ćˆ¶çł»ç»Ÿæ ·ćŒç­‰ćŸ…ćŻčèŻæĄ†çš„æ“äœœïŒŒćŠ‚ć…łé—­ă€èźŸçœźæ ‡éą˜ć†…ćźč等。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + WaitingObj?: PlusNativeUIWaitingObj; + /** + * JSONćŻčè±ĄïŒŒćŽŸç”Ÿç­‰ćŸ…ćŻčèŻæĄ†çš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + WaitingOptions?: PlusNativeUIWaitingOptions; + /** + * JSONćŻčè±ĄïŒŒćŽŸç”Ÿç­‰ćŸ…ćŻčèŻæĄ†äžŠloadingć›Ÿæ ‡è‡Ș漚ä艿 ·ćŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + WaitingLoadingOptions?: PlusNativeUIWaitingLoadingOptions; + /** + * JSONćŻčè±ĄïŒŒçł»ç»Ÿæç€șæ¶ˆæŻæĄ†èŠèźŸçœźçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + ToastOptions?: PlusNativeUIToastOptions; + /** + * ćŒčć‡șçł»ç»Ÿé€‰æ‹©æŒ‰é’źæĄ† + * 从ćș•éƒšćŠšç”»ćŒčć‡șçł»ç»Ÿæ ·ćŒé€‰æ‹©æŒ‰é’źæĄ†ïŒŒćŻèźŸçœźé€‰æ‹©æĄ†çš„æ ‡éą˜ă€æŒ‰é’źæ–‡ć­—ç­‰ă€‚ + * ćŒčć‡ș的提ç€șæĄ†äžșéžé˜»ćĄžæšĄćŒïŒŒç”šæˆ·ç‚čć‡»é€‰æ‹©æĄ†äžŠçš„æŒ‰é’źćŽć…łé—­ïŒŒćč¶é€šèż‡actionsheetCallbackć›žè°ƒć‡œæ•°é€šçŸ„ç”šæˆ·é€‰æ‹©çš„æŒ‰é’źă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + actionSheet(actionsheetStyle?: PlusNativeUIActionSheetStyles, actionsheetCallback?: (result: any) => void): PlusNativeUINativeUIObj; + /** + * ćŒčć‡șçł»ç»Ÿæç€șćŻčèŻæĄ† + * 戛ć»șćč¶æ˜Ÿç€șçł»ç»Ÿæ ·ćŒæç€șćŻčèŻæĄ†ïŒŒćŻèźŸçœźæç€șćŻčèŻæĄ†çš„æ ‡éą˜ă€ć†…ćźčă€æŒ‰é’źæ–‡ć­—ç­‰ă€‚ + * ćŒčć‡ș的提ç€șćŻčèŻæĄ†äžșéžé˜»ćĄžæšĄćŒïŒŒç”šæˆ·ç‚čć‡»æç€șćŻčèŻæĄ†äžŠçš„æŒ‰é’źćŽć…łé—­ïŒŒćč¶é€šèż‡alertCBć›žè°ƒć‡œæ•°é€šçŸ„ćŻčèŻæĄ†ć·Č慳闭。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + alert(message?: string, alertCB?: (result: any) => void, title?: string, buttonCapture?: string): void; + /** + * ćŒčć‡șçł»ç»ŸçĄźèź€ćŻčèŻæĄ† + * 戛ć»șćč¶æ˜Ÿç€șçł»ç»Ÿæ ·ćŒçĄźèź€ćŻčèŻæĄ†ïŒŒćŻèźŸçœźçĄźèź€ćŻčèŻæĄ†çš„æ ‡éą˜ă€ć†…ćźčă€æŒ‰é’źæ•°ç›źćŠć…¶æ–‡ć­—ă€‚ + * ćŒčć‡șçš„çĄźèź€ćŻčèŻæĄ†äžșéžé˜»ćĄžæšĄćŒïŒŒç”šæˆ·ç‚čć‡»çĄźèź€ćŻčèŻæĄ†äžŠçš„æŒ‰é’źćŽć…łé—­ïŒŒćč¶é€šèż‡confirmCBć›žè°ƒć‡œæ•°é€šçŸ„ç”šæˆ·ç‚čć‡»çš„æŒ‰é’źçŽąćŒ•ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + confirm(message?: string, confirmCB?: (result: any) => void, options?: PlusNativeUIConfirmOptions, buttons?: any []): void; + /** + * ć…łé—­çł»ç»Ÿç­‰ćŸ…ćŻčèŻæĄ† + * 慳闭ć·Č经星ç€șçš„æ‰€æœ‰çł»ç»Ÿæ ·ćŒç­‰ćŸ…ćŻčèŻæĄ†ïŒŒè§Šć‘WaitingćŻčè±Ąçš„oncloseäș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + closeWaiting(): void; + /** + * 慳闭è‡ȘćŠšæ¶ˆć€±çš„æç€șæ¶ˆæŻ + * 慳闭ć·Č经星ç€ș的所有è‡ȘćŠšæ¶ˆć€±çš„æç€șæĄ†ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + closeToast(): void; + /** + * éą„è§ˆć›Ÿç‰‡ + * 戛ć»șćč¶æ˜Ÿç€șć…šć±ć›Ÿç‰‡éą„è§ˆç•ŒéąïŒŒç”šæˆ·ç‚čć‡»ć›Ÿç‰‡æˆ–èż”ć›žé”źé€€ć‡șéą„è§ˆç•Œéąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + previewImage(urls?: any [], options?: PlusNativeUIPreviewImageOptions): void; + /** + * 星ç€șçł»ç»Ÿç­‰ćŸ…ćŻčèŻæĄ† + * 戛ć»șćč¶æ˜Ÿç€șçł»ç»Ÿæ ·ćŒç­‰ćŸ…ćŻčèŻæĄ†ïŒŒćč¶èż”ć›žç­‰ćŸ…ćŻčèŻæĄ†ćŻčè±ĄWaiting星ç€șćŽéœ€è°ƒç”šć…¶closeæ–čæł•èż›èĄŒć…łé—­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + showWaiting(title?: string, options?: PlusNativeUIWaitingOptions): PlusNativeUIWaitingObj; + /** + * ćŒčć‡șçł»ç»Ÿæ—„æœŸé€‰æ‹©ćŻčèŻæĄ† + * 戛ć»șćč¶æ˜Ÿç€șçł»ç»Ÿæ ·ćŒæ—„æœŸé€‰æ‹©ćŻčèŻæĄ†ïŒŒćŻèż›èĄŒæ—„æœŸçš„é€‰æ‹©ă€‚ + * ç”šæˆ·æ“äœœçĄźèź€ćŽé€šèż‡successCBć›žè°ƒć‡œæ•°èż”ć›žç”šæˆ·é€‰æ‹©çš„æ—„æœŸïŒŒè‹„ç”šæˆ·ć–æ¶ˆé€‰æ‹©ćˆ™é€šèż‡errorCBć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + pickDate(successCB?: (result: any) => void, errorCB?: (result: any) => void, options?: PlusNativeUIPickDateOption): void; + /** + * ćŒčć‡șçł»ç»Ÿæ—¶é—Žé€‰æ‹©ćŻčèŻæĄ† + * 戛ć»șćč¶ćŒčć‡șçł»ç»Ÿæ ·ćŒæ—¶é—Žé€‰æ‹©ćŻčèŻæĄ†ïŒŒćŻèż›èĄŒæ—¶é—Žçš„é€‰æ‹©ă€‚ + * ç”šæˆ·æ“äœœçĄźèź€ćŽé€šèż‡successCBć›žè°ƒć‡œæ•°èż”ć›žç”šæˆ·é€‰æ‹©çš„æ—¶é—ŽïŒŒè‹„ç”šæˆ·ć–æ¶ˆé€‰æ‹©ćˆ™é€šèż‡errorCBć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + pickTime(successCB?: (result: any) => void, errorCB?: (result: any) => void, options?: PlusNativeUIPickTimeOption): void; + /** + * ćŒčć‡șçł»ç»ŸèŸ“ć…„ćŻčèŻæĄ† + * 戛ć»șćč¶æ˜Ÿç€șçł»ç»Ÿæ ·ćŒèŸ“ć…„ćŻčèŻæĄ†ïŒŒćŻèźŸçœźèŸ“ć…„ćŻčèŻæĄ†çš„æ ‡éą˜ă€ć†…ćźčă€æç€șèŸ“ć…„äżĄæŻă€æŒ‰é’źæ•°ç›źćŠć…¶æ–‡ć­—ă€‚ + * ćŒčć‡șçš„èŸ“ć…„ćŻčèŻæĄ†äžșéžé˜»ćĄžæšĄćŒïŒŒć…¶äž­ćŒ…ć«çŒ–èŸ‘æĄ†äŸ›ç”šæˆ·èŸ“ć…„ć†…ćźč甚户ç‚čć‡»èŸ“ć…„ćŻčèŻæĄ†äžŠçš„æŒ‰é’źćŽè‡ȘćŠšć…łé—­ïŒŒćč¶é€šèż‡promptCBć›žè°ƒć‡œæ•°èż”ć›žç”šæˆ·ç‚čć‡»çš„æŒ‰é’źćŠèŸ“ć…„çš„ć†…ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + prompt(message?: string, promptCB?: (result: any) => void, title?: string, tip?: string, buttons?: any []): void; + /** + * 星ç€șè‡ȘćŠšæ¶ˆć€±çš„æç€șæ¶ˆæŻ + * 戛ć»șćč¶æ˜Ÿç€șçł»ç»Ÿæ ·ćŒæç€șæ¶ˆæŻïŒŒćŒčć‡ș的提ç€șæ¶ˆæŻäžșéžé˜»ćĄžæšĄćŒïŒŒæ˜Ÿç€șæŒ‡ćźšæ—¶é—ŽćŽè‡ȘćŠšæ¶ˆć€±ă€‚ + * 提ç€șæ¶ˆæŻæ˜Ÿç€șæ—¶é—ŽćŻé€šèż‡options的durationć±žæ€§æŽ§ćˆ¶ïŒŒé•żæ—¶é—Žæç€șæ¶ˆæŻæ˜Ÿç€șæ—¶é—ŽçșŠäžș3.5s短时闎提ç€șæ¶ˆæŻæ˜Ÿç€șæ—¶é—ŽçșŠäžș2s。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + toast(message?: string, options?: PlusNativeUIToastOptions): void; +} + +/** + * JSONćŻčè±ĄïŒŒćŽŸç”Ÿé€‰æ‹©æŒ‰é’źæĄ†äžŠæŒ‰é’źçš„æ ·ćŒć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ +interface PlusNativeUIActionButtonStyles { + /** + * æŒ‰é’źäžŠæ˜Ÿç€șçš„æ–‡ć­—éąœè‰Č + * ćŻć–ć€ŒïŒš + * "#RRGGBB"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"#FF0000"èĄšç€șæ–‡ć­—éąœè‰Čäžșçșąè‰Č + * "rgba(R,G,B,A)"ïŒŒć…¶äž­R/G/Bćˆ†ćˆ«ä»ŁèĄšçșąè‰Čć€Œ/绿è‰Čć€Œ/蓝è‰Čć€ŒïŒŒæ­Łæ•Žæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-255Aäžș透明ćșŠïŒŒæ”źç‚čæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-10äžșć…šé€æ˜ŽïŒŒ1äžșäžé€æ˜ŽïŒ‰ïŒŒćŠ‚"rgba(255,0,0,0.5)"ïŒŒèĄšç€șçșąè‰ČćŠé€æ˜Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + color?: string; + /** + * æŒ‰é’źäžŠæ˜Ÿç€șçš„æ–‡ć­—ć†…ćźč + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + title?: string; + /** + * æŒ‰é’źçš„æ ·ćŒ + * ćŻć–ć€ŒïŒš + * "destructive" - èĄšç€șè­Šç€șæŒ‰é’źæ ·ćŒïŒŒé»˜èź€æ–‡ć­—éąœè‰Čäžșçșąè‰Č + * "default" - èĄšç€șé»˜èź€æŒ‰é’źæ ·ćŒă€‚ + * é»˜èź€ć€Œäžș"default"。 + * - destructive: + * è­Šç€șæŒ‰é’źæ ·ćŒă€‚ + * + * - default: + * é»˜èź€æŒ‰é’źæ ·ćŒă€‚ + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + style?: 'destructive' | 'default'; +} + +/** + * JSONćŻčè±ĄïŒŒćŽŸç”Ÿé€‰æ‹©æŒ‰é’źæĄ†çš„æ ·ćŒć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ +interface PlusNativeUIActionSheetStyles { + /** + * é€‰æ‹©æŒ‰é’źæĄ†çš„æ ‡éą˜ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + title?: string; + /** + * ć–æ¶ˆæŒ‰é’źäžŠæ˜Ÿç€șçš„æ–‡ć­—ć†…ćźč + * äžèźŸçœźæ­€ć±žæ€§ïŒŒćˆ™äžæ˜Ÿç€șć–æ¶ˆæŒ‰é’źă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + cancel?: string; + /** + * é€‰æ‹©æĄ†äžŠçš„æŒ‰é’źïŒŒActionButtonStylesćŻčè±Ąæ•°ç»„ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + buttons?: PlusNativeUI []; +} + +/** + * çĄźèź€ćŻčèŻæĄ†çš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ +interface PlusNativeUIConfirmOptions { + /** + * çĄźèź€ćŻčèŻæĄ†æ˜Ÿç€șçš„æ ‡éą˜ + * ćŠ‚æžœäžèźŸçœźæ­€ć±žæ€§ć€ŒïŒŒćˆ™äžæ˜Ÿç€șæ ‡éą˜ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + title?: string; + /** + * çĄźèź€ćŻčèŻæĄ†äžŠæ˜Ÿç€șçš„æŒ‰é’ź + * 歗笩äžČæ•°ç»„ïŒŒæŻéĄčćŻčćș”ćœšçĄźèź€ćŻčèŻæĄ†äžŠæ˜Ÿç€ș侀äžȘæŒ‰é’źïŒŒç”šæˆ·ç‚čć‡»ćŽé€šèż‡confirmCBèż”ć›žç”šæˆ·ç‚čć‡»æŒ‰é’źçš„ćœšæ•°ç»„äž­çš„çŽąćŒ•ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + buttons?: any []; + /** + * ćŻčèŻæĄ†ćœšć±ćč•äž­çš„ćž‚ç›Žćˆ†äș«ćŻč霐æ–čćŒ + * ćŻć–ć€ŒïŒš + * "top" - èĄšç€ș枂盎汅饶ćŻč霐 + * "center" - èĄšç€ș枂盎汅䞭ćŻč霐 + * "bottom" - èĄšç€ș枂盎汅ćș•ćŻčéœă€‚ + * é»˜èź€ć€Œäžș"center"ïŒˆćž‚ç›Žć±…äž­ćŻčéœïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + verticalAlign?: string; +} + +/** + * JSONćŻčè±ĄïŒŒć›Ÿç‰‡éą„è§ˆçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ +interface PlusNativeUIPreviewImageOptions { + /** + * ć›Ÿç‰‡éą„è§ˆçš„èƒŒæ™Żéąœè‰Č + * 鱜è‰Čć€Œæ ŒćŒäžș"#RRGGBB"ïŒŒćŠ‚"#FF0000"èĄšç€șäžșçșąè‰ČèƒŒæ™Żă€‚ + * é»˜èź€ć€Œäžș黑è‰Č"#000000"ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + background?: string; + /** + * é»˜èź€æ˜Ÿç€șć›Ÿç‰‡çš„çŽąćŒ•ć€Œ + * çŽąćŒ•ć€Œä»Ž0ćŒ€ć§‹ïŒŒé»˜èź€ć€Œäžș0。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + current?: number; + /** + * ć›Ÿç‰‡æŒ‡ç€șć™šæ ·ćŒ + * ćŻć–ć€ŒïŒš + * "default" - é»˜èź€æŒ‡ç€șć™šïŒˆćș•éƒšćœ†ç‚čæ ·ćŒïŒ‰ïŒ› + * "number" - éĄ¶éƒšæ•°ć­—æŒ‡ç€șć™šïŒˆéĄ¶éƒšć±…äž­æ˜Ÿç€șïŒŒæ–‡ć­—äžș%ćœ“ć‰ć›Ÿç‰‡çŽąćŒ•ć€ŒïŒˆä»Ž1ćŒ€ć§‹ïŒ‰%/%ć›Ÿç‰‡æ€»æ•°% + * "none" - 䞍星ç€ș指ç€ș晹。 + * é»˜èź€ć€Œäžș"default"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + indicator?: string; + /** + * æ˜ŻćŠćŻćŸȘçŽŻéą„è§ˆ + * ćŻć–ć€ŒïŒš + * "true" - æ”ŻæŒćŸȘçŽŻéą„è§ˆïŒ› + * "false" - äžæ”ŻæŒćŸȘçŽŻéą„è§ˆă€‚ + * é»˜èź€ć€Œäžș"false"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + loop?: boolean; +} + +/** + * 旄期选择ćŻčèŻæĄ†çš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ +interface PlusNativeUIPickDateOption { + /** + * 旄期选择ćŻčèŻæĄ†æ˜Ÿç€șçš„æ ‡éą˜ + * ćŠ‚æžœæœȘèźŸçœźæ ‡éą˜ïŒŒćˆ™é»˜èź€æ˜Ÿç€șæ ‡éą˜äžșćœ“ć‰é€‰æ‹©çš„æ—„æœŸă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + title?: string; + /** + * 旄期选择ćŻčèŻæĄ†é»˜èź€æ˜Ÿç€ș的旄期 + * ćŠ‚æžœæœȘèźŸçœźé»˜èź€æ˜Ÿç€șçš„æ—„æœŸïŒŒćˆ™æ˜Ÿç€șćœ“ć‰çš„æ—„æœŸă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + date?: Date; + /** + * 旄期选择ćŻčèŻæĄ†ćŻé€‰æ‹©çš„æœ€ć°æ—„æœŸ + * Date类枋ćŻčè±ĄïŒŒćŠ‚æžœæœȘèźŸçœźćŻé€‰æ‹©çš„æœ€ć°æ—„æœŸïŒŒćˆ™äœżç”šçł»ç»Ÿé»˜èź€ćŻé€‰æ‹©çš„æœ€ć°æ—„æœŸć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + minDate?: Date; + /** + * 旄期选择ćŻčèŻæĄ†ćŻé€‰æ‹©çš„æœ€ć€§æ—„æœŸ + * Date类枋ćŻčè±ĄïŒŒćŠ‚æžœæœȘèźŸçœźćŻé€‰æ‹©çš„æœ€ć€§æ—„æœŸïŒŒćˆ™äœżç”šçł»ç»Ÿé»˜èź€ćŻé€‰æ‹©çš„æœ€ć€§æ—„æœŸć€Œă€‚ + * ć…¶ć€Œćż…éĄ»ć€§äșŽminDateèźŸçœźçš„ć€ŒïŒŒćŠćˆ™äœżç”šçł»ç»Ÿé»˜èź€ćŻé€‰æ‹©çš„æœ€ć€§æ—„æœŸć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + maxDate?: Date; + /** + * 时闎选择ćŻčèŻæĄ†ćŒčć‡ș指ç€șćŒș㟟 + * JSON类枋ćŻčè±ĄïŒŒæ ŒćŒćŠ‚{top:10;left:10;width:200;height:200;}ïŒŒæ‰€æœ‰ć€ŒäžșćƒçŽ ć€ŒïŒŒć…¶ć€Œäžș盾ćŻčäșŽćźč晹Webviewçš„äœçœźă€‚ + * 橂æœȘèźŸçœźæ­€ć€ŒïŒŒé»˜èź€ćœšć±ćč•ć±…äž­æ˜Ÿç€șă€‚ä»…ćœšiPadäžŠæœ‰æ•ˆïŒŒć…¶ćźƒèźŸć€‡ćżœç•„æ­€ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + popover?: any; +} + +/** + * JSONćŻčè±ĄïŒŒæ—¶é—Žé€‰æ‹©ćŻčèŻæĄ†çš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ +interface PlusNativeUIPickTimeOption { + /** + * 时闎选择ćŻčèŻæĄ†é»˜èź€æ˜Ÿç€ș的时闎 + * ćŠ‚æžœæœȘèźŸçœźæ ‡éą˜ïŒŒćˆ™é»˜èź€æ˜Ÿç€șæ ‡éą˜äžșćœ“ć‰é€‰æ‹©çš„æ—¶é—Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + time?: Date; + /** + * 时闎选择ćŻčèŻæĄ†æ˜Ÿç€șçš„æ ‡éą˜ + * ćŠ‚æžœæœȘèźŸçœźæ ‡éą˜ïŒŒćˆ™é»˜èź€æ˜Ÿç€șæ ‡éą˜äžșćœ“ć‰é€‰æ‹©çš„æ—¶é—Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + title?: string; + /** + * æ˜ŻćŠ24ć°æ—¶ćˆ¶æšĄćŒ + * trueèĄšç€șäœżç”š24ć°æ—¶ćˆ¶æšĄćŒæ˜Ÿç€șfaleèĄšç€șäœżç”š12ć°æ—¶ćˆ¶æšĄćŒæ˜Ÿç€șïŒŒé»˜èź€ć€Œäžștrue。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + is24Hour?: boolean; + /** + * 旄期选择ćŻčèŻæĄ†ćŒčć‡ș指ç€șćŒș㟟 + * JSON类枋ćŻčè±ĄïŒŒæ ŒćŒćŠ‚{top:10;left:10;width:200;height:200;}ïŒŒæ‰€æœ‰ć€ŒäžșćƒçŽ ć€ŒïŒŒć…¶ć€Œç›žćŻčäșŽćźč晹webviewçš„äœçœźă€‚ + * 橂æœȘèźŸçœźæ­€ć€ŒïŒŒé»˜èź€ćœšć±ćč•ć±…äž­æ˜Ÿç€șă€‚ä»…ćœšiPadäžŠæœ‰æ•ˆïŒŒć…¶ćźƒèźŸć€‡ćżœç•„æ­€ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + popover?: any; +} + +/** + * çł»ç»ŸćŽŸç”Ÿç•ŒéąćŸșç±»ćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ +interface PlusNativeUINativeUIObj { + /** + * ć…łé—­æ˜Ÿç€șçš„çł»ç»ŸćŽŸç”Ÿç•Œéą + * 调甚plus.nativeUI.actionSheetæ–čæł•ćˆ›ć»șćč¶æ˜Ÿç€șçł»ç»Ÿç•ŒéąćŽïŒŒćŻé€šèż‡ć…¶closeæ–čæł•ć°†ćŽŸç”Ÿç•Œéąć…łé—­ă€‚ + * æ­€æƒ…ć†”äž‹è§Šć‘ç•Œéąć…łé—­ć›žè°ƒć‡œæ•°ć‚æ•°çš„indexć±žæ€§ć€Œäžș-1。 + * æłšæ„ïŒšäž€äžȘçł»ç»ŸćŽŸç”Ÿç•ŒéąćȘèƒœć…łé—­äž€æŹĄïŒŒć€šæŹĄè°ƒç”šć°†æ— ä»»äœ•äœœç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + close(): void; +} + +/** + * çł»ç»Ÿç­‰ćŸ…ćŻčèŻæĄ†ćŻčè±Ą + * 从NativeUIObjćŻčè±Ąç»§æ‰żè€Œæ„ïŒŒé€šèż‡plus.nativeUI.showWaitingæ–čæł•ćˆ›ć»șæ—¶èż”ć›žă€‚ + * 甹äșŽæŽ§ćˆ¶çł»ç»Ÿæ ·ćŒç­‰ćŸ…ćŻčèŻæĄ†çš„æ“äœœïŒŒćŠ‚ć…łé—­ă€èźŸçœźæ ‡éą˜ć†…ćźč等。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ +interface PlusNativeUIWaitingObj { + /** + * ç­‰ćŸ…ćŻčèŻæĄ†ć…łé—­äș‹ä»¶ + * ç­‰ćŸ…æĄ†ć…łé—­æ—¶è§Šć‘ïŒŒćœ“è°ƒç”šcloseæ–čæł•或甚户ç‚čć‡»èż”ć›žæŒ‰é’źćŻŒè‡Žç­‰ćŸ…æĄ†ć…łé—­æ—¶è§Šć‘ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + onclose?: Function; + /** + * èźŸçœźç­‰ćŸ…ćŻčèŻæĄ†äžŠæ˜Ÿç€șçš„æ–‡ć­—ć†…ćźč + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + setTitle(title?: string): void; + /** + * ć…łé—­æ˜Ÿç€șçš„çł»ç»Ÿç­‰ćŸ…ćŻčèŻæĄ† + * 调甚plus.nativeUI.showWaitingæ–čæł•ćˆ›ć»șćč¶æ˜Ÿç€șçł»ç»Ÿç­‰ćŸ…ç•ŒćŽïŒŒćŻé€šèż‡ć…¶closeæ–čæł•ć°†ćŽŸç”Ÿç­‰ćŸ…æŽ§ä»¶ć…łé—­ă€‚ + * 侀äžȘçł»ç»Ÿç­‰ćŸ…ćŻčèŻæĄ†ćȘèƒœć…łé—­äž€æŹĄïŒŒć€šæŹĄè°ƒç”šć°†æ— ä»»äœ•äœœç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + close(): void; +} + +/** + * JSONćŻčè±ĄïŒŒćŽŸç”Ÿç­‰ćŸ…ćŻčèŻæĄ†çš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ +interface PlusNativeUIWaitingOptions { + /** + * ç­‰ćŸ…æĄ†èƒŒæ™ŻćŒșćŸŸçš„ćźœćșŠ + * ć€Œæ”ŻæŒćƒçŽ ć€ŒïŒˆ"500px"ïŒ‰æˆ–ç™Ÿćˆ†æŻ”ïŒˆ"50%"ïŒ‰ïŒŒç™Ÿćˆ†æŻ”ç›žćŻčäșŽć±ćč•çš„ćźœèźĄçź—ïŒŒćŠ‚æžœäžèźŸçœźćˆ™æ čæźć†…ćźčè‡ȘćŠšèźĄçź—ćˆé€‚çš„ćźœćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + width?: string; + /** + * ç­‰ćŸ…æĄ†èƒŒæ™ŻćŒșćŸŸçš„é«˜ćșŠ + * ć€Œæ”ŻæŒćƒçŽ ç»ćŻčć€ŒïŒˆ"500px"ïŒ‰æˆ–ç™Ÿćˆ†æŻ”ïŒˆ"50%"ïŒ‰ïŒŒćŠ‚æžœäžèźŸçœźćˆ™æ čæźć†…ćźčè‡ȘćŠšèźĄçź—ćˆé€‚çš„é«˜ćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + height?: string; + /** + * ç­‰ćŸ…æĄ†äž­æ–‡ć­—çš„éąœè‰Č + * 鱜è‰Čć€Œæ”ŻæŒ(ć‚è€ƒCSS鱜è‰Č规范)ïŒšéąœè‰Č損称(ć‚è€ƒCSS Color Names)/ćć…­èż›ćˆ¶ć€Œ/rgbć€Œ/rgbać€ŒïŒŒé»˜èź€ć€Œäžș癜è‰Č。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + color?: string; + /** + * ç­‰ćŸ…æĄ†äž­æ–‡ć­—çš„ć­—äœ“ć€§ć° + * 橂"14px"èĄšç€șäœżç”š14ćƒçŽ é«˜çš„æ–‡ć­—ïŒŒæœȘèźŸçœźćˆ™äœżç”šçł»ç»Ÿé»˜èź€ć­—äœ“ć€§ć°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + size?: string; + /** + * ç­‰ćŸ…ćŻčèŻæĄ†äž­æ ‡éą˜æ–‡ć­—çš„æ°ŽćčłćŻč霐æ–čćŒ + * ćŻč霐æ–čćŒćŻé€‰ć€ŒćŒ…æ‹ŹïŒš"left"氎ćčłć±…ć·ŠćŻč霐星ç€ș"center"氎ćčłć±…äž­ćŻč霐星ç€ș"right"氎ćčłć±…揳ćŻč霐星ç€șă€‚é»˜èź€ć€Œäžșæ°Žćčłć±…äž­ćŻč霐星ç€șïŒŒćł"center"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + textalign?: string; + /** + * ç­‰ćŸ…ćŻčèŻæĄ†çš„ć†…èŸč距 + * ć€Œæ”ŻæŒćƒçŽ ć€ŒïŒˆ"10px"ïŒ‰ć’Œç™Ÿćˆ†æŻ”ïŒˆ"5%"ïŒ‰ïŒŒç™Ÿćˆ†æŻ”ç›žćŻčäșŽć±ćč•çš„ćźœèźĄçź—ïŒŒé»˜èź€ć€Œäžș"3%"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + padding?: string; + /** + * ç­‰ćŸ…ćŻčèŻæĄ†æ˜Ÿç€șćŒșćŸŸçš„èƒŒæ™Żè‰Č + * èƒŒæ™Żè‰Čçš„ć€Œæ”ŻæŒ(ć‚è€ƒCSS鱜è‰Č规范)ïŒšéąœè‰Č損称(ć‚è€ƒCSS Color Names)/ćć…­èż›ćˆ¶ć€Œ/rgbć€Œ/rgbać€ŒïŒŒé»˜èź€ć€Œäžșrgba(0,0,0,0.8)。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + background?: string; + /** + * ç­‰ćŸ…ćŻčèŻæĄ†æ ·ćŒ + * ćŻć–ć€Œ"black"、"white"blackèĄšç€șç­‰ćŸ…æĄ†äžș黑è‰Čé›ȘèŠ±æ ·ćŒïŒŒé€šćžžćœšèƒŒæ™Żäž»è‰Čäžșæ”…è‰Čæ—¶äœżç”šïŒ›whiteèĄšç€șç­‰ćŸ…æĄ†äžș癜è‰Čé›ȘèŠ±æ ·ćŒïŒŒé€šćžžćœšèƒŒæ™Żäž»è‰Čäžșæ·±è‰Čæ—¶äœżç”šă€‚ + * ä»…ćœšiOSćčłć°æœ‰æ•ˆïŒŒć…¶ćźƒćčłć°ćżœç•„æ­€ć€ŒïŒŒæœȘèźŸçœźæ—¶é»˜èź€ć€Œäžșwhite。 + * - black: 黑è‰Čé›ȘèŠ±æ ·ćŒïŒŒé€‚ćˆæ”…è‰Čç•Œéąäœżç”š + * - white: 癜è‰Čé›ȘèŠ±æ ·ćŒïŒŒé€‚ćˆæ·±è‰Čç•Œéąäœżç”š + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + style?: 'black' | 'white'; + /** + * ç­‰ćŸ…æĄ†æ˜ŻćŠæšĄæ€æ˜Ÿç€ș + * æšĄæ€æ˜Ÿç€șæ—¶ç”šæˆ·äžćŻæ“äœœç›Žćˆ°ç­‰ćŸ…ćŻčèŻæĄ†ć…łé—­ïŒŒćŠćˆ™ç”šæˆ·ćœšç­‰ćŸ…ćŻčèŻæĄ†æ˜Ÿç€ș时äčŸćŻæ“äœœäž‹éąçš„憅ćźčæœȘèźŸçœźæ—¶é»˜èź€äžștrue。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + modal?: boolean; + /** + * ç­‰ćŸ…æĄ†æ˜Ÿç€șćŒșćŸŸçš„ćœ†è§’ + * ć€Œæ”ŻæŒćƒçŽ ć€ŒïŒˆ"10px"æœȘèźŸçœźæ—¶äœżç”šé»˜èź€ć€Œ"10px"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + round?: number; + /** + * ç‚čć‡»ç­‰ćŸ…æ˜Ÿç€șćŒșćŸŸæ˜ŻćŠè‡Ș抹慳闭 + * trueèĄšç€șç‚čć‡»ç­‰ćŸ…ćŻčèŻæĄ†æ˜Ÿç€șćŒșćŸŸæ—¶è‡ȘćŠšć…łé—­ïŒŒfalsećˆ™äžć…łé—­ïŒŒæœȘèźŸçœźæ—¶é»˜èź€ć€Œäžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + padlock?: boolean; + /** + * èż”ć›žé”źć€„ç†æ–čćŒ + * ćŻć–ć€Œ"none"èĄšç€șæˆȘèŽ·ć€„ç†èż”ć›žé”źïŒŒäœ†äžćšä»»äœ•ć“ćș”"close"èĄšç€șæˆȘèŽ·ć€„ç†èż”ć›žé”źćč¶ć…łé—­ç­‰ćŸ…æĄ†ïŒ›"transmit"èĄšç€ș䞍æˆȘèŽ·èż”ć›žé”źïŒŒć‘ćŽäŒ é€’ç»™WebviewçȘ—ćŁç»§ç»­ć€„ç†ïŒˆäžŽæœȘ星ç€șç­‰ćŸ…æĄ†çš„æƒ…ć†”äž€è‡ŽïŒ‰ă€‚ + * - none: æˆȘèŽ·èż”ć›žé”źïŒŒäžćšä»»äœ•ć“ćș” + * - close: æˆȘèŽ·èż”ć›žé”źćč¶ć…łé—­ç­‰ćŸ…æĄ† + * - transmit: 䞍æˆȘèŽ·èż”ć›žé”źïŒŒç»§ç»­äŒ é€’ç»™WebviewçȘ—揣 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + back?: 'none' | 'close' | 'transmit'; + /** + * è‡Ș漚äč‰ç­‰ćŸ…æĄ†äžŠloadingć›Ÿæ ‡æ ·ćŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + loading?: PlusNativeUIWaitingLoadingOptions; +} + +/** + * JSONćŻčè±ĄïŒŒćŽŸç”Ÿç­‰ćŸ…ćŻčèŻæĄ†äžŠloadingć›Ÿæ ‡è‡Ș漚ä艿 ·ćŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ +interface PlusNativeUIWaitingLoadingOptions { + /** + * loadingć›Ÿæ ‡æ˜Ÿç€șæ ·ćŒ + * ćŻć–ć€ŒïŒš + * "block"èĄšç€șć›Ÿæ ‡äžŽæ–‡ć­—ćˆ†ćŒ€äž€èĄŒæ˜Ÿç€șïŒŒäžŠéąæ˜Ÿç€șloadingć›Ÿæ ‡ïŒŒäž‹éąæ˜Ÿç€șæ–‡ć­—ïŒ› + * "inline"èĄšç€șloadingć›Ÿæ ‡äžŽæ–‡ć­—ćœšćŒäž€èĄŒæ˜Ÿç€șïŒŒć·ŠèŸč星ç€șloadingć›Ÿæ ‡ïŒŒćłèŸč星ç€șæ–‡ć­—ïŒ› + * "none"èĄšç€ș䞍星ç€șloadingć›Ÿæ ‡ïŒ› + * - block: + * loadingć›Ÿæ ‡äžŽæ–‡ć­—ćˆ†ćŒ€äž€èĄŒæ˜Ÿç€șïŒŒäžŠéąæ˜Ÿç€șloadingć›Ÿæ ‡ïŒŒäž‹éąæ˜Ÿç€șæ–‡ć­—ă€‚ + * + * - inline: + * loadingć›Ÿæ ‡äžŽæ–‡ć­—ćœšćŒäž€èĄŒæ˜Ÿç€șïŒŒć·ŠèŸč星ç€șloadingć›Ÿæ ‡ïŒŒćłèŸč星ç€șæ–‡ć­—ă€‚ + * + * - none: + * 䞍星ç€șloadingć›Ÿæ ‡ă€‚ + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + display?: 'block' | 'inline' | 'none'; + /** + * loadingć›Ÿæ ‡é«˜ćșŠ + * èźŸçœźloadingć›Ÿæ ‡çš„é«˜ćșŠïŒˆćźœćșŠç­‰æŻ”çŽ‡çŒ©æ”ŸïŒ‰ïŒŒć–ć€Œç±»ćž‹ïŒšćƒçŽ ć€ŒïŒŒćŠ‚"14px"èĄšç€ș14ćƒçŽ é«˜ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + height?: string; + /** + * loadingć›Ÿæ ‡è·ŻćŸ„ + * è‡Ș漚äč‰loadingć›Ÿæ ‡çš„è·ŻćŸ„ïŒŒpngæ ŒćŒïŒŒćč¶äž”ćż…éĄ»æ˜ŻæœŹćœ°è”„æșćœ°ć€ïŒ› + * loadingć›ŸèŠæ±‚ćźœæ˜Żé«˜çš„æ•Žæ•°ć€ïŒŒæ˜Ÿç€șç­‰ćŸ…æĄ†æ—¶æŒ‰ç…§ć›Ÿç‰‡çš„é«˜æšȘ搑æˆȘć–æŻćž§ćˆ·æ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + icon?: string; + /** + * loadingć›ŸæŻćž§ćˆ·æ–°é—Žéš” + * ć•äœäžșmsïŒˆæŻ«ç§’ïŒ‰ïŒŒé»˜èź€ć€Œäžș100ms。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + interval?: number; +} + +/** + * JSONćŻčè±ĄïŒŒçł»ç»Ÿæç€șæ¶ˆæŻæĄ†èŠèźŸçœźçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ +interface PlusNativeUIToastOptions { + /** + * 提ç€șæ¶ˆæŻæĄ†ćœšć±ćč•䞭的氎ćčłäœçœź + * ćŻé€‰ć€Œäžș"left"、"center"、"right"ïŒŒćˆ†ćˆ«äžșæ°Žćčłć±…ć·Šă€ć±…äž­ă€ć±…ćłïŒŒæœȘèźŸçœźæ—¶é»˜èź€ć€Œäžș"center"。 + * - left: æ°Žćčłć±…ć·ŠćŻč霐 + * - center: æ°Žćčłć±…äž­ćŻč霐 + * - right: æ°Žćčłć±…ć·ŠćŻč霐 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + align?: 'left' | 'center' | 'right'; + /** + * 提ç€șæ¶ˆæŻæĄ†æ˜Ÿç€ș的时闎 + * ćŻé€‰ć€Œäžș"long"、"short"ïŒŒć€Œäžș"long"时星ç€șæ—¶é—ŽçșŠäžș3.5sïŒŒć€Œäžș"short"时星ç€șæ—¶é—ŽçșŠäžș2sæœȘèźŸçœźæ—¶é»˜èź€ć€Œäžș"short"。 + * - long: é•żæ˜Ÿç€șæ—¶é—Ž + * - short: 短星ç€șæ—¶é—Ž + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + duration?: 'long' | 'short'; + /** + * 提ç€șæ¶ˆæŻæĄ†äžŠæ˜Ÿç€șçš„ć›Ÿæ ‡ + * ä»…æ”ŻæŒæœŹćœ°ć›Ÿç‰‡è·ŻćŸ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + icon?: string; + /** + * ć›Ÿæ ‡çš„ćźœćșŠ + * ć•äœäžșpxïŒˆé€»èŸ‘ćƒçŽ ć€ŒïŒ‰ïŒŒé»˜èź€ć€Œäžșć›Ÿç‰‡çš„ćźœćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + iconWidth?: string; + /** + * ć›Ÿæ ‡çš„é«˜ćșŠ + * ć•äœäžșpxïŒˆé€»èŸ‘ćƒçŽ ć€ŒïŒ‰ïŒŒé»˜èź€ć€Œäžșć›Ÿç‰‡çš„é«˜ćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + iconHeight?: string; + /** + * 提ç€șæ¶ˆæŻæĄ†äžŠæ˜Ÿç€șçš„æ ·ćŒ + * ćŻć–ć€ŒïŒš + * "block"èĄšç€șć›Ÿæ ‡äžŽæ–‡ć­—ćˆ†äž€èĄŒæ˜Ÿç€șïŒŒäžŠéąæ˜Ÿç€șć›Ÿæ ‡ïŒŒäž‹éąæ˜Ÿç€șæ–‡ć­—ïŒ› + * "inline"èĄšç€șć›Ÿæ ‡äžŽæ–‡ć­—ćœšćŒäž€èĄŒæ˜Ÿç€șïŒŒć·ŠèŸč星ç€șć›Ÿæ ‡ïŒŒćłèŸč星ç€șæ–‡ć­—ă€‚ + * é»˜èź€ć€Œäžș"block"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + style?: string; + /** + * 提ç€șæ¶ˆæŻæĄ†äžŠæ˜Ÿç€șçš„æ–‡æœŹç±»ćž‹ + * ćŻć–ć€ŒïŒš + * "text" - 星ç€șçš„æ¶ˆæŻć†…ćźčäžșæ–‡æœŹć­—çŹŠäžČ + * "richtext" - 星ç€șçš„æ¶ˆæŻć†…ćźčäžșćŻŒæ–‡æœŹć†…ćźč。 + * é»˜èź€ć€Œäžș"text"。 + * ćœ“typeäžș"text"æ—¶ïŒŒćŻŒæ–‡æœŹäœżç”šhtmlçš„éƒšćˆ†æ ‡ç­ŸïŒŒć…·äœ“æ ‡ç­ŸćŠ‚äž‹ïŒš + * ć›Ÿç‰‡æ ‡ç­Ÿ<img src="ć›Ÿç‰‡è”„æșurl朰杀" width="ć›Ÿç‰‡æ˜Ÿç€șçš„ćźœćșŠ" height="ć›Ÿç‰‡æ˜Ÿç€ș的高ćșŠ" onclick="console.log('clicked img')"></img> + * ć­—äœ“æ ‡ç­Ÿ<font color="ć­—äœ“éąœè‰Č"></font>ïŒŒć†…ćźčćœšäž€èĄŒæ˜Ÿç€ș䞍䞋时è‡ȘćŠšæąèĄŒïŒŒèĄŒé«˜é»˜èź€äžșć­—äœ“çš„1.2ć€ïŒ› + * æąèĄŒæ ‡ç­Ÿ<br/> + * 铟掄标筟<a onclick="console.log('clicked a')">é“ŸæŽ„ćœ°ć€</a>。 + * 橂ç€ș䟋“<img onclick="console.log('clicked img')" src="http://img-cdn-qiniu.dcloud.net.cn/icon2.png"/><a onclick="console.log(clicked a)">é“ŸæŽ„ćœ°ć€</a>”。 + * - text: æ–‡æœŹć­—çŹŠäžČ + * - richtext: ćŻŒæ–‡æœŹć†…ćźč + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + type?: 'text' | 'richtext'; + /** + * ćŻŒæ–‡æœŹæ ·ćŒ + * ćœ“typeć±žæ€§ć€Œäžș"richtext"时有效甚äșŽćźšäč‰ćŻŒæ–‡æœŹçš„æ ·ćŒïŒŒćŠ‚ć…¶æ–‡æœŹćŻč霐æ–čćŒă€äœżç”šçš„ć­—äœ“ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + richTextStyle?: PlusNativeObjRichTextStyles; + /** + * 提ç€șæ¶ˆæŻćœšć±ćč•äž­çš„ćž‚ç›Žäœçœź + * ćŻé€‰ć€Œäžș"top"、"center"、"bottom"ïŒŒćˆ†ćˆ«äžș枂盎汅饶、汅䞭、汅ćș•æœȘèźŸçœźæ—¶é»˜èź€ć€Œäžș"bottom"。 + * - top: 枂盎汅饶ćŻč霐 + * - center: 枂盎汅䞭ćŻč霐 + * - bottom: 枂盎汅ćș•ćŻč霐 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + verticalAlign?: 'top' | 'center' | 'bottom'; +} + +/** + * navigator甹äșŽçźĄç†æ”è§ˆć™šèżèĄŒçŽŻćąƒäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ +interface PlusNavigator { + /** + * 戛ć»șćș”ç”šćż«æ·æ–čćŒèŠèźŸçœźçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + ShortcutOptions?: PlusNavigatorShortcutOptions; + /** + * 曎新ćș”ç”šćŻćŠšç•ŒéąèŠèźŸçœźçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + SplashscreenOptions?: PlusNavigatorSplashscreenOptions; + /** + * èżèĄŒçŽŻćąƒæƒé™ç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + PermissionNames?: PlusNavigatorPermissionNames; + /** + * æŁ€æŸ„èżèĄŒçŽŻćąƒçš„æƒé™ + * ć‘çł»ç»ŸæŁ€æŸ„ćœ“ć‰çš‹ćșçš„æƒé™çŠ¶æ€ïŒŒäžè§Šć‘æƒé™ç›žćŻčćș”çš„ćŠŸèƒœAPIçš„è°ƒç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + checkPermission(permission?: PlusNavigatorPermissionNames): string; + /** + * 慳闭ćș”ç”šćŻćŠšç•Œéą + * ćŸˆć€šæƒ…ć†”äž‹ïŒŒćș”ç”šćŻćŠšćŽéœ€èŠäž€æź”æ—¶é—ŽćŠ èœœæ•°æźïŒŒäžșäș†éżć…ç•Œéąæ˜Ÿç€șç©șç™œć†…ćźč提高甚户䜓éȘŒæ•ˆæžœïŒŒèż™æ—¶ćŻæ˜Ÿç€ș搯抹界靱。 + * ç­‰æ•°æźćŠ èœœćźŒæˆćŽć†ć…łé—­ćŻćŠšç•Œéąèż›ć…„ćș”ç”šïŒŒé€šćžžćŻćœšćș”ç”šéŠ–ç•ŒéąćŠ èœœæ•°æźćźŒæˆćč¶æ›Žæ–°æ˜Ÿç€ș憅ćźčćŽè°ƒç”šæ­€æ–čæł•。 + * æłšæ„ïŒšHBuilder7.1ç‰ˆæœŹćŽćŻćŠšç•Œéąäžè°ƒç”šæ­€æ–čæł•è¶…èż‡6ç§’ćŽäŒšè‡Ș抹慳闭。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + closeSplashscreen(): void; + /** + * æŸ„èŻąèźŸć€‡æ˜ŻćŠäžșćˆ˜æ”·ć± + * ćˆ˜æ”·ć±èż”ć›žtrueïŒŒćŠćˆ™èż”ć›žfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + hasNotchInScreen(): boolean; + /** + * æŸ„èŻąćș”ç”šćŻćŠšç•Œéąæ˜ŻćŠć·Č慳闭 + * ćŠ‚æžœćŻćŠšç•Œéąæ˜Ÿç€șèż”ć›žtrueïŒŒćŠćˆ™èż”ć›žfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + hasSplashscreen(): boolean; + /** + * 曎新皋ćșćŻćŠšç•Œéą + * ćŻèźŸçœźćŻćŠšç•Œéąæ˜Ÿç€șçš„ć›Ÿç‰‡ïŒˆä»…æ”ŻæŒæœŹćœ°æ–‡ä»¶è·ŻćŸ„ïŒŒćŠ‚æžœæ˜Żçœ‘ç»œè”„æșćŻć…ˆé€šèż‡plus.downloader.*äž‹èœœćˆ°æœŹćœ°ïŒ‰ïŒŒ + * æ›Žæ–°ćŻćŠšç•ŒéąćŽçš‹ćșäž‹æŹĄćŻćŠšæ—¶ç”Ÿæ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + updateSplashscreen(options?: PlusNavigatorSplashscreenOptions): void; + /** + * 戛ć»șćș”ç”šćż«æ·æ–čćŒ + * ćœšçł»ç»ŸæĄŒéąćˆ›ć»șćș”ç”šçš„ćż«æ·æ–čćŒïŒŒç‚čć‡»ćŽćŻç›ŽæŽ„ćŻćŠšćș”甚。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + createShortcut(options?: PlusNavigatorShortcutOptions, successCallback?: (result: any) => void): void; + /** + * æŸ„èŻąæ˜ŻćŠć­˜ćœšćș”ç”šćż«æ·æ–čćŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + hasShortcut(options?: PlusNavigatorShortcutOptions, successCallback?: (result: any) => void): void; + /** + * ćˆ€æ–­ćœ“ć‰ćș”ç”šæ˜ŻćŠćˆ‡æąćˆ°ćŽć° + * ćœšć€šćș”ç”šèżèĄŒçŽŻćąƒïŒˆćŠ‚æ”ćș”ç”šïŒ‰äž­ïŒŒćŻćŠšäž€äžȘ新ćș”甚时äč‹ć‰èżèĄŒçš„ćș”ç”šć°†äŒšè‡ȘćŠšćˆ‡æąćˆ°ćŽć°èżèĄŒïŒŒæ­€æ—¶plus.navigator.isBackground()èż”ć›žçŠ¶æ€ćȘäžștrue。 + * æłšæ„ïŒšæ­€çŠ¶æ€äžæ˜Ż5+ćș”ç”šćˆ‡æąćˆ°çł»ç»ŸćŽć°çš„çŠ¶æ€ïŒŒè€Œæ˜ŻćœšćŒäž€apkäž­ćŒæ—¶èżèĄŒć€šäžȘćș”ç”šæ—¶èą«ćˆ‡æąćˆ°ćŽć°çš„çŠ¶æ€ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + isBackground(): boolean; + /** + * ćˆ€æ–­ćș”ç”šćœ“ć‰æ˜ŻćŠć…šć±æšĄćŒæ˜Ÿç€ș + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + isFullscreen(): boolean; + /** + * ćˆ€æ–­ćș”ç”šćœ“ć‰æ˜ŻćŠèŸ“ć‡șæ—„ćż— + * æ—„ćż—ćŒ…æ‹Źćș”ç”šćŽŸç”Ÿć±‚ć†…éƒšè·ŸèžȘæ—„ćż—ïŒˆADB、LogCatć·„ć…·ćŻèŽ·ć–çš„æ—„ćż—ïŒ‰ćŠJSć±‚è·ŸèžȘæ—„ćż—ïŒˆconsole.log蟓ć‡șçš„æ—„ćż—ïŒ‰ă€‚ + * ćŒ€ćŻæ—„ćż—ćœšäž€ćźšçš‹ćșŠäžŠäŒšé™äœŽçš‹ćșçš„æ€§èƒœïŒŒé€šćžžć»șèźźćœšæ­ŁćŒć‘ćžƒæ—¶ć…łé—­æ—„ćż—èŸ“ć‡șïŒŒćœšè°ƒèŻ•æ—¶ćŒ€ćŻæ—„ćż—èŸ“ć‡șïŒˆæ­€æ—¶ćŻä»„é€šèż‡ć·„ć…·ADB、LogCatèŽ·ć–ćˆ†æžæ—„ćż—ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + isLogs(): boolean; + /** + * èźŸçœźćș”ç”šæ˜ŻćŠć…šć±æ˜Ÿç€ș + * èźŸçœźćș”ç”šćœšć…šć±æšĄćŒæ˜Ÿç€șæ—¶ïŒŒć°†éšè—çł»ç»ŸçŠ¶æ€æ ïŒŒé€šćžžæžžæˆç±»ćș”ç”šæ‰äŒšèźŸçœźäžșć…šć±æšĄćŒæ˜Ÿç€ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + setFullscreen(fullscreen?: boolean): void; + /** + * èźŸçœźćș”ç”šæ˜ŻćŠèŸ“ć‡șæ—„ćż— + * èźŸçœźćș”ç”šæ˜ŻćŠèŸ“ć‡șæ—„ćż—äżĄæŻïŒŒé»˜èź€ć…łé—­èŸ“ć‡șæ—„ćż—ćŠŸèƒœă€‚ + * æ—„ćż—ćŒ…æ‹Źćș”ç”šćŽŸç”Ÿć±‚ć†…éƒšè·ŸèžȘæ—„ćż—ïŒˆADB、LogCatć·„ć…·ćŻèŽ·ć–çš„æ—„ćż—ïŒ‰ćŠJSć±‚è·ŸèžȘæ—„ćż—ïŒˆconsole.log蟓ć‡șçš„æ—„ćż—ïŒ‰ă€‚ + * ćŒ€ćŻæ—„ćż—ćœšäž€ćźšçš‹ćșŠäžŠäŒšé™äœŽçš‹ćșçš„æ€§èƒœïŒŒé€šćžžć»șèźźćœšæ­ŁćŒć‘ćžƒæ—¶ć…łé—­æ—„ćż—èŸ“ć‡șïŒŒćœšè°ƒèŻ•æ—¶ćŒ€ćŻæ—„ćż—èŸ“ć‡șïŒˆæ­€æ—¶ćŻä»„é€šèż‡ć·„ć…·ADB、LogCatèŽ·ć–ćˆ†æžæ—„ćż—ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + setLogs(log?: boolean): void; + /** + * èźŸçœźçł»ç»ŸçŠ¶æ€æ èƒŒæ™Żéąœè‰Č + * èźŸçœźćș”ç”šćœšć‰ć°èżèĄŒæ—¶çł»ç»ŸçŠ¶æ€æ çš„èƒŒæ™Żéąœè‰ČïŒŒé»˜èź€äœżç”šçł»ç»ŸçŠ¶æ€æ é»˜èź€èƒŒæ™Żè‰ČïŒˆæœ‰çł»ç»ŸçŠ¶æ€æ æ ·ćŒć†łćźšïŒ‰ă€‚ + * æłšæ„ïŒšäžșäș†æœ‰æ›Žć„œçš„ć…Œćźčæ€§ïŒŒéżć…èźŸçœźæŽ„èż‘ç™œè‰Č或黑è‰Č的鱜è‰Čć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + setStatusBarBackground(color?: string): void; + /** + * èŽ·ć–çł»ç»ŸçŠ¶æ€æ èƒŒæ™Żéąœè‰Č + * èŽ·ć–ćș”ç”šćœšć‰ć°èżèĄŒæ—¶çł»ç»ŸçŠ¶æ€æ çš„èƒŒæ™Żéąœè‰Č。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + getStatusBarBackground(): string; + /** + * èźŸçœźçł»ç»ŸçŠ¶æ€æ æ ·ćŒ + * èźŸçœźćș”ç”šćœšć‰ć°èżèĄŒæ—¶çł»ç»ŸçŠ¶æ€æ çš„æ ·ćŒïŒŒé»˜èź€ć€ŒćŻé€šèż‡manifest.json文件的plus->statusbar->styleé…çœźă€‚ + * æłšæ„ïŒšæ­€æ“äœœæ˜Żćș”ç”šć…šć±€é…çœźïŒŒè°ƒç”šçš„WebviewçȘ—ćŁć…łé—­ćŽä»ç„¶ç”Ÿæ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + setStatusBarStyle(style?: string): void; + /** + * èŽ·ć–çł»ç»ŸçŠ¶æ€æ æ ·ćŒ + * èŽ·ć–ćș”ç”šèżèĄŒæ—¶çł»ç»ŸçŠ¶æ€æ çš„æ ·ćŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + getStatusBarStyle(): string; + /** + * èŽ·ć–çł»ç»ŸçŠ¶æ€æ é«˜ćșŠ + * ć•äœäžșćƒçŽ ïŒˆpxïŒ‰ïŒŒć€ŒäžșWebview䞭的逻蟑高ćșŠć•äœïŒŒćŠ‚æžœèŠèŽ·ć–çœŸćźžé«˜ćșŠćˆ™ćż…饻äč˜ä»„plus.screen.scale。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + getStatusbarHeight(): number; + /** + * ćˆ€æ–­ćœ“ć‰æ˜ŻćŠäžșæČ‰æ”žćŒçŠ¶æ€æ æšĄćŒ + * ćŠ‚æžœćœ“ć‰ćș”甚采甚æČ‰æ”žćŒçŠ¶æ€æ ćˆ™èż”ć›žtrueïŒŒćŠćˆ™èż”ć›žfalse。 + * æłšæ„ïŒšćŠ‚æžœćœ“ć‰çł»ç»Ÿç‰ˆæœŹäžæ”ŻæŒæČ‰æ”žćŒçŠ¶æ€æ äčŸèż”曞false。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + isImmersedStatusbar(): boolean; + /** + * èźŸçœźuserAgentć€Œ + * èźŸçœźćș”ç”šé€šèż‡navigator.userAgentèŽ·ć–çš„ć€ŒïŒŒćŠæ‰€æœ‰ć‘è”·HttpèŻ·æ±‚æ—¶æäș€çš„userAgentć€Œă€‚ + * ćŠ‚æžœèŠèźŸçœźćŻćŠšéĄ”éąçš„userAgentć€Œćˆ™éœ€èŠćœšmanifest.jsonäž­èż›èĄŒé…çœźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + setUserAgent(useragent?: string, checkplus?: boolean): void; + /** + * èŽ·ć–userAgentć€Œ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + getUserAgent(): string; + /** + * èźŸçœźCookieć€Œ + * èźŸçœźćș”ç”šć‘è”·HttpèŻ·æ±‚æ—¶æäș€çš„cookieć€ŒïŒŒè°ƒç”šæ­€æŽ„ćŁćŽæ‰€æœ‰çš„èŻ·æ±‚éƒœç”Ÿæ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + setCookie(url?: string, value?: string): void; + /** + * èŽ·ć–Cookieć€Œ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + getCookie(url?: string): string; + /** + * ćˆ é™€ćș”甚所有Cookieć€Œ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + removeAllCookie(): void; + /** + * ćˆ é™€ćș”甚Cookie + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + removeCookie(url?: string): void; + /** + * ćˆ é™€ćș”ç”šæ‰€æœ‰äŒšèŻæœŸCookieć€Œ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + removeSessionCookie(): void; +} + +/** + * 戛ć»șćș”ç”šćż«æ·æ–čćŒèŠèźŸçœźçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ +interface PlusNavigatorShortcutOptions { + /** + * ćż«æ·æ–čćŒćç§° + * ćŠ‚æžœæœȘèźŸçœźćˆ™äœżç”šćș”ç”šçš„ćç§°ïŒŒmanifest.jsonäž­nameć±žæ€§ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + name?: string; + /** + * ćż«æ·æ–čćŒçš„ć›Ÿæ ‡ + * ćŠ‚æžœæœȘèźŸçœźćˆ™äŒ˜ć…ˆäœżç”šćș”ç”šäž­æŒ‡ćźšçš„ć›Ÿæ ‡ïŒˆmanifest.jsonäž­icon节ç‚č例ćŻčćș”ćˆ†èŸšçŽ‡çš„ć›Ÿæ ‡ïŒ‰ïŒŒćŠ‚æœȘćŒșé…ćˆ™äœżç”šćș”ç”šçš„ć›Ÿæ ‡ïŒˆä»…ćœšç‹Źç«‹æ‰“ćŒ…æ—¶ïŒ‰ïŒŒćŠćˆ™äœżç”šruntimeæäŸ›çš„é»˜èź€ć›Ÿæ ‡ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + icon?: string; + /** + * 戛ć»șćż«æ·æ–čćŒćŽçš„æç€șäżĄæŻ + * ćż«æ·æ–čćŒćˆ›ć»șæˆćŠŸćŽæ˜Ÿç€șïŒŒé»˜èź€æç€ș憅ćźčäžș“"XXXX"ć·Č戛ć»șæĄŒéąćż«æ·æ–čćŒâ€ïŒŒć…¶äž­"XXXX"äžș繋ćșçš„ćç§°ïŒŒćŠ‚æžœäžéœ€èŠæç€șćˆ™èźŸçœźæ­€ć€Œäžșç©ș歗笩äžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + toast?: string; + /** + * ćż«æ·æ–čćŒçš„æ‰©ć±•ć‚æ•° + * ć…¶äž­key撌valueć€Œéƒœćż…éĄ»æ˜Żć­—çŹŠäžČ类枋。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + extra?: any; + /** + * èŠćŻćŠšActivityç±»ć + * é€šćžžæƒ…ć†”äž‹äžéœ€èŠæŒ‡ćźšæ­€ć€ŒïŒŒä»…ćœš5+SDK集成时è‡Ș漚äč‰Activityæ‰ç”šćˆ°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + classname?: string; + /** + * æ˜ŻćŠéœ€èŠćŒșćˆ¶ćˆ›ć»șćż«æ·æ–čćŒ + * trueèĄšç€șćŒșćˆ¶ćˆ›ć»șfalseèĄšç€ș䞍ćŒșćˆ¶ćˆ›ć»șïŒŒé»˜èź€ć€Œäžștrue。 + * ćŒșćˆ¶ćˆ›ć»șćŻèƒœäŒšćŻŒè‡Žćœšæ— æł•ćˆ€æ–­ćż«æ·æ–čćŒæ˜ŻćŠć­˜ćœšçš„èźŸć€‡äžŠé‡ć€ćˆ›ć»șïŒŒćŠ‚æžœéœ€èŠć°œćŻèƒœéżć…ć‡șçŽ°é‡ć€ćˆ›ć»șæĄŒéąćż«æ·æ–čćŒćˆ™ćș”èŻ„èźŸçœźforceć±žæ€§ć€Œäžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + force?: boolean; +} + +/** + * 曎新ćș”ç”šćŻćŠšç•ŒéąèŠèźŸçœźçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ +interface PlusNavigatorSplashscreenOptions { + /** + * ćŻćŠšç•Œéąçš„ć›Ÿç‰‡è·ŻćŸ„ + * ä»…æ”ŻæŒæœŹćœ°æ–‡ä»¶è·ŻćŸ„ïŒŒć›Ÿç‰‡ćż…éĄ»äžșpngæ ŒćŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + image?: string; + /** + * æ˜ŻćŠè‡Ș抹慳闭搯抹界靱 + * trueèĄšç€șćș”甚搯抚搎è‡ȘćŠšć…łé—­ćŻćŠšç•ŒéąïŒŒfalseèĄšç€șćș”ç”šćŻćŠšćŽäžè‡ȘćŠšć…łé—­ćŻćŠšç•ŒéąïŒŒéœ€èŠćœšćș”甚调甚plus.navigator.closeSplashscreen()æ–čæł•慳闭。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + autoclose?: boolean; + /** + * æ˜ŻćŠè‡ȘćŠšć…łé—­ćŻćŠšç•ŒéąïŒˆWAP2APPćș”甚 + * 侎autocloseć±žæ€§ć€Œäœœç”šäž€è‡ŽïŒŒä»…ćœšWAP2APPćș”ç”šäž­æœ‰æ•ˆă€‚ + * äžæŽšèèźŸçœźæ­€ć€ŒïŒŒćŠ‚æžœæœȘèźŸçœźäŒšè‡ȘćŠšäœżç”šautocloseć±žæ€§ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + autoclose_w2a?: boolean; + /** + * ćŻćŠšç•Œéąć»¶æ—¶ć…łé—­æ—¶é—Ž + * ä»…ćœšèźŸçœźäžșè‡ȘćŠšć…łé—­ćŻćŠšç•Œéąæ—¶æœ‰æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + delay?: number; + /** + * ćŻćŠšç•Œéąć»¶æ—¶ć…łé—­æ—¶é—ŽïŒˆWAP2APPćș”甚 + * 侎delayć±žæ€§ć€Œäœœç”šäž€è‡ŽïŒŒä»…ćœšWAP2APPćș”ç”šäž­æœ‰æ•ˆă€‚ + * äžæŽšèèźŸçœźæ­€ć€ŒïŒŒćŠ‚æžœæœȘèźŸçœźäŒšè‡ȘćŠšäœżç”šdelayć±žæ€§ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + delay_w2a?: number; +} + +/** + * èżèĄŒçŽŻćąƒæƒé™ç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ +interface PlusNavigatorPermissionNames { + /** + * èźżé—źæ‘„ćƒć€Žæƒé™ + * 甹äșŽè°ƒç”šæ‘„ćƒć€ŽïŒˆplus.camera.*、plus.barcode.*ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + CAMERA?: string; + /** + * èźżé—źçł»ç»Ÿè”çł»äșș权限 + * 甹äșŽèźżé—źïŒˆèŻ»ă€ć†™ïŒ‰çł»ç»Ÿé€šèźŻćœ•ïŒˆplus.gallery.*ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + CONTACTS?: string; + /** + * èźżé—źçł»ç»Ÿç›žć†Œæƒé™ + * 甹äșŽèźżé—źïŒˆèŻ»ă€ć†™ïŒ‰çł»ç»Ÿç›žć†ŒïŒˆplus.gallery.*ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + GALLERY?: string; + /** + * ćźšäœæƒé™ + * 甹äșŽèŽ·ć–ćœ“ć‰ç”šæˆ·äœçœźäżĄæŻïŒˆplus.geolocation.*ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + LOCATION?: string; + /** + * æ¶ˆæŻé€šçŸ„æƒé™ + * 甹äșŽæŽ„æ”¶çł»ç»Ÿæ¶ˆæŻé€šçŸ„ïŒˆplus.push.*ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + NOTIFITION?: string; + /** + * ćœ•éŸłæƒé™ + * 甹äșŽèż›èĄŒæœŹćœ°ćœ•éŸłæ“äœœïŒˆplus.audio.AudioRecorderïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + RECORD?: string; + /** + * 戛ć»șæĄŒéąćż«æ·æ–čćŒæƒé™ + * 甹äșŽćœšçł»ç»ŸæĄŒéąćˆ›ć»șćż«æ·æ–čćŒć›Ÿæ ‡ïŒˆplus.navigator.createShortcutïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + SHORTCUT?: string; +} + +/** + * OrientationæšĄć—çźĄç†èźŸć€‡çš„æ–čć‘äżĄæŻïŒŒćŒ…æ‹Źalpha、beta、gamma侉äžȘæ–čć‘äżĄæŻïŒŒé€šèż‡plus.orientationćŻèŽ·ć–èźŸć€‡æ–č搑缡理ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/orientation.html](http://www.html5plus.org/doc/zh_cn/orientation.html) + */ +interface PlusOrientation { + /** + * JSONćŻčè±ĄïŒŒç›‘ćŹèźŸć€‡æ–čć‘æ„Ÿćș”ć™šć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/orientation.html](http://www.html5plus.org/doc/zh_cn/orientation.html) + */ + OrientationOption?: PlusOrientationOrientationOption; + /** + * JSONćŻčè±ĄïŒŒèźŸć€‡æ–čć‘äżĄæŻæ•°æź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/orientation.html](http://www.html5plus.org/doc/zh_cn/orientation.html) + */ + Rotation?: PlusOrientationRotation; + /** + * èŽ·ć–ćœ“ć‰èźŸć€‡çš„æ–čć‘äżĄæŻïŒŒćŒ…æ‹Źalpha、beta、gamma侉äžȘæ–čć‘äżĄæŻ + * æ–čć‘äżĄæŻæ˜ŻèźŸć€‡ç›žćŻčäșŽæ°Žćčłćˆć§‹æ–čć‘ćˆ†ćˆ«ä»„z、x、y蜎äžșèœŽćżƒæ—‹èœŹçš„è§’ćșŠïŒŒćŻčćș”ć€Œäžșalpha、beta、gamma侉äžȘæ–čć‘çš„äżĄæŻă€‚ æ–čć‘äżĄæŻćŻé€šèż‡successCBć›žè°ƒć‡œæ•°èż”ć›žă€‚æ–čć‘äżĄæŻèŽ·ć–ć€±èŽ„ćˆ™è°ƒç”šć›žè°ƒć‡œæ•°errorCB + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/orientation.html](http://www.html5plus.org/doc/zh_cn/orientation.html) + */ + getCurrentOrientation(successCB?: (result: string) => void, errorCB?: (result: any) => void): void; + /** + * ç›‘ćŹèźŸć€‡æ–čć‘äżĄæŻçš„ć˜ćŒ– + * æ–čć‘äżĄæŻæ˜ŻèźŸć€‡ç›žćŻčäșŽæ°Žćčłćˆć§‹æ–čć‘ćˆ†ćˆ«ä»„z、x、y蜎äžșèœŽćżƒæ—‹èœŹçš„è§’ćșŠïŒŒćŻčćș”ć€Œäžșalpha、beta、gamma侉äžȘæ–čć‘çš„äżĄæŻă€‚watchOrientationæŻéš”ć›șćźšæ—¶é—Žć°±èŽ·ć–äž€æŹĄèźŸć€‡çš„æ–čć‘äżĄæŻïŒŒé€šèż‡successCBć›žè°ƒć‡œæ•°èż”ć›žă€‚ćŻé€šèż‡option的frequencyć‚æ•°èźŸćźšèŽ·ć–èźŸć€‡æ–čć‘äżĄæŻçš„æ—¶é—Žé—Žéš”ă€‚æ–čć‘äżĄæŻèŽ·ć–ć€±èŽ„ćˆ™è°ƒç”šć›žè°ƒć‡œæ•°errorCB。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/orientation.html](http://www.html5plus.org/doc/zh_cn/orientation.html) + */ + watchOrientation(successCB?: (result: string) => void, errorCB?: (result: any) => void, option?: PlusOrientationOrientationOption): number; + /** + * ć…łé—­ç›‘ćŹèźŸć€‡æ–čć‘äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/orientation.html](http://www.html5plus.org/doc/zh_cn/orientation.html) + */ + clearWatch(watchId?: number): void; +} + +/** + * JSONćŻčè±ĄïŒŒç›‘ćŹèźŸć€‡æ–čć‘æ„Ÿćș”ć™šć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/orientation.html](http://www.html5plus.org/doc/zh_cn/orientation.html) + */ +interface PlusOrientationOrientationOption { + /** + * 曎新æ–čć‘äżĄæŻçš„æ—¶é—Žé—Žéš” + * æ•°ć€Œç±»ćž‹ïŒŒć•äœäžșmsïŒŒé»˜èź€ć€Œäžș500ms。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/orientation.html](http://www.html5plus.org/doc/zh_cn/orientation.html) + */ + frequency?: number; +} + +/** + * JSONćŻčè±ĄïŒŒèźŸć€‡æ–čć‘äżĄæŻæ•°æź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/orientation.html](http://www.html5plus.org/doc/zh_cn/orientation.html) + */ +interface PlusOrientationRotation { + /** + * 仄zæ–č搑äžșèœŽćżƒçš„æ—‹èœŹè§’ćșŠ + * æ”źç‚čæ•°ç±»ćž‹ïŒŒćȘèŻ»ć±žæ€§ïŒŒć–ć€ŒèŒƒć›Žäžș0戰360䞍等äșŽ360ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/orientation.html](http://www.html5plus.org/doc/zh_cn/orientation.html) + */ + alpha?: number; + /** + * 仄xæ–č搑äžșèœŽćżƒçš„æ—‹èœŹè§’ćșŠ + * æ”źç‚čæ•°ç±»ćž‹ïŒŒćȘèŻ»ć±žæ€§ïŒŒć–ć€ŒèŒƒć›Žäžș-180戰180䞍等äșŽ180ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/orientation.html](http://www.html5plus.org/doc/zh_cn/orientation.html) + */ + beta?: number; + /** + * 仄yæ–č搑äžșèœŽćżƒçš„æ—‹èœŹè§’ćșŠ + * æ”źç‚čæ•°ç±»ćž‹ïŒŒćȘèŻ»ć±žæ€§ïŒŒć–ć€ŒèŒƒć›Žäžș-180戰180䞍等äșŽ180ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/orientation.html](http://www.html5plus.org/doc/zh_cn/orientation.html) + */ + gamma?: number; + /** + * èźŸć€‡æ–č搑侎朰球磁ćœșćŒ—æžæ–čć‘çš„è§’ćșŠ + * æ”źç‚čæ•°ç±»ćž‹ïŒŒćȘèŻ»ć±žæ€§ïŒŒć–ć€ŒèŒƒć›Žäžș0戰360䞍等äșŽ360ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/orientation.html](http://www.html5plus.org/doc/zh_cn/orientation.html) + */ + magneticHeading?: number; + /** + * èźŸć€‡æ–čć‘äžŽćœ°çƒçœŸćźžćŒ—æžæ–čć‘çš„è§’ćșŠ + * æ”źç‚čæ•°ç±»ćž‹ïŒŒćȘèŻ»ć±žæ€§ïŒŒć–ć€ŒèŒƒć›Žäžș0戰360䞍等äșŽ360ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/orientation.html](http://www.html5plus.org/doc/zh_cn/orientation.html) + */ + trueHeading?: number; + /** + * èźŸć€‡æ–čć‘ć€Œçš„èŻŻć·źć€Œ + * æ”źç‚čæ•°ç±»ćž‹ïŒŒćȘèŻ»ć±žæ€§ïŒŒć–ć€ŒèŒƒć›Žäžș0戰360䞍等äșŽ360ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/orientation.html](http://www.html5plus.org/doc/zh_cn/orientation.html) + */ + headingAccuracy?: number; +} + +/** + * ProximityæšĄć—çźĄç†èźŸć€‡è·çŠ»äŒ æ„Ÿć™šïŒŒćŻèŽ·ć–ćœ“ć‰èźŸć€‡çš„æŽ„èż‘è·çŠ»äżĄæŻïŒŒé€šèż‡plus.proximityćŻèŽ·ć–èźŸć€‡è·çŠ»äŒ æ„ŸçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/proximity.html](http://www.html5plus.org/doc/zh_cn/proximity.html) + */ +interface PlusProximity { + /** + * èŽ·ć–ćœ“ć‰èźŸć€‡çš„æŽ„èż‘è·çŠ»äżĄæŻ + * èŽ·ć–ćœ“ć‰æŽ„èż‘èźŸć€‡çš„è·çŠ»äżĄæŻïŒŒè·çŠ»ć€Œć•äœäžșćŽ˜ç±łă€‚ćŠ‚æžœæ„Ÿćș”ć™šæ— æł•èŽ·ć–ć‡†çĄźçš„è·çŠ»ć€ŒïŒŒćˆ™ćœšæŽ„èż‘èźŸć€‡æ—¶èż”ć›ž0ïŒŒćŠćˆ™èż”ć›žInfinity。 èŽ·ć–æˆćŠŸćˆ™è°ƒç”šsuccessCBć›žè°ƒć‡œæ•°èż”æŽ„èż‘ć›žè·çŠ»ć€Œă€‚èŽ·ć–ć€±èŽ„ćˆ™è°ƒç”šerrorCBć›žè°ƒć‡œæ•°é”™èŻŻäżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/proximity.html](http://www.html5plus.org/doc/zh_cn/proximity.html) + */ + getCurrentProximity(successCB?: (result: number) => void, errorCB?: (result: any) => void): void; + /** + * ç›‘ćŹèźŸć€‡æŽ„èż‘è·çŠ»çš„ć˜ćŒ– + * watchProximityć°†ç›‘ćŹèźŸć€‡çš„æŽ„èż‘è·çŠ»äżĄæŻć˜ćŒ–äș‹ä»¶ïŒŒćœ“æŽ„èż‘è·çŠ»ć‘ç”Ÿć˜ćŒ–æ—¶é€šèż‡changeCBć›žè°ƒć‡œæ•°èż”ć›žè·çŠ»ć€Œă€‚ç›‘ćŹè·çŠ»ć˜ćŒ–äș‹ä»¶ć€±èŽ„ćˆ™é€šèż‡errorCBć›žè°ƒć‡œæ•°èż”ć›žé”™èŻŻäżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/proximity.html](http://www.html5plus.org/doc/zh_cn/proximity.html) + */ + watchProximity(changeCB?: (result: number) => void, errorCB?: (result: any) => void): number; + /** + * ć…łé—­ç›‘ćŹèźŸć€‡æŽ„èż‘è·çŠ»ć˜ćŒ– + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/proximity.html](http://www.html5plus.org/doc/zh_cn/proximity.html) + */ + clearWatch(watchId?: number): void; +} + +/** + * RuntimeæšĄć—çźĄç†èżèĄŒçŽŻćąƒïŒŒćŻç”šäșŽèŽ·ć–ćœ“ć‰èżèĄŒçŽŻćąƒäżĄæŻă€äžŽć…¶ćźƒçš‹ćșèż›èĄŒé€šèźŻç­‰ă€‚é€šèż‡plus.runtimećŻèŽ·ć–èżèĄŒçŽŻćąƒçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ +interface PlusRuntime { + /** + * JSONćŻčè±ĄïŒŒæ‰“ćŒ€çŹŹäž‰æ–č繋ćșć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + ApplicationInf?: PlusRuntimeApplicationInf; + /** + * JSONćŻčè±ĄïŒŒćș”甚角标星ç€șéœ€èŠçš„é€šçŸ„æ æ¶ˆæŻçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + BadgeOptions?: PlusRuntimeBadgeOptions; + /** + * JSONćŻčè±ĄïŒŒæ‰“ćŒ€æ–‡ä»¶ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + OpenFileOptions?: PlusRuntimeOpenFileOptions; + /** + * JSONćŻčè±ĄïŒŒćș”ç”šäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + WidgetInfo?: PlusRuntimeWidgetInfo; + /** + * JSONćŻčè±ĄïŒŒćș”ç”šćź‰èŁ…ć‚æ•° + * ćŻé€šèż‡ćŻčè±ĄèźŸçœźćź‰èŁ…çš„ćș”ç”šæ˜ŻćŠèż›èĄŒappidæ ĄéȘŒă€ç‰ˆæœŹć·æ ĄéȘŒç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + WidgetOptions?: PlusRuntimeWidgetOptions; + /** + * ćœ“ć‰ćș”甚的APPID + * ćœ“ć‰ćș”甚的APPIDïŒŒć­—çŹŠäžČç±»ćž‹ă€‚æłšæ„ïŒŒćŠ‚æžœæ˜ŻćœšHBuilder真æœșèżèĄŒèŽ·ć–çš„æ˜Żć›șćźšć€Œ"HBuilder"需芁提äș€Appäș‘ç«Żæ‰“ćŒ…ćŽèżèĄŒæ‰èƒœèŽ·ć–çœŸćźžçš„APPIDć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + appid?: string; + /** + * 第侉æ–č繋ćșè°ƒç”šæ—¶äŒ é€’ç»™çš‹ćșçš„ć‚æ•° + * 第侉æ–č繋ćșäŒ é€’èż‡æ„çš„ć‚æ•°ïŒŒć­—çŹŠäžČæ ŒćŒç±»ćž‹æ•°æźă€‚ + * äžæ˜Żç”±çŹŹäž‰æ–č繋ćșè°ƒç”šćŻćŠšïŒŒćˆ™èż”ć›žç©ș歗笩äžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + arguments?: string; + /** + * ćș”甚的枂ćœș掚ćčżæž é“æ ‡è݆ + * "qihoo:browser"æ ‡èŻ†360æ”è§ˆć™šæ”ćș”甚"qihoo:appstore "èĄšç€ș360手æœșćŠ©æ‰‹æ”ćș”甚"dcloud:streamapps"èĄšç€șDCloud攁ćș”甚ćŸșćș§ă€‚ + * æłšæ„ïŒšä»…æ”ćș”ç”šçŽŻćąƒäž­ćŻç”šïŒˆćŠ‚æžœæČĄæœ‰ç‰čæźŠé…çœźé»˜èź€èż”ć›žèżèĄŒçŽŻćąƒçš„ćŒ…ćïŒ‰ïŒŒéžæ”ćș”ç”šçŽŻćąƒäž­èż”ć›žç©ș歗笩äžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + channel?: string; + /** + * ćș”ç”šćŻćŠšæ„æș + * 5+ APPćŻćŠšç±»ćž‹ïŒŒćŻć–ä»„äž‹ć€ŒïŒš + * "default"ïŒšé»˜èź€ćŻćŠšæ–čćŒïŒŒé€šćžžèĄšç€șćș”ç”šćˆ—èĄšćŻćŠšïŒˆ360æ‰‹ćŠ©äž­æœçŽąćŻćŠšïŒ‰ïŒ› + * "scheme"ïŒšé€šèż‡urlschemeæ–čćŒè§Šć‘ćŻćŠšïŒ› + * "push"ïŒšé€šèż‡ç‚čć‡»çł»ç»Ÿé€šçŸ„æ–čćŒè§Šć‘ćŻćŠšïŒ› + * "stream"ïŒšé€šèż‡æ”ćș”甚apiplus.stream.openïŒ‰ćŻćŠšïŒ› + * "shortcut"ïŒšé€šèż‡ćż«æ·æ–čćŒćŻćŠšïŒŒiOSćčłć°èĄšç€șé€šèż‡3D Touchćż«æ·æ–čćŒïŒŒAndroidćčłć°èĄšç€șé€šèż‡æĄŒéąćż«æ·æ–čćŒćŻćŠšïŒ› + * "barcode"ïŒšé€šèż‡äșŒç»Žç æ‰«æćŻćŠšïŒ› + * "myapp"ïŒšé€šèż‡æ”ćș”甚"我的"ćș”ç”šćˆ—èĄšæˆ–ćŽ†ćČćˆ—èĄšäž­è§Šć‘ćŻćŠšïŒ› + * "favorite"ïŒšé€šèż‡æ”ćș”甚的"收藏"ćș”ç”šćˆ—èĄšćŻćŠšïŒ› + * "browser"ïŒšé€šèż‡æ”ćș”ç”šçš„ć†…çœźæ”è§ˆć™šćŻŒæ”ćŻćŠšçš„æ”ćș”ç”šïŒˆćœ°ć€æ èŸ“ć…„url搯抹ćș”甚、ç‚č懻wapéĄ”éąé“ŸæŽ„ćŻćŠšćș”甚 + * "engines"ïŒšé€šèż‡æ”ćș”ç”šçš„æ”è§ˆć™šç•ŒéąäœœäžșæœçŽąćŒ•æ“ŽćŻćŠšïŒ› + * "search"ïŒšé€šèż‡æ”ćș”甚的ćș”ç”šæœçŽąćŻćŠšćș”ç”šïŒˆćŠ‚iOSćčłć°çš„T9é”źç›˜æœçŽąïŒ‰ïŒ› + * "speech"ïŒšé€šèż‡æ”ćș”ç”šçš„èŻ­éŸłèŻ†ćˆ«ćŻćŠšćș”甚 + * "miniProgram"ïŒšé€šèż‡ćŸźäżĄć°çš‹ćșćŻćŠšćș”甚。 + * - default: + * é»˜èź€ćŻćŠšæ–čćŒïŒŒé€šćžžèĄšç€șä»Žçł»ç»ŸæĄŒéąć›Ÿæ ‡ćŻćŠš + * + * - scheme: + * é€šèż‡urlschemeæ–čćŒè§Šć‘ćŻćŠš + * + * - push: + * é€šèż‡ç‚čć‡»çł»ç»Ÿé€šçŸ„æ–čćŒè§Šć‘ćŻćŠš + * + * - stream: + * é€šèż‡æ”ćș”甚apiplus.stream.openïŒ‰ćŻćŠš + * + * - shortcut: + * iOSćčłć°èĄšç€șé€šèż‡3D Touchćż«æ·æ–čćŒïŒŒAndroidćčłć°èĄšç€șé€šèż‡æĄŒéąćż«æ·æ–čćŒćŻćŠš + * + * - barcode: + * é€šèż‡äșŒç»Žç æ‰«æćŻćŠš + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + launcher?: 'default' | 'scheme' | 'push' | 'stream' | 'shortcut' | 'barcode'; + /** + * ćș”ç”šćź‰èŁ…æ„æș + * 5+ćș”ç”šćź‰èŁ…æ„æșïŒŒćŻć–ä»„äž‹ć€ŒïŒš + * "default"ïŒšé»˜èź€ćź‰èŁ…æ„æșïŒŒapk/ipaćź‰èŁ…ćŒ…ć†…çœźćź‰èŁ…ïŒ› + * "stream"ïŒšé€šèż‡æ”ćș”甚apiplus.stream.openïŒ‰ćź‰èŁ…ïŒŒä»…æ”ćș”ç”šçŽŻćąƒäž‹æ”ŻæŒïŒ› + * "push"ïŒšé€šèż‡ç‚čć‡»çł»ç»Ÿé€šçŸ„æ–čćŒè§Šć‘ćź‰èŁ…ïŒŒä»…æ”ćș”ç”šçŽŻćąƒäž‹æ”ŻæŒïŒ› + * "scheme"ïŒšé€šèż‡urlschemeæ–čćŒè§Šć‘ćź‰èŁ…ïŒŒä»…æ”ćș”ç”šçŽŻćąƒäž‹æ”ŻæŒïŒ› + * "barcode"ïŒšé€šèż‡äșŒç»Žç æ‰«æè§Šć‘ćź‰èŁ…ïŒŒä»…æ”ćș”ç”šçŽŻćąƒäž‹æ”ŻæŒïŒ› + * "silent"ïŒšé€šèż‡ćŽć°é™é»˜æ–čćŒćź‰èŁ…ïŒŒä»…æ”ćș”ç”šçŽŻćąƒäž‹æ”ŻæŒïŒ› + * "speech"ïŒšé€šèż‡èŻ­éŸłèŻ†ćˆ«æ–čćŒè§Šć‘ćź‰èŁ…ïŒŒä»…æ”ćș”ç”šçŽŻćąƒäž‹æ”ŻæŒïŒ› + * "favorite"ïŒšé€šèż‡æ”¶è—ç•ŒéąćŻćŠšè§Šć‘ćź‰èŁ…ïŒŒä»…æ”ćș”ç”šçŽŻćąƒäž‹æ”ŻæŒă€‚ + * - default: + * é»˜èź€ćź‰èŁ…æ„æșïŒŒapk/ipaćź‰èŁ…ćŒ…ć†…çœźćź‰èŁ… + * + * - stream: + * é€šèż‡æ”ćș”甚apiplus.stream.openïŒ‰ćź‰èŁ… + * + * - push: + * é€šèż‡ç‚čć‡»çł»ç»Ÿé€šçŸ„æ–čćŒè§Šć‘ćź‰èŁ… + * + * - scheme: + * é€šèż‡urlschemeæ–čćŒè§Šć‘ćź‰èŁ… + * + * - barcode: + * é€šèż‡äșŒç»Žç æ‰«æè§Šć‘ćź‰èŁ… + * + * - silent: + * é€šèż‡ćŽć°é™é»˜æ–čćŒćź‰èŁ… + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + origin?: 'default' | 'stream' | 'push' | 'scheme' | 'barcode' | 'silent'; + /** + * ćźąæˆ·ç«Żçš„ç‰ˆæœŹć· + * 歗笩äžČç±»ćž‹ïŒŒćœšçŒ–èŻ‘çŽŻćąƒäž­èźŸçœźçš„apk/ipaç‰ˆæœŹć·ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + version?: string; + /** + * ćźąæˆ·ç«Ż5+èżèĄŒçŽŻćąƒçš„ç‰ˆæœŹć· + * 5+èżèĄŒçŽŻćąƒç‰ˆæœŹć·ïŒŒæ ŒćŒäžș[äž»ç‰ˆæœŹć·].[æŹĄç‰ˆæœŹć·].[äżźèźąç‰ˆæœŹć·].[çŒ–èŻ‘ä»Łć·]。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + innerVersion?: string; + /** + * èŽ·ć–ćœ“ć‰ćș”ç”šéŠ–éĄ”ćŠ èœœçš„æ—¶é—Ž + * ćș”ç”šćŠ èœœéŠ–éĄ”éąçš„æ€»æ—¶é—ŽïŒŒä»ŽćŒ€ć§‹ćŠ èœœéŠ–éĄ”éąćˆ°éŠ–éĄ”éąćŠ èœœćźŒæˆïŒŒć•äœäžșms。 + * æłšæ„ïŒŒćș”甚銖饔äžșçœ‘ç»œćœ°ć€ćˆ™ćŒ…æ‹Źçœ‘ç»œäŒ èŸ“æ—¶é—Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + launchLoadedTime?: number; + /** + * èŽ·ć–ćœ“ć‰ćș”ç”šçš„èż›çš‹æ ‡è݆ + * ćœ“ć‰ćș”ç”šæ‰€ć±žçł»ç»Ÿèż›çš‹æ ‡èŻ†ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + processId?: string; + /** + * èŽ·ć–ćœ“ć‰ćș”ç”šçš„ćŻćŠšæ—¶é—Ž + * ćș”ç”šćŻćŠšæ—¶é—ŽæˆłïŒŒè·1970ćčŽ1月1æ—„äč‹é—Žçš„æŻ«ç§’æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + startupTime?: number; + /** + * èŽ·ć–æŒ‡ćźšAPPIDćŻčćș”çš„ćș”ç”šäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + getProperty(appid?: string, getPropertyCB?: (result: PlusRuntimeWidgetInfo) => void): void; + /** + * ćź‰èŁ…ćș”甚 + * æ”ŻæŒä»„äž‹ç±»ćž‹ćź‰èŁ…ćŒ…ïŒš + * 1. ćș”甚蔄æșćź‰èŁ…ćŒ…ïŒˆwgtïŒ‰ïŒŒæ‰©ć±•ćäžș'.wgt' + * 2. ćș”甚蔄æșć·źé‡ć‡çș§ćŒ…wgtuïŒ‰ïŒŒæ‰©ć±•ćäžș'.wgtu' + * 3. çł»ç»Ÿçš‹ćșćź‰èŁ…ćŒ…ïŒˆapkïŒ‰ïŒŒèŠæ±‚äœżç”šćœ“ć‰ćčłć°æ”ŻæŒçš„ćź‰èŁ…ćŒ…æ ŒćŒă€‚ + * æłšæ„ïŒšä»…æ”ŻæŒæœŹćœ°ćœ°ć€ïŒŒè°ƒç”šæ­€æ–čæł•ć‰éœ€æŠŠćź‰èŁ…ćŒ…ä»Žçœ‘ç»œćœ°ć€æˆ–ć…¶ä»–äœçœźæ”Ÿçœźćˆ°èżèĄŒæ—¶çŽŻćąƒćŻä»„èźżé—źçš„æœŹćœ°ç›źćœ•ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + install(filePath?: string, options?: PlusRuntimeWidgetOptions, installSuccessCB?: (result: PlusRuntimeWidgetInfo) => void, installErrorCB?: (result: any) => void): void; + /** + * 退ć‡șćźąæˆ·ç«Żçš‹ćș + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + quit(): void; + /** + * é‡ćŻćœ“ć‰çš„ćș”甚 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + restart(): void; + /** + * èźŸçœźçš‹ćșćż«æ·æ–čćŒć›Ÿæ ‡äžŠæ˜Ÿç€șçš„è§’æ ‡æ•°ć­— + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + setBadgeNumber(number?: number, options?: PlusRuntimeBadgeOptions): void; + /** + * è°ƒç”šçŹŹäž‰æ–č繋ćșæ‰“ćŒ€æŒ‡ćźšçš„URL + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + openURL(url?: string, errorCB?: (result: any) => void, identity?: string): void; + /** + * äœżç”šć†…çœźWebviewçȘ—ćŁæ‰“ćŒ€URL + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + openWeb(url?: string): void; + /** + * è°ƒç”šçŹŹäž‰æ–č繋ćșæ‰“ćŒ€æŒ‡ćźšçš„æ–‡ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + openFile(filepath?: string, options?: PlusRuntimeOpenFileOptions, errorCB?: (result: any) => void): void; + /** + * ć€„ç†ç›ŽèŸŸéĄ”éąé“ŸæŽ„ć‚æ•° + * é€šèż‡URL SchemećŻćŠšæ—¶ïŒŒćŻä»„ćœš?ćŽéąæ·»ćŠ __direct_pageć‚æ•°è‡Ș漚äč‰ç›ŽèŸŸéĄ”éąćœ°ć€ïŒŒ + * 橂“streamapp://m3w.cn/s/HelloH5?__direct_page=http%3a%2f%2fm.weibo.cn%2fu%2f3196963860” + * ćœšæ”ćș”甚SDK集成时äčŸćŻä»„é€šèż‡direct_pageć‚æ•°ïŒˆćŽŸç”Ÿè°ƒç”šIntentïŒ‰èźŸçœźă€‚ + * æłšæ„ïŒšä»…çŹŹäž€æŹĄè°ƒç”šæ­€APIæ—¶èż”ć›žç›ŽèŸŸéĄ”éąé“ŸæŽ„ćœ°ć€ïŒŒć†æŹĄè°ƒç”šć°†èż”ć›žç©ș歗笩äžČïŒ›ćŠ‚æžœćș”ç”šé‡æ–°èą«ćžŠç›ŽèŸŸéĄ”éąé“ŸæŽ„ć‚æ•°çš„URL Scheme搯抹/æż€æŽ»æ—¶ïŒŒćŻć†æŹĄè°ƒç”šæ­€æ–čæł•èŽ·ć–ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + processDirectPage(): string; + /** + * è°ƒç”šçŹŹäž‰æ–č繋ćș + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + launchApplication(appInf?: PlusRuntimeApplicationInf, errorCB?: (result: any) => void): void; + /** + * ćˆ€æ–­çŹŹäž‰æ–č繋ćșæ˜ŻćŠć·Č歘朹 + * ćŠ‚æžœçŹŹäž‰æ–č繋ćșć·Čćź‰èŁ…ćˆ™èż”ć›žtrueæœȘćź‰èŁ…ćˆ™èż”ć›žfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + isApplicationExist(appInf?: PlusRuntimeApplicationInf): boolean; + /** + * ćˆ€æ–­æ˜ŻćŠè‡Ș漚äč‰ćș”ç”šćŻćŠšéĄ”éąćŠ èœœćœ°ć€ + * é€šèż‡URL SchemećŻćŠšæ—¶ïŒŒćŻä»„ćœš?ćŽéąæ·»ćŠ __launch_pathć‚æ•°è‡Ș漚äč‰ćș”ç”šćŻćŠšéŠ–éĄ”ćŠ èœœçš„éĄ”éąćœ°ć€ïŒŒ + * 橂“streamapp://m3w.cn/s/HelloH5?__launch_path=http%3a%2f%2fm.weibo.cn%2fu%2f3196963860” + * ćœšæ”SDK集成时äčŸćŻä»„é€šèż‡launch_pathć‚æ•°ïŒˆćŽŸç”Ÿè°ƒç”šIntentïŒ‰èźŸçœźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + isCustomLaunchPath(): boolean; +} + +/** + * JSONćŻčè±ĄïŒŒæ‰“ćŒ€çŹŹäž‰æ–č繋ćșć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ +interface PlusRuntimeApplicationInf { + /** + * 第侉æ–č繋ćșćŒ…損 + * 仅Androidćčłć°æ”ŻæŒïŒŒèĄšç€ș繋ćșçš„ćŒ…ćïŒŒć…¶ćźƒćčłć°ćżœç•„æ­€ć±žæ€§ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + pname?: string; + /** + * 繋ćșçš„æ“äœœèĄŒäžș + * Androidćčłć°äžŠäžŽçł»ç»Ÿçš„actionć€Œäž€è‡ŽïŒ›iOSćčłć°äžș芁调甚皋ćșçš„URLSchemeæ ŒćŒć­—çŹŠäžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + action?: string; + /** + * æ–°ä»»ćŠĄæšĄćŒæ ‡èź° + * ćŻć–ć€ŒïŒš + * true-äœżç”šæ–°ä»»ćŠĄæšĄćŒæ ‡èź°ïŒˆFLAG_ACTIVITY_NEW_TASKïŒ‰ćŻćŠšćș”甚 + * false-äžäœżç”šæ–°ä»»ćŠĄæšĄćŒæ ‡èź°ïŒˆFLAG_ACTIVITY_NEW_TASKïŒ‰ćŻćŠšćș”甚。 + * é»˜èź€ć€Œäžștrue。 + * æłšæ„ïŒšç”±äșŽ5+ćș”ç”šé…çœźçš„launchModeäžșsingleTaskïŒŒæ‰€ä»„ćŠäž€äžȘ5+ćș”ç”šé€šèż‡plus.runtime.launchApplicationćŻćŠšæ—¶ćŠ‚æžœćș”甚ć·Čç»ćœšćŽć°èżèĄŒćˆ™äžäŒšè§Šć‘newintentäș‹ä»¶ïŒŒäžșäș†éżć…æ­€é—źéą˜éœ€èЁ㰆newTaskć‚æ•°ć€ŒèźŸçœźäžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + newTask?: boolean; + /** + * 调甚皋ćșçš„ć‚æ•° + * 仅Androidćčłć°æ”ŻæŒïŒŒäžșJSONæ ŒćŒïŒŒç”šäșŽäŒ é€’给芁调甚皋ćșçš„ć‚æ•°ïŒŒćŠ‚extra:{url:"http://www.html5plus.org"}。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + extra?: any; +} + +/** + * JSONćŻčè±ĄïŒŒćș”甚角标星ç€șéœ€èŠçš„é€šçŸ„æ æ¶ˆæŻçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ +interface PlusRuntimeBadgeOptions { + /** + * æ¶ˆæŻçš„æ ‡éą˜ + * é»˜èź€ć€Œäžșćș”ç”šçš„ćç§°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + title?: string; + /** + * æ¶ˆæŻçš„ć†…ćźč + * é»˜èź€ć€Œäžș“悚有xæĄæœȘèŻ»æ¶ˆæŻ"â€ïŒŒć…¶äž­xæœȘèźŸçœźçš„è§’æ ‡æ•°ć­—ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + content?: string; +} + +/** + * JSONćŻčè±ĄïŒŒæ‰“ćŒ€æ–‡ä»¶ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ +interface PlusRuntimeOpenFileOptions { + /** + * äŒ˜ć…ˆäœżç”šçš„çš‹ćșćŒ…損 + * ćŠ‚æžœæŒ‡ćźšćŒ…ćçš„çš‹ćșć·Čç»ćź‰èŁ…ïŒŒćˆ™è°ƒç”šć…¶æ‰“ćŒ€æ–‡ä»¶ïŒŒè‹„çš‹ćșäžæ”ŻæŒæ‰“ćŒ€æ–‡ä»¶ćˆ™è§Šć‘é”™èŻŻć›žè°ƒă€‚ + * ćŠ‚æžœæŒ‡ćźšćŒ…ćçš„çš‹ćșæœȘćź‰èŁ…ïŒŒćˆ™ćŒčć‡șçł»ç»Ÿæ”ŻæŒæ‰“ćŒ€æ­€æ–‡ä»¶çš„ćˆ—èĄšïŒŒç”±ç”šæˆ·é€‰æ‹©çš‹ćșæ‰“ćŒ€ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + pname?: string; + /** + * ćŒčć‡șçł»ç»Ÿé€‰æ‹©çš‹ćșç•ŒéąæŒ‡ç€șćŒș㟟 + * JSONćŻčè±ĄïŒŒæ ŒćŒćŠ‚{top:10;left:10;width:200;height:200;}ïŒŒæ‰€æœ‰ć€ŒäžșćƒçŽ ć€ŒïŒŒć·ŠäžŠćæ ‡ç›žćŻčäșŽćźč晹webviewçš„äœçœźă€‚ä»…ćœšiPadèźŸć€‡ćčłć°æœ‰æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + popover?: any; +} + +/** + * JSONćŻčè±ĄïŒŒćș”ç”šäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ +interface PlusRuntimeWidgetInfo { + /** + * ćș”甚的APPID + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + appid?: string; + /** + * ćș”ç”šçš„ç‰ˆæœŹć· + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + version?: string; + /** + * ćș”ç”šçš„ćç§° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + name?: string; + /** + * ćș”ç”šæèż°äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + description?: string; + /** + * ćș”ç”šæèż°äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + author?: string; + /** + * ćŒ€ć‘è€…é‚źçź±ćœ°ć€ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + email?: string; + /** + * ćș”ç”šæŽˆæƒæèż°äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + license?: string; + /** + * ćș”ç”šæŽˆæƒèŻŽæ˜Žé“ŸæŽ„ćœ°ć€ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + licensehref?: string; + /** + * ćș”ç”šèźžćŻç‰čæ€§ćˆ—èĄš + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + features?: String[]; +} + +/** + * JSONćŻčè±ĄïŒŒćș”ç”šćź‰èŁ…ć‚æ•° + * ćŻé€šèż‡ćŻčè±ĄèźŸçœźćź‰èŁ…çš„ćș”ç”šæ˜ŻćŠèż›èĄŒappidæ ĄéȘŒă€ç‰ˆæœŹć·æ ĄéȘŒç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ +interface PlusRuntimeWidgetOptions { + /** + * æ˜ŻćŠćŒșćˆ¶ćź‰èŁ… + * trueèĄšç€șćŒșćˆ¶ćź‰èŁ…ïŒŒäžèż›èĄŒç‰ˆæœŹć·çš„æ ĄéȘŒïŒ›falsećˆ™éœ€èŠç‰ˆæœŹć·æ ĄéȘŒïŒŒćŠ‚æžœć°†èŠćź‰èŁ…ćș”ç”šçš„ç‰ˆæœŹć·äžé«˜äșŽçŽ°æœ‰ćș”ç”šçš„ç‰ˆæœŹć·ćˆ™ç»ˆæ­ąćź‰èŁ…ïŒŒćč¶èż”ć›žćź‰èŁ…ć€±èŽ„ă€‚ + * ä»…ćź‰èŁ…wgt撌wgtuæ—¶ç”Ÿæ•ˆïŒŒé»˜èź€ć€Œ false。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + force?: boolean; +} + +/** + * StorageæšĄć—çźĄç†ćș”ç”šæœŹćœ°æ•°æźć­˜ć‚šćŒș甚äșŽćș”ç”šæ•°æźçš„äżć­˜ć’ŒèŻ»ć–ă€‚ćș”ç”šæœŹćœ°æ•°æźäžŽlocalStorage、sessionStorage的ćŒșćˆ«ćœšäșŽæ•°æźæœ‰æ•ˆćŸŸäžćŒïŒŒć‰è€…ćŻćœšćș”ç”šć†…è·šćŸŸæ“äœœïŒŒæ•°æźć­˜ć‚šæœŸæ˜ŻæŒäč…ćŒ–çš„ïŒŒćč¶äž”æČĄæœ‰ćźčé‡é™ćˆ¶ă€‚é€šèż‡plus.storagećŻèŽ·ć–ćș”ç”šæœŹćœ°æ•°æźçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/storage.html](http://www.html5plus.org/doc/zh_cn/storage.html) + */ +interface PlusStorage { + /** + * èŽ·ć–ćș”ç”šć­˜ć‚šćŒșäž­äżć­˜çš„é”źć€ŒćŻč的äžȘ数 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/storage.html](http://www.html5plus.org/doc/zh_cn/storage.html) + */ + getLength(): number; + /** + * é€šèż‡é”ź(key)æŁ€çŽąèŽ·ć–ćș”ç”šć­˜ć‚šçš„ć€Œ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/storage.html](http://www.html5plus.org/doc/zh_cn/storage.html) + */ + getItem(key?: string): string; + /** + * äżźæ”čæˆ–æ·»ćŠ é”źć€Œ(key-value)ćŻčæ•°æźćˆ°ćș”ç”šæ•°æźć­˜ć‚šäž­ + * ćŠ‚æžœèźŸçœźçš„é”źćœšćș”ç”šæ•°æźć­˜ć‚šäž­ć·Čç»ć­˜ćœšïŒŒæ›Žæ–°ć­˜ć‚šçš„é”źć€Œă€‚ + * ć­˜ć‚šçš„é”źć’Œć€ŒæČĄæœ‰ćźčé‡é™ćˆ¶ïŒŒäœ†èż‡ć€šçš„æ•°æźé‡äŒšćŻŒè‡Žæ•ˆçŽ‡é™äœŽïŒŒć»șèźźć•äžȘé”źć€Œæ•°æźäžèŠè¶…èż‡10Kb。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/storage.html](http://www.html5plus.org/doc/zh_cn/storage.html) + */ + setItem(key?: string, value?: string): void; + /** + * é€šèż‡keyć€Œćˆ é™€é”źć€ŒćŻčć­˜ć‚šçš„æ•°æź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/storage.html](http://www.html5plus.org/doc/zh_cn/storage.html) + */ + removeItem(key?: string): void; + /** + * 枅陀ćș”ç”šæ‰€æœ‰çš„é”źć€ŒćŻčć­˜ć‚šæ•°æź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/storage.html](http://www.html5plus.org/doc/zh_cn/storage.html) + */ + clear(): void; + /** + * èŽ·ć–é”źć€ŒćŻčäž­æŒ‡ćźšçŽąćŒ•ć€Œçš„keyć€Œ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/storage.html](http://www.html5plus.org/doc/zh_cn/storage.html) + */ + key(index?: number): void; +} + +/** + * StreamæšĄć—æ“äœœæ”ćș”甚。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ +interface PlusStream { + /** + * JSONćŻčè±ĄïŒŒćŻćŠšæ”ćș”ç”šć‚æ•° + * æŒ‡ćźšèŠćŻćŠšçš„æ”ćș”ç”šæ ‡èŻ†ă€ćç§°ă€ć›Ÿæ ‡ă€ć‚æ•°ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + StreamOptions?: PlusStreamStreamOptions; + /** + * JSONćŻčè±ĄïŒŒæ”ćș”ç”šæąć€èżèĄŒçš„ć‚æ•° + * èźŸçœźæ”ćș”ç”šæąć€èżèĄŒæ—¶çš„ć‚æ•°ă€splashă€éŠ–éĄ”ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + StreamRestoreOptions?: PlusStreamStreamRestoreOptions; + /** + * 攁ćș”ç”šæąć€èżèĄŒæ—¶ćŻćŠšç•Œéąé…çœźć‚æ•° + * èźŸçœźæ”ćș”ç”šæąć€èżèĄŒæ—¶ćŻćŠšç•ŒéąïŒŒćŠ‚æ˜ŻćŠè‡ȘćŠšć…łé—­ă€ć»¶æ—¶ć…łé—­æ—¶é—Žă€è¶…æ—¶æ—¶é—Žç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + StreamRestoreSplashscreenOptions?: PlusStreamStreamRestoreSplashscreenOptions; + /** + * JSONćŻčè±ĄïŒŒćŻćŠšæ”ćș”甚的銖饔çȘ—ćŁć±žæ€§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + LaunchWebviewStyles?: PlusStreamLaunchWebviewStyles; + /** + * JSONćŻčè±ĄïŒŒæ”ćș”ç”šäżĄæŻ + * 攁ćș”ç”šæ ‡èŻ†ă€ć›Ÿæ ‡ă€æ˜ŻćŠäž‹èœœćźŒæˆç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + StreamInfo?: PlusStreamStreamInfo; + /** + * JSONćŻčè±ĄïŒŒć…æ”é‡æ“äœœć‚æ•° + * ćŒ…ć«ç””èŻć·ç ă€éȘŒèŻç ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + FreetrafficOptions?: PlusStreamFreetrafficOptions; + /** + * ć…æ”é‡çŠ¶æ€ć˜ćŒ–äș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + onfreetrafficStateChange?: any; + /** + * ćŻćŠšæ”ćș”甚 + * æ‰“ćŒ€æŒ‡ćźšçš„æ”ćș”ç”šïŒŒćœšæ”ćș”ç”šäž­é€šèż‡plus.runtime.launcherèŽ·ć–çš„ć€Œäžș"stream"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + open(options?: PlusStreamStreamOptions, successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; + /** + * 攁ćș”ç”šæż€æŽ»ç»ŸèźĄ + * 提äș€ç»ŸèźĄæ•°æźćˆ°æ”ćș”ç”šæœćŠĄć™šïŒŒèĄšæ˜ŽäžšćŠĄçł»ç»Ÿæż€æŽ»æˆćŠŸă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + activate(): void; + /** + * ć·Č䞋蜜攁ćș”ç”šćˆ—èĄš + * èŽ·ć–ćœ“ć‰èźŸć€‡äžŠć·Čćź‰èŁ…çš„æ‰€æœ‰æ”ćș”甚。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + list(options?: any, successCallback?: any, errorCallback?: any): void; + /** + * éą„ćŠ èœœæ”ćș”甚 + * éą„ćŠ èœœæŒ‡ćźšçš„æ”ćș”甚蔄æșïŒŒäž‹èœœćș”甚蔄æșç­‰ïŒŒćč¶äžèżèĄŒæ”ćș”甚。 + * ćŠ‚æžœćș”甚蔄æșć·Čç»äž‹èœœïŒŒćˆ™äžćšä»»äœ•æ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + preload(appid?: string): void; + /** + * ćˆ é™€æ”ćș”甚 + * ćˆ é™€ć·Č䞋蜜的攁ćș”甚枅ç©șćș”ç”šç›žć…łèżèĄŒæœŸäżć­˜çš„è”„æșïŒˆćŠ‚çŒ“ć­˜ă€é…çœźæ–‡ä»¶ç­‰ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + remove(appid?: string): void; + /** + * èźŸçœźæ”ćș”ç”šæąć€èżèĄŒçš„ć‚æ•° + * ćœ“æ”ćș”ç”šèżèĄŒæ•°ç›źè¶…èż‡é™ćˆ¶ïŒˆé€šćžžæœ€ć€šèżèĄŒ2äžȘ攁ćș”甚䌚è‡Ș抹慳闭äč‹ć‰ćˆ‡æąćˆ°ćŽć°èżèĄŒçš„ćș”甚。 + * ćŻé€šèż‡æ­€æ–čæł•èźŸçœźćș”ç”šèą«è‡ȘćŠšć…łé—­ćŽć†æŹĄèą«ć”€é†’æąć€èżèĄŒæ—¶çš„ć‚æ•°ïŒŒæ”ćș”ç”šæąć€èżèĄŒæ”çš‹äžŽçŹŹäž€æŹĄćŻćŠšäž€è‡ŽïŒˆć·źćˆ«æ˜ŻäŒšäœżç”šStreamRestoreOptionsäž­é…çœźçš„ć‚æ•°ïŒ‰ă€‚ + * ćŠ‚æžœæČĄæœ‰è°ƒç”šsetRestoreStateæ–čæł•ïŒŒćˆ™æąć€èżèĄŒæ—¶äœżç”šćŻćŠšæ—¶ïŒˆè°ƒç”šplus.stream.openæ–čæł•ïŒ‰äŒ ć…„çš„ć‚æ•°ă€‚ + * æłšæ„ïŒšćŠ‚æžœé€šèż‡plus.stream.openæ–čæł•搯抚ćș”ç”šïŒŒćˆ™ćżœç•„æ­€æ–čæł•èźŸçœźçš„ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + setRestoreState(options?: PlusStreamStreamRestoreOptions): void; + /** + * èŻ·æ±‚ć…æ”é‡éȘŒèŻç  + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + freetrafficRequest(options?: PlusStreamFreetrafficOptions, successCallback?: Function, errorCallback?: (result: any) => void): void; + /** + * ć…æ”é‡ç»‘ćźšæ‰‹æœșć· + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + freetrafficBind(options?: PlusStreamFreetrafficOptions, successCallback?: Function, errorCallback?: (result: any) => void): void; + /** + * è§Łé™€ć…æ”é‡ç»‘ćźš + * è§Łé™€ćœ“ć‰èźŸć€‡ç»‘ćźšçš„æ‰‹æœșć·ïŒŒćŠ‚æžœèźŸć€‡æœȘç»‘ćźšćˆ™äžæ‰§èĄŒæ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + freetrafficRelease(): void; + /** + * èŽ·ć–ć…æ”é‡çŠ¶æ€äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + freetrafficInfo(successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; + /** + * ć…æ”é‡æ˜ŻćŠç”Ÿæ•ˆ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + freetrafficIsValid(): boolean; +} + +/** + * JSONćŻčè±ĄïŒŒćŻćŠšæ”ćș”ç”šć‚æ•° + * æŒ‡ćźšèŠćŻćŠšçš„æ”ćș”ç”šæ ‡èŻ†ă€ćç§°ă€ć›Ÿæ ‡ă€ć‚æ•°ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ +interface PlusStreamStreamOptions { + /** + * 攁ćș”ç”šèżèĄŒæšĄćŒ + * ćŻć–ć€ŒïŒš"test"èĄšç€șæ”‹èŻ•ç‰ˆæšĄćŒèżèĄŒïŒŒć…¶ćźƒć€Œćˆ™äžșæ­ŁćŒç‰ˆæœŹæšĄćŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + appmode?: string; + /** + * 攁ćș”甚标è݆ + * 攁ćș”甚支䞀歗珊äžČæ ‡èŻ†ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + appid?: string; + /** + * ćŻćŠšæ”ćș”ç”šçš„ç›ŽèŸŸéĄ”éąé“ŸæŽ„ćœ°ć€ + * 揯朹ćș”ç”šäž­é€šèż‡plus.runtime.processDirectPage()æ–čæł•èŽ·ć–ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + direct_page?: string; + /** + * 攁ćș”ç”šèżèĄŒć‚æ•° + * ćŻćŠšæ”ćș”ç”šçš„æ‰©ć±•ć‚æ•°ïŒŒćŻćœšæ”ćș”ç”šäž­é€šèż‡plus.runtime.argumentsèŽ·ć–ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + extras?: any; + /** + * 攁ćș”ç”šć›Ÿæ ‡ + * 攁ćș”甚星ç€șçš„ć›Ÿæ ‡è·ŻćŸ„ïŒˆä»…æ”ŻæŒæœŹćœ°è·ŻćŸ„ïŒ‰ïŒŒćœšćŻćŠšæç€șç•Œéąäž­æ˜Ÿç€ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + icon?: string; + /** + * 攁ćș”甚搯抚类枋 + * 攁ćș”ç”šçš„ćŻćŠšç±»ćž‹ïŒŒćŻćœšæ”ćș”ç”šäž­é€šèż‡plus.runtime.launcherèŽ·ć–ïŒŒé»˜èź€ć€Œäžș“stream”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + launcher?: string; + /** + * ćș”ç”šćŻćŠšç•Œéąæ ·ćŒ + * ćŻć–ć€ŒïŒš + * "auto"è‡ȘćŠšé€‰æ‹©ćŻćŠšç•ŒéąïŒŒćŠ‚æžœsplashć›Ÿç‰‡ć·Čç»äž‹èœœćˆ™æ˜Ÿç€șsplashć›Ÿç‰‡ïŒŒćŠćˆ™äœżç”šé»˜èź€ćŠ èœœæ”ćș”ç”šç•ŒéąïŒ› + * "default"ïŒšäœżç”šé»˜èź€ćŠ èœœæ”ćș”ç”šç•ŒéąïŒˆćŠ‚ćœš360æ”è§ˆć™šçŽŻćąƒäž­ćœšæ ‡éą˜æ äž‹æ˜Ÿç€șćŠ èœœèż›ćșŠæĄïŒ‰ă€‚ + * é»˜èź€ć€Œäžș"auto"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + splash?: string; + /** + * 攁ćș”甚銖饔çȘ—揣ćŻčè±Ąæ ·ćŒ + * ćŠ‚æžœæ”ćș”甚ć·Čç»èżèĄŒïŒŒä»ŽćŽć°æż€æŽ»ćˆ°ć‰ć°æ—¶ćżœç•„æ­€ć±žæ€§ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + styles?: PlusStreamLaunchWebviewStyles; + /** + * 攁ćș”ç”šćç§° + * 攁ćș”甚星ç€șçš„æ ‡éą˜ïŒŒćœšćŻćŠšæç€șç•Œéąäž­æ˜Ÿç€ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + title?: string; + /** + * ćŻćŠšæ”ćș”ç”šçš„ćż«æ·æ–čćŒé€»èŸ‘ + * ćŻć–ć€ŒïŒš + * "auto" - æŁ€æŸ„ćč¶ćŒ•ćŻŒç”šæˆ·æ‰“ćŒ€ćż«æ·æ–čćŒæƒé™ïŒŒè‡Ș抹戛ć»șæĄŒéąćż«æ·æ–čćŒïŒŒćœšäžæ”ŻæŒćż«æ·æ–čćŒæ»€é‡çš„çł»ç»ŸäžŠä»…ćˆ›ć»șäž€æŹĄïŒ› + * "force" - æŁ€æŸ„ćč¶ćŒ•ćŻŒç”šæˆ·æ‰“ćŒ€ćż«æ·æ–čćŒæƒé™ïŒŒè‡Ș抹戛ć»șæĄŒéąćż«æ·æ–čćŒïŒŒćœšäžæ”ŻæŒćż«æ·æ–čćŒæ»€é‡çš„çł»ç»ŸäžŠæŻæŹĄéƒœć°èŻ•ćˆ›ć»ș + * "none" - äžæŁ€æŸ„ćż«æ·æ–čćŒæƒé™ïŒŒäžćˆ›ć»șæĄŒéąćż«æ·æ–čćŒïŒˆäžŽä»ŽæĄŒéąćż«æ·æ–čćŒćŻćŠšçš„æ”çš‹äž€è‡ŽïŒ‰ïŒ› + * "query" - ćŒčć‡șèŻąé—źæç€șæĄ†ïŒˆćș•郚星ç€ș甚户ç‚čć‡»çĄźćźšćŽćˆ›ć»șæĄŒéąćż«æ·æ–čćŒïŒˆæŁ€æŸ„ćč¶ćŒ•ćŻŒç”šæˆ·æ‰“ćŒ€ćż«æ·æ–čćŒæƒé™ïŒ‰ïŒ› + * "tipOnce" - äžšćŠĄé€»èŸ‘äžŽ"auto"ç±»äŒŒïŒŒć·źćˆ«æ˜ŻćȘäŒšćŒ•ćŻŒç”šæˆ·æ‰“ćŒ€ćż«æ·æ–čćŒæƒé™äž€æŹĄă€toast提ç€șäž€æŹĄă€‚ + * é»˜èź€ć€Œäžș"force"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + shortcut?: string; + /** + * 退ć‡ș攁ćș”ç”šçš„ćż«æ·æ–čćŒé€»èŸ‘ + * ćŻć–ć€ŒïŒš + * "query" - ćș”甚退ć‡șæ—¶æŁ€æŸ„æ˜ŻćŠćˆ›ć»șæĄŒéąćż«æ·æ–čćŒïŒŒćŠ‚æžœæŸ„èŻąćˆ°æČĄæœ‰ćˆ›ć»ș戙ćŒčć‡șèŻąé—źæĄ†ïŒŒç”šæˆ·ç‚čć‡»çĄźćźšćŽćˆ›ć»șæĄŒéąćż«æ·æ–čćŒïŒˆæŁ€æŸ„ćč¶ćŒ•ćŻŒç”šæˆ·æ‰“ćŒ€ćż«æ·æ–čćŒæƒé™ïŒ‰ïŒ› + * "queryOnce" - 仅ćș”ç”šçŹŹäž€æŹĄé€€ć‡șæŁ€æŸ„ïŒŒæŁ€æŸ„é€»èŸ‘ćŒquery + * "none" - ćș”甚退ć‡șæ—¶äžæŁ€æŸ„æ˜ŻćŠćˆ›ć»șæĄŒéąćż«æ·æ–čćŒă€‚ + * é»˜èź€ć€Œäžș"none"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + shortcutQuit?: string; +} + +/** + * JSONćŻčè±ĄïŒŒæ”ćș”ç”šæąć€èżèĄŒçš„ć‚æ•° + * èźŸçœźæ”ćș”ç”šæąć€èżèĄŒæ—¶çš„ć‚æ•°ă€splashă€éŠ–éĄ”ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ +interface PlusStreamStreamRestoreOptions { + /** + * 攁ćș”ç”šèżèĄŒć‚æ•° + * ćŻćŠšæ”ćș”ç”šçš„æ‰©ć±•ć‚æ•°ïŒŒćŻćœšæ”ćș”ç”šäž­é€šèż‡plus.runtime.argumentsèŽ·ć–ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + extras?: any; + /** + * ćș”ç”šćŻćŠšç•Œéąæ ·ćŒ + * ćŻć–ć€ŒïŒš + * "auto"è‡ȘćŠšé€‰æ‹©ćŻćŠšç•ŒéąïŒŒćŠ‚æžœæ”ćș”甚è‡ȘćŠšć…łé—­æ—¶æˆȘć›ŸæˆćŠŸćˆ™äœżç”šæˆȘć›ŸïŒŒćŠ‚æžœsplashć›Ÿç‰‡ć·Čç»äž‹èœœćˆ™æ˜Ÿç€șsplashć›Ÿç‰‡ïŒŒćŠćˆ™äœżç”šé»˜èź€ćŠ èœœæ”ćș”ç”šç•ŒéąïŒ› + * "default"ïŒšäœżç”šé»˜èź€ćŠ èœœæ”ćș”ç”šç•ŒéąïŒˆćŠ‚ćœš360æ”è§ˆć™šçŽŻćąƒäž­ćœšæ ‡éą˜æ äž‹æ˜Ÿç€șćŠ èœœèż›ćșŠæĄïŒ‰ă€‚ + * é»˜èź€ć€Œäžș"auto"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + splash?: string; + /** + * 攁ćș”甚銖饔çȘ—揣ćŻčè±Ąæ ·ćŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + styles?: PlusStreamLaunchWebviewStyles; + /** + * 攁ćș”ç”šæąć€èżèĄŒæ—¶ćŻćŠšç•Œéąé…çœźć‚æ•° + * 甹äșŽæ”ćș”甚è‡ȘćŠšć…łé—­ćŽæąć€èżèĄŒæ—¶è°ƒæ•ŽćŻćŠšç•Œéąé…çœźć‚æ•°ïŒŒćŠ‚ć°†è‡Ș抹慳闭splash调敎äžșæ‰‹ćŠšć…łé—­ïŒŒä»„äŸżæąć€äžŠæŹĄèżèĄŒçŠ¶æ€ćŽć†èż›ć…„ćș”甚。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + splashscreen?: PlusStreamStreamRestoreSplashscreenOptions; +} + +/** + * 攁ćș”ç”šæąć€èżèĄŒæ—¶ćŻćŠšç•Œéąé…çœźć‚æ•° + * èźŸçœźæ”ćș”ç”šæąć€èżèĄŒæ—¶ćŻćŠšç•ŒéąïŒŒćŠ‚æ˜ŻćŠè‡ȘćŠšć…łé—­ă€ć»¶æ—¶ć…łé—­æ—¶é—Žă€è¶…æ—¶æ—¶é—Žç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ +interface PlusStreamStreamRestoreSplashscreenOptions { + /** + * æ˜ŻćŠè‡Ș抹慳闭搯抹界靱 + * trueèĄšç€șćș”甚搯抚搎è‡ȘćŠšć…łé—­ćŻćŠšç•ŒéąïŒŒfalseèĄšç€șćș”ç”šćŻćŠšćŽäžè‡ȘćŠšć…łé—­ćŻćŠšç•ŒéąïŒŒéœ€èŠćœšćș”甚调甚plus.navigator.closeSplashscreen()æ–čæł•慳闭。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + autoclose?: boolean; + /** + * ćŻćŠšç•Œéąè¶…æ—¶æ—¶é—Ž + * ć•äœäžșæŻ«ç§’ïŒˆmsïŒ‰ïŒŒćœ“ćŻćŠšç•Œéąè¶…èż‡æ­€æ—¶é—Žä»ç„¶æœȘć…łé—­æ—¶ïŒˆäžçźĄautocloseć€ŒèźŸçœźtrueèż˜æ˜Żfalsećș”甚氆è‡Ș抹慳闭搯抹界靱。 + * é»˜èź€ć€Œäžș6000ïŒˆćł6ç§’ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + timeout?: number; +} + +/** + * JSONćŻčè±ĄïŒŒćŻćŠšæ”ćș”甚的銖饔çȘ—ćŁć±žæ€§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ +interface PlusStreamLaunchWebviewStyles { + /** + * 攁ćș”ç”šéŠ–éĄ”æ˜ŻćŠé˜»ćĄžçœ‘ç»œć›Ÿç‰‡çš„ćŠ èœœ + * trueèĄšç€șé˜»ćĄžçœ‘ç»œć›Ÿç‰‡çš„ćŠ èœœïŒŒfalseèĄšç€șäžé˜»ćĄžçœ‘ç»œć›Ÿç‰‡çš„ćŠ èœœă€‚é»˜èź€ć€Œäžșfalse。 + * èźŸçœźćŽćŻé€šèż‡WebviewçȘ—揣ćŻčè±Ąçš„setBlockNetworkImage(false)æ–čæł•äżźæ”čèźŸçœźæ„ç»§ç»­ćŠ èœœçœ‘ç»œć›Ÿç‰‡ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + blockNetworkImage?: boolean; + /** + * æŒ‡ćźšæ”ćș”ç”šéŠ–éĄ”ćœ°ć€ + * ćŻäœżç”šçœ‘ç»œćœ°ć€ïŒˆhttp://或https://ćŒ€ć€ŽïŒ‰ïŒŒäčŸćŻäœżç”šæœŹćœ°ćœ°ć€ïŒˆç›žćŻčćș”甚蔄æșè·ŻćŸ„ïŒ‰ă€‚ + * äčŸćŻäœżç”šç‰čćźšćœ°ć€ïŒš + * about:blank - äœżç”šç©șç™œéŠ–éĄ”ïŒŒä»…ćŠ èœœć†…çœźæłšć…„çš„è„šæœŹïŒˆćŠ‚all.js、wap2app.js、config.jsç­‰ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + launch_path?: string; + /** + * æŒ‡ćźšéŠ–éĄ”Webview的id + * ćŠ‚æžœæœȘæŒ‡ćźšidïŒŒćˆ™äœżç”šćș”甚的appid䜜äžș銖饔Webview的id。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + id?: string; + /** + * 攁ćș”ç”šéŠ–éĄ”æ˜ŻćŠæ˜Ÿç€ș + * trueèĄšç€ș星ç€șfalseèĄšç€ș䞍星ç€șă€‚é»˜èź€ć€Œäžștrue。 + * æłšæ„ïŒšæ”ćș”ç”šéŠ–éĄ”éšè—ćŽïŒŒéœ€èŠè°ƒç”šéŠ–éĄ”çš„setVisibleæ–čæł•星ç€șïŒŒćŠ‚plus.webview.getLaunchWebview().setVisible(true)。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + visible?: boolean; +} + +/** + * JSONćŻčè±ĄïŒŒæ”ćș”ç”šäżĄæŻ + * 攁ćș”ç”šæ ‡èŻ†ă€ć›Ÿæ ‡ă€æ˜ŻćŠäž‹èœœćźŒæˆç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ +interface PlusStreamStreamInfo { + /** + * 攁ćș”甚标è݆ + * 攁ćș”甚支䞀歗珊äžČæ ‡èŻ†ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + id?: string; + /** + * 攁ćș”ç”šçš„ć›Ÿæ ‡ + * 攁ćș”ç”šäž‹èœœçš„ć›Ÿæ ‡è·ŻćŸ„ïŒˆæœŹćœ°è·ŻćŸ„ïŒ‰ïŒŒćŠ‚æžœæœȘäž‹èœœćźŒæˆćˆ™èż”ć›žç©ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + icon?: string; + /** + * 攁ćș”ç”šæ˜ŻćŠäž‹èœœćꌿˆ + * trueèĄšç€ș攁ćș”甚䞋蜜ćꌿˆïŒŒfalseèĄšç€ș攁ćș”甚æœȘäž‹èœœćźŒæˆă€‚ + * æłšæ„ïŒŒæ”ćș”甚æœȘäž‹èœœćźŒæˆä»„èź©ćŻä»„æ­ŁćžžćŻćŠšèżèĄŒïŒŒćŻćŠšćŽäŒšè‡ȘćŠšäž‹èœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + complete?: boolean; +} + +/** + * JSONćŻčè±ĄïŒŒć…æ”é‡æ“äœœć‚æ•° + * ćŒ…ć«ç””èŻć·ç ă€éȘŒèŻç ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ +interface PlusStreamFreetrafficOptions { + /** + * ç””èŻć·ç  + * ć…æ”é‡èŻ·æ±‚éȘŒèŻç ă€ç»‘ćźšèźŸć€‡äœżç”šçš„ç””èŻć·ç ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + phone?: string; + /** + * éȘŒèŻç  + * ć…æ”é‡ç»‘ćźšèźŸć€‡äœżç”šçš„éȘŒèŻç ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + code?: string; +} + +/** + * UploaderæšĄć—çźĄç†çœ‘ç»œäžŠäŒ ä»»ćŠĄïŒŒç”šäșŽä»ŽæœŹćœ°äžŠäŒ ć„ç§æ–‡ä»¶ćˆ°æœćŠĄć™šïŒŒćč¶æ”ŻæŒè·šćŸŸèźżé—źæ“äœœă€‚é€šèż‡plus.uploaderćŻèŽ·ć–äžŠäŒ çźĄç†ćŻčè±Ąă€‚UploaderäžŠäŒ äœżç”šHTTP的POSTæ–čćŒæäș€æ•°æźïŒŒæ•°æźæ ŒćŒçŹŠćˆMultipart/form-dataè§„èŒƒïŒŒćłrfc1867Form-based File Upload in HTMLïŒ‰ćèźźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ +interface PlusUploader { + /** + * UploadćŻčè±ĄçźĄç†äž€äžȘäžŠäŒ ä»»ćŠĄ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + Upload?: PlusUploaderUpload; + /** + * äžŠäŒ ä»»ćŠĄäș‹ä»¶ç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + UploadEvent?: PlusUploaderUploadEvent; + /** + * äžŠäŒ ä»»ćŠĄçš„çŠ¶æ€ïŒŒNumber类枋 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + UploadState?: PlusUploaderUploadState; + /** + * JSONćŻčè±ĄïŒŒćˆ›ć»șäžŠäŒ ä»»ćŠĄçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + UploadOptions?: PlusUploaderUploadOptions; + /** + * JSONćŻčè±ĄïŒŒæ·»ćŠ äžŠäŒ æ–‡ä»¶çš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + UploadFileOptions?: PlusUploaderUploadFileOptions; + /** + * 新ć»șäžŠäŒ ä»»ćŠĄ + * èŻ·æ±‚äžŠäŒ çźĄç†ćˆ›ć»șæ–°çš„äžŠäŒ ä»»ćŠĄïŒŒćˆ›ć»șæˆćŠŸćˆ™èż”ć›žUploadćŻčè±ĄïŒŒç”šäșŽçźĄç†äžŠäŒ ä»»ćŠĄă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + createUpload(url?: string, options?: PlusUploaderUploadOptions, completedCB?: (result0: PlusUploaderUpload, result1: number) => void): PlusUploaderUpload; + /** + * æžšäžŸäžŠäŒ ä»»ćŠĄ + * æžšäžŸæŒ‡ćźšçŠ¶æ€çš„äžŠäŒ ä»»ćŠĄćˆ—èĄšïŒŒé€šèż‡enumCBć›žè°ƒć‡œæ•°èż”ć›žç»“æžœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + enumerate(enumCB?: (result: PlusUploader []) => void, state?: PlusUploaderUploadState): void; + /** + * æž…é™€äžŠäŒ ä»»ćŠĄ + * æž…é™€æŒ‡ćźšçŠ¶æ€çš„äžŠäŒ ä»»ćŠĄă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + clear(state?: PlusUploaderUploadState): void; + /** + * ćŒ€ć§‹æ‰€æœ‰äžŠäŒ ä»»ćŠĄ + * ćŒ€ć§‹æ‰€æœ‰ć€„äșŽæœȘćŒ€ć§‹è°ƒćșŠæˆ–æš‚ćœçŠ¶æ€çš„äžŠäŒ ä»»ćŠĄă€‚ + * è‹„äžŠäŒ ä»»ćŠĄæ•°è¶…èż‡ćŻćč¶ć‘ć€„ç†çš„æ€»æ•°ïŒŒè¶…ć‡ș的任报怄äșŽè°ƒćșŠçŠ¶æ€ïŒˆç­‰ćŸ…äžŠäŒ ïŒ‰ïŒŒćœ“æœ‰ä»»ćŠĄćꌿˆæ—¶æ čæźè°ƒćșŠçŠ¶æ€ä»»ćŠĄçš„äŒ˜ć…ˆçș§é€‰æ‹©ä»»ćŠĄćŒ€ć§‹äžŠäŒ ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + startAll(): void; +} + +/** + * UploadćŻčè±ĄçźĄç†äž€äžȘäžŠäŒ ä»»ćŠĄ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ +interface PlusUploaderUpload { + /** + * äžŠäŒ ä»»ćŠĄçš„æ ‡èŻ† + * 朹戛ć»șä»»ćŠĄæ—¶çł»ç»Ÿè‡ȘćŠšćˆ†é…ïŒŒç”šäșŽæ ‡èŻ†äžŠäŒ ä»»ćŠĄçš„ć”Żäž€æ€§ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + id?: string; + /** + * äžŠäŒ æ–‡ä»¶çš„æœćŠĄć™šćœ°ć€ + * 调甚plus.uploader.createUpload()æ–čæł•ćˆ›ć»șäžŠäŒ ä»»ćŠĄæ—¶èźŸçœźçš„ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + url?: string; + /** + * ä»»ćŠĄçš„çŠ¶æ€ + * äžŠäŒ ä»»ćŠĄçš„çŠ¶æ€ïŒŒć‚è€ƒUploadStateïŒŒćœšUploadCompleteCallbackäș‹ä»¶ć’ŒUploadStateChangedCallbackäș‹ä»¶è§Šć‘æ—¶æ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + state?: number; + /** + * äžŠäŒ ä»»ćŠĄçš„ć‚æ•° + * äžŠäŒ ä»»ćŠĄé…çœźçš„ć‚æ•°ïŒŒć‚è€ƒUploadOptions。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + options?: PlusUploaderUploadOptions; + /** + * äžŠäŒ ä»»ćŠĄćźŒæˆćŽæœćŠĄć™šèż”ć›žçš„æ•°æź + * èĄšç€șćœ“ć‰äžŠäŒ ä»»ćŠĄçš„çŠ¶æ€ïŒŒćŻé€šèż‡addEventListener()æ–čæł•监搏statechangedäș‹ä»¶ç›‘ćŹä»»ćŠĄçŠ¶æ€çš„ć˜ćŒ–ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + responseText?: string; + /** + * ć·ČćźŒæˆäžŠäŒ æ•°æźçš„ć€§ć°ïŒ‰ + * æ•Žæ•°ç±»ćž‹ïŒŒć•äœäžșć­—èŠ‚ïŒˆbyteïŒ‰ïŒŒäžŠäŒ ä»»ćŠĄćŒ€ć§‹äŒ èŸ“æ•°æźæ—¶ïŒŒæŻæŹĄè§Šć‘statechangedäș‹ä»¶æˆ–äžŠäŒ ä»»ćŠĄćꌿˆæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + uploadedSize?: number; + /** + * äžŠäŒ æ•°æźçš„æ€»ć€§ć° + * æ•Žæ•°ç±»ćž‹ïŒŒć•äœäžșć­—èŠ‚ïŒˆbyteïŒ‰ïŒŒäžŠäŒ ä»»ćŠĄćŒ€ć§‹äŒ èŸ“æ•°æźæ—¶æ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + totalSize?: number; + /** + * æ·»ćŠ äžŠäŒ æ–‡ä»¶ + * ć‘äžŠäŒ ä»»ćŠĄäž­æ·»ćŠ æ–‡ä»¶ïŒŒćż…éĄ»ćœšä»»ćŠĄćŒ€ć§‹äžŠäŒ ć‰è°ƒç”šă€‚ + * ä»„äž‹æƒ…ć†”äŒšćŻŒè‡Žæ·»ćŠ äžŠäŒ æ–‡ä»¶ć€±èŽ„ïŒš + * 1. optionsć‚æ•°äž­æŒ‡ćźšçš„keyćœšä»»ćŠĄäž­ć·Čç»ć­˜ćœšïŒŒćˆ™æ·»ćŠ ć€±èŽ„èż”ć›žfalse + * 2. pathć‚æ•°æŒ‡ćźšçš„æ–‡ä»¶è·ŻćŸ„äžćˆæł•æˆ–æ–‡ä»¶äžć­˜ćœšïŒŒćˆ™æ·»ćŠ ć€±èŽ„èż”ć›žfalse + * 3. äžŠäŒ ä»»ćŠĄć·Čç»ćŒ€ć§‹è°ƒćșŠïŒŒè°ƒç”šæ­€æ–čæł•ćˆ™æ·»ćŠ ć€±èŽ„èż”ć›žfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + addFile(path?: string, options?: PlusUploaderUploadFileOptions): boolean; + /** + * æ·»ćŠ äžŠäŒ æ•°æź + * ć‘äžŠäŒ ä»»ćŠĄäž­æ·»ćŠ æ•°æźïŒŒćż…éĄ»ćœšä»»ćŠĄćŒ€ć§‹äžŠäŒ ć‰è°ƒç”šă€‚ + * ä»„äž‹æƒ…ć†”äŒšćŻŒè‡Žæ·»ćŠ äžŠäŒ æ–‡ä»¶ć€±èŽ„ïŒš + * 1. keyć‚æ•°äž­æŒ‡ćźšçš„é”źććœšä»»ćŠĄäž­ć·Čç»ć­˜ćœšïŒŒćˆ™æ·»ćŠ ć€±èŽ„èż”ć›žfalse + * 2. äžŠäŒ ä»»ćŠĄć·Čç»ćŒ€ć§‹è°ƒćșŠïŒŒè°ƒç”šæ­€æ–čæł•ćˆ™æ·»ćŠ ć€±èŽ„èż”ć›žfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + addData(key?: string, value?: string): boolean; + /** + * ćŒ€ć§‹äžŠäŒ ä»»ćŠĄ + * ćŒ€ć§‹è°ƒćșŠäžŠäŒ ä»»ćŠĄïŒŒćŠ‚æžœä»»ćŠĄć·Čç»ć€„äșŽćŒ€ć§‹çŠ¶æ€ćˆ™æ— ä»»äœ•ć“ćș”。 + * 朹戛ć»șä»»ćŠĄæˆ–ä»»ćŠĄäžŠäŒ ć€±èŽ„ćŽè°ƒç”šćŻé‡æ–°ćŒ€ć§‹äžŠäŒ ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + start(): void; + /** + * æš‚ćœäžŠäŒ ä»»ćŠĄ + * æš‚ćœäžŠäŒ ä»»ćŠĄïŒŒćŠ‚æžœä»»ćŠĄć·Čç»ć€„äșŽćˆć§‹çŠ¶æ€æˆ–æš‚ćœçŠ¶æ€ćˆ™æ— ä»»äœ•ć“ćș”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + pause(): void; + /** + * æąć€æš‚ćœçš„äžŠäŒ ä»»ćŠĄ + * ç»§ç»­æš‚ćœçš„äžŠäŒ ä»»ćŠĄïŒŒćŠ‚æžœä»»ćŠĄć€„äșŽéžæš‚ćœçŠ¶æ€ćˆ™æ— ä»»äœ•ć“ćș”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + resume(): void; + /** + * ć–æ¶ˆäžŠäŒ ä»»ćŠĄ + * ćŠ‚æžœä»»ćŠĄæœȘćźŒæˆïŒŒćˆ™ç»ˆæ­ąäžŠäŒ ïŒŒćč¶ä»Žä»»ćŠĄćˆ—èĄšäž­ćˆ é™€ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + abort(): void; + /** + * æ·»ćŠ äžŠäŒ ä»»ćŠĄäș‹ä»¶ç›‘搏晚 + * äžŠäŒ ä»»ćŠĄæ·»ćŠ äș‹ä»¶ç›‘ćŹć™šćŽïŒŒćœ“ç›‘ćŹçš„äș‹ä»¶ć‘ç”Ÿæ—¶è§Šć‘listenerć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + addEventListener(type?: string, listener?: (result0: PlusUploaderUpload, result1: number) => void, capture?: boolean): void; + /** + * èŽ·ć–äžŠäŒ èŻ·æ±‚HTTP操ćș”ć€ŽéƒšäżĄæŻ + * HTTP操ćș”ć€Žéƒšć…šéƒšć†…ćźč䜜äžșæœȘè§Łæžçš„ć­—çŹŠäžČèż”ć›žïŒŒćŠ‚æžœæČĄæœ‰æŽ„æ”¶ćˆ°èż™äžȘHTTP操ćș”ć€Žæ•°æźæˆ–è€…äžŠäŒ èŻ·æ±‚æœȘćźŒæˆćˆ™äžșç©ș歗笩äžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + getAllResponseHeaders(): string; + /** + * èŽ·ć–äžŠäŒ èŻ·æ±‚æŒ‡ćźšçš„HTTP操ćș”ć€Žéƒšçš„ć€Œ + * ć…¶ć‚æ•°æ˜ŻèŠèż”ć›žçš„HTTP操ćș”ć€Žéƒšçš„ćç§°ïŒŒćŻä»„äœżç”šä»»äœ•ć€§ć°ć†™æ„ćˆ¶ćźšèż™äžȘć€Žéƒšćć­—ïŒŒć’Œć“ćș”ć€Žéƒšçš„æŻ”èŸƒæ˜ŻäžćŒșćˆ†ć€§ć°ć†™çš„ă€‚ + * ćŠ‚æžœæČĄæœ‰æŽ„æ”¶ćˆ°èż™äžȘć€Žéƒšæˆ–è€…äŒ€ć€„èŻ·æ±‚æœȘćźŒæˆćˆ™äžșç©ș歗笩äžČïŒ›ćŠ‚æžœæŽ„æ”¶ćˆ°ć€šäžȘæœ‰æŒ‡ćźšćç§°çš„ć€ŽéƒšïŒŒèż™äžȘć€Žéƒšçš„ć€Œèą«èżžæŽ„è”·æ„ćč¶èż”ć›žïŒŒäœżç”šé€—ć·ć’Œç©șæ Œćˆ†éš”ćŒ€ć„äžȘć€Žéƒšçš„ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + getResponseHeader(headerName?: string): string; + /** + * èźŸçœźäžŠäŒ èŻ·æ±‚çš„HTTPć€Žæ•°æź + * Http的Headerćș”èŻ„ćŒ…ć«ćœšé€šèż‡ćŽç»­start()è°ƒç”šè€Œć‘è”·çš„èŻ·æ±‚äž­ïŒŒæ­€æ–čæł•ćż…éœ€ćœšè°ƒç”šstart()äč‹ć‰èźŸçœźæ‰èƒœç”Ÿæ•ˆă€‚ + * ćŠ‚æžœćžŠæœ‰æŒ‡ćźšćç§°çš„ć€Žéƒšć·Čç»èą«æŒ‡ćźšäș†ïŒŒèż™äžȘć€Žéƒšçš„æ–°ć€Œć°±æ˜ŻïŒšäč‹ć‰æŒ‡ćźšçš„ć€ŒïŒŒćŠ äžŠé€—ć·ă€ä»„ćŠèż™äžȘè°ƒç”šæŒ‡ćźšçš„ć€ŒïŒˆćœąæˆäž€äžȘæ•°ç»„ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + setRequestHeader(headerName?: string, headerValue?: string): void; +} + +/** + * äžŠäŒ ä»»ćŠĄäș‹ä»¶ç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ +interface PlusUploaderUploadEvent { + /** + * äžŠäŒ ä»»ćŠĄçŠ¶æ€ć˜ćŒ–äș‹ä»¶ + * ćœ“äžŠäŒ ä»»ćŠĄçŠ¶æ€ć‘ç”Ÿć˜ćŒ–æ—¶è§Šć‘æ­€äș‹ä»¶ïŒŒäș‹ä»¶ćŽŸćž‹ć‚è€ƒUploadStateChangedCallback。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + statechanged?: string; +} + +/** + * äžŠäŒ ä»»ćŠĄçš„çŠ¶æ€ïŒŒNumber类枋 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ +type PlusUploaderUploadState = undefined | 0 | 1 | 2 | 3 | 4 | 5 | -1; + +/** + * JSONćŻčè±ĄïŒŒćˆ›ć»șäžŠäŒ ä»»ćŠĄçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ +interface PlusUploaderUploadOptions { + /** + * çœ‘ç»œèŻ·æ±‚ç±»ćž‹ + * ä»…æ”ŻæŒhttpćèźźçš„â€œPOSTâ€èŻ·æ±‚ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + method?: string; + /** + * äžŠäŒ ä»»ćŠĄæŻæŹĄäžŠäŒ çš„æ–‡ä»¶ć—ć€§ć°ïŒˆä»…ćœšæ”ŻæŒæ–­ç‚čç»­äŒ çš„æœćŠĄæœ‰æ•ˆïŒ‰ + * æ•°ć€Œç±»ćž‹ïŒŒć•äœäžșByteïŒˆć­—èŠ‚ïŒ‰ïŒŒé»˜èź€ć€Œäžș102400ïŒŒè‹„èźŸçœźć€Œć°äșŽç­‰äșŽ0ćˆ™èĄšç€șäžćˆ†ć—äžŠäŒ ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + blocksize?: number; + /** + * äžŠäŒ ä»»ćŠĄçš„äŒ˜ć…ˆçș§ + * æ•°ć€Œç±»ćž‹ïŒŒæ•°ć€Œè¶Šć€§äŒ˜ć…ˆçș§è¶Šé«˜ïŒŒé»˜èź€äŒ˜ć…ˆçș§ć€Œäžș0。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + priority?: number; + /** + * äžŠäŒ ä»»ćŠĄè¶…æ—¶æ—¶é—Ž + * æ•°ć€Œç±»ćž‹ïŒŒć•äœäžșs(秒)ïŒŒé»˜èź€ć€Œäžș120s。 + * è¶…æ—¶æ—¶é—ŽäžșæœćŠĄć™šć“ćș”èŻ·æ±‚çš„æ—¶é—ŽïŒˆäžæ˜ŻäžŠäŒ ä»»ćŠĄćźŒæˆçš„æ€»æ—¶é—ŽïŒ‰ïŒŒćŠ‚æžœèźŸçœźäžș0ćˆ™èĄšç€șæ°žèżœäžè¶…æ—¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + timeout?: number; + /** + * äžŠäŒ ä»»ćŠĄé‡èŻ•æŹĄæ•° + * æ•°ć€Œç±»ćž‹ïŒŒé»˜èź€äžșé‡èŻ•3æŹĄă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + retry?: number; + /** + * äžŠäŒ ä»»ćŠĄé‡èŻ•é—Žéš”æ—¶é—Ž + * æ•°ć€Œç±»ćž‹ïŒŒć•äœäžșs(秒)ïŒŒé»˜èź€ć€Œäžș30s。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + retryInterval?: number; +} + +/** + * JSONćŻčè±ĄïŒŒæ·»ćŠ äžŠäŒ æ–‡ä»¶çš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ +interface PlusUploaderUploadFileOptions { + /** + * æ–‡ä»¶é”źć + * äžŠäŒ æ–‡ä»¶ćœšäžŠäŒ ä»»ćŠĄäž­çš„é”źćïŒŒé»˜èź€ć€Œäžșäžșæ–‡ä»¶ćç§°ă€‚ + * äžŠäŒ ä»»ćŠĄäž­ćŠ‚æžœć·Čç»ć­˜ćœšç›žćŒkeyçš„äžŠäŒ æ–‡ä»¶æˆ–æ•°æźć°†ćŻŒè‡Žæ·»ćŠ æ–‡ä»¶ć€±èŽ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + key?: string; + /** + * æ–‡ä»¶ćç§° + * äžŠäŒ æ–‡ä»¶çš„ćç§°ïŒŒé»˜èź€ć€ŒäžșäžŠäŒ æ–‡ä»¶è·ŻćŸ„äž­çš„ćç§°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + name?: string; + /** + * æ–‡ä»¶ç±»ćž‹ + * äžŠäŒ æ–‡ä»¶çš„ç±»ćž‹ïŒˆćŠ‚ć›Ÿç‰‡æ–‡ä»¶äžș“image/jpegâ€ïŒ‰ïŒŒé»˜èź€ć€Œè‡Ș抹æ čæźæ–‡ä»¶ćŽçŒ€ćç§°ç”Ÿæˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + mime?: string; +} + +/** + * VideoæšĄć—çźĄç†ć€šćȘ’äœ“è§†éą‘ç›žć…łèƒœćŠ›ïŒŒćŻç”šćˆ›ć»șè§†éą‘æ’­æ”ŸæŽ§ä»¶ïŒŒç›Žæ’­æŽšæ”æŽ§ä»¶ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ +interface PlusVideo { + /** + * è§†éą‘æ’­æ”ŸæŽ§ä»¶ćŻčè±Ą + * VideoPlayerćŻčè±ĄèĄšç€șè§†éą‘æ’­æ”ŸæŽ§ä»¶ćŻčè±ĄïŒŒćœšçȘ—ćŁäž­æ’­æ”Ÿè§†éą‘ïŒŒćŻæ”ŻæŒæœŹćœ°è§†éą‘(mp4/flv)ïŒŒçœ‘ç»œè§†éą‘ćœ°ć€ïŒˆmp4/flv/m3u8ïŒ‰ćŠæ”ćȘ’䜓rtmp/hls/rtspïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + VideoPlayer?: PlusVideoVideoPlayer; + /** + * è§†éą‘æ’­æ”ŸæŽ§ä»¶ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + VideoPlayerStyles?: PlusVideoVideoPlayerStyles; + /** + * è§†éą‘æ’­æ”ŸæŽ§ä»¶äș‹ä»¶ç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + VideoPlayerEvents?: PlusVideoVideoPlayerEvents; + /** + * 盎播掚攁控件ćŻčè±Ą + * LivePusherćŻčè±ĄèĄšç€ș盎播掚攁控件ćŻčè±ĄïŒŒćœšçȘ—ćŁäž­æ˜Ÿç€șæ•èŽ·è§†éą‘ïŒŒćźžæ—¶æŽšé€ćˆ°æ”ćȘ’䜓RTMPïŒ‰æœćŠĄć™šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + LivePusher?: PlusVideoLivePusher; + /** + * ç›Žæ’­æŽšæ”æŽ§ä»¶é…çœźé€‰éĄč + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + LivePusherStyles?: PlusVideoLivePusherStyles; + /** + * 盎播掚攁控件äș‹ä»¶ç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + LivePusherEvents?: PlusVideoLivePusherEvents; + /** + * 戛ć»șVideoPlayerćŻčè±Ą + * 调甚歀æ–čæł•ćˆ›ć»ș搎ćč¶äžäŒšæ˜Ÿç€ș需芁调甚WebviewçȘ—ćŁçš„appendæ–čæł•ć°†ć…¶æ·»ćŠ ćˆ°WebviewçȘ—ćŁćŽæ‰èƒœæ˜Ÿç€ș。 + * æłšæ„ïŒšæ­€æ—¶éœ€èŠé€šèż‡stylesć‚æ•°çš„top/left/width/heightć±žæ€§èźŸçœźæŽ§ä»¶çš„äœçœźćŠć€§ć°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + createVideoPlayer(id?: string, styles?: PlusVideoVideoPlayerStyles): PlusVideoVideoPlayer; + /** + * 戛ć»șLivePusherćŻčè±Ą + * 调甚歀æ–čæł•ćˆ›ć»ș搎ćč¶äžäŒšæ˜Ÿç€ș需芁调甚WebviewçȘ—ćŁçš„appendæ–čæł•ć°†ć…¶æ·»ćŠ ćˆ°WebviewçȘ—ćŁćŽæ‰èƒœæ˜Ÿç€ș。 + * æłšæ„ïŒšæ­€æ—¶éœ€èŠé€šèż‡stylesć‚æ•°çš„top/left/width/heightć±žæ€§èźŸçœźæŽ§ä»¶çš„äœçœźćŠć€§ć°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + createLivePusher(id?: string, styles?: PlusVideoLivePusherStyles): PlusVideoLivePusher; + /** + * 柄扟ć·Čç»ćˆ›ć»ș的VideoPlayerćŻčè±Ą + * æŸ„æ‰ŸæŒ‡ćźšid的VideoPlayerćŻčè±ĄïŒŒćŠ‚æžœäžć­˜ćœšćˆ™èż”ć›žnull。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + getVideoPlayerById(id?: string): PlusVideoVideoPlayer; + /** + * 柄扟ć·Čç»ćˆ›ć»ș的LivePusherćŻčè±Ą + * æŸ„æ‰ŸæŒ‡ćźšid的LivePusherćŻčè±ĄïŒŒćŠ‚æžœäžć­˜ćœšćˆ™èż”ć›žnull。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + getLivePusherById(id?: string): PlusVideoLivePusher; +} + +/** + * è§†éą‘æ’­æ”ŸæŽ§ä»¶ćŻčè±Ą + * VideoPlayerćŻčè±ĄèĄšç€șè§†éą‘æ’­æ”ŸæŽ§ä»¶ćŻčè±ĄïŒŒćœšçȘ—ćŁäž­æ’­æ”Ÿè§†éą‘ïŒŒćŻæ”ŻæŒæœŹćœ°è§†éą‘(mp4/flv)ïŒŒçœ‘ç»œè§†éą‘ćœ°ć€ïŒˆmp4/flv/m3u8ïŒ‰ćŠæ”ćȘ’䜓rtmp/hls/rtspïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ +interface PlusVideoVideoPlayer { + /** + * ç›‘ćŹè§†éą‘æ’­æ”ŸæŽ§ä»¶äș‹ä»¶ + * ć‘è§†éą‘æ’­æ”ŸæŽ§ä»¶æ·»ćŠ äș‹ä»¶ç›‘ćŹć™šïŒŒćœ“æŒ‡ćźšçš„äș‹ä»¶ć‘ç”Ÿæ—¶ïŒŒć°†è§Šć‘listenerć‡œæ•°çš„æ‰§èĄŒă€‚ + * ćŻć€šæŹĄè°ƒç”šæ­€æ–čæł•ć‘è§†éą‘æ’­æ”ŸæŽ§ä»¶æ·»ćŠ ć€šäžȘç›‘ćŹć™šïŒŒćœ“ç›‘ćŹçš„äș‹ä»¶ć‘ç”Ÿæ—¶ïŒŒć°†æŒ‰ç…§æ·»ćŠ çš„ć…ˆćŽéĄșćșæ‰§èĄŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + addEventListener(event?: PlusVideoVideoPlayerEvents, listener?: (result: any) => void, capture?: boolean): void; + /** + * èźŸçœźè§†éą‘æ’­æ”ŸæŽ§ä»¶ć‚æ•° + * 甹äșŽćŠšæ€æ›Žæ–°è§†éą‘æ’­æ”ŸæŽ§ä»¶çš„é…çœźć‚æ•°ă€‚ + * æłšæ„ïŒšæœ‰äș›é€‰éĄčæ— æł•ćŠšæ€æ›Žæ–°ïŒŒćȘèƒœćˆ›ć»șæ—¶èż›èĄŒèźŸçœźïŒŒèŻŠæƒ…ć‚è€ƒVideoPlayerStyles。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + setStyles(styles?: PlusVideoVideoPlayerStyles): void; + /** + * èźŸçœźè§†éą‘æ’­æ”ŸæŽ§ä»¶ć‚æ•°ïŒˆć°†ćșŸćŒƒïŒŒäœżç”šsetStyles + * 甹äșŽćŠšæ€æ›Žæ–°è§†éą‘æ’­æ”ŸæŽ§ä»¶çš„é…çœźé€‰éĄč。 + * æłšæ„ïŒšæœ‰äș›é€‰éĄčæ— æł•ćŠšæ€æ›Žæ–°ïŒŒćȘèƒœćˆ›ć»șæ—¶èż›èĄŒèźŸçœźïŒŒèŻŠæƒ…ć‚è€ƒVideoPlayerStyles。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + setOptions(options?: PlusVideoVideoPlayerStyles): void; + /** + * æ’­æ”Ÿè§†éą‘ + * ćŠ‚æžœè§†éą‘ć·Čç»ć€„äșŽæ’­æ”ŸçŠ¶æ€ïŒŒćˆ™æ“äœœæ— æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + play(): void; + /** + * æš‚ćœè§†éą‘ + * ćŠ‚æžœè§†éą‘æœȘ怄äșŽæ’­æ”ŸçŠ¶æ€ïŒŒćˆ™æ“äœœæ— æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + pause(): void; + /** + * è·łèœŹćˆ°æŒ‡ćźšäœçœź + * ćŠ‚æžœè§†éą‘æœȘ怄äșŽæ’­æ”ŸçŠ¶æ€ïŒŒćˆ™æ“äœœæ— æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + seek(position?: number): void; + /** + * ćˆ‡æąćˆ°ć…šć± + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + requestFullScreen(direction?: number): void; + /** + * 退ć‡șć…šć± + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + exitFullScreen(): void; + /** + * ćœæ­ąæ’­æ”Ÿè§†éą‘ + * ćŠ‚æžœè§†éą‘æœȘ怄äșŽæ’­æ”Ÿæˆ–æš‚ćœçŠ¶æ€ïŒŒćˆ™æ“äœœæ— æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + stop(): void; + /** + * éšè—è§†éą‘æ’­æ”ŸæŽ§ä»¶ + * 隐藏ćȘæ˜ŻæŽ§ä»¶äžćŻè§ïŒŒæŽ§ä»¶äŸç„¶ć­˜ćœšćč¶äž”䞍æ”čć˜æ’­æ”ŸçŠ¶æ€ă€‚ + * ćŠ‚æžœæŽ§ä»¶ć·Čç»éšè—ïŒŒćˆ™æ“äœœæ— æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + hide(): void; + /** + * 星ç€șè§†éą‘æ’­æ”ŸæŽ§ä»¶ + * ć°†éšè—çš„æŽ§ä»¶æ˜Ÿç€șć‡șæ„ïŒˆć›žć€ćˆ°éšè—ć‰çš„çŠ¶æ€ïŒ‰ă€‚ + * ćŠ‚æžœæŽ§ä»¶ć·Č经星ç€șïŒŒćˆ™æ“äœœæ— æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + show(): void; + /** + * ć…łé—­è§†éą‘æ’­æ”ŸæŽ§ä»¶ + * ć…łé—­æ“äœœć°†é‡Šæ”ŸæŽ§ä»¶æ‰€æœ‰è”„æșïŒŒäžć†ćŻç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + close(): void; + /** + * 揑送ćŒčćč• + * ćŠ‚æžœè§†éą‘æœȘ怄äșŽæ’­æ”ŸçŠ¶æ€ïŒŒćˆ™æ“äœœæ— æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + sendDanmu(danmu?: any): void; + /** + * èźŸçœźć€é€Ÿæ’­æ”Ÿ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + playbackRate(rate?: number): void; +} + +/** + * è§†éą‘æ’­æ”ŸæŽ§ä»¶ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ +interface PlusVideoVideoPlayerStyles { + /** + * è§†éą‘è”„æșćœ°ć€ + * æ”ŻæŒæœŹćœ°ćœ°ć€ïŒŒä蟿”ŻæŒçœ‘ç»œćœ°ć€ćŠç›Žæ’­æ”ïŒˆRTMPïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + src?: string; + /** + * è§†éą‘ćˆć§‹æ’­æ”Ÿäœçœź + * ć•äœäžș秒sïŒ‰ă€‚ + * æłšæ„ïŒšä»…ćœšè§†éą‘ćŒ€ć§‹æ’­æ”Ÿć‰èźŸçœźæœ‰æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + 'initial-time'?: number; + /** + * è§†éą‘é•żćșŠ + * ć•äœäžș秒sïŒ‰ă€‚ + * æłšæ„ïŒšä»…ćœšè§†éą‘ćŒ€ć§‹æ’­æ”Ÿć‰èźŸçœźæœ‰æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + duration?: number; + /** + * æ˜ŻćŠæ˜Ÿç€șé»˜èź€æ’­æ”ŸæŽ§ä»¶ + * é»˜èź€ć€Œäžștrue。 + * ćŒ…æ‹Źæ’­æ”Ÿ/æš‚ćœæŒ‰é’źă€æ’­æ”Ÿèż›ćșŠă€æ—¶é—Žç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + controls?: boolean; + /** + * ćŒčćč•ćˆ—èĄš + * ćŒčćč•JSONćŻčè±ĄćŒ…æ‹Źć±žæ€§ïŒštextStringç±»ćž‹ïŒŒćŒčć蕿–‡æœŹç±»ćźčcolorStringç±»ćž‹ïŒŒćŒčćč•éąœè‰ČïŒŒæ ŒćŒäžș#RRGGBBtimeNumberç±»ćž‹ïŒŒćŒčćč•ć‡șçŽ°çš„æ—¶é—ŽïŒŒć•äœäžșç§’ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + 'danmu-list'?: any []; + /** + * æ˜ŻćŠæ˜Ÿç€șćŒčć蕿Œ‰é’ź + * é»˜èź€ć€Œäžșfalse。 + * æłšæ„ïŒšä»…ćœšæŽ§ä»¶æž„é€ æ—¶èźŸçœźæœ‰æ•ˆïŒŒäžèƒœćŠšæ€æ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + 'danmu-btn'?: boolean; + /** + * æ˜ŻćŠć±•ç€șćŒčćč• + * é»˜èź€ć€Œäžșfalse。 + * æłšæ„ïŒšä»…ćœšæŽ§ä»¶æž„é€ æ—¶èźŸçœźæœ‰æ•ˆïŒŒäžèƒœćŠšæ€æ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + 'enable-danmu'?: boolean; + /** + * æ˜ŻćŠè‡ȘćŠšæ’­æ”Ÿ + * é»˜èź€ć€Œäžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + autoplay?: boolean; + /** + * æ˜ŻćŠćŸȘçŽŻæ’­æ”Ÿ + * é»˜èź€ć€Œäžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + loop?: boolean; + /** + * æ˜ŻćŠé™éŸłæ’­æ”Ÿ + * é»˜èź€ć€Œäžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + muted?: boolean; + /** + * èźŸçœźć…šć±æ—¶è§†éą‘çš„æ–č搑 + * äžæŒ‡ćźšćˆ™æ čæźćźœé«˜æŻ”è‡ȘćŠšćˆ€æ–­ă€‚ + * æœ‰æ•ˆć€Œäžș 0ïŒˆæ­Łćžžç«–ć‘ïŒ‰, 90ïŒˆć±ćč•逆时针90ćșŠïŒ‰, -90ïŒˆć±ćč•éĄș时针90ćșŠïŒ‰ă€‚ + * é»˜èź€ć€Œäžș-90。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + direction?: number; + /** + * æ˜ŻćŠæ˜Ÿç€șæ’­æ”Ÿèż›ćșŠ + * é»˜èź€ć€Œäžștrue。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + 'show-progress'?: boolean; + /** + * æ˜ŻćŠæ˜Ÿç€șć…šć±æŒ‰é’ź + * é»˜èź€ć€Œäžștrue。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + 'show-fullscreen-btn'?: boolean; + /** + * æ˜ŻćŠæ˜Ÿç€șè§†éą‘ćș•éƒšæŽ§ćˆ¶æ çš„æ’­æ”ŸæŒ‰é’ź + * é»˜èź€ć€Œäžștrue。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + 'show-play-btn'?: boolean; + /** + * æ˜ŻćŠæ˜Ÿç€șè§†éą‘äž­é—Žçš„æ’­æ”ŸæŒ‰é’ź + * é»˜èź€ć€Œäžștrue。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + 'show-center-play-btn'?: boolean; + /** + * æ˜ŻćŠćŒ€ćŻæŽ§ćˆ¶èż›ćșŠçš„æ‰‹ćŠż + * é»˜èź€ć€Œäžștrue。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + 'enable-progress-gesture'?: boolean; + /** + * ćœ“è§†éą‘ć€§ć°äžŽ video ćźčć™šć€§ć°äžäž€è‡Žæ—¶ïŒŒè§†éą‘çš„èĄšçŽ°ćœąćŒ + * æœ‰æ•ˆć€ŒäžșcontainïŒˆćŒ…ć«ïŒ‰ïŒŒfillïŒˆćĄ«ć……ïŒ‰ïŒŒcoverïŒˆèŠ†ç›–ïŒ‰ă€‚ + * é»˜èź€ć€Œäžșcontain。 + * 仅Androidćčłć°æ”ŻæŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + objectFit?: string; + /** + * è§†éą‘ć°éąçš„ć›Ÿç‰‡çœ‘ç»œè”„æșćœ°ć€ + * ćŠ‚æžœ controls ć±žæ€§ć€Œäžș false ćˆ™èźŸçœź poster æ— æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + poster?: string; + /** + * VideoPlayeræŽ§ä»¶ć·ŠäžŠè§’çš„ćž‚ç›Žćç§»é‡ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶WebviewçȘ—ćŁçš„é«˜ćșŠïŒ› + * è‡ȘćŠšèźĄçź—ïŒŒćŠ‚"auto",æ čæźheightć€Œè‡ȘćŠšèźĄçź—ïŒŒç›žćŻčäșŽçˆ¶WebviewçȘ—ćŁćž‚ç›Žć±…äž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + top?: string; + /** + * VideoPlayeræŽ§ä»¶ć·ŠäžŠè§’çš„æ°Žćčłćç§»é‡ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶WebviewçȘ—ćŁçš„ćźœćșŠïŒ› + * è‡ȘćŠšèźĄçź—ïŒŒćŠ‚"auto"æ čæźwidthć€Œè‡ȘćŠšèźĄçź—ïŒŒç›žćŻčäșŽçˆ¶WebviewçȘ—ćŁæ°Žćčłć±…䞭。 + * é»˜èź€ć€Œäžș"0px"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + left?: string; + /** + * VideoPlayeræŽ§ä»¶çš„ćźœćșŠ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶WebviewçȘ—ćŁçš„ćźœćșŠă€‚ + * é»˜èź€ć€Œäžș"100%"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + width?: string; + /** + * VideoPlayer控件的高ćșŠ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶WebviewçȘ—ćŁçš„é«˜ćșŠă€‚ + * é»˜èź€ć€Œäžș"100%"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + height?: string; + /** + * VideoPlayeræŽ§ä»¶ćœšWebviewçȘ—ćŁçš„ćžƒć±€æšĄćŒ + * ćŻć–ć€ŒïŒš + * "static" - é™æ€ćžƒć±€æšĄćŒïŒŒćŠ‚æžœéĄ”éąć­˜ćœšæ»šćŠšæĄćˆ™éšçȘ—ćŁć†…ćźčæ»šćŠšïŒ› + * "absolute" - 绝ćŻčćžƒć±€æšĄćŒïŒŒćŠ‚æžœéĄ”éąć­˜ćœšæ»šćŠšæĄäžéšçȘ—ćŁć†…ćźčæ»šćŠšïŒ› + * é»˜èź€ć€Œäžș"static"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + position?: string; +} + +/** + * è§†éą‘æ’­æ”ŸæŽ§ä»¶äș‹ä»¶ç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ +interface PlusVideoVideoPlayerEvents { + /** + * è§†éą‘æ’­æ”Ÿäș‹ä»¶ + * ćœ“è§†éą‘ćŒ€ć§‹/ç»§ç»­æ’­æ”Ÿæ—¶è§Šć‘ă€‚ + * 无äș‹ä»¶ć›žè°ƒć‡œæ•°ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + play?: string; + /** + * è§†éą‘æš‚ćœäș‹ä»¶ + * ćœ“è§†éą‘æš‚ćœæ’­æ”Ÿæ—¶è§Šć‘ă€‚ + * 无äș‹ä»¶ć›žè°ƒć‡œæ•°ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + pause?: string; + /** + * è§†éą‘ç»“æŸäș‹ä»¶ + * ćœ“è§†éą‘æ’­æ”Ÿćˆ°æœ«ć°Ÿæ—¶è§Šć‘ă€‚ + * 无äș‹ä»¶ć›žè°ƒć‡œæ•°ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + ended?: string; + /** + * è§†éą‘æ’­æ”Ÿèż›ćșŠæ›Žæ–°äș‹ä»¶ + * ćœ“è§†éą‘æ’­æ”Ÿèż›ćșŠć˜ćŒ–æ—¶è§Šć‘ïŒŒè§Šć‘éą‘çŽ‡250msäž€æŹĄă€‚ + * äș‹ä»¶ć›žè°ƒć‡œæ•°ć‚æ•°event.detail = {currentTime:"Numberç±»ćž‹ïŒŒćœ“ć‰æ’­æ”Ÿæ—¶é—ŽïŒˆć•äœäžș秒",duration:"Numberç±»ćž‹ïŒŒè§†éą‘æ€»é•żćșŠïŒˆć•䜍äžș秒"}。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + timeupdate?: string; + /** + * è§†éą‘æ’­æ”Ÿć…šć±æ’­æ”ŸçŠ¶æ€ć˜ćŒ–äș‹ä»¶ + * ćœ“è§†éą‘æ’­æ”Ÿèż›ć…„æˆ–é€€ć‡șć…šć±æ—¶è§Šć‘ă€‚ + * äș‹ä»¶ć›žè°ƒć‡œæ•°ć‚æ•°event.detail = {fullScreen:"Booleanç±»ćž‹ïŒŒćœ“ć‰çŠ¶æ€æ˜ŻćŠäžșć…šć±", direction:"Stringç±»ćž‹ïŒŒvertical或horizontal"}。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + fullscreenchange?: string; + /** + * è§†éą‘çŒ“ć†Čäș‹ä»¶ + * ćœ“è§†éą‘æ’­æ”Ÿć‡ș现猓ć†Čæ—¶è§Šć‘ă€‚ + * 无äș‹ä»¶ć›žè°ƒć‡œæ•°ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + waiting?: string; + /** + * è§†éą‘é”™èŻŻäș‹ä»¶ + * ćœ“è§†éą‘æ’­æ”Ÿć‡șé”™æ—¶è§Šć‘ă€‚ + * 无äș‹ä»¶ć›žè°ƒć‡œæ•°ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + error?: string; +} + +/** + * 盎播掚攁控件ćŻčè±Ą + * LivePusherćŻčè±ĄèĄšç€ș盎播掚攁控件ćŻčè±ĄïŒŒćœšçȘ—ćŁäž­æ˜Ÿç€șæ•èŽ·è§†éą‘ïŒŒćźžæ—¶æŽšé€ćˆ°æ”ćȘ’䜓RTMPïŒ‰æœćŠĄć™šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ +interface PlusVideoLivePusher { + /** + * ç›‘ćŹç›Žæ’­æŽšæ”æŽ§ä»¶äș‹ä»¶ + * ć‘ç›Žæ’­æŽšæ”æŽ§ä»¶æ·»ćŠ äș‹ä»¶ç›‘ćŹć™šïŒŒćœ“æŒ‡ćźšçš„äș‹ä»¶ć‘ç”Ÿæ—¶ïŒŒć°†è§Šć‘listenerć‡œæ•°çš„æ‰§èĄŒă€‚ + * ćŻć€šæŹĄè°ƒç”šæ­€æ–čæł•ć‘ç›Žæ’­æŽšæ”æŽ§ä»¶æ·»ćŠ ć€šäžȘç›‘ćŹć™šïŒŒćœ“ç›‘ćŹçš„äș‹ä»¶ć‘ç”Ÿæ—¶ïŒŒć°†æŒ‰ç…§æ·»ćŠ çš„ć…ˆćŽéĄșćșæ‰§èĄŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + addEventListener(event?: PlusVideoLivePusherEvents, listener?: (result: any) => void, capture?: boolean): void; + /** + * èźŸçœźç›Žæ’­æŽšæ”æŽ§ä»¶ć‚æ•° + * 甹äșŽćŠšæ€æ›Žæ–°ç›Žæ’­æŽšæ”æŽ§ä»¶çš„é…çœźć‚æ•°ă€‚ + * æłšæ„ïŒšæœ‰äș›é€‰éĄčæ— æł•ćŠšæ€æ›Žæ–°ïŒŒćȘèƒœćˆ›ć»șæ—¶èż›èĄŒèźŸçœźïŒŒèŻŠæƒ…ć‚è€ƒLivePusherStyles。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + setStyles(styles?: PlusVideoLivePusherStyles): void; + /** + * èźŸçœźç›Žæ’­æŽšæ”æŽ§ä»¶ć‚æ•°ïŒˆć°†ćșŸćŒƒïŒŒäœżç”šsetStyles + * 甹äșŽćŠšæ€æ›Žæ–°ç›Žæ’­æŽšæ”æŽ§ä»¶çš„é…çœźé€‰éĄč。 + * æłšæ„ïŒšæœ‰äș›é€‰éĄčæ— æł•ćŠšæ€æ›Žæ–°ïŒŒćȘèƒœćˆ›ć»șæ—¶èż›èĄŒèźŸçœźïŒŒèŻŠæƒ…ć‚è€ƒLivePusherStyles。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + setOptions(options?: PlusVideoLivePusherStyles): void; + /** + * éą„è§ˆæ‘„ćƒć€Žé‡‡é›†æ•°æź + * è°ƒç”šæ‘„ćƒć€Žé‡‡é›†ć›Ÿćƒæ•°æźïŒŒćč¶ćœšæŽšæ”æŽ§ä»¶äž­éą„è§ˆïŒˆæ­€æ—¶äžäŒšć‘æœćŠĄć™šæŽšæ”ïŒŒéœ€è°ƒç”šstartæ–čæł•æ‰ćŒ€ć§‹æŽšæ”ïŒ‰ă€‚ + * æłšæ„ïŒšäžșäș†çĄźäżéą„览çȘ—ćŁć€§ć°æ­ŁçĄźïŒŒćș”èŻ„ćœšćˆ›ć»șæŽ§ä»¶ćŽć»¶æ—¶äž€ćźšçš„æ—¶é—ŽïŒˆćŠ‚500msïŒ‰èż›èĄŒéą„è§ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + preview(): void; + /** + * ćŒ€ć§‹æŽšæ” + * ćŠ‚æžœć·Čç»ć€„äșŽæŽšæ”çŠ¶æ€ïŒŒćˆ™æ“äœœæ— æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + start(successCB?: Function, errorCB?: Function): void; + /** + * ćœæ­ąæŽšæ” + * ćŠ‚æžœæœȘ怄äșŽæŽšæ”çŠ¶æ€ïŒŒćˆ™æ“äœœæ— æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + stop(options?: any): void; + /** + * æš‚ćœæŽšæ” + * ćŠ‚æžœæœȘ怄äșŽæŽšæ”çŠ¶æ€ïŒŒćˆ™æ“äœœæ— æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + pause(): void; + /** + * æąć€æŽšæ” + * ćŠ‚æžœæœȘ怄äșŽæš‚ćœçŠ¶æ€ïŒŒćˆ™æ“äœœæ— æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + resume(): void; + /** + * ćˆ‡æąć‰ćŽæ‘„ćƒć€Ž + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + switchCamera(): void; + /** + * 濫照 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + snapshot(successCB?: Function, errorCB?: Function): void; + /** + * ć…łé—­ç›Žæ’­æŽšæ”æŽ§ä»¶ + * ć…łé—­æ“äœœć°†é‡Šæ”ŸæŽ§ä»¶æ‰€æœ‰è”„æșïŒŒäžć†ćŻç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + close(): void; +} + +/** + * ç›Žæ’­æŽšæ”æŽ§ä»¶é…çœźé€‰éĄč + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ +interface PlusVideoLivePusherStyles { + /** + * æŽšæ”ćœ°ć€ + * æ”ŻæŒRTMPćèźźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + url?: string; + /** + * æŽšæ”è§†éą‘æšĄćŒ + * ćŻć–ć€ŒïŒšSD标枅, HD高枅, FHDïŒˆè¶…æž…ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + mode?: string; + /** + * æ˜ŻćŠé™éŸł + * é»˜èź€ć€Œäžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + muted?: boolean; + /** + * ćŒ€ćŻæ‘„ćƒć€Ž + * é»˜èź€ć€Œäžștrue。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + 'enable-camera'?: boolean; + /** + * è‡ȘćŠšèšé›† + * é»˜èź€ć€Œäžștrue。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + 'auto-focus'?: boolean; + /** + * æ˜ŻćŠçŸŽéąœ + * ćŻć–ć€Œ0、1ïŒŒć…¶äž­0èĄšç€șäžäœżç”šçŸŽéąœïŒŒ1èĄšç€șäžäœżç”šçŸŽéąœă€‚ + * é»˜èź€ć€Œäžș0(äžäœżç”šçŸŽéąœ)。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + beauty?: number; + /** + * æ˜ŻćŠçŸŽç™œ + * ćŻć–ć€Œ0、1、2、3、4、5ïŒŒć…¶äž­0èĄšç€șäžäœżç”šçŸŽç™œïŒŒć…¶äœ™ć€Œćˆ†ćˆ«èĄšç€ș矎癜的皋ćșŠïŒŒć€Œè¶Šć€§çŸŽç™œçš‹ćșŠè¶Šć€§ă€‚ + * é»˜èź€ć€Œäžș0ïŒˆäžäœżç”šçŸŽç™œïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + whiteness?: number; + /** + * ćźœé«˜æŻ” + * ćŻć–ć€ŒïŒš3:4, 9:16。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + aspect?: string; + /** + * LivePusheræŽ§ä»¶ć·ŠäžŠè§’çš„ćž‚ç›Žćç§»é‡ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶WebviewçȘ—ćŁçš„é«˜ćșŠïŒ› + * è‡ȘćŠšèźĄçź—ïŒŒćŠ‚"auto",æ čæźheightć€Œè‡ȘćŠšèźĄçź—ïŒŒç›žćŻčäșŽçˆ¶WebviewçȘ—ćŁćž‚ç›Žć±…äž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + top?: string; + /** + * LivePusheræŽ§ä»¶ć·ŠäžŠè§’çš„æ°Žćčłćç§»é‡ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶WebviewçȘ—ćŁçš„ćźœćșŠïŒ› + * è‡ȘćŠšèźĄçź—ïŒŒćŠ‚"auto"æ čæźwidthć€Œè‡ȘćŠšèźĄçź—ïŒŒç›žćŻčäșŽçˆ¶WebviewçȘ—ćŁæ°Žćčłć±…䞭。 + * é»˜èź€ć€Œäžș"0px"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + left?: string; + /** + * LivePusheræŽ§ä»¶çš„ćźœćșŠ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶WebviewçȘ—ćŁçš„ćźœćșŠă€‚ + * é»˜èź€ć€Œäžș"100%"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + width?: string; + /** + * LivePusher控件的高ćșŠ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶WebviewçȘ—ćŁçš„é«˜ćșŠă€‚ + * é»˜èź€ć€Œäžș"100%"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + height?: string; + /** + * LivePusheræŽ§ä»¶ćœšWebviewçȘ—ćŁçš„ćžƒć±€æšĄćŒ + * ćŻć–ć€ŒïŒš + * "static" - é™æ€ćžƒć±€æšĄćŒïŒŒćŠ‚æžœéĄ”éąć­˜ćœšæ»šćŠšæĄćˆ™éšçȘ—ćŁć†…ćźčæ»šćŠšïŒ› + * "absolute" - 绝ćŻčćžƒć±€æšĄćŒïŒŒćŠ‚æžœéĄ”éąć­˜ćœšæ»šćŠšæĄäžéšçȘ—ćŁć†…ćźčæ»šćŠšïŒ› + * é»˜èź€ć€Œäžș"static"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + position?: string; +} + +/** + * 盎播掚攁控件äș‹ä»¶ç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ +interface PlusVideoLivePusherEvents { + /** + * çŠ¶æ€ć˜ćŒ–äș‹ä»¶ + * ćœ“æŽšæ”èżžæŽ„æœćŠĄć™šçŠ¶æ€ć˜ćŒ–æ—¶è§Šć‘ă€‚ + * äș‹ä»¶ć›žè°ƒć‡œæ•°ć‚æ•°event={type:"äș‹ä»¶ç±»ćž‹ïŒŒæ­€æ—¶äžșstatechange",target:"è§Šć‘æ­€äș‹ä»¶çš„盎播掚攁控件ćŻčè±Ą",detail:{code:"çŠ¶æ€ç ïŒŒć‚è€ƒćŽéąçŠ¶æ€ç èŻŽæ˜Ž",message:"æèż°äżĄæŻ"}}。 + * ć…¶äž­code状态码 + * 1001 - ć·Čç»èżžæŽ„æŽšæ”æœćŠĄć™šïŒ› + * 1002 - ć·Čç»äžŽæœćŠĄć™šæĄæ‰‹ćźŒæŻ•,ćŒ€ć§‹æŽšæ”ïŒ› + * 1003 - æ‰“ćŒ€æ‘„ćƒć€ŽæˆćŠŸïŒ› + * 1004 - ćœ•ć±ćŻćŠšæˆćŠŸïŒ› + * 1005 - æŽšæ”ćŠšæ€è°ƒæ•Žćˆ†èŸšçŽ‡ïŒ› + * 1006 - æŽšæ”ćŠšæ€è°ƒæ•Žç çŽ‡ïŒ› + * 1007 - éŠ–ćž§ç”»éąé‡‡é›†ćźŒæˆïŒ› + * 1008 - çŒ–ç ć™šćŻćŠšïŒ› + * -1301 - æ‰“ćŒ€æ‘„ćƒć€Žć€±èŽ„ïŒ› + * -1302 - æ‰“ćŒ€éșŠć…‹éŁŽć€±èŽ„ïŒ› + * -1303 - è§†éą‘çŒ–ç ć€±èŽ„ïŒ› + * -1304 - éŸłéą‘çŒ–ç ć€±èŽ„ïŒ› + * -1305 - äžæ”ŻæŒçš„è§†éą‘ćˆ†èŸšçŽ‡ïŒ› + * -1306 - äžæ”ŻæŒçš„éŸłéą‘é‡‡æ ·çŽ‡ïŒ› + * -1307 - çœ‘ç»œæ–­èżžïŒŒäž”ç»ć€šæŹĄé‡èżžæŠąæ•‘æ— æ•ˆïŒŒæ›Žć€šé‡èŻ•èŻ·è‡ȘèĄŒé‡ćŻæŽšæ”ïŒ› + * -1308 - ćŒ€ć§‹ćœ•ć±ć€±èŽ„ïŒŒćŻèƒœæ˜Żèą«ç”šæˆ·æ‹’ç»ïŒ› + * -1309 - ćœ•ć±ć€±èŽ„ïŒŒäžæ”ŻæŒçš„Androidçł»ç»Ÿç‰ˆæœŹïŒŒéœ€èŠ5.0ä»„äžŠçš„çł»ç»ŸïŒ› + * -1310 - ćœ•ć±èą«ć…¶ä»–ćș”甚打断äș†ïŒ› + * -1311 - Android Micæ‰“ćŒ€æˆćŠŸïŒŒäœ†æ˜Żćœ•äžćˆ°éŸłéą‘æ•°æźïŒ› + * -1312 - ćœ•ć±ćŠšæ€ćˆ‡æšȘç«–ć±ć€±èŽ„ïŒ› + * 1101 - çœ‘ç»œçŠ¶ć†”äžäœłïŒšäžŠèĄŒćžŠćźœć€Șć°ïŒŒäžŠäŒ æ•°æźć—é˜»ïŒ› + * 1102 - çœ‘ç»œæ–­èżž, ć·Č搯抹è‡ȘćŠšé‡èżžïŒ› + * 1103 - çĄŹçŒ–ç ćŻćŠšć€±èŽ„,é‡‡ç”šèœŻçŒ–ç ïŒ› + * 1104 - è§†éą‘çŒ–ç ć€±èŽ„ïŒ› + * 1105 - æ–°çŸŽéąœèœŻçŒ–ç ćŻćŠšć€±èŽ„ïŒŒé‡‡ç”šè€çš„èœŻçŒ–ç ïŒ› + * 1106 - æ–°çŸŽéąœèœŻçŒ–ç ćŻćŠšć€±èŽ„ïŒŒé‡‡ç”šè€çš„èœŻçŒ–ç ïŒ› + * 3001 - RTMP -DNSè§Łæžć€±èŽ„ïŒ› + * 3002 - RTMPæœćŠĄć™šèżžæŽ„ć€±èŽ„ïŒ› + * 3003 - RTMPæœćŠĄć™šæĄæ‰‹ć€±èŽ„ïŒ› + * 3004 - RTMPæœćŠĄć™šäž»ćŠšæ–­ćŒ€ïŒŒèŻ·æŁ€æŸ„æŽšæ”ćœ°ć€çš„ćˆæł•æ€§æˆ–é˜Č盗铟有效期 + * 3005 - RTMP èŻ»/ć†™ć€±èŽ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + statechange?: string; + /** + * 眑络状态通矄äș‹ä»¶ + * ćœ“æŽšæ”çš„çœ‘ç»œçŠ¶æ€ć‘ç”Ÿć˜ćŒ–æ—¶è§Šć‘ă€‚ + * äș‹ä»¶ć›žè°ƒć‡œæ•°ć‚æ•°event={type:"äș‹ä»¶ç±»ćž‹ïŒŒæ­€æ—¶äžșnetstatus",target:"è§Šć‘æ­€äș‹ä»¶çš„盎播掚攁控件ćŻčè±Ą",detail:{videoBitrate:"è§†éą‘ç çŽ‡",audioBitrate:"音鱑码率",videoFPS:"è§†éą‘ćž§çŽ‡",netSpeed:"掚攁眑速",videoWidth:"è§†éą‘ćźœćșŠ",videoHeight:"è§†éą‘é«˜ćșŠ"}}。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + netstatus?: string; + /** + * æžČæŸ“é”™èŻŻäș‹ä»¶ + * ćœ“æŽšæ”ć‘ç”Ÿé”™èŻŻæ˜Żè§Šć‘ă€‚ + * äș‹ä»¶ć›žè°ƒć‡œæ•°ć‚æ•°event={type:"äș‹ä»¶ç±»ćž‹ïŒŒæ­€æ—¶äžșerror",target:"è§Šć‘æ­€äș‹ä»¶çš„盎播掚攁控件ćŻčè±Ą",detail:{code:"é”™èŻŻçŒ–ç ïŒŒć‚è€ƒćŽéąé”™èŻŻç èŻŽæ˜Ž",message:"æèż°äżĄæŻ"}}。 + * ć…¶äž­codeé”™èŻŻç ïŒš + * 1001 - ç”šæˆ·çŠæ­ąäœżç”šæ‘„ćƒć€ŽïŒ› + * 1002 - ç”šæˆ·çŠæ­ąäœżç”šćœ•éŸłă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + error?: string; +} + +/** + * WebviewæšĄć—çźĄç†ćș”甚çȘ—ćŁç•ŒéąïŒŒćźžçŽ°ć€šçȘ—ćŁçš„é€»èŸ‘æŽ§ćˆ¶çźĄç†æ“äœœă€‚é€šèż‡plus.webviewćŻèŽ·ć–ćș”ç”šç•ŒéąçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebview { + /** + * 䞀组甚äșŽćźšäč‰éĄ”éąæˆ–æŽ§ä»¶æ˜Ÿç€șćŠšç”»æ•ˆæžœ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + AnimationTypeShow?: PlusWebviewAnimationTypeShow; + /** + * 䞀组甚äșŽćźšäč‰éĄ”éąæˆ–æŽ§ä»¶ć…łé—­çš„ćŠšç”»æ•ˆæžœ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + AnimationTypeClose?: PlusWebviewAnimationTypeClose; + /** + * WebviewçȘ—揣ćŻčè±ĄïŒŒç”šäșŽæ“äœœćŠ èœœHTMLéĄ”éąçš„çȘ—揣 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewObject?: PlusWebviewWebviewObject; + /** + * WebviewçȘ—ćŁćŠšç”»ć‚æ•° + * 甹äșŽæŒ‡ćźšćŠšç”»ç›źæ ‡çȘ—ćŁïŒŒè”·ć§‹äœçœźă€ç›źæ ‡äœçœźç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewAnimationOptions?: PlusWebviewWebviewAnimationOptions; + /** + * WebviewçȘ—ćŁćŠšç”»æ ·ćŒ + * 甹äșŽæŒ‡ćźšćŠšç”»çȘ—ćŁçš„è”·ć§‹äœçœźă€ç›źæ ‡äœçœźç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewAnimationStyles?: PlusWebviewWebviewAnimationStyles; + /** + * WebviewçȘ—ćŁć›žćŒčæ ·ćŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewBounceStyle?: PlusWebviewWebviewBounceStyle; + /** + * WebviewçȘ—ćŁć†…ćźčćŠšç”»ć‚æ•° + * æŒ‡ćźšćŠšç”»çš„ç±»ćž‹ă€æŒç»­æ—¶é—Žç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewContentAnimationOptions?: PlusWebviewWebviewContentAnimationOptions; + /** + * ćŽŸç”ŸæŽ§ä»¶ćœšçȘ—ćŁäž­ćœé çš„æ–čćŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewDock?: PlusWebviewWebviewDock; + /** + * WebviewçȘ—ćŁæ»‘ćŠšäș‹ä»¶æ•°æź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewDragEvent?: PlusWebviewWebviewDragEvent; + /** + * çȘ—ćŁæ‰‹ćŠżæ“äœœć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewDragOptions?: PlusWebviewWebviewDragOptions; + /** + * æ‰‹ćŠżæ“äœœć…łè”ćŻčè±Ąć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewDragOtherViewOptions?: PlusWebviewWebviewDragOtherViewOptions; + /** + * æˆȘć±ç»˜ćˆ¶æ“äœœć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewDrawOptions?: PlusWebviewWebviewDrawOptions; + /** + * çȘ—ćŁæ”¶è—ć‚æ•° + * ćœšæ”ćș”ç”šçŽŻćąƒäž­è°ƒç”šæ”¶è—ćŠŸèƒœæ—¶äœżç”šçš„ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewFavoriteOptions?: PlusWebviewWebviewFavoriteOptions; + /** + * 戛ć»șćŠ èœœHTMLæ•°æźć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewLoadDataOptions?: PlusWebviewWebviewLoadDataOptions; + /** + * çȘ—ćŁçš„ćˆ†äș«ć‚æ•° + * ćœšæ”ćș”ç”šçŽŻćąƒäž­è°ƒç”šćˆ†äș«ćŠŸèƒœæ—¶äœżç”šçš„ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewShareOptions?: PlusWebviewWebviewShareOptions; + /** + * çȘ—ćŁćŽŸç”Ÿć­ViewæŽ§ä»¶æ ·ćŒ + * ćŻèźŸçœźćŽŸç”ŸæŽ§ä»¶çš„æ ‡èŻ†ă€ć€§ć°ă€äœçœźä»„ćŠç»˜ćˆ¶çš„ć†…ćźč等。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewSubNViewStyles?: PlusWebviewWebviewSubNViewStyles; + /** + * çȘ—ćŁæ ‡éą˜æ æŽ§ä»¶æ ·ćŒ + * æ ‡éą˜æ æŽ§ä»¶ć›șćźšé«˜ćșŠäžș44px,ćŻé€šèż‡WebviewçȘ—揣ćŻčè±Ąçš„getTitleNViewæ–čæł•èŽ·ć–æ ‡éą˜æ ćŽŸç”ŸæŽ§ä»¶ćŻčè±ĄćŠšæ€ç»˜ćˆ¶ć†…ćźč。 + * ćŻä»„é€šèż‡WebviewObjectćŻčè±Ąçš„getTitleNView()èŽ·ć–æ ‡éą˜æ çš„NViewćŻčè±ĄïŒŒç„¶ćŽè°ƒç”šć…¶setStyleæ–čæł•æ›Žæ–°æ ·ćŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewTitleNViewStyles?: PlusWebviewWebviewTitleNViewStyles; + /** + * çȘ—ćŁæ ‡éą˜æ è‡Ș漚ä艿Œ‰é’źæ ·ćŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewTitleNViewButtonStyles?: PlusWebviewWebviewTitleNViewButtonStyles; + /** + * æ ‡éą˜æ æŽ§ä»¶çš„èż›ćșŠæĄæ ·ćŒ + * 星ç€șćœšæ ‡éą˜æ æŽ§ä»¶ćș•éƒšă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewProgressStyles?: PlusWebviewWebviewProgressStyles; + /** + * çȘ—ćŁæ ‡éą˜æ æŽ§ä»¶çš„ćˆ†ć‰Čçșżæ ·ćŒ + * 星ç€șćœšæ ‡éą˜æ æŽ§ä»¶ćș•éƒšă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewSplitLineStyles?: PlusWebviewWebviewSplitLineStyles; + /** + * WebviewçȘ—揣äș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewEvent?: PlusWebviewWebviewEvent; + /** + * JSONćŻčè±ĄïŒŒćŽŸç”ŸçȘ—ćŁæ‰©ć±•ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewExtraOptions?: PlusWebviewWebviewExtraOptions; + /** + * ćŽŸç”ŸæŽ§ä»¶ćœšçȘ—ćŁäž­æ˜Ÿç€șçš„äœçœź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewPosition?: PlusWebviewWebviewPosition; + /** + * WebviewçȘ—ćŁäž‹æ‹‰ćˆ·æ–°æ ·ćŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewPullToRefreshStyles?: PlusWebviewWebviewPullToRefreshStyles; + /** + * WebviewçȘ—揣renderedäș‹ä»¶ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewRenderedEventOptions?: PlusWebviewWebviewRenderedEventOptions; + /** + * æ›żæąH5æ ‡ć‡†APIé…çœźäżĄæŻ + * ç›źć‰ä»…æ”ŻæŒæ›żæąH5æ ‡ć‡†ćźšäœæŽ„ćŁ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewReplaceWebApiOptions?: PlusWebviewWebviewReplaceWebApiOptions; + /** + * JSONćŻčè±ĄïŒŒWebviewçȘ—ćŁçš„çł»ç»ŸçŠ¶æ€æ ćŒșćŸŸæ ·ćŒ + * ä»…ćœšćș”ç”šèźŸçœźäžșæČ‰æ”žćŒçŠ¶æ€æ æ ·ćŒäž‹æœ‰æ•ˆïŒŒéžæČ‰æ”žćŒçŠ¶æ€æ æ ·ćŒäž‹ćżœç•„æ­€ć±žæ€§ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewStatusbarStyles?: PlusWebviewWebviewStatusbarStyles; + /** + * JSONćŻčè±ĄïŒŒWebviewçȘ—揣ćŻčè±Ąçš„æ ·ćŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewStyles?: PlusWebviewWebviewStyles; + /** + * 䞀组甚äșŽćźšäč‰éĄ”éąæˆ–æŽ§ä»¶ć˜ćœąçš„ć±žæ€§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewTransform?: PlusWebviewWebviewTransform; + /** + * 䞀组甚äșŽćźšäč‰éĄ”éąæˆ–æŽ§ä»¶èœŹæąæ•ˆæžœçš„ć±žæ€§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewTransition?: PlusWebviewWebviewTransition; + /** + * 拊æˆȘWebviewçȘ—ćŁè”„æșèŻ·æ±‚çš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewOverrideResourceOptions?: PlusWebviewWebviewOverrideResourceOptions; + /** + * 拊æˆȘWebviewçȘ—揣URLèŻ·æ±‚çš„ć±žæ€§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewOverrideUrlOptions?: PlusWebviewWebviewOverrideUrlOptions; + /** + * 监搬WebviewçȘ—ćŁè”„æșćŠ èœœçš„ć±žæ€§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewListenResourceOptions?: PlusWebviewWebviewListenResourceOptions; + /** + * èŽ·ć–æ‰€æœ‰WebviewçȘ—揣 + * èŽ·ć–ćș”甚䞭ć·Č戛ć»ș的所有WebviewçȘ—ćŁïŒŒćŒ…æ‹Źæ‰€æœ‰æœȘ星ç€ș的WebviewçȘ—ćŁă€‚ + * èż”ć›žWebviewObjectćŻčè±Ąćœšæ•°ç»„äž­æŒ‰ćˆ›ć»ș的慈搎éĄșćșæŽ’ćˆ—ïŒŒćłæ•°ç»„äž­çŹŹäž€äžȘWebviewObjectćŻčè±Ąç”šæ˜ŻćŠ èœœćș”ç”šçš„ć…„ćŁéĄ”éąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + all(): PlusWebview []; + /** + * 慳闭WebviewçȘ—揣 + * 慳闭ć·Čç»æ‰“ćŒ€çš„WebviewçȘ—ćŁïŒŒéœ€ć…ˆèŽ·ć–çȘ—揣ćŻčè±Ąæˆ–çȘ—揣idćč¶ćŻæŒ‡ćźšć…łé—­çȘ—ćŁçš„ćŠšç”»ćŠćŠšç”»æŒç»­æ—¶é—Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + close(id_wvobj?: string, aniClose?: string, duration?: number, extras?: PlusWebviewWebviewExtraOptions): void; + /** + * 戛ć»ș新的WebviewçȘ—揣 + * 戛ć»șWebviewçȘ—ćŁïŒŒç”šäșŽćŠ èœœæ–°çš„HTMLéĄ”éąïŒŒćŻé€šèż‡stylesèźŸçœźWebviewçȘ—ćŁçš„æ ·ćŒïŒŒćˆ›ć»șćźŒæˆćŽéœ€èŠè°ƒç”šshowæ–čæł•æ‰èƒœć°†WebviewçȘ—ćŁæ˜Ÿç€șć‡șæ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + create(url?: string, id?: string, styles?: PlusWebviewWebviewStyles, extras?: any): PlusWebviewWebviewObject; + /** + * èŽ·ć–ćœ“ć‰çȘ—ćŁçš„WebviewObjectćŻčè±Ą + * èŽ·ć–ćœ“ć‰éĄ”éąæ‰€ć±žçš„WebviewçȘ—揣ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + currentWebview(): PlusWebviewWebviewObject; + /** + * èŽ·ć–ć±ć蕿‰€æœ‰ćŻè§†çš„WebviewçȘ—揣 + * ä»…ćœšć±ćč•ćŒșćŸŸæ˜Ÿç€ș的WebviewçȘ—ćŁïŒŒćŠ‚æžœWebviewçȘ—ćŁæ˜Ÿç€șäș†äœ†èą«ć…¶ćźƒWebviewçȘ—ćŁç›–äœćˆ™èź€äžșäžćŻè§†ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + getDisplayWebview(): PlusWebview []; + /** + * æŸ„æ‰ŸæŒ‡ćźšæ ‡èŻ†çš„WebviewObjectçȘ—揣 + * 朹ć·Č戛ć»ș的çȘ—ćŁćˆ—èĄšäž­æŸ„æ‰ŸæŒ‡ćźšæ ‡èŻ†çš„WebviewçȘ—揣ćč¶èż”曞。 + * è‹„æČĄæœ‰æŸ„æ‰Ÿćˆ°æŒ‡ćźšæ ‡èŻ†çš„çȘ—ćŁćˆ™èż”ć›žnullïŒŒè‹„ć­˜ćœšć€šäžȘç›žćŒæ ‡èŻ†çš„WebviewçȘ—ćŁïŒŒćˆ™èż”ć›žçŹŹäž€äžȘ戛ć»ș的WebviewçȘ—ćŁă€‚ + * ćŠ‚æžœèŠèŽ·ć–ćș”ç”šć…„ćŁéĄ”éąæ‰€ć±žçš„WebviewçȘ—ćŁïŒŒć…¶æ ‡è݆äžșćș”甚的%APPID%ïŒŒćŻé€šèż‡plus.runtime.appidèŽ·ć–ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + getWebviewById(id?: string): PlusWebviewWebviewObject; + /** + * èŽ·ć–ćș”甚銖饔WebviewObjectçȘ—揣ćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + getLaunchWebview(): PlusWebviewWebviewObject; + /** + * èŽ·ć–ćș”甚珏äșŒäžȘ銖饔WebviewObjectçȘ—揣ćŻčè±Ą + * ćœšćŒéŠ–éĄ”æšĄćŒäž‹ïŒˆćœšmanifest.json的plus->secondwebview节ç‚čäž‹é…çœźïŒ‰ïŒŒćș”甚䌚è‡Ș抹戛ć»ș䞀äžȘ銖饔WebviewïŒŒé€šèż‡getLaunchWebview()ćŻèŽ·ć–çŹŹäž€äžȘ銖饔çȘ—揣ćŻčè±ĄïŒŒé€šèż‡getSecondWebview()ćŻèŽ·ć–çŹŹäșŒäžȘ銖饔çȘ—揣ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + getSecondWebview(): PlusWebviewWebviewObject; + /** + * èŽ·ć–ćș”甚星ç€șæ ˆéĄ¶çš„WebviewObjectçȘ—揣ćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + getTopWebview(): PlusWebviewWebviewObject; + /** + * 隐藏WebviewçȘ—揣 + * æ čæźæŒ‡ćźšçš„WebviewObjectćŻčè±Ąæˆ–id隐藏WebviewçȘ—ćŁïŒŒäœżćŸ—çȘ—ćŁäžćŻè§ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + hide(id_wvobj?: string, aniHide?: string, duration?: number, extras?: PlusWebviewWebviewExtraOptions): void; + /** + * 戛ć»șćč¶æ‰“ćŒ€WebviewçȘ—揣 + * 戛ć»șćč¶æ˜Ÿç€șWebviewçȘ—ćŁïŒŒç”šäșŽćŠ èœœæ–°çš„HTMLéĄ”éąïŒŒćŻé€šèż‡stylesèźŸçœźWebviewçȘ—ćŁçš„æ ·ćŒïŒŒćˆ›ć»șćźŒæˆćŽè‡Ș抹氆WebviewçȘ—ćŁæ˜Ÿç€șć‡șæ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + open(url?: string, id?: string, styles?: PlusWebviewWebviewStyles, aniShow?: string, duration?: number, showedCB?: Function): PlusWebviewWebviewObject; + /** + * éą„èœœçœ‘ç»œéĄ”éą + * éą„èœœçœ‘ç»œéĄ”éąäŒšć‘æœćŠĄć™šć‘è”·http/httpsèŻ·æ±‚èŽ·ć–htmléĄ”éąć†…ćźč + * ćŸ…WebviewçȘ—ćŁćŠ èœœæ­€urléĄ”éąæ—¶äŒšćˆ™æ čæźçŒ“ć­˜æœșćˆ¶äŒ˜ć…ˆäœżç”šéą„èœœçš„éĄ”éąć†…ćźč(ćŠ ćż«éĄ”éąæ˜Ÿç€ș速ćșŠ)。 + * æłšæ„ïŒšéą„èœœçœ‘ç»œéĄ”éąä»…ćœšèżèĄŒæœŸç”Ÿæ•ˆïŒŒäžșäș†èŠ‚çœć†…ć­˜ä»…äżç•™æœ€ćŽ5äžȘéą„èœœéĄ”éąæ•°æźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + prefetchURL(url?: string): void; + /** + * éą„èœœçœ‘ç»œéĄ”éąïŒˆć€šäžȘćœ°ć€ïŒ‰ + * éą„èœœçœ‘ç»œéĄ”éąäŒšć‘æœćŠĄć™šć‘è”·http/httpsèŻ·æ±‚èŽ·ć–htmléĄ”éąć†…ćźč + * ćŸ…WebviewçȘ—ćŁćŠ èœœæ­€urléĄ”éąæ—¶äŒšćˆ™æ čæźçŒ“ć­˜æœșćˆ¶äŒ˜ć…ˆäœżç”šéą„èœœçš„éĄ”éąć†…ćźč(ćŠ ćż«éĄ”éąæ˜Ÿç€ș速ćșŠ)。 + * æłšæ„ïŒšéą„èœœçœ‘ç»œéĄ”éąä»…ćœšèżèĄŒæœŸç”Ÿæ•ˆïŒŒäžșäș†èŠ‚çœć†…ć­˜ä»…äżç•™æœ€ćŽ5äžȘéą„èœœéĄ”éąæ•°æźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + prefetchURLs(urls?: any []): void; + /** + * 星ç€șWebviewçȘ—揣 + * 星ç€șć·Č戛ć»ș或隐藏的WebviewçȘ—ćŁïŒŒéœ€ć…ˆèŽ·ć–çȘ—揣ćŻčè±Ąæˆ–çȘ—揣idćč¶ćŻæŒ‡ćꚿ˜Ÿç€șçȘ—ćŁçš„ćŠšç”»ćŠćŠšç”»æŒç»­æ—¶é—Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + show(id_wvobj?: string, aniShow?: string, duration?: number, showedCB?: Function, extras?: PlusWebviewWebviewExtraOptions): PlusWebviewWebviewObject; + /** + * WebviewçȘ—ćŁç»„ćˆćŠšç”» + * ćŒæ­„ç»„ćˆäž€äžȘWebviewçȘ—ćŁćŠšç”»ïŒŒćŠšç”»ćꌿˆćŽçȘ—ćŁçš„äœçœźäŒšć‘ç”Ÿć˜ćŒ–ïŒŒäž€æŹĄéœ€èŠćœšćŠšç”»ć±žæ€§ć‚æ•°äž­èźŸçœźćŠšç”»è”·ć§‹äœçœźă€ç»“æŸäœçœźç­‰ă€‚ + * æłšæ„ïŒšæ­€ćŠšç”»æ“äœœäŒšæ”č揘çȘ—ćŁäœçœźïŒˆćŠ‚leftć€Œç­‰ïŒ‰ïŒŒć†æŹĄè°ƒç”šshowæ–čæł•æ—¶éœ€èŠçĄźäżć…¶äœçœźæ˜ŻćŠćœšćŻè§†ćŒșćŸŸïŒŒćŠ‚æžœäžćœšćŻè§†ćŒșćŸŸćˆ™éœ€èŠè°ƒç”šçȘ—ćŁçš„setStyleæ–čæł•èźŸçœźć…¶äœçœźćˆ°ćŻè§†ćŒșćŸŸć†…ïŒŒćŠ‚setStyle({left:'0px'});。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + startAnimation(options?: PlusWebviewWebviewAnimationOptions, otherOptions?: PlusWebviewWebviewAnimationOptions, callback?: (result: any) => void): void; + /** + * èŽ·ć–Webviewé»˜èź€æ˜ŻćŠćŒ€ćŻçĄŹä»¶ćŠ é€Ÿ + * 由äșŽäžćŒèźŸć€‡ćŻčçĄŹä»¶ćŠ é€Ÿçš„æ”ŻæŒæƒ…ć†”ć­˜ćœšć·źćŒ‚ïŒŒćŒ€ćŻçĄŹä»¶ćŠ é€ŸèƒœćŠ é€ŸHTMLéĄ”éąçš„æžČ染䜆äčŸäŒšæ¶ˆè€—æ›Žć€šçš„çł»ç»Ÿè”„æșïŒŒä»Žè€ŒćŻŒè‡Žćœšéƒšćˆ†èźŸć€‡äžŠćŻèƒœć‡ș现é—Șć±ă€ć‘è™šă€ćˆ†ć—æžČæŸ“ç­‰é—źéą˜ïŒŒ ć› æ­€5+ Runtime䌚æ čæźèźŸć€‡ćźžé™…æ”ŻæŒæƒ…ć†”è‡ȘćŠšé€‰æ‹©æ˜ŻćŠćŒ€ćŻçĄŹä»¶ćŠ é€Ÿă€‚ + * ć…łé—­çĄŹä»¶ćŠ é€Ÿćˆ™ćŻèƒœäŒšćŻŒè‡ŽWebviewéĄ”éąæ— æł•æ”ŻæŒVideoæ ‡ç­Ÿæ’­æ”Ÿè§†éą‘ç­‰é—źéą˜ïŒŒćŠ‚æžœćœšç‰čćźšæƒ…ć†”äž‹éœ€èŠè°ƒæ•Žäżźæ”čé»˜èź€ćŒ€ćŻçĄŹä»¶ćŠ é€Ÿçš„èĄŒäžșïŒŒćˆ™ćŻé€šèż‡plus.webview.defaultHardwareAccelerated()æ–čæł•èŽ·ć–ćœ“ć‰èźŸć€‡é»˜èź€æ˜ŻćŠćŒ€ćŻçĄŹä»¶ćŠ é€ŸçŠ¶æ€ïŒŒä»Žè€Œć†łćźšæ˜ŻćŠéœ€èŠæ˜ŸćŒćŒ€ćŻæˆ–ć…łé—­æŒ‡ćźšWebviewçš„çĄŹä»¶ćŠ é€ŸćŠŸèƒœïŒˆé€šèż‡WebviewStyles的hardwareAcceleratedć±žæ€§èźŸçœźïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + defaultHardwareAccelerated(): boolean; +} + +/** + * 䞀组甚äșŽćźšäč‰éĄ”éąæˆ–æŽ§ä»¶æ˜Ÿç€șćŠšç”»æ•ˆæžœ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewAnimationTypeShow { + /** + * è‡ȘćŠšé€‰æ‹©ćŠšç”»æ•ˆæžœ + * è‡ȘćŠšé€‰æ‹©ćŠšç”»æ•ˆæžœïŒŒäœżç”šäžŠæŹĄæ˜Ÿç€șçȘ—ćŁèźŸçœźçš„ćŠšç”»æ•ˆæžœïŒŒćŠ‚æžœæ˜ŻçŹŹäž€æŹĄæ˜Ÿç€șćˆ™é»˜èź€ćŠšç”»æ•ˆæžœâ€œnone”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + auto?: string; + /** + * æ— ćŠšç”»æ•ˆæžœ + * ç«‹ćłæ˜Ÿç€șéĄ”éąïŒŒæ— ä»»äœ•ćŠšç”»æ•ˆæžœïŒŒéĄ”éąæ˜Ÿç€șé»˜èź€çš„ćŠšç”»æ•ˆæžœă€‚ + * æ­€æ•ˆæžœćżœç•„ćŠšç”»æ—¶é—Žć‚æ•°ïŒŒç«‹ćłæ˜Ÿç€ș。 + * ćŻčćș”慳闭抚画"none"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + none?: string; + /** + * ä»ŽćłäŸ§æšȘć‘æ»‘ćŠšæ•ˆæžœ + * éĄ”éąä»Žć±ćč•ćłäŸ§ć€–ć‘ć†…æšȘć‘æ»‘ćŠšæ˜Ÿç€ș。 + * ćŻčćș”慳闭抚画"slide-out-right"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + 'slide-in-right'?: string; + /** + * ä»Žć·ŠäŸ§æšȘć‘æ»‘ćŠšæ•ˆæžœ + * éĄ”éąä»Žć±ćč•ć·ŠäŸ§ć‘ćłæšȘć‘æ»‘ćŠšæ˜Ÿç€ș。 + * ćŻčćș”慳闭抚画"slide-out-left"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + 'slide-in-left'?: string; + /** + * ä»ŽäžŠäŸ§ç«–ć‘æ»‘ćŠšæ•ˆæžœ + * éĄ”éąä»Žć±ćč•äžŠäŸ§ć‘äž‹ç«–ć‘æ»‘ćŠšæ˜Ÿç€ș。 + * ćŻčćș”慳闭抚画"slide-out-top"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + 'slide-in-top'?: string; + /** + * ä»Žäž‹äŸ§ç«–ć‘æ»‘ćŠšæ•ˆæžœ + * éĄ”éąä»Žć±ćč•äž‹äŸ§ć‘äžŠç«–ć‘æ»‘ćŠšæ˜Ÿç€ș。 + * ćŻčćș”慳闭抚画"slide-out-bottom"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + 'slide-in-bottom'?: string; + /** + * ä»Žé€æ˜Žćˆ°äžé€æ˜Žé€æžæ˜Ÿç€ș效果 + * éĄ”éąä»ŽćźŒć…šé€æ˜Žćˆ°äžé€æ˜Žé€æžæ˜Ÿç€ș。 + * ćŻčćș”慳闭抚画"fade-out"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + 'fade-in'?: string; + /** + * ä»Žć°ćˆ°ć€§é€æžæ”Ÿć€§æ˜Ÿç€ș效果 + * éĄ”éąćœšć±ćč•äž­é—Žä»Žć°ćˆ°ć€§é€æžæ”Ÿć€§æ˜Ÿç€ș。 + * ćŻčćș”慳闭抚画"zoom-in"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + 'zoom-out'?: string; + /** + * ä»Žć°ćˆ°ć€§é€æžæ”Ÿć€§ćč¶äž”ä»Žé€æ˜Žćˆ°äžé€æ˜Žé€æžæ˜Ÿç€ș效果 + * éĄ”éąćœšć±ćč•äž­é—Žä»Žć°ćˆ°ć€§é€æžæ”Ÿć€§ćč¶äž”ä»Žé€æ˜Žćˆ°äžé€æ˜Žé€æžæ˜Ÿç€ș。 + * ćŻčćș”慳闭抚画"zoom-fade-in"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + 'zoom-fade-out'?: string; + /** + * ä»ŽćłäŸ§ćčłç§»ć…„æ ˆćŠšç”»æ•ˆæžœ + * éĄ”éąä»Žć±ćč•ćłäŸ§æ»‘ć…„星ç€șïŒŒćŒæ—¶äžŠäž€äžȘéĄ”éąćžŠé˜Žćœ±æ•ˆæžœä»Žć±ćč•ć·ŠäŸ§æ»‘ć‡șéšè—ă€‚ + * ćŻčćș”慳闭抚画"pop-out"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + 'pop-in'?: string; +} + +/** + * 䞀组甚äșŽćźšäč‰éĄ”éąæˆ–æŽ§ä»¶ć…łé—­çš„ćŠšç”»æ•ˆæžœ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewAnimationTypeClose { + /** + * è‡ȘćŠšé€‰æ‹©ćŠšç”»æ•ˆæžœ + * è‡ȘćŠšé€‰æ‹©æ˜Ÿç€șçȘ—ćŁç›žćŻčäșŽçš„ćŠšç”»æ•ˆæžœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + auto?: string; + /** + * æ— ćŠšç”» + * ç«‹ćłć…łé—­éĄ”éąïŒŒæ— ä»»äœ•ćŠšç”»æ•ˆæžœă€‚ + * æ­€æ•ˆæžœćżœç•„ćŠšç”»æ—¶é—Žć‚æ•°ïŒŒç«‹ćłć…łé—­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + none?: string; + /** + * æšȘć‘ć‘ćłäŸ§æ»‘ć‡șć±ćč•抚画 + * éĄ”éąä»Žć±ćč•äž­æšȘć‘ć‘ćłäŸ§æ»‘ćŠšćˆ°ć±ćč•怖慳闭。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + 'slide-out-right'?: string; + /** + * æšȘć‘ć‘ć·ŠäŸ§æ»‘ć‡șć±ćč•抚画 + * éĄ”éąä»Žć±ćč•äž­æšȘć‘ć‘ć·ŠäŸ§æ»‘ćŠšćˆ°ć±ćč•怖慳闭。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + 'slide-out-left'?: string; + /** + * ç«–ć‘ć‘äžŠäŸ§æ»‘ć‡șć±ćč•抚画 + * éĄ”éąä»Žć±ćč•äž­ç«–ć‘ć‘äžŠäŸ§æ»‘ćŠšćˆ°ć±ćč•怖慳闭。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + 'slide-out-top'?: string; + /** + * ç«–ć‘ć‘äž‹äŸ§æ»‘ć‡șć±ćč•抚画 + * éĄ”éąä»Žć±ćč•äž­ç«–ć‘ć‘äž‹äŸ§æ»‘ćŠšćˆ°ć±ćč•怖慳闭。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + 'slide-out-bottom'?: string; + /** + * ä»Žäžé€æ˜Žćˆ°é€æ˜Žé€æžéšè—ćŠšç”» + * éĄ”éąä»Žäžé€æ˜Žćˆ°é€æ˜Žé€æžéšè—ć…łé—­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + 'fade-out'?: string; + /** + * ä»Žć€§é€æžçŒ©ć°ć…łé—­ćŠšç”» + * éĄ”éąé€æžć‘éĄ”éąäž­ćżƒçŒ©ć°ć…łé—­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + 'zoom-in'?: string; + /** + * ä»Žć€§é€æžçŒ©ć°ćč¶äž”ä»Žäžé€æ˜Žćˆ°é€æ˜Žé€æžéšè—ć…łé—­ćŠšç”» + * éĄ”éąé€æžć‘éĄ”éąäž­ćżƒçŒ©ć°ćč¶äž”ä»Žäžé€æ˜Žćˆ°é€æ˜Žé€æžéšè—ć…łé—­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + 'zoom-fade-in'?: string; + /** + * ä»ŽćłäŸ§ćčłç§»ć‡șæ ˆćŠšç”»æ•ˆæžœ + * éĄ”éąä»Žć±ćč•ćłäŸ§æ»‘ć‡șæ¶ˆć€±ïŒŒćŒæ—¶äžŠäž€äžȘéĄ”éąćžŠé˜Žćœ±æ•ˆæžœä»Žć±ćč•ć·ŠäŸ§æ»‘ć…„星ç€ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + 'pop-out'?: string; +} + +/** + * WebviewçȘ—揣ćŻčè±ĄïŒŒç”šäșŽæ“äœœćŠ èœœHTMLéĄ”éąçš„çȘ—揣 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewObject { + /** + * WebviewçȘ—ćŁçš„æ ‡è݆ + * ćœšæ‰“ćŒ€æˆ–ćˆ›ć»șWebviewçȘ—ćŁæ—¶èźŸçœźïŒŒćŠ‚æžœæČĄæœ‰èźŸçœźçȘ—ćŁæ ‡èŻ†ïŒŒæ­€ć±žæ€§ć€Œäžșundefined。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + id?: string; + /** + * WebviewçȘ—ćŁć…łé—­äș‹ä»¶ + * ćœ“WebviewçȘ—ćŁć…łé—­æ—¶è§Šć‘æ­€äș‹ä»¶ïŒŒç±»ćž‹äžșEventCallback。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + onclose?: (result: any) => void; + /** + * WebviewçȘ—ćŁé”™èŻŻäș‹ä»¶ + * ćœ“WebviewçȘ—ćŁćŠ èœœé”™èŻŻæ—¶è§Šć‘æ­€äș‹ä»¶ïŒŒç±»ćž‹äžșEventCallback。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + onerror?: PlusWebviewWebviewEvent; + /** + * WebviewçȘ—ćŁéĄ”éąćŠ èœœćźŒæˆäș‹ä»¶ + * ćœ“WebviewçȘ—ćŁéĄ”éąćŠ èœœćźŒæˆæ—¶è§Šć‘æ­€äș‹ä»¶ïŒŒç±»ćž‹äžșEventCallback。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + onloaded?: PlusWebviewWebviewEvent; + /** + * WebviewçȘ—ćŁéĄ”éąćŒ€ć§‹ćŠ èœœäș‹ä»¶ + * ćœ“WebviewçȘ—ćŁćŒ€ć§‹ćŠ èœœæ–°éĄ”éąæ—¶è§Šć‘æ­€äș‹ä»¶ïŒŒç±»ćž‹äžșEventCallback。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + onloading?: PlusWebviewWebviewEvent; + /** + * æ·»ćŠ äș‹ä»¶ç›‘搏晚 + * 搑WebviewçȘ—ćŁæ·»ćŠ äș‹ä»¶ç›‘ćŹć™šïŒŒćœ“æŒ‡ćźšçš„äș‹ä»¶ć‘ç”Ÿæ—¶ïŒŒć°†è§Šć‘listenerć‡œæ•°çš„æ‰§èĄŒă€‚ + * ćŻć€šæŹĄè°ƒç”šæ­€æ–čæł•搑Webviewæ·»ćŠ ć€šäžȘç›‘ćŹć™šïŒŒćœ“ç›‘ćŹçš„äș‹ä»¶ć‘ç”Ÿæ—¶ïŒŒć°†æŒ‰ç…§æ·»ćŠ çš„ć…ˆćŽéĄșćșæ‰§èĄŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + addEventListener(event?: PlusWebviewWebviewEvent, listener?: (result: any) => void, capture?: boolean): void; + /** + * 朹WebviewçȘ—ćŁäž­æ·»ćŠ ć­çȘ—揣 + * 氆揩侀äžȘWebviewçȘ—ćŁäœœäžș歐çȘ—ćŁæ·»ćŠ ćˆ°ćœ“ć‰WebviewçȘ—ćŁäž­ïŒŒæ·»ćŠ ćŽć…¶æ‰€æœ‰æƒćœ’çˆ¶WebviewçȘ—ćŁïŒŒćœ“çˆ¶çȘ—ćŁć…łé—­æ—¶ć­çȘ—揣è‡Ș抹慳闭。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + append(webview?: PlusNativeObjView): void; + /** + * æ·»ćŠ WebviewçȘ—ćŁéą„ćŠ èœœjs文件 + * ćŻčäșŽäž€äș›çœ‘络HTMLéĄ”éąïŒŒćœšæ— æł•äżźæ”čHTMLéĄ”éąæ—¶ćŻé€šèż‡æ­€æ–čæł•è‡ȘćŠšćŠ èœœæœŹćœ°jsæ–‡ä»¶ă€‚ + * ćœ“WebviewçȘ—ćŁè·łèœŹćˆ°æ–°éĄ”éąæ—¶äčŸäŒšè‡ȘćŠšćŠ èœœæŒ‡ćźšçš„jsæ‰§èĄŒïŒŒæ·»ćŠ ć€šäžȘjsæ–‡ä»¶ć°†æŒ‰ç…§æ·»ćŠ çš„ć…ˆćŽéĄșćșæ‰§èĄŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + appendJsFile(file?: string): void; + /** + * WebviewçȘ—ćŁć†…ćźč抚画 + * ćŠšç”»ćŽćŻèƒœäŒšćŻŒè‡ŽWebviewçȘ—ćŁæ˜Ÿç€ș憅ćźčæ”čć˜ïŒŒćŻé€šèż‡è°ƒç”šrestoreæ–čæł•æąć€ă€‚ + * ćœ“WebviewçȘ—ćŁć†…ćźčćŠšç”»ćŒ•è”·ć†…ćźčäžćŻè§ïŒˆé€æ˜ŽïŒ‰ïŒŒć°†æ˜Ÿç€șæ­€çȘ—ćŁćŽéąçš„ć†…ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + animate(options?: PlusWebviewWebviewContentAnimationOptions, callback?: Function): void; + /** + * ćŽé€€ćˆ°äžŠæŹĄćŠ èœœçš„éĄ”éą + * WebviewçȘ—ćŁćŽ†ćČèź°ćœ•æ“äœœïŒŒćŽé€€ćˆ°çȘ—ćŁäžŠæŹĄćŠ èœœçš„HTMLéĄ”éąă€‚ + * ćŠ‚æžœçȘ—ćŁćŽ†ćČèź°ćœ•äž­æČĄæœ‰ćŻćŽé€€çš„éĄ”éąćˆ™äžè§Šć‘ä»»äœ•æ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + back(): void; + /** + * ćŒ€ć§‹WebviewçȘ—ćŁçš„äž‹æ‹‰ćˆ·æ–° + * ćŒ€ć§‹è§Šć‘äž‹æ‹‰ćˆ·æ–°æ•ˆæžœïŒŒäžŽç”šæˆ·æ“äœœäž‹æ‹‰ćˆ·æ–°èĄŒäžșäž€è‡ŽïŒˆæœ‰ćŠšç”»æ•ˆæžœïŒ‰ă€‚ + * è§Šć‘setPullTorefreshæ–čæł•èźŸçœźçš„äž‹æ‹‰ćˆ·æ–°äș‹ä»¶ć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + beginPullToRefresh(): void; + /** + * æŸ„èŻąWebviewçȘ—ćŁæ˜ŻćŠćŻćŽé€€ + * WebviewçȘ—ćŁćŽ†ćČèź°ćœ•æŸ„èŻąæ“äœœïŒŒèŽ·ć–Webviewæ˜ŻćŠćŻćŽé€€ćˆ°ćŽ†ćČćŠ èœœçš„éĄ”éąïŒŒç»“æžœé€šèż‡queryCallbackć›žè°ƒæ–čæł•èż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + canBack(queryCallback?: (result: any) => void): void; + /** + * æŸ„èŻąWebviewçȘ—ćŁæ˜ŻćŠćŻć‰èż› + * WebviewçȘ—ćŁćŽ†ćČèź°ćœ•æŸ„èŻąæ“äœœïŒŒèŽ·ć–Webviewæ˜ŻćŠćŻć‰èż›ćˆ°ćŽ†ćČćŠ èœœçš„éĄ”éąïŒŒç»“æžœé€šèż‡queryCallbackć›žè°ƒæ–čæł•èż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + canForward(queryCallback?: (result: any) => void): void; + /** + * æŁ€æ”‹WebviewçȘ—ćŁæ˜ŻćŠæžČæŸ“ćźŒæˆ + * æŁ€æ”‹æ–čćŒäžșćˆ€æ–­çš„WebviewçȘ—ćŁć†…ćźčæ˜ŻćŠäžșç™œć±ïŒŒćŠ‚æžœéžç™œć±ćˆ™èź€äžșæžČæŸ“ćźŒæˆïŒŒćŠćˆ™èź€äžșæžČ染æœȘćźŒæˆă€‚ + * é€šèż‡successCallbackć›žè°ƒć‡œæ•°èż”ć›žç»“æžœïŒŒćŠ‚æžœæŁ€æ”‹èż‡çš‹äž­ć‘ç”Ÿé”™èŻŻćˆ™è§Šć‘errorCallbackć›žè°ƒć‡œæ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + checkRenderedContent(options?: PlusWebviewWebviewRenderedEventOptions, successCallback?: Function, errorCallback?: (result: any) => void): void; + /** + * èŽ·ć–WebviewçȘ—ćŁçš„æ‰€æœ‰ć­WebviewçȘ—揣 + * èŽ·ć–æ·»ćŠ ćˆ°WebviewçȘ—ćŁäž­çš„æ‰€æœ‰ć­WebviewçȘ—ćŁïŒŒćŠ‚æžœæČĄæœ‰ć­WebviewçȘ—ćŁćˆ™èż”ć›žç©șæ•°ç»„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + children(): PlusWebview []; + /** + * æž…ç©ș掟生WebviewçȘ—ćŁćŠ èœœçš„ć†…ćźč + * æž…é™€ćŽŸç”ŸçȘ—ćŁçš„ć†…ćźč甚äșŽé‡çœźćŽŸç”ŸçȘ—ćŁćŠ èœœçš„ć†…ćźčïŒŒæž…é™€ć…¶ćŠ èœœçš„ćŽ†ćČèź°ćœ•ç­‰ć†…ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + clear(): void; + /** + * 慳闭WebviewçȘ—揣 + * 慳闭ćč¶é”€æŻWebviewçȘ—ćŁïŒŒćŻèźŸçœźć…łé—­ćŠšç”»ć’ŒćŠšç”»æŒç»­æ—¶é—Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + close(aniClose?: PlusWebviewAnimationTypeClose, duration?: number, extras?: PlusWebviewWebviewExtraOptions): void; + /** + * èźŸçœźWebviewçȘ—ćŁçš„æ»‘ć±æ“äœœæ‰‹ćŠż + * 氆WebviewçȘ—ćŁçš„ć·Šćłæ»‘ćŠšæ‰‹ćŠżć…łè”ćˆ°ć…¶ćźƒWebviewçȘ—ćŁïŒŒćŻćźžçŽ°æ»‘ćŠšćˆ‡æąæ˜Ÿç€șWebviewçš„ćŠšç”»æ•ˆæžœïŒˆćŠ‚TabéĄ”éąćˆ‡æąæ•ˆæžœïŒ‰ă€‚ + * æłšæ„ïŒšæ»‘ć±æ“äœœäŒšæ”č揘çȘ—ćŁäœçœźïŒˆćŠ‚leftć€Œç­‰ïŒ‰ïŒŒćŠ‚æžœäžćœšćŻè§†ćŒșćŸŸćˆ™éœ€èŠè°ƒç”šçȘ—ćŁçš„setStyleæ–čæł•èźŸçœźć…¶äœçœźćˆ°ćŻè§†ćŒșćŸŸć†…ïŒŒćŠ‚setStyle({left:'0px'});。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + drag(options?: PlusWebviewWebviewDragOptions, otherView?: PlusWebviewWebviewDragOtherViewOptions, callback?: (result: PlusWebviewWebviewDragEvent) => void): void; + /** + * æˆȘć±ç»˜ćˆ¶ + * 氆WebviewçȘ—ćŁçš„ćŻè§†ćŒș㟟æˆȘć±ćč¶ç»˜ćˆ¶ćˆ°Bitmapć›Ÿç‰‡ćŻčè±Ąäž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + draw(bitmap?: PlusNativeObjBitmap, successCallback?: Function, errorCallback?: (result: any) => void, options?: PlusWebviewWebviewDrawOptions): void; + /** + * 结束WebviewçȘ—ćŁçš„äž‹æ‹‰ćˆ·æ–° + * ć…łé—­äž‹æ‹‰ćˆ·æ–°æ•ˆæžœïŒŒæąć€ćˆ°ćŒ€ć§‹äž‹æ‹‰ćˆ·æ–°äč‹ć‰çš„æ•ˆæžœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + endPullToRefresh(): void; + /** + * 朹WebviewçȘ—ćŁäž­æ‰§èĄŒJSè„šæœŹ + * 氆JSè„šæœŹć‘é€ćˆ°WebviewçȘ—ćŁäž­èżèĄŒïŒŒćŻç”šäșŽćźžçްWebviewçȘ—ćŁé—Žçš„æ•°æźé€šèźŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + evalJS(js?: string): void; + /** + * ć‰èż›ćˆ°äžŠæŹĄćŠ èœœçš„éĄ”éą + * WebviewçȘ—ćŁćŽ†ćČèź°ćœ•æ“äœœïŒŒć‰èż›ćˆ°çȘ—ćŁäžŠæŹĄćŠ èœœçš„HTMLéĄ”éąă€‚ + * ćŠ‚æžœçȘ—ćŁćŽ†ćČèź°ćœ•äž­æČĄæœ‰ćŻć‰èż›çš„éĄ”éąćˆ™äžè§Šć‘ä»»äœ•æ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + forward(): void; + /** + * èŽ·ć–WebviewçȘ—ćŁçš„æ”¶è—ć‚æ•° + * èŽ·ć–WebviewçȘ—ćŁçš„æ”¶è—ć‚æ•°ïŒŒćŠ‚æ”¶è—éĄ”éąçš„æ ‡éą˜ă€ć›Ÿæ ‡ă€ćœ°ć€ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + getFavoriteOptions(): PlusWebviewWebviewFavoriteOptions; + /** + * èŽ·ć–WebviewçȘ—ćŁçš„ćˆ†äș«ć‚æ•° + * èŽ·ć–WebviewçȘ—ćŁçš„ćˆ†äș«ć‚æ•°ïŒŒćŠ‚ćˆ†äș«çš„æ ‡éą˜ă€ć›Ÿæ ‡ă€é“ŸæŽ„朰杀等。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + getShareOptions(): PlusWebviewWebviewShareOptions; + /** + * èŽ·ć–WebviewçȘ—ćŁçš„æ ·ćŒ + * èŽ·ć–WebviewçȘ—ćŁçš„æ ·ćŒć±žæ€§ïŒŒćŠ‚çȘ—ćŁäœçœźă€ć€§ć°ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + getStyle(): PlusWebviewWebviewStyles; + /** + * èŽ·ć–WebviewçȘ—ćŁçš„ćŽŸç”Ÿć­View控件ćŻčè±Ą + * 戛ć»șWebviewçȘ—ćŁçš„æ‰€æœ‰ćŽŸç”Ÿć­ViewæŽ§ä»¶ă€‚ + * ćŻä»„ćœšćˆ›ć»șçȘ—ćŁæ—¶èźŸçœźć…¶subNViewsć±žæ€§è‡Ș抹戛ć»șćș”ç”šéŠ–éĄ”ćŻé€šèż‡manfest.json侭的plus->launchwebview->subNNViews节ç‚čé…çœźćˆ›ć»ș + * äčŸćŻä»„é€šèż‡WebviewçȘ—ćŁçš„appendæ–čæł•ć°†ć·Čç»ćˆ›ć»ș的掟生ViewæŽ§ä»¶æ·»ćŠ äžș慶歐。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + getSubNViews(): any []; + /** + * èŽ·ć–WebviewçȘ—ćŁćŠ èœœHTMLéĄ”éąçš„æ ‡éą˜ + * æ ‡éą˜äžșHTMLéĄ”éąhead节ç‚č例title节ç‚čäž­çš„æ–‡æœŹć†…ćźčïŒŒćœ“çȘ—ćŁć†…ćźčć‘ç”ŸéĄ”éąć†…è·łèœŹæ—¶ćŻé€šèż‡çȘ—ćŁè§Šć‘çš„â€œloaded”äș‹ä»¶äž­è°ƒç”šæ­€æ–čæł•æ„èŽ·ć–è·łèœŹćŽéĄ”éąçš„æ ‡éą˜ă€‚ + * ćŠ‚æžœHTMLéĄ”éąæČĄæœ‰äœżç”štitle节ç‚čæ„èźŸçœźæ ‡éą˜ïŒŒćˆ™èż”ć›žç©ș歗笩äžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + getTitle(): string; + /** + * èŽ·ć–WebviewçȘ—ćŁçš„æ ‡éą˜æ æŽ§ä»¶ćŻčè±Ą + * 戛ć»șWebviewçȘ—ćŁæ—¶èźŸçœźć…¶titleNViewć±žæ€§æ—¶ćˆ™è‡Ș抹戛ć»șæ ‡éą˜æ æŽ§ä»¶ïŒŒćș”ç”šéŠ–éĄ”ćŻé€šèż‡manfest.json侭的plus->launchwebview->titleNView节ç‚čé…çœźćˆ›ć»șæ ‡éą˜æ æŽ§ä»¶ă€‚ + * ćŻé€šèż‡æ­€æ–čæł•èŽ·ć–WebviewçȘ—ćŁćˆ›ć»șçš„æ ‡éą˜æ æŽ§ä»¶ïŒŒćŻčè±Ąç±»ćž‹äžșplus.nativeObj.ViewïŒŒćŻé€šèż‡è°ƒç”šć…¶drawBitmap/drawRect/drawTextæ–čæł•ç»˜ćˆ¶æ›Žæ–°ć†…ćźčæ„ćźžçŽ°è‡Ș漚ä艿 ·ćŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + getTitleNView(): PlusNativeObjView; + /** + * èŽ·ć–WebviewçȘ—ćŁćŠ èœœHTMLéĄ”éąçš„ćœ°ć€ + * ćœ“çȘ—ćŁć†…ćźčć‘ç”ŸéĄ”éąć†…è·łèœŹæ—¶ćŻé€šèż‡çȘ—ćŁè§Šć‘çš„â€œloaded”äș‹ä»¶äž­è°ƒç”šæ­€æ–čæł•æ„èŽ·ć–è·łèœŹćŽéĄ”éąçš„ćœ°ć€ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + getURL(): string; + /** + * 隐藏WebviewçȘ—揣 + * 隐藏WebviewçȘ—ćŁćŻäżć­˜ć·ČćŠ èœœHTMLéĄ”éąçš„äžŠäž‹æ–‡æ•°æźïŒŒèƒœé™äœŽćș”ç”šäœżç”šçš„çł»ç»Ÿè”„æșïŒŒé€šèż‡showæ–čæł•ćŻć°†éšè—çš„WebviewçȘ—ćŁæ˜Ÿç€șć‡șæ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + hide(aniHide?: PlusWebviewAnimationTypeClose, duration?: number, extras?: PlusWebviewWebviewExtraOptions): void; + /** + * éšè—æ ‡éą˜æ äžŠæŒ‰é’źçš„çșąç‚č + * ä»…ćœšçȘ—ćŁäœżç”šćŽŸç”Ÿæ ‡éą˜æ ïŒˆtitleNView时生效æœȘ星ç€șćŽŸç”Ÿæ ‡éą˜æ æ—¶æ“äœœæ­€æŽ„ćŁæ— ä»»äœ•æ•ˆæžœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + hideTitleNViewButtonRedDot(index?: number): void; + /** + * æ˜ŻćŠæ‹ŠæˆȘWebviewçȘ—ćŁçš„è§Šć±äș‹ä»¶ + * 拊æˆȘćŽè§Šć±äș‹ä»¶äžć†äŒ é€’ïŒŒćŠćˆ™äŒ é€’ç»™ViewæŽ§ä»¶äž‹çš„ć…¶ćźƒçȘ—ćŁć€„ç†ă€‚ + * WebviewçȘ—ćŁé»˜èꀿ‹ŠæˆȘæ‰€æœ‰è§Šć±äș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + interceptTouchEvent(intercept?: boolean): void; + /** + * æŸ„èŻąWebviewçȘ—ćŁæ˜ŻćŠćŒ€ćŻçĄŹä»¶ćŠ é€Ÿ + * è‹„WebviewçȘ—揣ć·Čç»ćŒ€ćŻçĄŹä»¶ćŠ é€Ÿćˆ™èż”ć›žtrueïŒŒćŠćˆ™èż”ć›žfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + isHardwareAccelerated(): boolean; + /** + * æŸ„èŻąWebviewçȘ—ćŁæ˜ŻćŠćŻè§ + * è‹„WebviewçȘ—揣ć·Č经星ç€șïŒˆè°ƒç”šèż‡showæ–čæł•ïŒŒćłäœżèą«ć…¶ćźƒçȘ—ćŁæŒĄäœäș†äčŸèź€äžșć·Č星ç€șïŒ‰ćˆ™èż”ć›žtrue苄WebviewçȘ—ćŁèą«éšè—ćˆ™èż”ć›žfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + isVisible(): boolean; + /** + * ç›‘ćŹéĄ”éąćŒ€ć§‹ćŠ èœœè”„æș + * WebviewćŠ èœœè”„æșæ—¶ïŒŒćŠ‚æžœæ»Ąè¶łoptionsć‚æ•°äž­ćźšäč‰çš„æĄä»¶ïŒŒćˆ™è§Šć‘callbackć›žè°ƒă€‚ + * æ­€æ–čæł•ä»…è§Šć‘ć›žè°ƒäș‹ä»¶ïŒŒäžäŒšé˜»æ­ąè”„æșçš„ćŠ èœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + listenResourceLoading(options?: PlusWebviewWebviewListenResourceOptions, callback?: (result: any) => void): void; + /** + * ćŠ èœœæ–°HTMLæ•°æź + * è§Šć‘WebviewçȘ—ćŁćŠ èœœHTMLéĄ”éąæ•°æźïŒŒćŠ‚æžœHTMLæ•°æźæ— æ•ˆć°†ćŻŒè‡ŽéĄ”éąćŠ èœœć€±èŽ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + loadData(data?: string, options?: PlusWebviewWebviewLoadDataOptions): void; + /** + * ćŠ èœœæ–°URLéĄ”éą + * è§Šć‘WebviewçȘ—ćŁä»Žæ–°çš„URLćœ°ć€ćŠ èœœéĄ”éąïŒŒćŠ‚æžœurlćœ°ć€æ— æ•ˆć°†ćŻŒè‡ŽéĄ”éąæ˜Ÿç€șć€±èŽ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + loadURL(url?: string, additionalHttpHeaders?: any): void; + /** + * èŽ·ć–WebviewçȘ—揣ćŻčè±Ąçš„ćŽŸç”ŸïŒˆNative.JSïŒ‰ćźžäŸ‹ćŻčè±Ą + * Androidćčłć°èż”曞WebviewçȘ—揣ćŻčè±Ąçš„android.webkit.WebviewćźžäŸ‹ćŻčè±ĄïŒŒ + * iOSćčłć°èż”曞WebviewçȘ—揣ćŻčè±Ąçš„UIWebviewćźžäŸ‹ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + nativeInstanceObject(): PlusAndroidInstanceObject | PlusIosInstanceObject; + /** + * èŽ·ć–ćœšćœ“ć‰WebviewçȘ—ćŁäž­ćˆ›ć»ș的所有çȘ—揣 + * èż”ć›žä»Žćœ“ć‰Webview䞭调甚plus.webview.open或plus.webview.create戛ć»ș的所有WebviewçȘ—ćŁæ•°ç»„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + opened(): PlusWebview []; + /** + * èŽ·ć–ćœ“ć‰WebviewçȘ—ćŁçš„ćˆ›ć»ș者 + * 戛ć»ș者äžș调甚plus.webview.open或plus.webview.createæ–čæł•ćˆ›ć»șćœ“ć‰çȘ—ćŁçš„WebviewçȘ—ćŁă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + opener(): PlusWebviewWebviewObject; + /** + * 拊æˆȘWebviewçȘ—ćŁçš„è”„æșćŠ èœœ + * æ čæźćŒșé…è§„ćˆ™æ‹ŠæˆȘWebviewçȘ—ćŁćŠ èœœè”„æșçš„URLćœ°ć€ïŒŒé‡ćźšć‘ćˆ°ć…¶ćźƒè”„æșćœ°ć€ïŒˆæš‚ä»…æ”ŻæŒæœŹćœ°ćœ°ć€ïŒ‰ă€‚ + * æłšæ„ïŒšć€šæŹĄè°ƒç”šoverrideResourceRequestæ—¶ä»…ä»„æœ€ćŽäž€æŹĄè°ƒç”šèźŸçœźçš„ć‚æ•°ć€Œç”Ÿæ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + overrideResourceRequest(options?: PlusWebview []): void; + /** + * 拊æˆȘWebviewçȘ—ćŁçš„URLèŻ·æ±‚ + * 拊æˆȘURLèŻ·æ±‚ćŽïŒŒWebviewçȘ—ćŁć°†äžäŒšè·łèœŹćˆ°æ–°çš„URLćœ°ć€ïŒŒæ­€æ—¶ć°†é€šèż‡callbackć›žè°ƒæ–čæł•èż”ć›žæ‹ŠæˆȘ的URLćœ°ć€ïŒˆćŻæ–°ćŒ€WebviewçȘ—ćŁćŠ èœœURLéĄ”éąç­‰ïŒ‰ă€‚ + * æ­€æ–čæł•ćȘ胜拊æˆȘçȘ—ćŁçš„çœ‘ç»œè¶…é“ŸæŽ„è·łèœŹïŒˆćŒ…æ‹Źè°ƒç”šloadURLæ–čæł•è§Šć‘çš„è·łèœŹïŒ‰ïŒŒäžćŻæ‹ŠæˆȘéĄ”éąèŻ·æ±‚è”„æșèŻ·æ±‚ïŒˆćŠ‚ćŠ èœœcss/js/png等蔄æșçš„èŻ·æ±‚ïŒ‰ă€‚ + * æłšæ„ïŒšć€šæŹĄè°ƒç”šoverrideUrlLoadingæ—¶ä»…ä»„æœ€ćŽäž€æŹĄè°ƒç”šèźŸçœźçš„ć‚æ•°ć€Œç”Ÿæ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + overrideUrlLoading(options?: PlusWebviewWebviewOverrideUrlOptions, callback?: (result: any) => void): void; + /** + * èŽ·ć–ćœ“ć‰WebviewçȘ—ćŁçš„çˆ¶çȘ—揣 + * WebviewçȘ—ćŁäœœäžș歐çȘ—ćŁæ·»ćŠ ïŒˆWebview.appendïŒ‰ćˆ°ć…¶ćźƒWebviewçȘ—ćŁäž­æ—¶æœ‰æ•ˆïŒŒèż™æ—¶ć…¶ćźƒWebviewçȘ—揣äžș父çȘ—ćŁă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + parent(): PlusWebviewWebviewObject; + /** + * é‡æ–°ćŠ èœœWebviewçȘ—ćŁæ˜Ÿç€ș的HTMLéĄ”éą + * è§Šć‘WebviewçȘ—ćŁé‡æ–°ćŠ èœœćœ“ć‰æ˜Ÿç€șçš„éĄ”éąć†…ćźč。 + * ćŠ‚æžœćœ“ć‰HTMLéĄ”éąæœȘćŠ èœœćźŒćˆ™ćœæ­ąćč¶é‡æ–°ćŠ èœœïŒŒćŠ‚æžœćœ“ć‰WebviewçȘ—揣æČĄæœ‰ćŠ èœœä»»äœ•éĄ”éąćˆ™æ— ć“ćș”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + reload(force?: boolean): void; + /** + * é‡çœźWebviewçȘ—ćŁçš„ć›žćŒčäœçœź + * ćŒ€ćŻçȘ—ćŁć›žćŒčæ•ˆæžœćŽïŒŒćœ“çȘ—ćŁäž­ć±•çŽ°çš„ć†…ćźčæ»šćŠšćˆ°ć€ŽïŒˆéĄ¶éƒšæˆ–ćș•éƒšïŒ‰æ—¶ïŒŒć†æ‹–æ‹œæ—¶çȘ—ćŁæ•Žäœ“ć†…ćźčć°†è·Ÿéšç§»ćŠšïŒŒæŸćŒ€ćŽè‡Ș抹曞ćŒčćˆ°ćœé äœçœźă€‚ + * èż™æ—¶éœ€èŠè°ƒç”šæ­€æ–čæł•æ„é‡çœźçȘ—ćŁçš„ć›žćŒčäœçœźïŒŒçȘ—ćŁć°†é‡‡ç”šćŠšç”»æ–čćŒć›žćŒčćˆ°ć…¶ćˆć§‹æ˜Ÿç€șçš„äœçœźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + resetBounce(): void; + /** + * æąć€Webview控件星ç€ș憅ćźč + * æąć€è°ƒç”šanimateæ–čæł•æ”č揘WebviewæŽ§ä»¶çš„ć†…ćźčïŒŒæ›Žæ–°è‡łćŠšç”»ć‰æ˜Ÿç€ș的憅ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + restore(): void; + /** + * 移陀歐WebviewçȘ—揣 + * ä»Žćœ“ć‰WebviewçȘ—ćŁç§»é™€æŒ‡ćźšçš„ć­WebviewçȘ—ćŁïŒŒè‹„æŒ‡ćźšçš„webviewćŻčè±Ąäžæ˜Żćœ“ć‰çȘ—ćŁçš„ć­çȘ—ćŁćˆ™æ— ä»»äœ•äœœç”šă€‚ + * 移陀搎歐WebviewçȘ—ćŁäžäŒšć…łé—­ïŒŒéœ€èŠè°ƒç”šć…¶closeæ–čæł•æ‰èƒœçœŸæ­Łć…łé—­ćč¶é”€æŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + remove(webview?: PlusNativeObjView): void; + /** + * 移陀WebviewçȘ—揣äș‹ä»¶ç›‘搏晚 + * 从WebviewçȘ—ćŁç§»é™€é€šèż‡addEventListeneræ–čæł•æ·»ćŠ çš„äș‹ä»¶ç›‘ćŹć™šïŒŒè‹„æČĄæœ‰æŸ„æ‰Ÿćˆ°ćŻčćș”çš„äș‹ä»¶ç›‘ćŹć™šïŒŒćˆ™æ— ä»»äœ•äœœç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + removeEventListener(event?: PlusWebviewWebviewEvent, listener?: (result: any) => void): void; + /** + * 从父çȘ—ćŁäž­ç§»é™€ + * ä»Žæ‰€ć±žçš„çˆ¶WebviewçȘ—ćŁç§»é™€ïŒŒćŠ‚æžœæČĄæœ‰çˆ¶çȘ—ćŁïŒŒćˆ™æ— ä»»äœ•äœœç”šă€‚ + * 从父çȘ—ćŁäž­ç§»é™€ćŽć­WebviewçȘ—ćŁäžäŒšć…łé—­ïŒŒéœ€èŠè°ƒç”šć…¶closeæ–čæł•æ‰èƒœçœŸæ­Łć…łé—­ćč¶é”€æŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + removeFromParent(): void; + /** + * ç§»é™€æ ‡éą˜æ äžŠæŒ‰é’źçš„è§’æ ‡ + * ä»…ćœšçȘ—ćŁäœżç”šćŽŸç”Ÿæ ‡éą˜æ ïŒˆtitleNView时生效æœȘ星ç€șćŽŸç”Ÿæ ‡éą˜æ æ—¶æ“äœœæ­€æŽ„ćŁæ— ä»»äœ•æ•ˆæžœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + removeTitleNViewButtonBadge(index?: number): void; + /** + * èźŸçœźWebviewçȘ—ćŁçš„ć›žćŒč效果 + * ćŒ€ćŻçȘ—ćŁć›žćŒčæ•ˆæžœćŽïŒŒćœ“çȘ—ćŁäž­ć±•çŽ°çš„ć†…ćźčæ»šćŠšćˆ°ć€ŽïŒˆéĄ¶éƒšæˆ–ćș•éƒšïŒ‰æ—¶ïŒŒć†æ‹–æ‹œæ—¶çȘ—ćŁæ•Žäœ“ć†…ćźčć°†è·Ÿéšç§»ćŠšïŒŒæŸćŒ€ćŽè‡Ș抹曞ćŒčćˆ°ćœé äœçœźïŒˆćŻé€šèż‡styleèźŸçœźïŒ‰ă€‚ + * 拖拜çȘ—ćŁć†…ćźčæ—¶éĄ”éąæ˜Ÿç€șWebviewçȘ—ćŁçš„èƒŒæ™Żè‰ČïŒŒé»˜èź€äžș透明歀时星ç€șWebview例靱的憅ćźčïŒŒćˆ©ç”šèż™äžȘç‰čç‚čćŻä»„ćźžçŽ°è‡Șćźšäž‹æ‹‰ćˆ·æ–°ç‰čæ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + setBounce(style?: PlusWebviewWebviewBounceStyle): void; + /** + * èźŸçœźWebviewçȘ—ćŁæ˜ŻćŠé˜»ćĄžćŠ èœœéĄ”éąäž­äœżç”šçš„çœ‘ç»œć›Ÿç‰‡ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + setBlockNetworkImage(block?: boolean): void; + /** + * èźŸçœźHTML憅ćźčæ˜ŻćŠćŻè§ + * èźŸçœźHTML憅ćźčäžćŻè§ćŽïŒŒć°†æ˜Ÿç€șWebviewçȘ—ćŁçš„èƒŒæ™Żè‰Č。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + setContentVisible(visible?: boolean): void; + /** + * èźŸçœźéą„ćŠ èœœçš„CSS文件 + * éą„ćŠ èœœCSSæ–‡ä»¶äžéœ€èŠćœšHTMLéĄ”éąäž­æ˜ŸćŒćŒ•ç”šïŒŒćœšWebviewçȘ—ćŁćŠ èœœHTMLéĄ”éąæ—¶è‡ȘćŠšćŠ èœœïŒŒćœšéĄ”éąè·łèœŹæ—¶äčŸäŒšè‡ȘćŠšćŠ èœœă€‚ + * èźŸçœźæ–°çš„CSSæ–‡ä»¶ćŽć°†æž…ç©șäč‹ć‰èźŸçœźçš„ć€ŒïŒˆćŒ…æ‹Źè°ƒç”šsetCssTextèźŸçœźçš„ć€ŒïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + setCssFile(file?: string): void; + /** + * èźŸçœźéą„ćŠ èœœçš„CSS憅ćźč + * éą„ćŠ èœœCSS憅ćźčäžéœ€èŠćœšHTMLéĄ”éąäž­æ˜ŸćŒćŒ•ç”šïŒŒćœšWebviewçȘ—ćŁćŠ èœœHTMLéĄ”éąæ—¶è‡ȘćŠšćŠ èœœïŒŒćœšéĄ”éąè·łèœŹæ—¶äčŸäŒšè‡ȘćŠšćŠ èœœă€‚ + * èźŸçœźæ–°çš„CSS憅ćźčćŽć°†æž…ç©șäč‹ć‰èźŸçœźçš„ć€ŒïŒˆćŒ…æ‹Źè°ƒç”šsetCssFileèźŸçœźçš„ć€ŒïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + setCssText(text?: string): void; + /** + * èźŸçœźWebviewçȘ—ćŁçš„æ”¶è—ć‚æ•° + * ä»…ćœšæ”ćș”ç”šçŽŻćąƒïŒˆæ”ćș”甚/5+æ”è§ˆć™šïŒ‰äž­æœ‰æ•ˆïŒšç”šæˆ·ç‚čć‡»æ”ćș”ç”šçŽŻćąƒçš„æ”¶è—æŒ‰é’źæ—¶äœżç”šçš„ć‚æ•°ïŒŒćŠ‚èźŸçœźæ”¶è—éĄ”éąæ ‡éą˜ïŒŒć›Ÿæ ‡ă€éĄ”éąćœ°ć€ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + setFavoriteOptions(options?: PlusWebviewWebviewFavoriteOptions): void; + /** + * èźŸçœźWebviewçȘ—揣ćș•éƒšäżźć€ćŒș㟟高ćșŠ + * ćŠ‚æžœWebviewćŠ èœœéĄ”éąäž­ć­˜ćœšćș•éƒšćœé ćŒșćŸŸïŒˆćŠ‚â€œè˜‘è‡èĄ—â€WAPéĄ”éąçš„ćș•郚Tabæ ïŒ‰ïŒŒćœšéĄ”éąæ»šćŠšæ—¶ćŠšæ€æ”č揘Webview高ćșŠćŻèƒœäŒšć‡ș现ćș•éƒšćœé ćŒșćŸŸæŠ–ćŠšçš„çŽ°è±ĄïŒˆćŠ‚360æ”è§ˆć™šäž­ć‘äžŠæ»‘éĄ¶éƒšæ ‡éą˜æ è‡ȘćŠšæ¶ˆć€±ćŒ•è”·Webviewć˜é«˜ïŒ‰ă€‚ + * æ­€æ—¶ćŻä»„è°ƒç”šæ­€æ–čæł•æ„æŒ‡ćźšćș•éƒšćœé ćŒșćŸŸïŒˆé€šćžžæ˜Żćș•郚Tabæ ïŒ‰èż›èĄŒäŒ˜ćŒ–äżźć€æŠ–ćŠšæ•ˆæžœïŒŒé«˜ćșŠć€Œäžșćș•éƒšćœé ćŒșćŸŸçš„é«˜ćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + setFixBottom(height?: number): void; + /** + * èźŸçœźéą„ćŠ èœœçš„JS文件 + * éą„ćŠ èœœJSæ–‡ä»¶äžéœ€èŠćœšHTMLéĄ”éąäž­æ˜ŸćŒćŒ•ç”šïŒŒćœšWebviewçȘ—ćŁćŠ èœœHTMLéĄ”éąæ—¶è‡ȘćŠšćŠ èœœïŒŒćœšéĄ”éąè·łèœŹæ—¶äčŸäŒšè‡ȘćŠšćŠ èœœă€‚ + * èźŸçœźæ–°çš„JSæ–‡ä»¶ćŽć°†æž…ç©șäč‹ć‰èźŸçœźçš„ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + setJsFile(file?: string): void; + /** + * èźŸçœźWebviewçȘ—ćŁçš„äž‹æ‹‰ćˆ·æ–°æ•ˆæžœ + * ćŒ€ćŻWebviewçȘ—ćŁçš„äž‹æ‹‰ćˆ·æ–°ćŠŸèƒœïŒŒæ˜Ÿç€șçȘ—ćŁć†…çœźçš„äž‹æ‹‰ćˆ·æ–°æŽ§ä»¶æ ·ćŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + setPullToRefresh(style?: PlusWebviewWebviewPullToRefreshStyles, refreshCB?: Function): void; + /** + * èźŸçœźWebviewçȘ—揣renderedäș‹ä»¶ć‚æ•° + * ćŻèźŸçœźéĄ”éąæžČæŸ“ćźŒæˆçš„ćˆ€æ–­æ ‡ć‡†ïŒŒćŠ‚ćˆ€æ–­éĄ”éąéĄ¶éƒšćŒș柟、侭问ćŒșćŸŸă€æˆ–ćș•郚ćŒș柟。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + setRenderedEventOptions(options?: PlusWebviewWebviewRenderedEventOptions): void; + /** + * èźŸçœźWebviewçȘ—ćŁçš„æ ·ćŒ + * 曎新WebviewçȘ—ćŁçš„æ ·ćŒïŒŒćŠ‚çȘ—ćŁäœçœźă€ć€§ć°ă€èƒŒæ™Żè‰Č等。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + setStyle(styles?: PlusWebviewWebviewStyles): void; + /** + * èźŸçœźWebviewçȘ—ćŁçš„ćˆ†äș«ć‚æ•° + * ä»…ćœšæ”ćș”ç”šçŽŻćąƒïŒˆæ”ćș”甚/5+æ”è§ˆć™šïŒ‰äž­æœ‰æ•ˆïŒšç”šæˆ·ç‚čć‡»æ”ćș”ç”šçŽŻćąƒçš„ćˆ†äș«æŒ‰é’źæ—¶äœżç”šçš„ć‚æ•°ïŒŒćŠ‚èźŸçœźćˆ†äș«çš„æ ‡éą˜ă€é“ŸæŽ„朰杀等。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + setShareOptions(options?: PlusWebviewWebviewShareOptions): void; + /** + * èźŸçœźæ ‡éą˜æ äžŠæŒ‰é’źçš„è§’æ ‡ + * ä»…ćœšçȘ—ćŁäœżç”šćŽŸç”Ÿæ ‡éą˜æ ïŒˆtitleNView时生效æœȘ星ç€șćŽŸç”Ÿæ ‡éą˜æ æ—¶æ“äœœæ­€æŽ„ćŁæ— ä»»äœ•æ•ˆæžœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + setTitleNViewButtonBadge(index?: number, text?: string): void; + /** + * èźŸçœźWebviewçȘ—ćŁæ˜ŻćŠćŻè§ + * äżźæ”čçȘ—ćŁæ˜ŻćŠćŻè§ćč¶äžćœ±ć“çȘ—ćŁçš„æ˜Ÿç€ș栈éĄșćșïŒŒçȘ—ćŁæ˜Ÿç€ș䞎隐藏äčŸäžäŒšæœ‰ćŠšç”»æ•ˆæžœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + setVisible(visible?: boolean): void; + /** + * 星ç€șWebviewçȘ—揣 + * ćœ“è°ƒç”šplus.webview.createæ–čæł•ćˆ›ć»șWebviewçȘ—ćŁćŽïŒŒéœ€èŠè°ƒç”šć…¶showæ–čæł•才胜星ç€șćč¶ćŻèźŸçœźçȘ—ćŁæ˜Ÿç€șćŠšç”»ćŠćŠšç”»æ—¶é—Žă€‚ + * WebviewçȘ—ćŁèą«éšè—ćŽäčŸćŻè°ƒç”šæ­€æ–čæł•杄重新星ç€ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + show(aniShow?: PlusWebviewAnimationTypeShow, duration?: number, showedCB?: Function, extras?: PlusWebviewWebviewExtraOptions): void; + /** + * ćœšæŒ‡ćźšWebviewçȘ—ćŁćŽæ˜Ÿç€ș + * ćœ“è°ƒç”šplus.webview.createæ–čæł•ćˆ›ć»șWebviewçȘ—ćŁćŽïŒŒćŻè°ƒç”šć…¶showBehindæ–čæł•星ç€șćœšæŒ‡ćźšWebviewçȘ—揣äč‹ćŽă€‚ + * èż™ç§æ˜Ÿç€șæ–čćŒäžäŒšć‡șçŽ°ćŠšç”»æ•ˆæžœïŒŒćœ“æŒ‡ćźšçš„WebviewçȘ—ćŁć…łé—­ćŽïŒŒćˆ™è‡Șèș«çȘ—揣è‡ȘćŠšæ˜Ÿç€șć‡șæ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + showBehind(webview?: PlusWebviewWebviewObject): void; + /** + * èźŸçœźæ ‡éą˜æ äžŠæŒ‰é’źçš„çșąç‚č + * ä»…ćœšçȘ—ćŁäœżç”šćŽŸç”Ÿæ ‡éą˜æ ïŒˆtitleNView时生效æœȘ星ç€șćŽŸç”Ÿæ ‡éą˜æ æ—¶æ“äœœæ­€æŽ„ćŁæ— ä»»äœ•æ•ˆæžœă€‚ + * æłšæ„ïŒšèźŸçœźæ˜Ÿç€șæŒ‰é’źçš„è§’æ ‡ćŽçșąç‚č䞍星ç€ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + showTitleNViewButtonRedDot(index?: number): void; + /** + * ćœæ­ąćŠ èœœHTMLéĄ”éąć†…ćźč + * è§Šć‘WebviewçȘ—ćŁćœæ­ąćŠ èœœéĄ”靱憅ćźčïŒŒćŠ‚æžœć·Čç»ćŠ èœœéƒšćˆ†ć†…ćźčćˆ™æ˜Ÿç€ș郹戆憅ćźčïŒŒćŠ‚æžœćŠ èœœćźŒæˆćˆ™æ˜Ÿç€ș慹郹憅ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + stop(): void; + /** + * 曎新WebviewçȘ—ćŁçš„ćŽŸç”Ÿć­View控件ćŻčè±Ą + * é€šèż‡WebviewSubNViewStyles侭的idć±žæ€§ć€ŒćŒč配歐ViewæŽ§ä»¶æ›Žæ–°ç»˜ćˆ¶ć†…ćźčïŒŒćŠ‚æžœæČĄæœ‰æŸ„æ‰Ÿćˆ°ćŻčćș”id的歐ViewæŽ§ä»¶ćˆ™ćżœç•„ă€‚ + * æ­€æ“äœœä»…æ›Žæ–°ć­ViewæŽ§ä»¶äžŠç»˜ćˆ¶çš„ć†…ćźčïŒŒäžäŒšæ·»ćŠ æˆ–ćˆ é™€ćŽŸç”Ÿć­View控件ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + updateSubNViews(styles?: PlusWebview []): void; +} + +/** + * WebviewçȘ—ćŁćŠšç”»ć‚æ•° + * 甹äșŽæŒ‡ćźšćŠšç”»ç›źæ ‡çȘ—ćŁïŒŒè”·ć§‹äœçœźă€ç›źæ ‡äœçœźç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewAnimationOptions { + /** + * æ‰§èĄŒćŠšç”»çš„çȘ—揣ćŻčè±Ą + * ćŻć–ć€ŒWebviewçȘ—揣ćŻčè±Ąă€WebviewçȘ—ćŁçš„idStringç±»ćž‹ïŒ‰ă€ćŽŸç”ŸViewçȘ—揣ćŻčè±ĄïŒˆplus.nativeObj.ViewïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + view?: PlusWebviewWebviewObject; + /** + * ćŠšç”»æ ·ćŒ + * 甹äșŽæŒ‡ćźšćŠšç”»çȘ—ćŁçš„è”·ć§‹äœçœźïŒŒç›źæ ‡äœçœźç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + styles?: PlusWebviewWebviewAnimationStyles; + /** + * çȘ—ćŁćŠšç”»ćꌿˆćŽçš„èĄŒäžș + * ćŻć–ć€ŒïŒš + * "none" - ćŠšç”»ćźŒæˆćŽäžćšä»»äœ•æ“äœœïŒ› + * "hide" - ćŠšç”»ćźŒæˆćŽéšè—çȘ—ćŁïŒ› + * "close" - ćŠšç”»ćźŒæˆćŽć…łé—­çȘ—ćŁă€‚ + * é»˜èź€ć€Œäžș"none"。 + * - none: ćŠšç”»ćźŒæˆćŽäžćšä»»äœ•æ“äœœ + * - hide: ćŠšç”»ćźŒæˆćŽéšè—çȘ—揣 + * - close: ćŠšç”»ćźŒæˆćŽć…łé—­çȘ—揣 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + action?: 'none' | 'hide' | 'close'; +} + +/** + * WebviewçȘ—ćŁćŠšç”»æ ·ćŒ + * 甹äșŽæŒ‡ćźšćŠšç”»çȘ—ćŁçš„è”·ć§‹äœçœźă€ç›źæ ‡äœçœźç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewAnimationStyles { + /** + * 画çȘ—ćŁçš„è”·ć§‹ć·ŠäŸ§äœçœź + * æ”ŻæŒç™Ÿćˆ†æŻ”ă€ćƒçŽ ć€ŒïŒŒé»˜èź€ć€Œäžșćœ“ć‰çȘ—ćŁçš„äœçœźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + fromLeft?: string; + /** + * 画çȘ—ćŁçš„ç›źæ ‡ć·ŠäŸ§äœçœź + * æŒç™Ÿćˆ†æŻ”ă€ćƒçŽ ć€Œă€‚ + * æłšæ„ïŒšćŠ‚æžœèźŸçœźçš„äœçœźäžŽè”·ć§‹äœçœźäž€ç›ŽïŒŒćˆ™æ— ćŠšç”»æ•ˆæžœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + toLeft?: string; +} + +/** + * WebviewçȘ—ćŁć›žćŒčæ ·ćŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewBounceStyle { + /** + * WebviewçȘ—ćŁæ”ŻæŒć›žćŒč效果的æ–č搑 + * ćŻé€šèż‡æ­€ć‚æ•°èźŸçœźćŒ€ćŻWebviewć“ȘäžȘæ–čć‘æ”ŻæŒć›žćŒčæ•ˆæžœă€‚ + * æ”ŻæŒä»„äž‹ć±žæ€§ïŒš + * topïŒšèĄšç€șçȘ—ćŁéĄ¶éƒšæ”ŻæŒć›žćŒč效果 + * leftïŒšèĄšç€șçȘ—ćŁć·ŠäŸ§æ”ŻæŒć›žćŒč效果 + * rightïŒšèĄšç€șçȘ—ćŁćłäŸ§æ”ŻæŒć›žćŒč效果 + * bottomïŒšèĄšç€șçȘ—揣ćș•éƒšæ”ŻæŒć›žćŒčæ•ˆæžœă€‚ + * **ç›źć‰ä»…æ”ŻæŒtopć±žæ€§** + * ć±žæ€§ć€ŒïŒšç”šäșŽæŒ‡ćźšćŻæ‹–æ‹œçš„èŒƒć›ŽïŒŒćŻć–ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"ïŒ›ćƒçŽ ć€ŒïŒŒćŠ‚"100px"è‡ȘćŠšèźĄçź—ć€ŒïŒŒćŠ‚"auto"ïŒ›æ— ć›žćŒčæ•ˆæžœć€ŒïŒŒćŠ‚"none" + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + position?: any; + /** + * WebviewçȘ—ćŁć›žćŒčæ—¶ćœé çš„äœçœź + * ćŒ€ćŻçȘ—ćŁć›žćŒčæ•ˆæžœćŽïŒŒćœ“çȘ—ćŁäž­ć±•çŽ°çš„ć†…ćźčæ»šćŠšćˆ°ć€ŽïŒˆéĄ¶éƒšæˆ–ćș•éƒšïŒ‰æ—¶ïŒŒć†æ‹–æ‹œæ—¶çȘ—ćŁæ•Žäœ“ć†…ćźčć°†è·Ÿéšç§»ćŠšïŒŒæ‹–æ‹œèż‡çš‹äž­ć°†è§Šć‘"dragBounce"äș‹ä»¶ïŒŒæŸćŒ€ćŽè‡Ș抹曞ćŒčćˆ°ćœé äœçœźă€‚ + * æ”ŻæŒä»„äž‹ć±žæ€§ïŒš + * topïŒšèĄšç€șçȘ—ćŁéĄ¶éƒšć›žćŒčæ—¶ćœé çš„äœçœźă€‚ + * ć±žæ€§ć€ŒïŒšç”šäșŽæŒ‡ćźšçȘ—ćŁć›žćŒčçš„äœçœźïŒŒćŻć–ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"5%"ïŒ›ćƒçŽ ć€ŒïŒŒćŠ‚"100px"è‡ȘćŠšèźĄçź—ć€ŒïŒŒćŠ‚"auto"ïŒŒé»˜èź€äžșćŻæ‹–æ‹œçš„èŒƒć›Žć€Œçš„äž€ćŠïŒ› + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + changeoffset?: any; + /** + * WebviewçȘ—ćŁäŸ§æ»‘æ—¶ćœé çš„äœçœź + * ćŒ€ćŻçȘ—ćŁć›žćŒčæ•ˆæžœćŽïŒŒćœ“çȘ—ćŁäž­ć±•çŽ°çš„ć†…ćźčæ»šćŠšćˆ°ć€ŽïŒˆć·ŠäŸ§æˆ–ćłäŸ§ïŒ‰æ—¶ïŒŒćœšæ‹–æ‹œæ—¶çȘ—ćŁæ•Žäœ“ć†…ćźčć°†è·Ÿéšç§»ćŠšïŒŒæŸćŒ€ćŽè‡ȘćŠšćœé çš„äŸ§æ»‘äœçœźïŒŒćč¶è§Šć‘"slideBounce"äș‹ä»¶ă€‚ + * æ”ŻæŒä»„äž‹ć±žæ€§ïŒš + * leftïŒšèĄšç€șçȘ—ćŁć·ŠäŸ§äŸ§æ»‘çš„äœçœźïŒ› + * rightïŒšèĄšç€șçȘ—ćŁćłäŸ§äŸ§æ»‘çš„äœçœźă€‚ + * ć±žæ€§ć€ŒïŒšç”šäșŽæŒ‡ćꚿ»‘ćŠšćŽćœé çš„è·çŠ»ïŒŒćŻć–ç™Ÿćˆ†æŻ”ïŒˆleft/right盾ćŻčäșŽçȘ—ćŁçš„ćźœćșŠïŒŒtop/bottom盾ćŻčäșŽçȘ—ćŁçš„é«˜ćșŠïŒ‰ïŒŒćŠ‚"30%"ïŒ›ćƒçŽ ć€ŒïŒŒćŠ‚"100px"è‡ȘćŠšèźĄçź—ć€ŒïŒŒäžșćŻæ‹–æ‹œèŒƒć›ŽïŒŒćŠ‚"auto"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + slideoffset?: any; + /** + * WebviewçȘ—ćŁæ‹–æ‹œćç§»çš„äœçœź + * ćŒ€ćŻçȘ—ćŁć›žćŒčæ•ˆæžœćŽïŒŒćŻä»„é€šèż‡æ­€ć±žæ€§ć€Œæ„äž»ćŠšèźŸçœźæ‹–æ‹œçš„ćç§»äœçœźïŒŒäžŽæ‰‹ćŠšæ“äœœæ‹–æ‹œè‡łæ­€ćç§»äœçœźæŸćŒ€ćŽçš„é€»èŸ‘äž€è‡Žă€‚ + * æ”ŻæŒä»„äž‹ć±žæ€§ïŒš + * topïŒšèĄšç€șçȘ—ćŁéĄ¶éƒšćç§»çš„äœçœźïŒ› + * leftïŒšèĄšç€șçȘ—ćŁć·ŠäŸ§ćç§»çš„äœçœźïŒ› + * rightïŒšèĄšç€șçȘ—ćŁćłäŸ§ćç§»çš„äœçœźïŒ› + * bottomïŒšèĄšç€șçȘ—揣ćș•éƒšćç§»çš„äœçœźă€‚ + * ć±žæ€§ć€ŒïŒšç”šäșŽæŒ‡ćźšćç§»çš„äœçœźïŒŒćŻć–ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"5%"ïŒ›ćƒçŽ ć€ŒïŒŒćŠ‚"100px"ïŒ›æœ‰æ•ˆć€ŒèŒƒć›Žäžș0戰positionć±žæ€§ćźšäč‰çš„äœçœźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + offset?: any; + /** + * WebviewçȘ—ćŁæ˜ŻćŠé˜»æ­ątouchäș‹ä»¶äŒ é€’ç»™DOM慃箠 + * èźŸçœźäžștrueèĄšç€șé˜»æ­ątouchäș‹ä»¶ïŒŒèźŸçœźäžșfalseèĄšç€șäžé˜»æ­ątouchäș‹ä»¶ă€‚ćœ“ćŒ€ćŻäŸ§æ»‘ćŠŸèƒœïŒˆć·ŠäŸ§æ»‘ć’ŒćłäŸ§æ»‘ïŒ‰æ—¶é»˜èź€ć€ŒäžștrueïŒŒćŠćˆ™äžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + preventTouchEvent?: boolean; +} + +/** + * WebviewçȘ—ćŁć†…ćźčćŠšç”»ć‚æ•° + * æŒ‡ćźšćŠšç”»çš„ç±»ćž‹ă€æŒç»­æ—¶é—Žç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewContentAnimationOptions { + /** + * 抚画类枋 + * ćŻć–ć€ŒïŒš"shrink" - ä»ŽäžŠćˆ°äž‹ćˆ†ć—æ”¶çŒ©æž…é™€çȘ—ćŁćŠšç”»ă€‚ + * - shrink: ä»ŽäžŠćˆ°äž‹ćˆ†ć—æž…é™€ćŠšç”» + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + type?: 'shrink'; + /** + * ćŠšç”»æŒç»­æ—¶é—Ž + * ć•äœäžșæŻ«ç§’ïŒŒé»˜èź€ć€Œäžș200ms。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + duration?: number; + /** + * ćŠšç”»ćž§æ•° + * 濅饻äžș性äșŽ0çš„æ•Žæ•°ïŒŒé»˜èź€ć€Œäžș12。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + frames?: number; + /** + * ćŠšç”»äœœç”šćŒș㟟 + * æ”ŻæŒä»„äž‹ć±žæ€§ïŒš + * top - ćŒșćŸŸè·çŠ»æŽ§ä»¶éĄ¶éƒšçš„ćç§»é‡ïŒŒć±žæ€§ć€ŒćŻć–ćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ïŒŒç™Ÿćˆ†æŻ”ïŒˆćŠ‚"10%"盞ćŻčäșŽæŽ§ä»¶çš„é«˜ćșŠïŒ‰,é»˜èź€ć€Œäžș'0px' + * bottom - ćŒșćŸŸè·çŠ»æŽ§ä»¶ćș•éƒšçš„ćç§»é‡ïŒŒć±žæ€§ć€ŒćŻć–ćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ïŒŒç™Ÿćˆ†æŻ”ïŒˆćŠ‚"10%"盞ćŻčäșŽæŽ§ä»¶çš„é«˜ćșŠïŒ‰,é»˜èź€ć€Œäžș'0px' + * left - ćŒșćŸŸè·çŠ»æŽ§ä»¶ć·ŠäŸ§çš„ćç§»é‡ïŒŒć±žæ€§ć€ŒćŻć–ćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ïŒŒç™Ÿćˆ†æŻ”ïŒˆćŠ‚"10%"盞ćŻčäșŽæŽ§ä»¶çš„ćźœćșŠïŒ‰,é»˜èź€ć€Œäžș'0px' + * right - ćŒșćŸŸè·çŠ»æŽ§ä»¶ćłäŸ§çš„ćç§»é‡ïŒŒć±žæ€§ć€ŒćŻć–ćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ïŒŒç™Ÿćˆ†æŻ”ïŒˆćŠ‚"10%"盞ćŻčäșŽæŽ§ä»¶çš„ćźœćșŠïŒ‰,é»˜èź€ć€Œäžș'0px'。 + * 橂“{top:'44px',bottom:'48px'}”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + region?: any; +} + +/** + * ćŽŸç”ŸæŽ§ä»¶ćœšçȘ—ćŁäž­ćœé çš„æ–čćŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewDock { + /** + * æŽ§ä»¶ćœé ćˆ™éĄ”éąéĄ¶éƒš + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + top?: string; + /** + * æŽ§ä»¶ćœé ćœšéĄ”éąćș•郚 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + bottom?: string; + /** + * æŽ§ä»¶ćœé ćœšéĄ”éąćłäŸ§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + right?: string; + /** + * æŽ§ä»¶ćœé ćœšéĄ”éąć·ŠäŸ§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + left?: string; +} + +/** + * WebviewçȘ—ćŁæ»‘ćŠšäș‹ä»¶æ•°æź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewDragEvent { + /** + * æ‰‹ćŠżç±»ćž‹ + * ćŻć–ć€ŒïŒš + * "rtl" - ä»Žćłć‘ć·Šæ»‘ćŠšæ‰‹ćŠżïŒ› + * "left" - ć‘ć·Šæ»‘ćŠšæ‰‹ćŠżïŒŒäžŽrtl䞀臎 + * "ltr" - ä»Žć·Šć‘ćłæ»‘ćŠšæ‰‹ćŠżïŒ› + * "right" - ć‘ćłæ»‘ćŠšæ‰‹ćŠżïŒŒäžŽlträž€è‡Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + direction?: string; + /** + * çȘ—ćŁæ»‘ćŠšç±»ćž‹ + * ćŻć–ć€ŒïŒš + * "start" - èĄšç€șćŒ€ć§‹æ»‘ćŠšæ“äœœïŒ› + * "move" - èĄšç€șæ­Łćœšæ»‘ćŠšïŒ› + * "end" - èĄšç€șæ»‘ćŠšæ“äœœç»“æŸă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + type?: string; + /** + * çȘ—ćŁæ»‘ćŠšç»“æžœ + * ćŻć–ć€ŒïŒš + * "true" - èĄšç€șæ»‘ćŠšæ“äœœæˆćŠŸïŒ› + * "false" - èĄšç€șæ»‘ćŠšæ“äœœć€±èŽ„ïŒˆæąć€ćˆ°æ»‘ćŠšć‰çš„çŠ¶æ€ïŒ‰ïŒ› + * "undefined" - æ— çŠ¶æ€ć€ŒïŒˆćœ“typeć€Œäžș"end"æ—¶èż”ć›žæ­€ć€ŒïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + result?: string; + /** + * ćœ“ć‰æ“äœœçȘ—ćŁæ ‡è݆ + * ćœ“typeć€Œäžș"start"/"move"æ—¶ïŒŒäżć­˜ćœ“ć‰æ“äœœçȘ—ćŁïŒˆæˆ–ViewæŽ§ä»¶ïŒ‰çš„æ ‡èŻ†ïŒ› + * ćœ“typeć€Œäžș"end"æ—¶äżć­˜æ»‘ćŠšæ“äœœćŽæ˜Ÿç€șçȘ—ćŁïŒˆæˆ–ViewæŽ§ä»¶ïŒ‰çš„æ ‡èŻ†ïŒˆćłresultć€Œäžș"true"ćˆ™èź€äžșć…łè”çȘ—ćŁæ˜Ÿç€șresultć€Œäžșfalsećˆ™èź€äžșäž»çȘ—ćŁæ˜Ÿç€șïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + id?: string; + /** + * ć…łè”çȘ—ćŁæ ‡è݆ + * æ»‘ćŠšæ“äœœć…łè”çȘ—ćŁïŒˆæˆ–ViewæŽ§ä»¶ïŒ‰çš„æ ‡èŻ†ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + otherId?: string; + /** + * äž»çȘ—ćŁæ ‡è݆ + * æ»‘ćŠšæ“äœœäž»çȘ—ćŁïŒˆæˆ–ViewæŽ§ä»¶ïŒ‰çš„æ ‡èŻ†ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + targetId?: string; + /** + * æ»‘ćŠšèż›ćșŠ + * æ»‘ćŠšèż›ćșŠäœçœźäżĄæŻïŒŒć–ć€ŒèŒƒć›Žäžș0-100ïŒŒćŠ‚20èĄšç€șæ»‘ćŠšäș†æ€»è·çŠ»çš„20% + * ćœ“typeć€Œäžș"start"时progressć€Œäžș0 + * ćœ“typeć€Œäžș"end"æ—¶ćŠ‚æžœresultäžștrue戙progressć€Œäžș0ïŒŒćŠ‚æžœresultäžșfalse戙progressć€Œäžș100 + * ćœ“typeć€Œäžș"move"æ—¶ïŒŒäżć­˜ćœ“ć‰æ»‘ćŠšçš„èż›ćșŠäżĄæŻïŒˆæłšïŒšć€šæŹĄè§Šć‘moveäș‹ä»¶ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + progress?: number; +} + +/** + * çȘ—ćŁæ‰‹ćŠżæ“äœœć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewDragOptions { + /** + * æ»‘ć±æ“äœœć›žè°ƒäș‹ä»¶è§Šć‘æ­„长 + * 甹äșŽèźŸçœźæ»‘ć±ć›žè°ƒäș‹ä»¶è§Šć‘éą‘çŽ‡ïŒŒć–ć€ŒèŒƒć›Žäžș1-100ïŒŒć€Œè¶Šć°è§Šć‘éą‘çŽ‡è¶Šé«˜ïŒŒć€Œè¶Šć€§è§Šć‘éą‘çŽ‡è¶Šć°ïŒŒé»˜èź€ć€Œäžș20。 + * ćŠ‚èźŸçœźć€Œäžș20ïŒŒćˆ™èĄšç€șæ»‘ć±æ“äœœç§»ćŠšè·çŠ»è¶…èż‡ćŻç§»ćŠšèŒƒć›Žçš„20%ćˆ™è§Šć‘äž€æŹĄć›žè°ƒäș‹ä»¶ïŒŒćŻé€šèż‡ć›žè°ƒć‡œæ•°ć‚数WebviewDragEvent的progressć±žæ€§èŽ·ć–ă€‚ + * æłšæ„ïŒšè§Šć‘éą‘çŽ‡èż‡ć€§äŒšćœ±ć“æ•ˆçŽ‡ïŒŒćŒ€ć‘è€…éœ€è°šæ…ŽèźŸçœźæ­€ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + callbackStep?: number; + /** + * èźŸçœźçš„æ‰‹ćŠżç±»ćž‹ + * ćŻć–ć€ŒïŒš + * ćŻć–ć€ŒïŒš + * "rtl" - ä»Žćłć‘ć·Šæ»‘ćŠšæ‰‹ćŠżïŒ› + * "left" - ć‘ć·Šæ»‘ćŠšæ‰‹ćŠżïŒŒäžŽrtl䞀臎 + * "ltr" - ä»Žć·Šć‘ćłæ»‘ćŠšæ‰‹ćŠżïŒ› + * "right" - ć‘ćłæ»‘ćŠšæ‰‹ćŠżïŒŒäžŽlträž€è‡Žă€‚ + * - rtl: ä»Žćłć‘ć·Šæ»‘ćŠšæ‰‹ćŠż + * - left: ć‘ć·Šæ»‘ćŠšæ‰‹ćŠżïŒŒäžŽrtl䞀臎 + * - ltr: ä»Žć·Šć‘ćłæ»‘ćŠšæ‰‹ćŠż + * - right: ć‘ćłæ»‘ćŠšæ‰‹ćŠżïŒŒäžŽltr䞀臎 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + direction?: 'rtl' | 'left' | 'ltr' | 'right'; + /** + * æ»‘ćŠšæ‰‹ćŠżæšĄćŒ + * ćŻć–ć€ŒïŒš + * "followFinger" - ćœ“ć‰WebviewçȘ—ćŁè·Ÿéšæ‰‹æŒ‡æ»‘ćŠšïŒ› + * "silent" - ćœ“ć‰WebviewçȘ—ćŁäžè·Ÿéšæ‰‹æŒ‡æ»‘ćŠšïŒ› + * "bounce" - ćœ“ć‰WebviewçȘ—揣è‡Ș抹曞ćŒčïŒˆæŸæ‰‹ćŽçȘ—ćŁæąć€ćˆ°æ‹–ćŠšć‰çš„äœçœźïŒ‰,é€šćžžćŻé€šèż‡èźŸçœźæ­€æšĄćŒæ„ćźžçŽ°TabéĄčæ— æł•ç»§ç»­æ»‘ćŠšćˆ‡æąè‡Ș抹曞ćŒčæ•ˆæžœă€‚ + * - followFinger: ćœ“ć‰WebviewçȘ—ćŁè·Ÿéšæ‰‹æŒ‡æ»‘ćŠš + * - silent: ćœ“ć‰WebviewçȘ—ćŁäžè·Ÿéšæ‰‹æŒ‡æ»‘ćŠš + * - bounce: ćœ“ć‰WebviewçȘ—揣è‡Ș抹曞ćŒč + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + moveMode?: 'followFinger' | 'silent' | 'bounce'; +} + +/** + * æ‰‹ćŠżæ“äœœć…łè”ćŻčè±Ąć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewDragOtherViewOptions { + /** + * æ‰‹ćŠżć…łè”ćŻčè±Ą + * ćŻć–ć€ŒWebviewçȘ—ćŁçš„idStringç±»ćž‹ïŒ‰ă€WebviewçȘ—揣ćŻčè±Ąă€ćŽŸç”ŸViewçȘ—揣ćŻčè±ĄïŒˆplus.nativeObj.ViewïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + view?: string; + /** + * æ»‘ćŠšæšĄćŒ + * ćŻć–ć€ŒïŒš + * "follow" - ćŒæ­„è·Ÿéšäž»WebviewçȘ—ćŁæ»‘ćŠšïŒ› + * "silent" - 䞍跟随䞻WebviewçȘ—ćŁæ»‘ćŠšă€‚ + * - follow: ćŒæ­„è·Ÿéšäž»WebviewçȘ—ćŁæ»‘ćŠš + * - silent: 䞍跟随䞻WebviewçȘ—ćŁæ»‘ćŠš + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + moveMode?: 'follow' | 'silent'; +} + +/** + * æˆȘć±ç»˜ćˆ¶æ“äœœć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewDrawOptions { + /** + * æˆȘć±ć›Ÿç‰‡çš„äœæ·± + * ćŻć–ć€ŒïŒš + * "RGB565" - RGB565ćœ©è‰ČæšĄćŒ,侀äžȘćƒçŽ ć äž€äžȘć­—èŠ‚ïŒ› + * "ARGB" - ARGBćœ©è‰ČæšĄćŒ,äżć­˜é€æ˜ŽćșŠäżĄæŻă€‚ + * - RGB565: + * RGB565ćœ©è‰ČæšĄćŒ,侀äžȘćƒçŽ ć äž€äžȘć­—èŠ‚ă€‚ + * + * - ARGB: + * ARGBćœ©è‰ČæšĄćŒ,äżć­˜é€æ˜ŽćșŠäżĄæŻă€‚ + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + bit?: 'RGB565' | 'ARGB'; + /** + * æ˜ŻćŠæŁ€æ”‹æˆȘć±ć›Ÿç‰‡æ˜ŻćŠäžșç©ș癜 + * ćŻć–ć€ŒïŒš + * true - èĄšç€șæŁ€æ”‹ćˆ°æˆȘć±ćˆ°ç©șç™œć›Ÿç‰‡æ—¶èź€äžșæ“äœœć€±èŽ„ïŒˆè§Šć‘é”™èŻŻć›žè°ƒć‡œæ•°ïŒ‰ïŒ› + * false - èĄšç€șäžæŁ€æ”‹ïŒŒćłäœżäžșç©șç™œć›Ÿç‰‡ä»ç„¶èż”ć›žæˆćŠŸă€‚ + * é»˜èź€ć€Œäžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + check?: boolean; + /** + * èźŸçœźæˆȘć±ćŒș㟟 + * 盾ćŻčäșŽWebviewçȘ—ćŁçš„ćŒșćŸŸäżĄæŻïŒŒé»˜èź€ć€Œäžș{top:'0px',left:'0px',width:'100%',height:'100%'}。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + clip?: PlusNativeObj; + /** + * æ˜ŻćŠæŁ€æ”‹ćœ“ć‰æ˜ŻćŠćŒčć‡șèœŻé”źç›˜ + * ćŻć–ć€ŒïŒš + * true - èĄšç€șæŁ€æ”‹ćˆ°ćŒčć‡șèœŻé”źç›˜æ˜Żèź€äžșæˆȘć±æ“äœœć€±èŽ„ïŒˆè§Šć‘é”™èŻŻć›žè°ƒć‡œæ•°ïŒ‰ïŒ› + * false - èĄšç€șäžæŁ€æ”‹èœŻé”źç›˜çŠ¶æ€ïŒŒç›ŽæŽ„æˆȘć±ă€‚ + * é»˜èź€ć€Œäžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + checkKeyboard?: boolean; +} + +/** + * çȘ—ćŁæ”¶è—ć‚æ•° + * ćœšæ”ćș”ç”šçŽŻćąƒäž­è°ƒç”šæ”¶è—ćŠŸèƒœæ—¶äœżç”šçš„ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewFavoriteOptions { + /** + * 收藏时星ç€șçš„ć›Ÿæ ‡ + * ćœšæ”¶è—ćˆ—èĄšäž­æ˜Ÿç€șçš„ć›Ÿæ ‡ïŒŒé»˜èź€äœżç”šćș”ç”šć›Ÿæ ‡ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + icon?: string; + /** + * 收藏时星ç€șçš„æ ‡éą˜ + * ćœšæ”¶è—ćˆ—èĄšäž­æ˜Ÿç€șçš„æ ‡éą˜ć­—çŹŠäžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + title?: string; + /** + * æ”¶è—çš„éĄ”éąćœ°ć€ + * ćż…éĄ»æ˜Żçœ‘ç»œćœ°ć€ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + href?: string; +} + +/** + * 戛ć»șćŠ èœœHTMLæ•°æźć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewLoadDataOptions { + /** + * éĄ”éąçš„Base URL + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + baseURL?: string; + /** + * HTMLæ•°æźçš„æ•°æźç±»ćž‹ + * é»˜èź€ć€Œäžș"text/html"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + mimeType?: string; + /** + * HTMLæ•°æźçš„çŒ–ç ç±»ćž‹ + * é»˜èź€ć€Œäžș"utf-8"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + encoding?: string; +} + +/** + * çȘ—ćŁçš„ćˆ†äș«ć‚æ•° + * ćœšæ”ćș”ç”šçŽŻćąƒäž­è°ƒç”šćˆ†äș«ćŠŸèƒœæ—¶äœżç”šçš„ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewShareOptions { + /** + * 戆äș«æ—¶äœżç”šçš„ć›Ÿæ ‡ + * é»˜èź€äœżç”šćș”ç”šć›Ÿæ ‡ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + icon?: string; + /** + * 戆äș«æ—¶äœżç”šçš„æ ‡éą˜ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + title?: string; + /** + * 戆äș«æ—¶äœżç”šçš„铟掄朰杀 + * ćż…éĄ»æ˜Żçœ‘ç»œćœ°ć€ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + href?: string; +} + +/** + * çȘ—ćŁćŽŸç”Ÿć­ViewæŽ§ä»¶æ ·ćŒ + * ćŻèźŸçœźćŽŸç”ŸæŽ§ä»¶çš„æ ‡èŻ†ă€ć€§ć°ă€äœçœźä»„ćŠç»˜ćˆ¶çš„ć†…ćźč等。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewSubNViewStyles { + /** + * 掟生歐ViewæŽ§ä»¶çš„æ ‡èŻ† + * ćŻé€šèż‡plus.nativeObj.View.getViewById(id)æ–čæł•äŒ ć…„æ­€æ ‡èŻ†æ„èŽ·ć–ć­View控件ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + id?: string; + /** + * 掟生歐ViewæŽ§ä»¶ç±»ćž‹ + * ćŻć–ć€ŒïŒš + * "NView" - 掟生歐View控件plus.nativeObj.NView + * "ImageSlider" - ćŽŸç”Ÿć›Ÿç‰‡èœźæ’­æŽ§ä»¶ïŒˆplus.nativeObj.ImageSliderïŒ‰ă€‚ + * é»˜èź€ć€Œäžș"NView"。 + * - NView: + * 掟生歐View控件plus.nativeObj.NView + * + * - ImageSlider: + * ćŽŸç”Ÿć›Ÿç‰‡èœźæ’­æŽ§ä»¶ïŒˆplus.nativeObj.ImageSlider + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + type?: 'NView' | 'ImageSlider'; + /** + * 掟生歐ViewæŽ§ä»¶çš„æ ·ćŒ + * ćŻèźŸçœźćŽŸç”ŸæŽ§ä»¶çš„äœçœźă€ć€§ć°ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + styles?: PlusNativeObjViewStyles; + /** + * 掟生歐ViewæŽ§ä»¶ćˆć§‹ç»˜ćˆ¶ć†…ćźč + * ćŻèźŸçœźç»˜ćˆ¶ć›Ÿç‰‡ă€çŸ©ćœąćŒșćŸŸă€æ–‡æœŹç­‰ć†…ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + tags?: any []; +} + +/** + * çȘ—ćŁæ ‡éą˜æ æŽ§ä»¶æ ·ćŒ + * æ ‡éą˜æ æŽ§ä»¶ć›șćźšé«˜ćșŠäžș44px,ćŻé€šèż‡WebviewçȘ—揣ćŻčè±Ąçš„getTitleNViewæ–čæł•èŽ·ć–æ ‡éą˜æ ćŽŸç”ŸæŽ§ä»¶ćŻčè±ĄćŠšæ€ç»˜ćˆ¶ć†…ćźč。 + * ćŻä»„é€šèż‡WebviewObjectćŻčè±Ąçš„getTitleNView()èŽ·ć–æ ‡éą˜æ çš„NViewćŻčè±ĄïŒŒç„¶ćŽè°ƒç”šć…¶setStyleæ–čæł•æ›Žæ–°æ ·ćŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewTitleNViewStyles { + /** + * æ ‡éą˜æ æŽ§ä»¶æ˜ŻćŠæ˜Ÿç€șć·ŠäŸ§èż”ć›žæŒ‰é’ź + * ćŻć–ć€ŒïŒš + * "true" - 星ç€șèż”ć›žæŒ‰é’źïŒ› + * "false" - 䞍星ç€șèż”ć›žæŒ‰é’źă€‚ + * é»˜èź€ć€Œäžș"false"。 + * èż”ć›žæŒ‰é’źçš„éąœè‰ČäžșçȘ—ćŁæ ‡éą˜æ–‡ć­—éąœè‰ČïŒŒæŒ‰äž‹æ—¶éąœè‰Čè‡ȘćŠšè°ƒæ•Žé€æ˜ŽćșŠäžș0.3。 + * ç‚čć‡»èż”ć›žæŒ‰é’źçš„é€»èŸ‘äžŽæŒ‰äž‹çł»ç»Ÿèż”ć›žé”źé€»èŸ‘äž€è‡Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + autoBackButton?: boolean; + /** + * æ ‡éą˜æ æŽ§ä»¶çš„èƒŒæ™Żéąœè‰Č + * 鱜è‰Čć€Œæ ŒćŒäžș"#RRGGBB"ïŒŒćŠ‚"#FF0000"èĄšç€șäžșçșąè‰ČèƒŒæ™ŻïŒŒé»˜èź€ć€Œäžș"#F7F7F7"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + backgroundColor?: string; + /** + * æ ‡éą˜æ äžŠçš„è‡Ș漚ä艿Œ‰é’ź + * 戛ć»ș的è‡Ș漚ä艿Œ‰é’źæ•°ç›źäžé™ćˆ¶ïŒŒćźžé™…ćș”甚䞭ć»șèźźæœ€ć€šèźŸçœź4äžȘæŒ‰é’źïŒˆćŒ…æ‹Źć·ŠäŸ§èż”ć›žæŒ‰é’źïŒ‰ă€‚ + * æłšæ„ïŒšæ­€ć±žæ€§äžæ”ŻæŒćŠšæ€äżźæ”čïŒŒä»…ćœšćˆ›ć»știtleNViewæ—¶èźŸçœźæœ‰æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + buttons?: PlusWebview []; + /** + * æ ‡éą˜æ æŽ§ä»¶ć˜ćŒ–äœœç”šèŒƒć›Ž + * ä»…ćœštypeć€Œäžștransparentæ—¶æœ‰æ•ˆïŒŒéĄ”éąæ»šćŠšæ—¶æ ‡éą˜æ èƒŒæ™Żé€æ˜ŽćșŠć°†ć‘ç”Ÿć˜ćŒ–ă€‚ + * ćœ“éĄ”éąæ»šćŠšćˆ°æŒ‡ćźšćç§»é‡æ—¶æ ‡éą˜æ èƒŒæ™Żć˜äžșćźŒć…šäžé€æ˜Žă€‚ + * æ”ŻæŒç™Ÿćˆ†æŻ”ă€ćƒçŽ ć€ŒïŒŒé»˜èź€äžș'132px'。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + coverage?: string; + /** + * æ ‡éą˜æ æŽ§ä»¶æ˜ŻćŠæ˜Ÿç€șHomeæŒ‰é’ź + * ćŻć–ć€ŒïŒš + * "true" - 星ç€șHomeæŒ‰é’źïŒ› + * "false" - 䞍星ç€șHomeæŒ‰é’źă€‚ + * é»˜èź€ć€Œäžș"false"。 + * HomeæŒ‰é’źçš„éąœè‰ČäžșçȘ—ćŁæ ‡éą˜æ–‡ć­—éąœè‰ČïŒŒæŒ‰äž‹æ—¶éąœè‰Čè‡ȘćŠšè°ƒæ•Žé€æ˜ŽćșŠäžș0.3。 + * ç‚č懻HomeæŒ‰é’źçš„é€»èŸ‘äžșć…łé—­æ‰€æœ‰éžéŠ–éĄ”çȘ—ćŁïŒŒæ˜Ÿç€ș銖饔çȘ—ćŁă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + homeButton?: boolean; + /** + * 憅èŸč距 + * æ ‡éą˜æ ć·Šćłçš„ć†…èŸčè·ïŒŒć•äœäžșpxïŒˆé€»èŸ‘ćƒçŽ ć€ŒïŒ‰ïŒŒćŠ‚"10px"èĄšç€ș10é€»èŸ‘ćƒçŽ ć€Œă€‚ + * é»˜èź€ć€Œäžș"0px"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + padding?: string; + /** + * 揳憅èŸč距 + * æ ‡éą˜æ ćłäŸ§ć†…èŸčè·ïŒŒć•äœäžșpxïŒˆé€»èŸ‘ćƒçŽ ć€ŒïŒ‰ïŒŒćŠ‚"10px"èĄšç€ș10é€»èŸ‘ćƒçŽ ć€Œă€‚ + * é»˜èź€ć€Œäžș"0px"ïŒŒäŒ˜ć…ˆçș§padding-right > padding。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + 'padding-right'?: string; + /** + * 淊憅èŸč距 + * æ ‡éą˜æ ć·ŠäŸ§ć†…èŸčè·ïŒŒć•äœäžșpxïŒˆé€»èŸ‘ćƒçŽ ć€ŒïŒ‰ïŒŒćŠ‚"10px"èĄšç€ș10é€»èŸ‘ćƒçŽ ć€Œă€‚ + * é»˜èź€ć€Œäžș"0px"ïŒŒäŒ˜ć…ˆçș§padding-left > padding。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + 'padding-left'?: string; + /** + * æ ‡éą˜æ æŽ§ä»¶çš„èż›ćșŠæĄæ ·ćŒ + * èźŸçœźæ­€ć±žæ€§ćˆ™ćœšæ ‡éą˜æ æŽ§ä»¶çš„ćș•郚星ç€șèż›ćșŠæĄïŒŒćŻé…çœźèż›ćșŠæĄéąœè‰Čć€Œćłé«˜ćșŠă€‚ + * èźŸçœźæ­€ć±žæ€§ć€Œäžșundefined或nullćˆ™éšè—èż›ćșŠæĄă€‚ + * é»˜èź€äžæ˜Ÿç€șćș•éƒšèż›ćșŠæĄă€‚ + * æłšæ„ïŒšæ­€ć±žæ€§ć°†ćșŸćŒƒïŒŒæŽšèäœżç”šWebviewStyles的progress。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + progress?: PlusWebviewWebviewProgressStyles; + /** + * æ ‡éą˜æ æŽ§ä»¶çš„ćș•éƒšćˆ†ć‰Čçșż + * èźŸçœźæ­€ć±žæ€§ćˆ™ćœšæ ‡éą˜æ æŽ§ä»¶çš„ćș•郚星ç€ș戆ć‰ČçșżïŒŒćŻé…çœźéąœè‰Čć€ŒćŠé«˜ćșŠă€‚ + * èźŸçœźæ­€ć±žæ€§ć€Œäžșundefined或nullćˆ™éšè—ćˆ†ć‰Čçșżă€‚ + * é»˜èź€äžæ˜Ÿç€șćș•éƒšćˆ†ć‰Čçșżă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + splitLine?: PlusWebviewWebviewSplitLineStyles; + /** + * æ ‡éą˜æ äžŠćˆć§‹è‡Ș漚äč‰ç»˜ćˆ¶ć†…ćźč + * 揯甹äșŽèźŸçœźè‡Ș漚äč‰ç»˜ćˆ¶ć›Ÿç‰‡ă€çŸ©ćœąćŒșćŸŸă€æ–‡æœŹç­‰ć†…ćźč。 + * æłšæ„ïŒšæ­€ć±žæ€§äžæ”ŻæŒćŠšæ€äżźæ”čïŒŒä»…ćœšćˆ›ć»știtleNViewæ—¶èźŸçœźæœ‰æ•ˆïŒŒćŠ‚æžœéœ€èŠæ›Žæ–°ç»˜ćˆ¶ć†…ćźč揯æ čæźtags的id调甚drawæ–čæł•æ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + tags?: any []; + /** + * æ ‡éą˜æ æŽ§ä»¶çš„æ ‡éą˜æ–‡ć­—éąœè‰Č + * 鱜è‰Čć€Œæ ŒćŒäžș"#RRGGBB"ïŒŒćŠ‚"#FF0000"èĄšç€șæ ‡éą˜æ–‡ć­—éąœè‰Čäžșçșąè‰ČïŒŒé»˜èź€ć€Œäžș"#000000"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + titleColor?: string; + /** + * æ ‡éą˜æ æŽ§ä»¶çš„æ ‡éą˜æ–‡ć­—è¶…ć‡ș星ç€șćŒșćŸŸæ—¶ć€„ç†æ–čćŒ + * ćŻć–ć€ŒïŒš + * "clip" - 超ć‡ș星ç€șćŒșćŸŸæ—¶ć†…ćźčèŁć‰Ș + * "ellipsis" - 超ć‡ș星ç€șćŒșćŸŸæ—¶ć°Ÿéƒšæ˜Ÿç€șçœç•„æ ‡èź°ïŒˆ...ïŒ‰ă€‚ + * é»˜èź€ć€Œäžș"ellipsis"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + titleOverflow?: string; + /** + * æ ‡éą˜æ æŽ§ä»¶çš„æ ‡éą˜æ–‡ć­—ć†…ćźč + * ćœšæ ‡éą˜æ æŽ§ä»¶ć±…äž­ïŒˆæ°Žćčłć’Œćž‚盎星ç€șïŒŒć·ŠćłèŸč距äžș88pxïŒŒćŠ‚æžœæ–‡æœŹèż‡é•żćˆ™ć°ŸéƒšèŁć‰ȘïŒˆćŠ äž‰äžȘç‚č"..."星ç€ș。 + * ćœ“äžèźŸçœźtitleTextć±žæ€§æˆ–ć±žæ€§ć€Œäžșundefined/nullæ—¶ïŒŒäœżç”šćœ“ć‰WebviewçȘ—ćŁćŠ èœœéĄ”éąçš„æ ‡éą˜ïŒŒćč¶è‡ȘćŠšćŒæ­„æ›Žæ–°éĄ”éąçš„æ ‡éą˜ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + titleText?: string; + /** + * æ ‡éą˜æ æŽ§ä»¶çš„æ ‡éą˜æ–‡ć­—ć­—äœ“ć€§ć° + * ć­—äœ“ć€§ć°ć•äœäžșćƒçŽ ïŒŒćŠ‚"20px"èĄšç€șć­—äœ“ć€§ć°äžș20ćƒçŽ ïŒŒé»˜èź€ć€Œäžș17惏箠。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + titleSize?: string; + /** + * æ ‡éą˜æ æŽ§ä»¶æ ·ćŒ + * ćŻć–ć€ŒïŒš + * "default" - é»˜èź€æ ·ćŒïŒŒéĄ¶éƒšćœé æ˜Ÿç€șïŒŒæŒ€ćŽ‹WebviewéĄ”éąć†…ćźč星ç€șćŒșćŸŸïŒ› + * "transparent" - é€æ˜Žæ ·ćŒïŒŒéĄ¶éƒšæČ‰æ”žćŒæ˜Ÿç€ș芆盖WebviewéĄ”éąć†…ćźčïŒŒæ ‡éą˜æ äžŠć†…ćźčïŒˆé™€æŒ‰é’źć€–ïŒ‰ć…šéƒšé€æ˜ŽïŒŒćœ“éĄ”éąæ»šćŠšæ—¶é€æ˜ŽćșŠé€æžć˜ćŒ–ïŒŒç›Žćˆ°äžé€æ˜Žæ˜Ÿç€ș。 + * é»˜èź€ć€Œäžș"default"。 + * æłšæ„ïŒšæ­€ć±žæ€§äžæ”ŻæŒćŠšæ€æ›Žæ–°ă€‚ + * - default: + * é»˜èź€æ ·ćŒïŒŒéĄ¶éƒšćœé æ˜Ÿç€șïŒŒæŒ€ćŽ‹WebviewéĄ”éąć†…ćźč星ç€șćŒș㟟 + * + * - transparent: + * é€æ˜Žæ ·ćŒïŒŒéĄ¶éƒšæČ‰æ”žćŒæ˜Ÿç€ș芆盖WebviewéĄ”éąć†…ćźčïŒŒæ ‡éą˜æ äžŠć†…ćźčïŒˆé™€æŒ‰é’źć€–ïŒ‰ć…šéƒšé€æ˜ŽïŒŒćœ“éĄ”éąæ»šćŠšæ—¶é€æ˜ŽćșŠé€æžć˜ćŒ–ïŒŒç›Žćˆ°äžé€æ˜Žæ˜Ÿç€ș + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + type?: 'default' | 'transparent'; +} + +/** + * çȘ—ćŁæ ‡éą˜æ è‡Ș漚ä艿Œ‰é’źæ ·ćŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewTitleNViewButtonStyles { + /** + * æŒ‰é’źæ ·ćŒ + * èżèĄŒçŽŻćąƒäž­ć†…çœźæŒ‰é’źæ ·ćŒç›ŽæŽ„äœżç”šïŒŒć†…çœźæ ·ćŒćżœç•„fontSrc撌textć±žæ€§ă€‚ + * ćŻć–ć€ŒïŒš + * "forward" - ć‰èż›æŒ‰é’źïŒ› + * "back" - ćŽé€€æŒ‰é’źïŒ› + * "share" - 戆äș«æŒ‰é’źïŒ› + * "favorite" - æ”¶è—æŒ‰é’źïŒ› + * "home" - äž»éĄ”æŒ‰é’źïŒ› + * "menu" - èœć•æŒ‰é’źïŒ› + * "close" - ć…łé—­æŒ‰é’źïŒ› + * "none" - æ— æ ·ćŒă€‚ + * é»˜èź€ć€Œäžșæ— æ ·ćŒïŒˆ"none"ïŒ‰ïŒŒéœ€é€šèż‡textć±žæ€§èźŸçœźæŒ‰é’źäžŠæ˜Ÿç€ș的憅ćźčă€é€šèż‡fontSrcć±žæ€§èźŸçœźäœżç”šçš„ć­—äœ“ćș“。 + * - forward: ć‰èż›æŒ‰é’ź + * - back: ćŽé€€æŒ‰é’ź + * - share: 戆äș«æŒ‰é’ź + * - favorite: æ”¶è—æŒ‰é’ź + * - home: äž»éĄ”æŒ‰é’ź + * - menu: èœć•æŒ‰é’ź + * - close: ć…łé—­æŒ‰é’ź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + type?: 'forward' | 'back' | 'share' | 'favorite' | 'home' | 'menu' | 'close'; + /** + * æŒ‰é’źçš„èƒŒæ™Żéąœè‰Č + * ä»…ćœšæ ‡éą˜æ type=transparentæ—¶ç”Ÿæ•ˆïŒŒćœ“æ ‡éą˜æ é€æ˜Žæ—¶æŒ‰é’źæ˜Ÿç€șçš„èƒŒæ™Żéąœè‰Č。 + * ćŻć–ć€Œ#RRGGBB撌rgbaæ ŒćŒéąœè‰Č歗笩äžČïŒŒé»˜èź€ć€Œäžș灰è‰ČćŠé€æ˜Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + background?: string; + /** + * æŒ‰é’źäžŠæ˜Ÿç€șçš„è§’æ ‡æ–‡æœŹ + * æœ€ć€šæ˜Ÿç€ș3äžȘć­—çŹŠïŒŒè¶…èż‡ćˆ™æ˜Ÿç€șäžș...。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + badgeText?: string; + /** + * æŒ‰é’źäžŠæ–‡ć­—éąœè‰Č + * ćŻć–ć€ŒïŒš "#RRGGBB"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"#FF0000"èĄšç€ș绘戶çșąè‰Čèż”ć›žé”źïŒ› + * "rgba(R,G,B,A)"ïŒŒć…¶äž­R/G/Bćˆ†ćˆ«ä»ŁèĄšçșąè‰Čć€Œ/绿è‰Čć€Œ/蓝è‰Čć€ŒïŒŒæ­Łæ•Žæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-255Aäžș透明ćșŠïŒŒæ”źç‚čæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-10äžșć…šé€æ˜ŽïŒŒ1äžșäžé€æ˜ŽïŒ‰ïŒŒćŠ‚"rgba(255,0,0,0.5)"ïŒŒèĄšç€șçșąè‰ČćŠé€æ˜Žă€‚ + * é»˜èź€ć€ŒäžșçȘ—ćŁæ ‡éą˜æ æŽ§ä»¶çš„æ ‡éą˜æ–‡ć­—éąœè‰Č。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + color?: string; + /** + * æŒ‰äž‹çŠ¶æ€æŒ‰é’źæ–‡ć­—éąœè‰Č + * ćŻć–ć€ŒïŒš "#RRGGBB"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"#FF0000"èĄšç€ș绘戶çșąè‰Čèż”ć›žé”źïŒ› + * "rgba(R,G,B,A)"ïŒŒć…¶äž­R/G/Bćˆ†ćˆ«ä»ŁèĄšçșąè‰Čć€Œ/绿è‰Čć€Œ/蓝è‰Čć€ŒïŒŒæ­Łæ•Žæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-255Aäžș透明ćșŠïŒŒæ”źç‚čæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-10äžșć…šé€æ˜ŽïŒŒ1äžșäžé€æ˜ŽïŒ‰ïŒŒćŠ‚"rgba(255,0,0,0.5)"ïŒŒèĄšç€șçșąè‰ČćŠé€æ˜Žă€‚ + * é»˜èź€ć€Œäžșcolorć±žæ€§ć€Œè‡ȘćŠšè°ƒæ•Žé€æ˜ŽćșŠäžș0.3。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + colorPressed?: string; + /** + * æŒ‰é’źćœšæ ‡éą˜æ äžŠçš„æ˜Ÿç€șäœçœź + * ćŻć–ć€ŒïŒš + * "right" - ćœšæ ‡éą˜æ äž­é ćłæŽ’ćˆ—æ˜Ÿç€ș + * "left" - ćœšæ ‡éą˜æ äž­é ć·ŠäŸ§æŽ’ćˆ—æ˜Ÿç€șïŒˆćœšèż”ć›žé”źćŽïŒ‰ă€‚ + * é»˜èź€ć€Œäžș"right"。 + * - right: + * ćœšæ ‡éą˜æ äž­é ćłæŽ’ćˆ—æ˜Ÿç€ș + * + * - left: + * ćœšæ ‡éą˜æ äž­é ć·ŠäŸ§æŽ’ćˆ—æ˜Ÿç€șïŒˆćœšèż”ć›žé”źćŽïŒ‰ + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + float?: 'right' | 'left'; + /** + * æŒ‰é’źäžŠæ–‡ć­—çš„çȗ细 + * ćŻć–ć€ŒïŒš + * "normal" - æ ‡ć‡†ć­—äœ“ïŒ› + * "bold" - ㊠çČ—ć­—äœ“ă€‚ + * é»˜èź€ć€Œäžș"normal"。 + * - normal: + * æ ‡ć‡†ć­—äœ“ + * + * - bold: + * ㊠çČ—ć­—äœ“ + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + fontWeight?: 'normal' | 'bold'; + /** + * æŒ‰é’źäžŠæ–‡ć­—ć€§ć° + * ćŻć–ć€ŒïŒšć­—äœ“é«˜ćșŠćƒçŽ ć€ŒïŒŒæ•°ć­—ćŠ "px"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"22px"。 + * çȘ—ćŁæ ‡éą˜æ äžșé€æ˜Žæ ·ćŒïŒˆtype="transparent"ïŒ‰æ—¶ïŒŒé»˜èź€ć€Œäžș"22px" + * çȘ—ćŁæ ‡éą˜æ äžșé»˜èź€æ ·ćŒïŒˆtype="default"ïŒ‰æ—¶ïŒŒé»˜èź€ć€Œäžș"27px"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + fontSize?: string; + /** + * æŒ‰é’źäžŠæ–‡ć­—äœżç”šçš„ć­—äœ“æ–‡ä»¶è·ŻćŸ„ + * ć­—äœ“æ–‡ä»¶è·ŻćŸ„æ”ŻæŒä»„äž‹ç±»ćž‹ïŒš + * 盾ćŻčè·ŻćŸ„ - 盾ćŻčäșŽćœ“ć‰éĄ”靱的hostäœçœźïŒŒćŠ‚"a.ttf"ïŒŒæłšæ„ćœ“ć‰éĄ”éąäžșçœ‘ç»œćœ°ć€ćˆ™äžæ”ŻæŒïŒ› + * 绝ćŻčè·ŻćŸ„ - çł»ç»Ÿç»ćŻčè·ŻćŸ„ïŒŒćŠ‚Androidćčłć°"/sdcard/a.ttf"ïŒŒæ­€ç±»è·ŻćŸ„é€šćžžé€šèż‡ć…¶ćźƒ5+ APIèŽ·ć–çš„ïŒ› + * æ‰©ć±•ç›žćŻčè·ŻćŸ„URL(RelativeURL) - 仄"_"ćŒ€ć€Žçš„ç›žćŻčè·ŻćŸ„ïŒŒćŠ‚"_www/a.ttf" + * æœŹćœ°è·ŻćŸ„URL - 仄“file://â€ćŒ€ć€ŽïŒŒćŽéąè·Ÿéšçł»ç»Ÿç»ćŻčè·ŻćŸ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + fontSrc?: string; + /** + * æŒ‰é’źç‚čć‡»ćŽè§Šć‘çš„ć›žè°ƒć‡œæ•° + * ć›žè°ƒć‡œæ•°äž­ć°†èż”ć›žæ­€JSONćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + onclick?: (result: any) => void; + /** + * æŒ‰é’źäžŠæ˜ŻćŠæ˜Ÿç€șçșąç‚č + * èźŸçœźäžștruećˆ™æ˜Ÿç€șçșąç‚čfalsećˆ™äžæ˜Ÿç€șçșąç‚čă€‚é»˜èź€ć€Œäžșfalse。 + * æłšæ„ïŒšćœ“èźŸçœźäș†è§’æ ‡æ–‡æœŹæ—¶çșąç‚č䞍星ç€ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + redDot?: boolean; + /** + * æ˜ŻćŠæ˜Ÿç€ș选择指ç€șć›Ÿæ ‡ + * èźŸçœźäžștruećˆ™æ˜Ÿç€ș选择指ç€șć›Ÿæ ‡ïŒˆć‘äž‹çź­ć€ŽïŒ‰ïŒŒéąœè‰ČäžŽæ–‡ć­—éąœè‰Č䞀臎 + * falsećˆ™äžæ˜Ÿç€șă€‚é»˜èź€ć€Œäžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + select?: boolean; + /** + * æŒ‰é’źäžŠæ˜Ÿç€șçš„æ–‡ć­— + * æŽšèäœżç”šäž€äžȘć­—çŹŠïŒŒè¶…èż‡äž€äžȘć­—çŹŠćŻèƒœæ— æł•æ­Łćžžæ˜Ÿç€șïŒŒäœżç”šć­—äœ“ć›Ÿæ ‡æ—¶unicodeć­—çŹŠèĄšç€ș濅饻'\u'ćŒ€ć€ŽïŒŒćŠ‚"\ue123"ïŒˆæłšæ„äžèƒœć†™æˆ"\e123"ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + text?: string; + /** + * æŒ‰é’źçš„ćźœćșŠ + * ćŻć–ć€ŒïŒš + * "*px" - é€»èŸ‘ćƒçŽ ć€ŒïŒŒćŠ‚"10px"èĄšç€ș10é€»èŸ‘ćƒçŽ ć€ŒïŒŒæŒ‰é’źçš„ć†…ćźčć±…äž­æ˜Ÿç€ș + * "auto" - è‡ȘćźšèźĄçź—ćźœćșŠïŒŒæ čæźć†…ćźčè‡ȘćŠšè°ƒæ•ŽæŒ‰é’źćźœćșŠă€‚ + * é»˜èź€ć€Œäžș"44px"ïŒˆé€‚ćˆć­—äœ“ć›Ÿæ ‡ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + width?: string; +} + +/** + * æ ‡éą˜æ æŽ§ä»¶çš„èż›ćșŠæĄæ ·ćŒ + * 星ç€șćœšæ ‡éą˜æ æŽ§ä»¶ćș•éƒšă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewProgressStyles { + /** + * èż›ćșŠæĄéąœè‰Č + * ćŻć–ć€ŒïŒš "#RRGGBB"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"#FF0000"èĄšç€ș绘戶çșąè‰Č戆ć‰ČçșżïŒ› + * "rgba(R,G,B,A)"ïŒŒć…¶äž­R/G/Bćˆ†ćˆ«ä»ŁèĄšçșąè‰Čć€Œ/绿è‰Čć€Œ/蓝è‰Čć€ŒïŒŒæ­Łæ•Žæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-255Aäžș透明ćșŠïŒŒæ”źç‚čæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-10äžșć…šé€æ˜ŽïŒŒ1äžșäžé€æ˜ŽïŒ‰ïŒŒćŠ‚"rgba(255,0,0,0.5)"ïŒŒèĄšç€șçșąè‰ČćŠé€æ˜Žă€‚ + * é»˜èź€ć€Œäžș"#00FF00"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + color?: string; + /** + * èż›ćșŠæĄé«˜ćșŠ + * ćŻć–ć€ŒïŒšćƒçŽ ć€ŒïŒˆé€»èŸ‘ćƒçŽ ïŒ‰ïŒŒæ”ŻæŒć°æ•°ç‚čïŒŒćŠ‚"1px"èĄšç€ș1ćƒçŽ é«˜ïŒ›ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"1%"盞ćŻčäșŽæ ‡éą˜æ æŽ§ä»¶çš„高ćșŠă€‚ + * é»˜èź€ć€Œäžș"2px"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + height?: string; +} + +/** + * çȘ—ćŁæ ‡éą˜æ æŽ§ä»¶çš„ćˆ†ć‰Čçșżæ ·ćŒ + * 星ç€șćœšæ ‡éą˜æ æŽ§ä»¶ćș•éƒšă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewSplitLineStyles { + /** + * ćș•éƒšćˆ†ć‰Čçșżéąœè‰Č + * ćŻć–ć€ŒïŒš "#RRGGBB"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"#FF0000"èĄšç€ș绘戶çșąè‰Č戆ć‰ČçșżïŒ› + * "rgba(R,G,B,A)"ïŒŒć…¶äž­R/G/Bćˆ†ćˆ«ä»ŁèĄšçșąè‰Čć€Œ/绿è‰Čć€Œ/蓝è‰Čć€ŒïŒŒæ­Łæ•Žæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-255Aäžș透明ćșŠïŒŒæ”źç‚čæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-10äžșć…šé€æ˜ŽïŒŒ1äžșäžé€æ˜ŽïŒ‰ïŒŒćŠ‚"rgba(255,0,0,0.5)"ïŒŒèĄšç€șçșąè‰ČćŠé€æ˜Žă€‚ + * é»˜èź€ć€Œäžș"#CCCCCC"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + color?: string; + /** + * ćș•éƒšćˆ†ć‰Čçșżé«˜ćșŠ + * ćŻć–ć€ŒïŒšćƒçŽ ć€ŒïŒˆé€»èŸ‘ćƒçŽ ïŒ‰ïŒŒæ”ŻæŒć°æ•°ç‚čïŒŒćŠ‚"1px"èĄšç€ș1ćƒçŽ é«˜ïŒ›ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"1%"盞ćŻčäșŽæ ‡éą˜æ æŽ§ä»¶çš„高ćșŠă€‚ + * é»˜èź€ć€Œäžș"1px"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + height?: string; +} + +/** + * WebviewçȘ—揣äș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewEvent { + /** + * WebviewçȘ—ćŁć…łé—­äș‹ä»¶ + * é€šèż‡WebviewObjectćŻčè±Ąçš„addEventListeneræ–čæł•æ·»ćŠ äș‹ä»¶ç›‘ćŹć‡œæ•°ïŒŒćœ“WebviewçȘ—ćŁć…łé—­æ—¶è§Šć‘æ­€äș‹ä»¶ïŒŒć›žè°ƒć‡œæ•°ç±»ćž‹äžșEventCallback。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + close?: string; + /** + * WebviewçȘ—ćŁć›žćŒčäș‹ä»¶ + * é€šèż‡WebviewObjectćŻčè±Ąçš„setBounceæ–čæł•ćŒ€ćŻć›žćŒčæ•ˆæžœèźŸçœźéĄ¶éƒšäž‹æ‹‰ć›žćŒčchangeoffsetć±žæ€§ćŽïŒŒćœ“ç”šæˆ·ć‘äž‹æ‹–æ‹œçȘ—ćŁæ—¶è§Šć‘ć‘æ­€äș‹ä»¶ïŒŒć›žè°ƒć‡œæ•°ç±»ćž‹äžșBounceEventCallback。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + dragBounce?: string; + /** + * WebviewçȘ—ćŁć›žćŒčäș‹ä»¶ + * é€šèż‡WebviewObjectćŻčè±Ąçš„setBounceæ–čæł•ćŒ€ćŻć›žćŒčæ•ˆæžœèźŸçœźć·ŠćłäŸ§äŸ§æ»‘slideoffsetć±žæ€§ćŽïŒŒćœ“ç”šæˆ·ć‘ć·ŠćłäŸ§æ‹–æ‹œçȘ—ćŁäŸ§æ»‘æ—¶è§Šć‘ć‘æ­€äș‹ä»¶ïŒŒć›žè°ƒć‡œæ•°ç±»ćž‹äžșBounceEventCallback。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + slideBounce?: string; + /** + * WebviewçȘ—ćŁćŠ èœœé”™èŻŻäș‹ä»¶ + * é€šèż‡WebviewObjectćŻčè±Ąçš„addEventListeneræ–čæł•æ·»ćŠ äș‹ä»¶ç›‘ćŹć‡œæ•°ïŒŒćœ“WebviewçȘ—ćŁćŠ èœœé”™èŻŻæ—¶è§Šć‘æ­€äș‹ä»¶ïŒŒć›žè°ƒć‡œæ•°ç±»ćž‹äžșEventCallback。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + error?: string; + /** + * WebviewçȘ—ćŁéšè—äș‹ä»¶ + * é€šèż‡WebviewObjectćŻčè±Ąçš„addEventListeneræ–čæł•æ·»ćŠ äș‹ä»¶ç›‘ćŹć‡œæ•°ïŒŒćœ“WebviewçȘ—ćŁéšè—ïŒˆçȘ—ćŁćŠšç”»ćꌿˆćŽïŒ‰æ—¶è§Šć‘æ­€äș‹ä»¶ïŒŒć›žè°ƒć‡œæ•°ç±»ćž‹äžșEventCallback。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + hide?: string; + /** + * WebviewçȘ—ćŁéĄ”éąćŒ€ć§‹ćŠ èœœäș‹ä»¶ + * é€šèż‡WebviewObjectćŻčè±Ąçš„addEventListeneræ–čæł•æ·»ćŠ äș‹ä»¶ç›‘ćŹć‡œæ•°ïŒŒćœ“WebviewçȘ—ćŁćŒ€ć§‹ćŠ èœœæ–°éĄ”éąæ—¶è§Šć‘æ­€äș‹ä»¶ïŒŒć›žè°ƒć‡œæ•°ç±»ćž‹äžșEventCallback。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + loading?: string; + /** + * WebviewçȘ—ćŁéĄ”éąćŠ èœœćźŒæˆäș‹ä»¶ + * é€šèż‡WebviewObjectćŻčè±Ąçš„addEventListeneræ–čæł•æ·»ćŠ äș‹ä»¶ç›‘ćŹć‡œæ•°ïŒŒćœ“WebviewçȘ—ćŁéĄ”éąćŠ èœœćźŒæˆæ—¶è§Šć‘æ­€äș‹ä»¶ïŒŒć›žè°ƒć‡œæ•°ç±»ćž‹äžșEventCallback。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + loaded?: string; + /** + * WebviewçȘ—ćŁæ˜Ÿç€șéźçœ©ć±‚æ—¶ç‚č懻äș‹ä»¶ + * é€šèż‡WebviewObjectćŻčè±Ąçš„addEventListeneræ–čæł•æ·»ćŠ äș‹ä»¶ç›‘ćŹć‡œæ•°ïŒŒćœ“WebviewçȘ—ćŁé€šèż‡maskć±žæ€§èźŸçœźæ˜Ÿç€șéźçœ©ć±‚ćč¶äž”ç‚čć‡»æ—¶è§Šć‘æ­€äș‹ä»¶ïŒŒć›žè°ƒć‡œæ•°ç±»ćž‹äžșEventCallback。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + maskClick?: string; + /** + * WebviewçȘ—ćŁćŒ€ć§‹æžČ染äș‹ä»¶ + * é€šèż‡WebviewObjectćŻčè±Ąçš„addEventListeneræ–čæł•æ·»ćŠ äș‹ä»¶ç›‘ćŹć‡œæ•°ïŒŒćœ“WebviewçȘ—ćŁćŒ€ć§‹æžČæŸ“ć†…ćźčæ—¶è§Šć‘æ­€äș‹ä»¶ïŒŒć›žè°ƒć‡œæ•°ç±»ćž‹äžșEventCallback。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + rendering?: string; + /** + * WebviewçȘ—揣æžČæŸ“ćźŒæˆäș‹ä»¶ + * é€šèż‡WebviewObjectćŻčè±Ąçš„addEventListeneræ–čæł•æ·»ćŠ äș‹ä»¶ç›‘ćŹć‡œæ•°ïŒŒćœ“WebviewçȘ—揣æžČæŸ“ćźŒæˆæ—¶è§Šć‘æ­€äș‹ä»¶ïŒŒć›žè°ƒć‡œæ•°ç±»ćž‹äžșEventCallback。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + rendered?: string; + /** + * WebviewçȘ—ćŁæ˜Ÿç€șäș‹ä»¶ + * é€šèż‡WebviewObjectćŻčè±Ąçš„addEventListeneræ–čæł•æ·»ćŠ äș‹ä»¶ç›‘ćŹć‡œæ•°ïŒŒćœ“WebviewçȘ—ćŁæ˜Ÿç€șçȘ—ćŁćŠšç”»ćꌿˆćŽïŒ‰æ—¶è§Šć‘æ­€äș‹ä»¶ïŒŒć›žè°ƒć‡œæ•°ç±»ćž‹äžșEventCallback。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + show?: string; + /** + * WebviewćŠ èœœéĄ”éąæ ‡éą˜æ›Žæ–°äș‹ä»¶ + * é€šèż‡WebviewObjectćŻčè±Ąçš„addEventListeneræ–čæł•æ·»ćŠ äș‹ä»¶ç›‘ćŹć‡œæ•°ïŒŒćœ“WebviewçȘ—ćŁćŠ èœœæ–°éĄ”éąæ›Žæ–°æ ‡éą˜æ—¶è§Šć‘æ­€äș‹ä»¶ïŒŒć›žè°ƒć‡œæ•°ç±»ćž‹äžșSuccessCallback。 + * æłšæ„ïŒšæ­€äș‹ä»¶äŒšć…ˆäșŽloadedäș‹ä»¶è§Šć‘ïŒŒé€šćžžćœšćŠ èœœçœ‘ç»œéĄ”éąæ—¶é€šèż‡æ­€äș‹ä»¶ćŻæ›Žćż«èŽ·ć–ćˆ°éĄ”éąçš„æ ‡éą˜ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + titleUpdate?: string; + /** + * WebviewçȘ—ćŁæŽ„æ”¶ćˆ°è§Šć±äș‹ä»¶ + * é€šèż‡WebviewObjectćŻčè±Ąçš„addEventListeneræ–čæł•æ·»ćŠ äș‹ä»¶ç›‘ćŹć‡œæ•°ïŒŒćœ“ç”šæˆ·æ“äœœæŒ‰äž‹ćˆ°WebviewçȘ—ćŁæ—¶è§Šć‘æ­€äș‹ä»¶ïŒŒć›žè°ƒć‡œæ•°ç±»ćž‹äžșSuccessCallback。 + * æłšæ„ïŒšæŻæŒ‰äž‹ć±ćč•è§Šć‘äž€æŹĄæ­€äș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + touchstart?: string; + /** + * WebviewçȘ—ćŁäŸ§æ»‘èż”ć›žäș‹ä»¶ + * é€šèż‡WebviewObjectćŻčè±Ąçš„addEventListeneræ–čæł•æ·»ćŠ äș‹ä»¶ç›‘ćŹć‡œæ•°ïŒŒćœ“WebviewçȘ—ćŁäŸ§æ»‘èż”ć›žæ—¶è§Šć‘æ­€äș‹ä»¶ïŒŒć›žè°ƒć‡œæ•°ç±»ćž‹äžșPopGestureCallback。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + popGesture?: string; + /** + * WebviewçȘ—ćŁćŠ èœœèż›ćșŠć˜ćŒ–äș‹ä»¶ + * é€šèż‡WebviewObjectćŻčè±Ąçš„addEventListeneræ–čæł•æ·»ćŠ äș‹ä»¶ç›‘ćŹć‡œæ•°ïŒŒćœ“WebviewçȘ—ćŁćŠ èœœéĄ”éąèż›ćșŠć˜ćŒ–æ—¶è§Šć‘æ­€äș‹ä»¶ă€‚ + * ć›žè°ƒć‡œæ•°ćŽŸćž‹äžșvoid PorgressCandedCallback(Event e),ćŻé€šèż‡e.progressèŽ·ć–çȘ—ćŁćŠ èœœèż›ćșŠïŒŒć–ć€ŒèŒƒć›Žäžș0-100。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + progressChanged?: string; + /** + * WebviewçȘ—ćŁäž‹æ‹‰ćˆ·æ–°äș‹ä»¶ + * WebviewçȘ—ćŁæ‰“ćŒ€äž‹æ‹‰ćˆ·æ–°ćŠŸèƒœćŽïŒŒç”šæˆ·æ“äœœäž‹æ‹‰ćˆ·æ–°æ—¶æˆ–è°ƒç”šbeginPullToRefreshæ–čæł•æ—¶è§Šć‘ïŒŒç”šäșŽé€šçŸ„äžšćŠĄé€»èŸ‘ćŻä»„ćŒ€ć§‹æ‰§èĄŒćˆ·æ–°æ“äœœă€‚ + * æ›Žæ–°æ“äœœćźŒæˆćŽè°ƒç”šçȘ—ćŁçš„endPullToRefreshæ–čæł•ç»“æŸäž‹æ‹‰ćˆ·æ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + pullToRefresh?: string; +} + +/** + * JSONćŻčè±ĄïŒŒćŽŸç”ŸçȘ—ćŁæ‰©ć±•ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewExtraOptions { + /** + * çȘ—ćŁćŠšç”»ćŠ é€Ÿ + * ćŒ€ćŻçȘ—ćŁćŠšç”»ćŠ é€ŸćŠŸèƒœćŻäŒ˜ćŒ–çȘ—ćŁćŠšç”»æ•ˆæžœïŒŒæć‡ćŠšç”»æ”çš‹ćșŠïŒŒćŻéżć…éƒšćˆ†èźŸć€‡äžŠæ‰“ćŒ€ïŒˆć…łé—­ïŒ‰çȘ—揣é—Șć±çš„é—źéą˜ă€‚ + * ćŻć–ć€ŒïŒš + * "auto" - è‡ȘćŠšäŒ˜ćŒ–çȘ—ćŁćŠšç”»ïŒ› + * "none" - 慳闭çȘ—ćŁćŠšç”»ćŠ é€ŸćŠŸèƒœïŒ› + * "capture" - äœżç”šæˆȘć±æ–čćŒćŠ é€ŸçȘ—ćŁćŠšç”»ă€‚ + * é»˜èź€ć€Œäžș"auto"。 + * - auto: + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + acceleration?: 'auto'; + /** + * çȘ—ćŁćŠšç”»ćŠ é€Ÿæ—¶äœżç”šçš„ć›Ÿç‰‡ + * ćœ“äœżç”šæˆȘć±æ–čćŒćŠ é€ŸçȘ—ćŁćŠšç”»æ—¶ïŒŒćŻèźŸçœźć·Čç»ćˆ›ć»șć„œçš„æˆȘć±ć›Ÿç‰‡ïŒŒæ­€æ—¶äžäŒšèż›èĄŒćźžæ—¶æˆȘć±æ“äœœïŒŒćŠ é€ŸçȘ—ćŁćŠšç”»ć“ćș”æ—¶é—ŽïŒŒæć‡ç”šæˆ·äœ“éȘŒă€‚ + * ćŠ‚æžœæœȘæŒ‡ćźšæˆȘć±ć›Ÿç‰‡ïŒŒćˆ™ćźžæ—¶æˆȘć–ćœ“ć‰WebviewçȘ—揣ćŻčè±Ąçš„ć›Ÿç‰‡èż›èĄŒćŠšç”»æ“äœœă€‚ + * ćŠ‚æžœçȘ—揣æœȘäœżç”šæˆȘć±æ–čćŒćŠ é€ŸćŠšç”»ïŒŒćˆ™ćżœç•„æ­€ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + capture?: PlusNativeObjBitmap; + /** + * ć…łè”çȘ—ćŁćŠšç”»äœżç”šçš„ć›Ÿç‰‡ + * ćœ“äœżç”šæˆȘć±æ–čćŒćŠ é€ŸçȘ—ćŁćŠšç”»æ—¶ïŒŒćŻèźŸçœźć·Čç»ćˆ›ć»șć„œçš„æˆȘć±ć›Ÿç‰‡ïŒŒæ­€æ—¶äžäŒšèż›èĄŒćźžæ—¶æˆȘć±æ“äœœïŒŒćŠ é€Ÿć…łè”çȘ—ćŁćŠšç”»ć“ćș”æ—¶é—ŽïŒŒæć‡ç”šæˆ·äœ“éȘŒă€‚ + * ćŠ‚æžœæœȘæŒ‡ćźšæˆȘć±ć›Ÿç‰‡ïŒŒćˆ™ćźžæ—¶æˆȘć–ć…łè”WebviewçȘ—揣ćŻčè±Ąçš„ć›Ÿç‰‡èż›èĄŒćŠšç”»æ“äœœă€‚ + * ćŠ‚æžœçȘ—揣æœȘäœżç”šæˆȘć±æ–čćŒćŠ é€ŸćŠšç”»ïŒŒćˆ™ćżœç•„æ­€ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + otherCapture?: PlusNativeObjBitmap; +} + +/** + * ćŽŸç”ŸæŽ§ä»¶ćœšçȘ—ćŁäž­æ˜Ÿç€șçš„äœçœź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewPosition { + /** + * æŽ§ä»¶ćœšéĄ”éąäž­æ­ŁćžžćźšäœïŒŒćŠ‚æžœéĄ”éąć­˜ćœšæ»šćŠšæĄćˆ™éšçȘ—ćŁć†…ćźčæ»šćŠš + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + static?: string; + /** + * æŽ§ä»¶ćœšéĄ”éąäž­ç»ćŻčćźšäœïŒŒćŠ‚æžœéĄ”éąć­˜ćœšæ»šćŠšæĄäžéšçȘ—ćŁć†…ćźčæ»šćŠš + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + absolute?: string; + /** + * æŽ§ä»¶ćœšéĄ”éąäž­ćœé ïŒŒćœé çš„äœçœźé€šèż‡dockć±žæ€§èż›èĄŒćźšäč‰ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + dock?: string; +} + +/** + * WebviewçȘ—ćŁäž‹æ‹‰ćˆ·æ–°æ ·ćŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewPullToRefreshStyles { + /** + * æ˜ŻćŠćŒ€ćŻWebviewçȘ—ćŁçš„äž‹æ‹‰ćˆ·æ–°ćŠŸèƒœ + * trueèĄšç€șćŒ€ćŻçȘ—ćŁçš„äž‹æ‹‰ćˆ·æ–°ćŠŸèƒœïŒ› + * falseèĄšç€ș慳闭çȘ—ćŁçš„äž‹æ‹‰ćˆ·æ–°ćŠŸèƒœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + support?: boolean; + /** + * äž‹æ‹‰ćˆ·æ–°æŽ§ä»¶éąœè‰Č + * 鱜è‰Čć€Œæ ŒćŒäžș"#RRGGBB"ïŒŒćŠ‚"#FF0000"äžșèźŸçœźäž‹æ‹‰ć±žæ€§æŽ§ä»¶äžșçșąè‰ČïŒŒé»˜èź€ć€Œäžș"#2BD009"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + color?: string; + /** + * äž‹æ‹‰ćˆ·æ–°æ ·ćŒ + * 甹äșŽćźšäč‰äž‹æ‹‰ćˆ·æ–°éŁŽæ Œæ ·ćŒïŒŒćŻć–ć€ŒïŒš + * "default" - ç»ć…žäž‹æ‹‰ćˆ·æ–°æ ·ćŒïŒˆäž‹æ‹‰æ‹–ćŠšæ—¶éĄ”éąć†…ćźč跟随 + * "circle" - ćœ†ćœˆæ ·ćŒäž‹æ‹‰ćˆ·æ–°æŽ§ä»¶æ ·ćŒïŒˆäž‹æ‹‰æ‹–ćŠšæ—¶ä»…ćˆ·æ–°æŽ§ä»¶è·ŸéšïŒ‰ă€‚ + * é»˜èź€ć€Œäžș"default"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + style?: string; + /** + * çȘ—ćŁçš„äž‹æ‹‰ćˆ·æ–°æŽ§ä»¶èż›ć…„ćˆ·æ–°çŠ¶æ€çš„æ‹‰æ‹œé«˜ćșŠ + * æ”ŻæŒç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"ïŒ›ćƒçŽ ć€ŒïŒŒćŠ‚"50px"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + height?: string; + /** + * çȘ—ćŁćŻäž‹æ‹‰æ‹–æ‹œçš„èŒƒć›Ž + * æ”ŻæŒç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"ïŒ›ćƒçŽ ć€ŒïŒŒćŠ‚"50px"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + range?: string; + /** + * äž‹æ‹‰ćˆ·æ–°æŽ§ä»¶çš„è”·ć§‹äœçœź + * 仅ćŻč"circle"æ ·ćŒäž‹æ‹‰ćˆ·æ–°æŽ§ä»¶æœ‰æ•ˆïŒŒç”šäșŽćźšäč‰ćˆ·æ–°æŽ§ä»¶äž‹æ‹‰æ—¶çš„è”·ć§‹äœçœźă€‚ + * 盾ćŻčäșŽWebviewçš„éĄ¶éƒšćç§»é‡ïŒŒæ”ŻæŒç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"ïŒ›ćƒçŽ ć€ŒïŒŒćŠ‚"50px"。 + * é»˜èź€ć€Œäžș"0px"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + offset?: string; + /** + * ćœšäž‹æ‹‰ćŻćˆ·æ–°çŠ¶æ€æ—¶æ˜Ÿç€ș的憅ćźč + * æ”ŻæŒä»„äž‹ć±žæ€§ïŒš + * captionïŒšćœšäž‹æ‹‰ćŻćˆ·æ–°çŠ¶æ€æ—¶äž‹æ‹‰ćˆ·æ–°æŽ§ä»¶äžŠæ˜Ÿç€șçš„æ ‡éą˜ć†…ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + contentdown?: any; + /** + * ćœšé‡Šæ”ŸćŻćˆ·æ–°çŠ¶æ€æ—¶æ˜Ÿç€ș的憅ćźč + * æ”ŻæŒä»„äž‹ć±žæ€§ïŒš + * captionïŒšćœšé‡Šæ”ŸćŻćˆ·æ–°çŠ¶æ€æ—¶äž‹æ‹‰ćˆ·æ–°æŽ§ä»¶äžŠæ˜Ÿç€șçš„æ ‡éą˜ć†…ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + contentover?: any; + /** + * ćœšæ­Łćœšćˆ·æ–°çŠ¶æ€æ—¶æ˜Ÿç€ș的憅ćźč + * æ”ŻæŒä»„äž‹ć±žæ€§ïŒš + * captionïŒšćœšæ­Łćœšćˆ·æ–°çŠ¶æ€æ—¶äž‹æ‹‰ćˆ·æ–°æŽ§ä»¶äžŠæ˜Ÿç€șçš„æ ‡éą˜ć†…ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + contentrefresh?: any; +} + +/** + * WebviewçȘ—揣renderedäș‹ä»¶ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewRenderedEventOptions { + /** + * ćˆ€æ–­çȘ—揣æžČæŸ“ćźŒæˆç±»ćž‹ + * ćŻć–ć€ŒïŒš + * "top"-ä»ŽéĄ¶éƒšć‘äž‹ćç§»22pxæšȘçșżæˆȘć±æŁ€æ”‹æžČæŸ“æ˜ŻćŠćźŒæˆïŒ› + * "bottom"-从ćș•éƒšć‘äžŠćç§»25pxæšȘçșżæŁ€æ”‹æžČæŸ“æ˜ŻćŠćźŒæˆïŒ› + * "center"-从䞭闎æšȘçșżæŁ€æ”‹æžČæŸ“æ˜ŻćŠćźŒæˆïŒ› + * "auto"äžșć…šć±æŁ€æ”‹ïŒˆć·Šă€äž­ă€ćłäž‰æĄç«–çșżïŒ‰ă€‚ + * é»˜èź€ć€Œäžș"auto"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + type?: string; + /** + * ćˆ€æ–­çȘ—揣æžČæŸ“ćźŒæˆé—Žéš”æ—¶é—Ž + * ć•äœäžșmsïŒˆæŻ«ç§’ïŒ‰ïŒŒé»˜èź€ć€Œäžș150ms。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + interval?: number; +} + +/** + * æ›żæąH5æ ‡ć‡†APIé…çœźäżĄæŻ + * ç›źć‰ä»…æ”ŻæŒæ›żæąH5æ ‡ć‡†ćźšäœæŽ„ćŁ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewReplaceWebApiOptions { + /** + * æ›żæąH5æ ‡ć‡†ćźšäœæŽ„ćŁ(navigator.geolocation.*) + * 由äșŽçœ‘ç»œćŽŸć› ïŒŒćœšéƒšćˆ†æ‰‹æœșäžŠćŻèƒœæ— æł•è°ƒç”šæ ‡ć‡†H5ćźšäœæŽ„ćŁ(navigator.geolocation.*)èŽ·ć–ćźšäœæ•°æźïŒŒæ­€æ—¶ćŻä»„é€šèż‡æ­€ć±žæ€§é…çœźäœżç”šćŽŸç”ŸćźšäœæšĄć—æ›żæąæ ‡ć‡†H5ćźšäœæŽ„ćŁïŒŒćŻć–ć€ŒïŒš + * "alldevice" - ćœšæ‰€æœ‰èźŸć€‡äžŠæ›żæąæ ‡ć‡†H5ćźšäœæŽ„ćŁ(navigator.geolocation.*) + * "auto" - è‡ȘćŠšæ›żæąH5æ ‡ć‡†ćźšäœæŽ„ćŁïŒŒä»…ćœšè°ƒç”šæ ‡ć‡†H5ćźšäœæŽ„ćŁæ— æł•èŽ·ć–æ•°æźçš„èźŸć€‡äžŠæ›żæąïŒ› + * "none" - äžæ›żæąH5æ ‡ć‡†ćźšäœæŽ„ćŁ(navigator.geolocation.*)。 + * é»˜èź€ć€Œäžș"none"。 + * æłšæ„ïŒšæ›żæąH5æ ‡ć‡†ćźšäœæŽ„ćŁïŒŒäŒšćŻŒè‡ŽéĄ”éąćŠ èœœé€ŸćșŠć»¶èżŸ100msć·ŠćłïŒŒæŽšèäœżç”š"auto"æšĄćŒă€‚ + * - alldevice: + * ćŒșćˆ¶æ›żæąH5æ ‡ć‡†ćźšäœæŽ„ćŁ(navigator.geolocation.*) + * + * - auto: + * è‡ȘćŠšæ›żæąæ ‡ć‡†H5ćźšäœæŽ„ćŁïŒŒä»…ćœšè°ƒç”šæ ‡ć‡†H5ćźšäœæŽ„ćŁæ— æł•èŽ·ć–æ•°æźçš„èźŸć€‡äžŠæ›żæą + * + * - none: + * äžæ›żæąæ ‡ć‡†H5ćźšäœæŽ„ćŁ(navigator.geolocation.*) + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + geolocation?: 'alldevice' | 'auto' | 'none'; +} + +/** + * JSONćŻčè±ĄïŒŒWebviewçȘ—ćŁçš„çł»ç»ŸçŠ¶æ€æ ćŒșćŸŸæ ·ćŒ + * ä»…ćœšćș”ç”šèźŸçœźäžșæČ‰æ”žćŒçŠ¶æ€æ æ ·ćŒäž‹æœ‰æ•ˆïŒŒéžæČ‰æ”žćŒçŠ¶æ€æ æ ·ćŒäž‹ćżœç•„æ­€ć±žæ€§ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewStatusbarStyles { + /** + * çł»ç»ŸçŠ¶æ€æ ćŒșćŸŸèƒŒæ™Żéąœè‰Č + * 鱜è‰Čć€Œæ ŒćŒäžș"#RRGGBB"ïŒŒćŠ‚"#FF0000"èĄšç€șäžșçșąè‰ČèƒŒæ™Żă€‚ + * é»˜èź€ć€Œäžșćș”甚manifest.jsonäž­plus->statusbar->backgroundć±žæ€§é…çœźçš„ć€ŒïŒŒćŠ‚æžœæœȘé…çœźæ­€ć±žæ€§ć€ŒïŒŒćˆ™äœżç”šçł»ç»Ÿé»˜èź€çŠ¶æ€æ çš„èƒŒæ™Żéąœè‰Č。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + background?: string; +} + +/** + * JSONćŻčè±ĄïŒŒWebviewçȘ—揣ćŻčè±Ąçš„æ ·ćŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewStyles { + /** + * çȘ—ćŁćŠ èœœéĄ”éąæ—¶éąć€–æ·»ćŠ çš„HTTPèŻ·æ±‚ć€Žæ•°æź + * ä»…ćœšWebviewçȘ—ćŁçŹŹäž€æŹĄćŠ èœœéĄ”éąæ—¶äœżç”šïŒŒćŠ‚ç”šæˆ·ç‚čć‡»çš„è§Šć‘çš„é“ŸæŽ„è·łèœŹćˆ™äžć†æ·»ćŠ æ­€éąć€–èŻ·æ±‚ć€Žæ•°æźă€‚ + * ćŠ‚æžœWebviewçȘ—ćŁéžçŹŹäž€æŹĄćŠ èœœéĄ”éąæ—¶äčŸéœ€èŠéąć€–æ·»ćŠ HTTPèŻ·æ±‚ć€Žæ•°æźïŒŒćŻé€šèż‡loadURL()æ–čæł•çš„ć‚æ•°èźŸçœźă€‚ + * ćŠ‚æžœHTTPèŻ·æ±‚ć€Žäž­ć·Čç»ćŒ…ć«éœ€èŠéąć€–æ·»ćŠ çš„ć€Žæ•°æźïŒŒćˆ™æ·»ćŠ çš„èŻ·æ±‚æ•°æźèŠ†ç›–é»˜èź€ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + additionalHttpHeaders?: any; + /** + * çȘ—ćŁćŠšç”»äŒ˜ćŒ–æ–čćŒ + * ćŻć–ć€ŒïŒš + * "auto" - ćŠ‚æžœçȘ—ćŁäž­ć­˜ćœštitleNView或subNViewsçȘ—ćŁćŠšç”»æ—¶çœŸćźžWebviewæŽ§ä»¶ä»ŽćŠšç”»çȘ—ćŁäž­ç§»é™€ćŠ é€ŸïŒˆéżć…çœŸćźžWebviewæžČæŸ“ćœ±ć“ćŠšç”»æ•ˆçŽ‡ïŒ‰ïŒ› + * "none" - çȘ—ćŁćŠšç”»äžäœżç”šäŒ˜ćŒ–ă€‚ + * é»˜èź€ć€Œäžș"auto"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + animationOptimization?: string; + /** + * çȘ—ćŁçš„çŒ“ć­˜æšĄćŒ + * ćŻć–ć€ŒïŒš + * "default" - æ čæźcache-controlć†łćźšæ˜ŻćŠäœżç”šçŒ“ć­˜æ•°æźïŒŒćŠ‚æžœć­˜ćœšçŒ“ć­˜ćč¶äž”æČĄæœ‰èż‡æœŸćˆ™äœżç”šæœŹćœ°çŒ“ć­˜è”„æșïŒŒćŠćˆ™ä»Žçœ‘ç»œèŽ·ć–ïŒ› + * "cacheElseNetwork" - ćȘèŠć­˜ćœšçŒ“ć­˜ïŒˆćłäœżèż‡æœŸïŒ‰æ•°æźćˆ™äœżç”šïŒŒćŠćˆ™ä»Žçœ‘ç»œèŽ·ć–ïŒ› + * "noCache" - äžäœżç”šçŒ“ć­˜æ•°æźïŒŒć…šéƒšä»Žçœ‘ç»œèŽ·ć–ïŒ› + * "cacheOnly" - ä»…äœżç”šçŒ“ć­˜æ•°æźïŒŒäžä»Žçœ‘ç»œèŽ·ć–ïŒˆæłšïŒšćŠ‚æžœæČĄæœ‰çŒ“ć­˜æ•°æźćˆ™äŒšćŻŒè‡ŽćŠ èœœć€±èŽ„ïŒ‰ă€‚ + * é»˜èź€äœżç”š"default"。 + * - default: + * æ čæźcache-controlć†łćźšæ˜ŻćŠäœżç”šçŒ“ć­˜æ•°æźïŒŒćŠ‚æžœć­˜ćœšçŒ“ć­˜ćč¶äž”æČĄæœ‰èż‡æœŸćˆ™äœżç”šæœŹćœ°çŒ“ć­˜è”„æșïŒŒćŠćˆ™ä»Žçœ‘ç»œèŽ·ć–ă€‚ + * + * - cacheElseNetwork: + * ćȘèŠć­˜ćœšçŒ“ć­˜ïŒˆćłäœżèż‡æœŸïŒ‰æ•°æźćˆ™äœżç”šïŒŒćŠćˆ™ä»Žçœ‘ç»œèŽ·ć–ă€‚ + * + * - noCache: + * äžäœżç”šçŒ“ć­˜æ•°æźïŒŒć…šéƒšä»Žçœ‘ç»œèŽ·ć–ă€‚ + * + * - cacheOnly: + * ä»…äœżç”šçŒ“ć­˜æ•°æźïŒŒäžä»Žçœ‘ç»œèŽ·ć–ïŒˆæłšïŒšćŠ‚æžœæČĄæœ‰çŒ“ć­˜æ•°æźćˆ™äŒšćŻŒè‡ŽćŠ èœœć€±èŽ„ïŒ‰ă€‚ + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + cachemode?: 'default' | 'cacheElseNetwork' | 'noCache' | 'cacheOnly'; + /** + * WebviewçȘ—揣è‡ȘćŠšć€„ç†èż”ć›žé”źé€»èŸ‘ + * ćœ“WebviewçȘ—ćŁćœšæ˜Ÿç€șæ ˆéĄ¶ïŒŒćč¶äž”WebviewçȘ—揣侭æČĄæœ‰è°ƒç”šJSç›‘ćŹèż”ć›žé”źïŒˆplus.key.addEventListener('backbutton',...)ïŒ‰æ—¶æŒ‰äž‹èż”ć›žé”źć“ćș”èĄŒäžș。 + * ćŻć–ć€ŒïŒš + * "hide" - 隐藏WebviewçȘ—ćŁïŒŒéšè—ćŠšç”»äžŽäžŠäž€æŹĄè°ƒç”šæ˜Ÿç€șæ—¶èźŸçœźçš„ćŠšç”»ç±»ćž‹ç›žćŻčćș”ïŒˆćŠ‚â€œslide-in-right”ćŻčćș”的慳闭抚画äžș“slid-out-right” + * "close" - 慳闭WebviewçȘ—ćŁïŒŒć…łé—­ćŠšç”»äžŽäžŠäž€æŹĄè°ƒç”šæ˜Ÿç€șæ—¶èźŸçœźçš„ćŠšç”»ç±»ćž‹ç›žćŻčćș”ïŒˆćŠ‚â€œslide-in-right”ćŻčćș”的慳闭抚画äžș“slid-out-right”  + * "none" - äžćšæ“äœœïŒŒć°†èż”ć›žé”źäŒ é€’ç»™äž‹äž€WebviewçȘ—ćŁć€„ç†ïŒ› + * "quit" - 退ć‡șćș”甚。 + * - hide: + * 隐藏WebviewçȘ—ćŁïŒŒéšè—ćŠšç”»äžŽäžŠäž€æŹĄè°ƒç”šæ˜Ÿç€șæ—¶èźŸçœźçš„ćŠšç”»ç±»ćž‹ç›žćŻčćș”ïŒˆćŠ‚â€œslide-in-right”ćŻčćș”的慳闭抚画äžș“slid-out-rightâ€ïŒ‰ă€‚ + * + * - close: + * 慳闭WebviewçȘ—ćŁïŒŒć…łé—­ćŠšç”»äžŽäžŠäž€æŹĄè°ƒç”šæ˜Ÿç€șæ—¶èźŸçœźçš„ćŠšç”»ç±»ćž‹ç›žćŻčćș”ïŒˆćŠ‚â€œslide-in-right”ćŻčćș”的慳闭抚画äžș“slid-out-rightâ€ïŒ‰ă€‚ + * + * - none: + * äžćšæ“äœœïŒŒć°†èż”ć›žé”źäŒ é€’ç»™äž‹äž€WebviewçȘ—ćŁć€„ç†ă€‚ + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + backButtonAutoControl?: 'hide' | 'close' | 'none'; + /** + * çȘ—ćŁçš„èƒŒæ™Żéąœè‰Č + * çȘ—揣ç©ș癜ćŒșćŸŸçš„èƒŒæ™ŻæšĄćŒïŒŒèźŸçœźbackgroundäžș鱜è‰Čć€Œ(ć‚è€ƒCSS Color NamesïŒŒćŻć–ć€Œ/ćć…­èż›ćˆ¶ć€Œ/rgbć€Œ/rgbać€Œ)çȘ—揣äžșç‹Źć æšĄćŒæ˜Ÿç€șïŒˆć æ•ŽäžȘć±ćč•ćŒșćŸŸïŒ‰ïŒ› + * èźŸçœźbackgroundäžș“transparentâ€ïŒŒćˆ™èĄšç€șçȘ—ćŁèƒŒæ™Żé€æ˜ŽïŒŒäžșéžç‹Źć æšĄćŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + background?: string; + /** + * çȘ—ćŁéĄ¶éƒšèƒŒæ™Żéąœè‰Čć€Œ + * çȘ—ćŁć†…ćźčæ»šćŠšćˆ°éĄ¶éƒšäž‹æ‹‰æ—¶ćŻè§ă€‚ + * ćŻć–ć€ŒïŒš + * "#RRGGBB"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"#FF0000"èĄšç€șçșąè‰Č + * "rgba(R,G,B,A)"ïŒŒć…¶äž­R/G/Bćˆ†ćˆ«ä»ŁèĄšçșąè‰Čć€Œ/绿è‰Čć€Œ/蓝è‰Čć€ŒïŒŒæ­Łæ•Žæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-255Aäžș透明ćșŠïŒŒæ”źç‚čæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-10äžșć…šé€æ˜ŽïŒŒ1äžșäžé€æ˜ŽïŒ‰ïŒŒćŠ‚"rgba(255,0,0,0.5)"ïŒŒèĄšç€șçșąè‰ČćŠé€æ˜Žă€‚ + * é»˜èź€ć€Œäžșé€æ˜Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + backgroundColorTop?: string; + /** + * çȘ—揣ćș•éƒšèƒŒæ™Żéąœè‰Č + * çȘ—ćŁć†…ćźčæ»šćŠšćˆ°ćș•éƒšäžŠæ‹‰æ—¶ćŻè§ă€‚ + * ćŻć–ć€ŒïŒš + * "#RRGGBB"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"#FF0000"èĄšç€șçșąè‰Č + * "rgba(R,G,B,A)"ïŒŒć…¶äž­R/G/Bćˆ†ćˆ«ä»ŁèĄšçșąè‰Čć€Œ/绿è‰Čć€Œ/蓝è‰Čć€ŒïŒŒæ­Łæ•Žæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-255Aäžș透明ćșŠïŒŒæ”źç‚čæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-10äžșć…šé€æ˜ŽïŒŒ1äžșäžé€æ˜ŽïŒ‰ïŒŒćŠ‚"rgba(255,0,0,0.5)"ïŒŒèĄšç€șçșąè‰ČćŠé€æ˜Žă€‚ + * é»˜èź€ć€Œäžșé€æ˜Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + backgroundColorBottom?: string; + /** + * æ˜ŻćŠé˜»ćĄžçœ‘ç»œć›Ÿç‰‡çš„ćŠ èœœ + * ćžƒć°”ç±»ćž‹ïŒŒtrueèĄšç€șé˜»ćĄžïŒŒfalseèĄšç€șäžé˜»ćĄžïŒŒé»˜èź€ć€Œäžșfalse。 + * é˜»ćĄžćŽWebviewçȘ—ćŁć°†äžćŠ èœœéĄ”éąäž­äœżç”šçš„æ‰€æœ‰çœ‘ç»œć›Ÿç‰‡ïŒŒćŻé€šèż‡WebviewçȘ—揣ćŻčè±Ąçš„setBlockNetWorkImage()æ–čæł•ćŠšæ€äżźæ”čæ­€çŠ¶æ€ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + blockNetworkImage?: boolean; + /** + * çȘ—ćŁćž‚ç›Žć‘äžŠçš„ćç§»é‡ + * æ”ŻæŒç™Ÿćˆ†æŻ”ă€ćƒçŽ ć€ŒïŒŒé»˜èź€ć€Œæ— ć€ŒïŒˆæ čæźtop撌heightć±žæ€§ć€Œæ„è‡ȘćŠšèźĄçź—ïŒ‰ă€‚ + * ćœ“ćŒæ—¶èźŸçœźäș†top撌heightć€Œæ—¶ïŒŒćżœç•„æ­€ć±žæ€§ć€ŒïŒ› + * ćœ“æœȘèźŸçœźheightć€Œæ—¶ïŒŒćŻé€šèż‡top撌bottomć±žæ€§ć€Œæ„çĄźćźšçȘ—ćŁçš„é«˜ćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + bottom?: string; + /** + * çȘ—ćŁé‡ćˆ°èŸčæĄ†æ˜ŻćŠæœ‰ććŒč效果 + * ćŻć–ć€ŒïŒš + * "none" - èĄšç€șæČĄæœ‰ććŒč效果 + * "vertical" - èĄšç€ș枂目æ–čć‘æœ‰ććŒč效果 + * "horizontal" - èĄšç€șæ°Žćčłæ–čć‘æœ‰ććŒč效果 + * "all" - èĄšç€șćž‚ç›Žć’Œæ°Žćčłæ–čć‘éƒœæœ‰ććŒčæ•ˆæžœă€‚ + * é»˜èź€ć€Œäžș"none"。 + * - none: æČĄæœ‰ććŒč效果 + * - vertical: 枂目æ–čć‘æœ‰ććŒč效果 + * - horizontal: æ°Žćčłæ–čć‘æœ‰ććŒč效果 + * - all: ćž‚ç›Žć’Œæ°Žćčłæ–čć‘éƒœæœ‰ććŒč效果 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + bounce?: 'none' | 'vertical' | 'horizontal' | 'all'; + /** + * çȘ—ćŁć›žćŒč效果ćŒșćŸŸçš„èƒŒæ™Ż + * çȘ—ćŁć›žćŒč效果ćŒșćŸŸèƒŒæ™ŻćŻæ”ŻæŒéąœè‰Čć€Œæˆ–ć›Ÿç‰‡ïŒš + * 鱜è‰Čć€Œæ ŒćŒäžș"#RRGGBB"ïŒŒćŠ‚"#FFFFFF"äžșèźŸçœźç™œè‰ČèƒŒæ™ŻïŒ› + * èƒŒæ™Żć›Ÿäžș"url(%image path%)"ïŒŒćŠ‚"url(./icon.png)"äžșèźŸçœźicon.pngäžșèƒŒæ™Żć›ŸïŒŒć›Ÿç‰‡é‡‡ç”šćčłé“șæšĄćŒç»˜ćˆ¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + bounceBackground?: string; + /** + * çȘ—ćŁć†…ćźčćœæ­ąæ»‘ćŠšçš„ć‡é€ŸćșŠ + * ćœ“WebviewćŠ èœœçš„ć†…ćźčè¶…èż‡ć…¶é«˜ćșŠæ—¶ïŒŒćŻä»„æ‹–æ‹œæ»‘ćŠšć†…ćźčdecelerationRateć±žæ€§æŽ§ćˆ¶æ‰‹æŒ‡æŸćŒ€ćŽéĄ”éąæ»‘ćŠšçš„é€ŸćșŠă€‚ + * èźŸçœźć€Œè¶Šć€§æ‰‹æŒ‡æŸćŒ€ćŽçš„æ»‘ćŠšé€ŸćșŠè¶Šćż«ïŒˆæ»‘ćŠšè·çŠ»è¶Šé•żïŒ‰ïŒŒć…¶ć€ŒćŸŸèŒƒć›Žäžș0.0-1.0ïŒŒé»˜èź€ć€Œäžș0.989。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + decelerationRate?: number; + /** + * çȘ—ćŁçš„ćœé æ–čćŒ + * ćœ“WebviewçȘ—ćŁæ·»ćŠ ćˆ°ćŠć€–äž€äžȘçȘ—ćŁäž­æ—¶ïŒŒćœé æ–čćŒæ‰äŒšç”Ÿæ•ˆïŒŒé‡‡ç”šćœé æ–čćŒæ·»ćŠ äŒšćŻŒè‡ŽćŽŸWebviewçȘ—揣è‡ȘćŠšè°ƒæ•Žć…¶ć€§ć°éżć…ć…¶ć†…ćźčèą«ć­çȘ—ćŁç›–äœă€‚ + * ćŻć–ć€ŒïŒš"top"ïŒŒæŽ§ä»¶ćœé ćˆ™éĄ”éąéĄ¶éƒšïŒ›"bottom"ïŒŒæŽ§ä»¶ćœé ćœšéĄ”éąćș•郚"right"ïŒŒæŽ§ä»¶ćœé ćœšéĄ”éąćłäŸ§ïŒ›"left"ïŒŒæŽ§ä»¶ćœé ćœšéĄ”éąć·ŠäŸ§ă€‚ + * é»˜èź€ć€Œäžș"bottom"。 + * - top: æŽ§ä»¶ćœé ćˆ™éĄ”éąéĄ¶éƒš + * - bottom: æŽ§ä»¶ćœé ćœšéĄ”éąćș•郚 + * - right: æŽ§ä»¶ćœé ćœšéĄ”éąćłäŸ§ + * - left: æŽ§ä»¶ćœé ćœšéĄ”éąć·ŠäŸ§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + dock?: 'top' | 'bottom' | 'right' | 'left'; + /** + * çȘ—ćŁćŠ èœœé”™èŻŻæ—¶è·łèœŹçš„éĄ”éąćœ°ć€ + * ćœ“WebviewçȘ—ćŁæ— æł•ćŠ èœœæŒ‡ćźšçš„urlćœ°ć€æ—¶ïŒˆćŠ‚æœŹćœ°éĄ”éąäžć­˜ćœšïŒŒæˆ–è€…æ— æł•èźżé—źçš„çœ‘ç»œćœ°ć€ïŒ‰ïŒŒæ­€æ—¶äŒšè‡ȘćŠšè·łèœŹćˆ°æŒ‡ćźšçš„é”™èŻŻéĄ”éąćœ°ć€ïŒˆä»…æ”ŻæŒæœŹćœ°éĄ”éąćœ°ć€ïŒ‰ă€‚ + * èźŸçœźäžș“noneâ€ćˆ™ć…łé—­è·łèœŹćˆ°é”™èŻŻéĄ”éąćŠŸèƒœïŒŒæ­€æ—¶éĄ”éąæ˜Ÿç€șWebviewé»˜èź€çš„é”™èŻŻéĄ”éąć†…ćźčă€‚é»˜èź€äœżç”š5+ Runtimeć†…çœźçš„é”™èŻŻéĄ”éąă€‚ + * - none: ć…łé—­ćŠ èœœéĄ”éąé”™èŻŻè‡ȘćŠšè·łèœŹćŠŸèƒœ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + errorPage?: 'none'; + /** + * æ›żæąH5æ ‡ć‡†API + * 甹äșŽè§Łć†łćœšéƒšćˆ†èźŸć€‡äžŠè°ƒç”šH5æ ‡ć‡†ćźšäœæŽ„ćŁćŻèƒœæ— æł•èŽ·ć–ćźšäœæ•°æźçš„é—źéą˜ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + replacewebapi?: PlusWebviewWebviewReplaceWebApiOptions; + /** + * çȘ—ćŁæ˜ŻćŠćŒ€ćŻçĄŹä»¶ćŠ é€Ÿ + * ćžƒć°”ç±»ćž‹ïŒŒtrueèĄšç€șćŒ€ćŻçĄŹä»¶ćŠ é€ŸïŒŒfalseèĄšç€șäžćŒ€ćŻçĄŹä»¶ćŠ é€ŸïŒŒé»˜èź€æƒ…ć†”5+ Runtime䌚æ čæźèźŸć€‡ćźžé™…æ”ŻæŒæƒ…ć†”è‡ȘćŠšé€‰æ‹©æ˜ŻćŠćŒ€ćŻçĄŹä»¶ćŠ é€ŸïŒŒćŻä»„é€šèż‡plus.webview.defaultHardwareAccelerated()æ–čæł•èŽ·ć–é»˜èź€Webviewæ˜ŻćŠćŒ€ćŻçĄŹä»¶ćŠ é€Ÿă€‚ + * 由äșŽäžćŒèźŸć€‡ćŻčçĄŹä»¶ćŠ é€Ÿçš„æ”ŻæŒæƒ…ć†”ć­˜ćœšć·źćŒ‚ïŒŒćŒ€ćŻçĄŹä»¶ćŠ é€ŸèƒœćŠ é€ŸHTMLéĄ”éąçš„æžČ染䜆äčŸäŒšæ¶ˆè€—æ›Žć€šçš„çł»ç»Ÿè”„æșïŒŒä»Žè€ŒćŻŒè‡Žćœšéƒšćˆ†èźŸć€‡äžŠćŻèƒœć‡ș现é—Șć±ă€ć‘è™šă€ćˆ†ć—æžČæŸ“ç­‰é—źéą˜ïŒŒć› æ­€ćœšç‰čćźšèźŸć€‡çš„ç‰čćźšéĄ”éąćŠ‚æžœć‡șçŽ°ä»„äžŠé—źéą˜éœ€èŠæ‰‹ćŠšèźŸçœźć…łé—­çĄŹä»¶ćŠ é€Ÿæ„éżć…ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + hardwareAccelerated?: boolean; + /** + * çȘ—ćŁçš„é«˜ćșŠ + * æ”ŻæŒç™Ÿćˆ†æŻ”ă€ćƒçŽ ć€ŒïŒŒé»˜èź€äžș100%。 + * ćœ“æœȘèźŸçœźheightć±žæ€§ć€Œæ—¶ïŒŒäŒ˜ć…ˆé€šèż‡top撌bottomć±žæ€§ć€Œæ„èźĄçź—çȘ—ćŁçš„é«˜ćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + height?: string; + /** + * çȘ—ćŁäœżç”šçš„ć†…æ ž + * ćŻć–ć€ŒïŒš + * "WKWebview" - 朹iOS8.0ćŠä»„äžŠçł»ç»Ÿäœżç”šWKWebviewć†…æ žïŒŒäœŽç‰ˆæœŹäž‹ä»ç„¶äœżç”šUIWebviewć†…æ žïŒ› + * "UIWebview" - ćœšæ‰€æœ‰ç‰ˆæœŹäžŠéƒœäœżç”šUIWebviewć†…æ žă€‚ + * é»˜èź€ć€Œäžș"UIWebview"。 + * WKWebviewć†…æ žçš„äŒ˜ćŠżæ˜ŻïŒš + * 1. æ»šćŠšæ—¶æ‡’ćŠ èœœçš„ć›Ÿç‰‡äčŸćŻä»„ćźžæ—¶æžČ染UIWebviewćœšæ»šćŠšćœæ­ąćŽæ‰èƒœæžČ染 + * 2. WKWebview的videoæ”ŻæŒAirPlay。 + * 䜆WKWebviewä蟿œ‰äș›é™ćˆ¶ć’Œäžè¶łïŒŒç›źć‰ć·ČçŸ„çš„é—źéą˜æœ‰ïŒš + * 1. äžæ”ŻæŒè·šćŸŸèźŸçœźcookieïŒŒćłplus.navigator.setCookie()APIæ— æł•äœżç”šïŒ› + * 2. æœŹćœ°çš„HTMLéĄ”éąäž­çš„XHRäžæ”ŻæŒè·šćŸŸèźżé—źïŒŒéœ€äœżç”šplus.net.XMLHttpRequestæ„æ›żæąïŒ› + * 3. äžæ”ŻæŒäœżç”šWebSQLïŒŒéœ€äœżç”šindexDBæ„æ›żæąïŒ› + * 4. äžæ”ŻæŒjsćŽŸç”Ÿæ··æ·†ćŠŸèƒœïŒŒéœ€äœżç”šć‰ç«Żjsæ··æ·†æ„æ›żæąïŒ› + * 5. ć†…ć­˜äžè¶łæ—¶äŒšç™œć±ă€‚ + * 銖饔的Webview的kernel朹manifestäž­é…çœźïŒˆplus->kernel->iosïŒ‰ă€‚ + * - WKWebview: + * äœżç”š"WKWebview"ć†…æ žă€‚ + * + * - UIWebview: + * äœżç”š"UIWebview"ć†…æ žă€‚ + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + kernel?: 'WKWebview' | 'UIWebview'; + /** + * çȘ—ćŁæ°Žćčłć‘ćłçš„ćç§»é‡ + * æ”ŻæŒç™Ÿćˆ†æŻ”ă€ćƒçŽ ć€ŒïŒŒé»˜èź€ć€Œäžș0px。 + * æœȘèźŸçœźleftć±žæ€§ć€Œæ—¶ïŒŒäŒ˜ć…ˆé€šèż‡right撌widthć±žæ€§ć€Œæ„èźĄçź—çȘ—ćŁçš„leftäœçœźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + left?: string; + /** + * çȘ—ćŁçš„èŸč距 + * 甹äșŽćźšäœçȘ—ćŁçš„äœçœźïŒŒæ”ŻæŒautoautoèĄšç€șć±…äž­ă€‚è‹„èźŸçœźäș†left、right、top、bottom戙ćŻčćș”çš„èŸčè·ć€Œć€±æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + margin?: string; + /** + * çȘ—ćŁçš„éźçœ© + * 甹äșŽèźŸçœźWebviewçȘ—ćŁçš„éźçœ©ć±‚æ ·ćŒïŒŒéźçœ©ć±‚äŒšèŠ†ç›–Webviewäž­æ‰€æœ‰ć†…ćźčïŒŒćŒ…æ‹Źć­webviewćč¶äž”æˆȘ获webviewçš„æ‰€æœ‰è§Šć±äș‹ä»¶ïŒŒæ­€æ—¶WebviewçȘ—ćŁçš„ç‚čć‡»æ“äœœäŒšè§Šć‘maskClickäș‹ä»¶ă€‚ + * 歗笩äžČç±»ćž‹ïŒŒćŻć–ć€ŒïŒš + * rgbaæ ŒćŒć­—çŹŠäžČïŒŒćźšäč‰çșŻè‰Čéźçœ©ć±‚æ ·ćŒïŒŒćŠ‚"rgba(0,0,0,0.5)"ïŒŒèĄšç€ș黑è‰ČćŠé€æ˜ŽïŒ› + * "none"ïŒŒèĄšç€șäžäœżç”šéźçœ©ć±‚ïŒ› + * é»˜èź€ć€Œäžș"none"ïŒŒćłæ— éźçœ©ć±‚ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + mask?: string; + /** + * çȘ—ćŁçš„äžé€æ˜ŽćșŠ + * 0äžșć…šé€æ˜ŽïŒŒ1äžșäžé€æ˜ŽïŒŒé»˜èź€ć€Œäžș1ïŒŒćłäžé€æ˜Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + opacity?: number; + /** + * æŽ§ćˆ¶Webviewæłšć…„5+ API时æœș + * ćŻć–ć€ŒïŒš + * "ahead" - ć°œé‡æć‰ïŒŒæ‹ŠæˆȘéĄ”éąäž­çœ‘ç»œjsèŻ·æ±‚ćźžçŽ°æć‰æłšć…„ïŒŒćŠ‚æžœæČĄæœ‰æ‹ŠæˆȘ戰jsèŻ·æ±‚ćˆ™ćœšéĄ”éąloadedæ—¶æłšć…„ïŒ› + * "normal" - éĄ”éąloadedæ—¶æłšć…„ïŒ› + * "later" - èŸƒæ™šćœšæłšć…„ïŒŒćœšloadedäș‹ä»¶ć‘ç”ŸćŽ2sć†æłšć…„ïŒŒplusreadyäș‹ä»¶ćŒæ ·ć»¶èżŸïŒ› + * "none" - äžæłšć…„ïŒŒéĄ”éąæ— æł•è°ƒç”š5+ APIïŒŒäžè§Šć‘plusreadyäș‹ä»¶ă€‚ + * é»˜èź€ć€Œäžș"normal"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + plusrequire?: string; + /** + * çȘ—ćŁçš„èż›ćșŠæĄæ ·ćŒ + * èźŸçœźæ­€ć±žæ€§ćˆ™ćœšWebviewçȘ—ćŁçš„éĄ¶éƒšæ˜Ÿç€șèż›ćșŠæĄïŒŒćŻé…çœźèż›ćșŠæĄéąœè‰ČćŠé«˜ćșŠă€‚ + * èźŸçœźæ­€ć±žæ€§ć€Œäžșundefined或nullćˆ™éšè—èż›ćșŠæĄă€‚ + * é»˜èź€äžæ˜Ÿç€șèż›ćșŠæĄă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + progress?: PlusWebviewWebviewProgressStyles; + /** + * çȘ—ćŁçš„äŸ§æ»‘èż”ć›žćŠŸèƒœ + * ćŻć–ć€ŒïŒš + * "none"-æ— äŸ§æ»‘èż”ć›žćŠŸèƒœïŒ› + * "close"-äŸ§æ»‘èż”ć›žć…łé—­WebviewçȘ—ćŁïŒ› + * "hide"-äŸ§æ»‘èż”ć›žéšè—webviewçȘ—ćŁă€‚ + * - none: æ— äŸ§æ»‘èż”ć›žćŠŸèƒœ + * - close: äŸ§æ»‘èż”ć›žć…łé—­WebviewçȘ—揣 + * - hide: äŸ§æ»‘èż”ć›žéšè—webviewçȘ—揣 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + popGesture?: 'none' | 'close' | 'hide'; + /** + * çȘ—ćŁäž‹æ‹‰ćˆ·æ–°é…çœź + * èźŸçœźçȘ—ćŁæ˜ŻćŠćŒ€ćŻäž‹æ‹‰ćˆ·æ–°ćŠŸèƒœćŠæ ·ćŒă€‚ + * ćŒ€ćŻäž‹æ‹‰ćˆ·æ–°ćŽćŻé€šèż‡ç›‘ćŹçȘ—ćŁçš„"pullToRefresh"äș‹ä»¶ć€„ç†äž‹æ‹‰ćˆ·æ–°äžšćŠĄé€»èŸ‘ïŒŒæ›Žæ–°æ“äœœćꌿˆćŽè°ƒç”šçȘ—ćŁçš„endPullToRefreshæ–čæł•ç»“æŸäž‹æ‹‰ćˆ·æ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + pullToRefresh?: PlusWebviewWebviewPullToRefreshStyles; + /** + * çȘ—揣æžČæŸ“æšĄćŒ + * æ”ŻæŒä»„äž‹ć±žæ€§ć€ŒïŒš + * "onscreen" - WebviewçȘ—ćŁćœšć±ćč•ćŒșćŻè§æ—¶æžČæŸ“ïŒŒäžćŻè§æ—¶äžèż›èĄŒæžČæŸ“ïŒŒæ­€æ—¶èƒœć‡ć°‘ć†…ć­˜äœżç”šé‡ïŒ› + * "always" - Webviewćœšä»»äœ•æ—¶ć€™éƒœæžČæŸ“ïŒŒćœšć†…ć­˜èŸƒć€§çš„èźŸć€‡äžŠäœżç”šïŒŒèą«éźæŒĄçš„çȘ—ćŁćœšæ­€äž­æšĄćŒäž‹æ˜Ÿç€șçš„æ—¶ć€™äŒšæœ‰æ›Žæ”ç•…çš„æ•ˆæžœă€‚ + * é»˜èź€ć€Œäžș"onscreen"。 + * 仅Androidćčłć°æ”ŻæŒă€‚ + * - onscreen: WebviewçȘ—ćŁćœšć±ćč•ćŒșćŻè§æ—¶æžČæŸ“ïŒŒäžćŻè§æ—¶äžèż›èĄŒæžČæŸ“ïŒŒæ­€æ—¶èƒœć‡ć°‘ć†…ć­˜äœżç”šé‡ + * - always: Webviewćœšä»»äœ•æ—¶ć€™éƒœæžČæŸ“ïŒŒćœšć†…ć­˜èŸƒć€§çš„èźŸć€‡äžŠäœżç”šïŒŒèą«éźæŒĄçš„çȘ—ćŁćœšæ­€äž­æšĄćŒäž‹æ˜Ÿç€șçš„æ—¶ć€™äŒšæœ‰æ›Žæ”ç•…çš„æ•ˆæžœ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + render?: 'onscreen' | 'always'; + /** + * çȘ—ćŁæ°Žćčłć‘ć·Šçš„ćç§»é‡ + * æ”ŻæŒç™Ÿćˆ†æŻ”ă€ćƒçŽ ć€ŒïŒŒé»˜èź€æ— ć€ŒïŒˆæ čæźleft撌widthć±žæ€§ć€Œæ„è‡ȘćŠšèźĄçź—ïŒ‰ă€‚ + * ćœ“èźŸçœźäș†left撌widthć€Œæ—¶ïŒŒćżœç•„æ­€ć±žæ€§ć€ŒïŒ› + * ćœ“æœȘèźŸçœźwidthć€Œæ—¶ïŒŒćŻé€šèż‡left撌bottomć±žæ€§ć€Œæ„çĄźćźšçȘ—ćŁçš„ćźœćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + right?: string; + /** + * çȘ—ćŁæ˜ŻćŠćŻçŒ©æ”Ÿ + * çȘ—ćŁèźŸçœźäžșćŻçŒ©æ”ŸïŒˆscalable:trueïŒ‰æ—¶ïŒŒç”šæˆ·ćŻé€šèż‡ćŒæŒ‡æ“äœœæ”Ÿć€§æˆ–çŒ©ć°éĄ”éąïŒŒæ­€æ—¶htmléĄ”éąćŻé€šèż‡meta节ç‚čèźŸçœźâ€œname="viewport" content="user-scalable=no"â€æ„é™ćˆ¶éĄ”éąäžćŻçŒ©æ”Ÿă€‚ + * çȘ—ćŁèźŸçœźäžșäžćŻçŒ©æ”ŸïŒˆscalable:falseïŒ‰æ—¶ïŒŒç”šæˆ·äžćŻé€šèż‡ćŒæŒ‡æ“äœœæ”Ÿć€§æˆ–çŒ©ć°éĄ”éąïŒŒćłäœżéĄ”éąäž­çš„meta节ç‚čä蟿— æł•ćŒ€ćŻćŻçŒ©æ”ŸćŠŸèƒœă€‚ + * é»˜èź€ć€ŒäžșfalseïŒŒćłäžćŻçŒ©æ”Ÿă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + scalable?: boolean; + /** + * çȘ—ćŁæ˜ŻćŠæ˜Ÿç€șæ»šćŠšæĄ + * 甹äșŽæŽ§ćˆ¶çȘ—ćŁæ»šćŠšæĄæ ·ćŒïŒŒćŻć–ć€ŒïŒš + * "all"ïŒšćž‚ç›Žć’Œæ°Žćčłæ»šćŠšæĄéƒœæ˜Ÿç€ș + * "vertical"仅星ç€șćž‚ç›Žæ»šćŠšæĄïŒ› + * "horizontal"仅星ç€șæ°Žćčłæ»šćŠšæĄïŒ› + * "none"ïŒšćž‚ç›Žć’Œæ°Žćčłæ»šćŠšæĄéƒœäžæ˜Ÿç€ș。 + * é»˜èź€ć€Œäžș"all"ïŒŒćłćž‚ç›Žć’Œæ°Žćčłæ»šćŠšæĄéƒœæ˜Ÿç€ș。 + * æłšæ„ïŒšæ˜Ÿç€șæ»šćŠšæĄçš„ć‰ææĄä»¶æ˜ŻçȘ—ćŁäž­çš„ć†…ćźčè¶…èż‡çȘ—ćŁæ˜Ÿç€șçš„ćźœæˆ–é«˜ă€‚ + * - all: ćž‚ç›Žć’Œæ°Žćčłæ»šćŠšæĄéƒœæ˜Ÿç€ș + * - vertical: 仅星ç€șćž‚ç›Žæ»šćŠšæĄ + * - horizontal: 仅星ç€șæ°Žćčłæ»šćŠšæĄ + * - none: ćž‚ç›Žć’Œæ°Žćčłæ»šćŠšæĄéƒœäžæ˜Ÿç€ș + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + scrollIndicator?: 'all' | 'vertical' | 'horizontal' | 'none'; + /** + * ç‚čć‡»èźŸć€‡çš„çŠ¶æ€æ æ—¶æ˜ŻćŠæ»šćŠšèż”ć›žè‡łéĄ¶éƒš + * trueèĄšç€șç‚čć‡»èźŸć€‡çš„çŠ¶æ€æ ćŻä»„æ»šćŠšèż”ć›žè‡łéĄ¶éƒšïŒŒfalseèĄšç€șç‚čć‡»èźŸć€‡çš„çŠ¶æ€æ äžćŻä»„ïŒŒé»˜èź€ć€Œäžștrue。 + * æ­€ćŠŸèƒœä»…iOSćčłć°æ”ŻæŒïŒŒćœšiPhone䞊有䞔ćȘ有䞀äžȘWebviewçȘ—ćŁçš„scrollsToTopć±žæ€§ć€Œäžștrueæ—¶æ‰ç”Ÿæ•ˆïŒŒæ‰€ä»„ćœšæ˜Ÿç€ș撌慳闭WebviewçȘ—ćŁæ—¶éœ€ćŠšæ€æ›Žæ–°æ‰€æœ‰Webview的scrollsToTopć€ŒïŒŒć·ČçĄźäżæ­€ćŠŸèƒœç”Ÿæ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + scrollsToTop?: boolean; + /** + * æ˜ŻćŠćŻćˆ†äș«çȘ—ćŁćŠ èœœçš„é“ŸæŽ„朰杀 + * ćœšæ”ćș”ç”šçŽŻćąƒïŒˆæ”ćș”甚/5+æ”è§ˆć™šïŒ‰äž­ćŻé€šèż‡ćˆ†äș«æŒ‰é’źćˆ†äș«éĄ”éąé“ŸæŽ„ćœ°ć€ïŒŒ + * ćŻć–ć€ŒïŒš + * true - 揯戆äș«çȘ—ćŁćŠ èœœéĄ”éąé“ŸæŽ„ćœ°ć€ïŒ› + * false - 侍揯戆äș«çȘ—ćŁćŠ èœœçš„éĄ”éąé“ŸæŽ„ćœ°ć€ïŒŒæ­€æ—¶ćˆ†äș«çš„æ˜Żćș”甚。 + * é»˜èź€ć€Œć€Œäžștrue。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + shareable?: boolean; + /** + * ćŒčć‡șçł»ç»ŸèœŻé”źç›˜æšĄćŒ + * ćŻé€‰ć€ŒïŒšâ€œadjustPan”- ćŒčć‡șèœŻé”źç›˜æ—¶WebviewçȘ—揣è‡ȘćŠšäžŠç§»ïŒŒä»„äżèŻćœ“ć‰èŸ“ć…„æĄ†ćŻè§ïŒ›â€œadjustResize”- è‡ȘćŠšè°ƒæ•ŽWebviewçȘ—ćŁć€§ć°ïŒˆć±ćč•ćŒșćŸŸć‡ćŽ»èœŻé”źç›˜ćŒșćŸŸïŒ‰ïŒŒćŒæ—¶è‡ȘćŠšæ»šćŠšWebviewäżèŻèŸ“ć…„æĄ†ćŻè§ă€‚ + * é»˜èź€ć€Œäžș“adjustPan”。 + * - adjustPan: ćŒčć‡șèœŻé”źç›˜æ—¶WebviewçȘ—揣è‡ȘćŠšäžŠç§»ïŒŒä»„äżèŻćœ“ć‰èŸ“ć…„æĄ†ćŻè§ + * - adjustResize: è‡ȘćŠšè°ƒæ•ŽWebviewçȘ—ćŁć€§ć°ïŒˆć±ćč•ćŒșćŸŸć‡ćŽ»èœŻé”źç›˜ćŒșćŸŸïŒ‰ïŒŒćŒæ—¶è‡ȘćŠšæ»šćŠšWebviewäżèŻèŸ“ć…„æĄ†ćŻè§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + softinputMode?: 'adjustPan' | 'adjustResize'; + /** + * çȘ—ćŁçŠ¶æ€æ æ ·ćŒ + * ä»…ćœšćș”ç”šèźŸçœźäžșæČ‰æ”žćŒçŠ¶æ€æ æ ·ćŒäž‹æœ‰æ•ˆïŒŒèźŸçœźæ­€ć±žæ€§ćŽć°†è‡ȘćŠšäżç•™çł»ç»ŸçŠ¶æ€æ ćŒșćŸŸäžèą«WebviewçȘ—ćŁć ç”šïŒˆćłWebviewçȘ—揣靾æČ‰æ”žćŒæ ·ćŒæ˜Ÿç€șïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + statusbar?: PlusWebviewWebviewStatusbarStyles; + /** + * 漚äč‰çȘ—ćŁçš„ćŽŸç”Ÿć­View控件 + * æ•°ç»„ç±»ćž‹ïŒŒćŻé€šèż‡é…çœźéĄčèźŸçœźćŽŸç”Ÿć­ViewæŽ§ä»¶ïŒŒæŻäžȘé…çœźéĄčćŻčćș”æ·»ćŠ äž€äžȘ掟生歐ViewæŽ§ä»¶ă€‚ + * é€šèż‡WebviewçȘ—ćŁçš„getSubNViews()æ–čæł•ćŻèŽ·ć–ćŽŸç”Ÿć­View控件ćŻčè±Ąæ•°ç»„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + subNViews?: PlusWebview []; + /** + * 漚äč‰çȘ—ćŁçš„æ ‡éą˜æ æŽ§ä»¶æ ·ćŒ + * èźŸçœźæ­€ć±žæ€§ć€Œćˆ™èĄšæ˜Žćˆ›ć»șWebviewçȘ—ćŁçš„æ ‡éą˜æ æŽ§ä»¶ïŒŒćč¶ćŻé€šèż‡ć…¶ć±žæ€§ć€ŒèźŸçœźèƒŒæ™Żéąœè‰Čă€æ–‡æœŹć†…ćźčă€æ–‡æœŹéąœè‰Č等。 + * é€šèż‡WebviewçȘ—ćŁçš„getTitleNView()æ–čæł•ćŻèŽ·ć–æ ‡éą˜æ æŽ§ä»¶ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + titleNView?: PlusWebviewWebviewTitleNViewStyles; + /** + * çȘ—ćŁćž‚ç›Žć‘äž‹çš„ćç§»é‡ + * æ”ŻæŒç™Ÿćˆ†æŻ”ă€ćƒçŽ ć€ŒïŒŒé»˜èź€ć€Œäžș0px。 + * æœȘèźŸçœźtopć±žæ€§ć€Œæ—¶ïŒŒäŒ˜ć…ˆé€šèż‡bottom撌heightć±žæ€§ć€Œæ„èźĄçź—çȘ—ćŁçš„topäœçœźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + top?: string; + /** + * çȘ—揣漹äč‰çȘ—ćŁć˜æąçš„ćŠšç”»æ•ˆæžœ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + transition?: PlusWebviewWebviewTransition; + /** + * çȘ—揣漹äč‰çȘ—ćŁć˜ćœąæ•ˆæžœ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + transform?: PlusWebviewWebviewTransform; + /** + * WebviewçȘ—ćŁçš„æŽ’ç‰ˆäœçœź + * ćœ“WebviewçȘ—ćŁæ·»ćŠ ćˆ°ćŠć€–äž€äžȘçȘ—ćŁäž­æ—¶ïŒŒæŽ’ç‰ˆäœçœźæ‰äŒšç”Ÿæ•ˆïŒŒæŽ’ç‰ˆäœçœźć†łćźšć­çȘ—ćŁćœšçˆ¶çȘ—ćŁäž­çš„ćźšäœæ–čćŒă€‚ + * ćŻć–ć€ŒïŒš"static"ïŒŒæŽ§ä»¶ćœšéĄ”éąäž­æ­ŁćžžćźšäœïŒŒćŠ‚æžœéĄ”éąć­˜ćœšæ»šćŠšæĄćˆ™éšçȘ—ćŁć†…ćźčæ»šćŠšïŒ›"absolute"ïŒŒæŽ§ä»¶ćœšéĄ”éąäž­ç»ćŻčćźšäœïŒŒćŠ‚æžœéĄ”éąć­˜ćœšæ»šćŠšæĄäžéšçȘ—ćŁć†…ćźčæ»šćŠšïŒ›"dock"ïŒŒæŽ§ä»¶ćœšéĄ”éąäž­ćœé ïŒŒćœé çš„äœçœźç”±dockć±žæ€§ć€Œć†łćźšă€‚ + * é»˜èź€ć€Œäžș"absolute"。 + * - static: æŽ§ä»¶ćœšéĄ”éąäž­æ­ŁćžžćźšäœïŒŒćŠ‚æžœéĄ”éąć­˜ćœšæ»šćŠšæĄćˆ™éšçȘ—ćŁć†…ćźčæ»šćŠš + * - absolute: æŽ§ä»¶ćœšéĄ”éąäž­ç»ćŻčćźšäœïŒŒćŠ‚æžœéĄ”éąć­˜ćœšæ»šćŠšæĄäžéšçȘ—ćŁć†…ćźčæ»šćŠš + * - dock: æŽ§ä»¶ćœšéĄ”éąäž­ćœé ïŒŒćœé çš„äœçœźç”±dockć±žæ€§ć€Œć†łćźš + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + position?: 'static' | 'absolute' | 'dock'; + /** + * ç”šæˆ·æ˜ŻćŠćŻé€‰æ‹©ć†…ćźč + * ćŻć–ć€ŒïŒš + * true - èĄšç€șćŻé€‰æ‹©ć†…ćźčïŒŒç”šæˆ·ćŻé€šèż‡é•żæŒ‰æ„é€‰æ‹©éĄ”éąć†…ćźčïŒŒćŠ‚æ–‡æœŹć†…ćźčé€‰æ‹©ćŽćŻä»„ćŒčć‡șçł»ç»Ÿć€ćˆ¶çČ˜èŽŽèœć•ïŒ› + * false - èĄšç€șäžćŻé€‰æ‹©ć†…ćźčïŒŒç”šæˆ·äžćŻé€šèż‡é•żæŒ‰æ„é€‰æ‹©éĄ”éąć†…ćźč。 + * é»˜èź€ć€Œäžștrue。 + * æłšæ„ïŒšćœšWebéĄ”éąäž­ćŻé€šèż‡CSS的user-selectćŻč捕äžȘéĄ”éąć…ƒçŽ èż›èĄŒæŽ§ćˆ¶ïŒŒć‰ææ˜ŻWebviewćŻčè±Ąçš„userSelectèźŸçœźäžștrueïŒŒćŠćˆ™CSSèźŸçœźçš„user-selectć€±æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + userSelect?: boolean; + /** + * è§†éą‘ć…šć±æ’­æ”Ÿæ—¶çš„æ˜Ÿç€șæ–č搑 + * ćŻć–ć€ŒïŒš + * "auto": è‡ȘćŠšé€‚é…ïŒŒćŠ‚æžœćœ“ć‰éĄ”éąç«–ć±ïŒŒćˆ™ç«–ć±æ˜Ÿç€șïŒ›ćŠ‚æžœćœ“ć‰éĄ”éąæšȘ盘星ç€șïŒŒćˆ™æšȘć±ïŒ›ćŠ‚æžœćœ“ć‰éĄ”éąè‡ȘćŠšæ„Ÿćș”ïŒŒćˆ™è‡ȘćŠšæ„Ÿćș”æšȘç«–ć±ćˆ‡æąă€‚ + * "portrait-primary": ç«–ć±æ­Łæ–čć‘ïŒ› + * "portrait-secondary": ç«–ć±ćæ–čć‘ïŒŒć±ć蕿­Łæ–čć‘æŒ‰éĄșæ—¶é’ˆæ—‹èœŹ180° + * "landscape-primary": æšȘć±æ­Łæ–čć‘ïŒŒć±ć蕿­Łæ–čć‘æŒ‰éĄșæ—¶é’ˆæ—‹èœŹ90° + * "landscape-secondary": æšȘć±æ–čć‘ïŒŒć±ć蕿­Łæ–čć‘æŒ‰éĄșæ—¶é’ˆæ—‹èœŹ270° + * "landscape": æšȘć±æ­Łæ–čć‘æˆ–ćæ–čć‘ïŒŒæ čæźèźŸć€‡é‡ćŠ›æ„Ÿćș”晚è‡ȘćŠšè°ƒæ•ŽïŒ› + * é»˜èź€ć€Œäžș“auto”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + videoFullscreen?: string; + /** + * çȘ—ćŁçš„ćźœćșŠ + * æ”ŻæŒç™Ÿćˆ†æŻ”ă€ćƒçŽ ć€ŒïŒŒé»˜èź€äžș100%。æœȘèźŸçœźwidthć±žæ€§ć€Œæ—¶ïŒŒćŻćŒæ—¶èźŸçœźleft撌rightć±žæ€§ć€Œæ”č揘çȘ—ćŁçš„é»˜èź€ćźœćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + width?: string; + /** + * çȘ—ćŁçš„ć †ć éĄșćșć€Œ + * æ‹„æœ‰æ›Žé«˜ć †ć éĄșćșçš„çȘ—ćŁæ€»æ˜ŻäŒšć€„äșŽć †ć éĄșćșèŸƒäœŽçš„çȘ—ćŁçš„ć‰éąïŒŒæ‹„æœ‰ç›žćŒć †ć éĄșćșçš„çȘ—ćŁćŽè°ƒç”šshowæ–čæł•ćˆ™ćœšć‰éąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + zindex?: number; +} + +/** + * 䞀组甚äșŽćźšäč‰éĄ”éąæˆ–æŽ§ä»¶ć˜ćœąçš„ć±žæ€§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewTransform { + /** + * æš‚äžæ”ŻæŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + rotate?: string; + /** + * æš‚äžæ”ŻæŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + translate?: string; + /** + * æš‚äžæ”ŻæŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + scale?: string; + /** + * æš‚äžæ”ŻæŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + skew?: string; + /** + * æš‚äžæ”ŻæŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + matrix?: string; +} + +/** + * 䞀组甚äșŽćźšäč‰éĄ”éąæˆ–æŽ§ä»¶èœŹæąæ•ˆæžœçš„ć±žæ€§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewTransition { + /** + * äș§ç”Ÿć˜æąæ•ˆæžœçš„ć±žæ€§ + * é»˜èź€ć€Œäžș"all"ïŒŒæš‚äžæ”ŻæŒć…¶ćźƒć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + property?: string; + /** + * ć˜æąæŒç»­çš„æ—¶é—Ž + * é»˜èź€ć€Œäžș0ïŒŒćłæ— ćŠšç”»æ•ˆæžœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + duration?: string; + /** + * çȘ—ćŁć˜æąæ•ˆæžœ + * ćŻć–ć€ŒïŒš + * "linear"ïŒšćŒ€é€Ÿć˜ćŒ–ïŒŒćŒ€é€ŸćŠšç”»æ•ˆæžœïŒ› + * "ease-in"ïŒšćŒ€ćŠ é€Ÿć˜ćŒ–ïŒŒé€æžć˜ćż«çš„ćŠšç”»æ•ˆæžœïŒ› + * "ease-out"ïŒšćŒ€ć‡é€Ÿć˜ćŒ–ïŒŒé€æžć˜æ…ąçš„ćŠšç”»æ•ˆæžœïŒ› + * "ease-in-out"ïŒšć…ˆćŠ é€ŸćŽć‡é€Ÿć˜ćŒ–ïŒŒć…ˆć˜ćż«ćŽć˜æ…ąçš„ćŠšç”»æ•ˆæžœă€‚ + * é»˜èź€ć€Œäžș"ease-in-out"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + timingfunction?: string; +} + +/** + * 拊æˆȘWebviewçȘ—ćŁè”„æșèŻ·æ±‚çš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewOverrideResourceOptions { + /** + * ćŒș配需芁拊æˆȘèŻ·æ±‚è”„æșçš„URL朰杀 + * æ”ŻæŒæ­Łćˆ™èĄšèŸŸćŒïŒŒé»˜èź€ć€Œäžșç©ș歗笩äžČïŒˆćłäžæ‹ŠæˆȘïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + match?: string; + /** + * 拊æˆȘé‡ćźšć‘çš„è”„æșćœ°ć€ + * ä»…æ”ŻæŒæœŹćœ°è”„æșćœ°ć€ïŒŒćŠ‚"_www"、"_doc"、"_downloads"、"_documents"ç­‰ćŒ€ć€Žçš„è·ŻćŸ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + redirect?: string; + /** + * é‡ćźšć‘çš„è”„æșæ•°æźç±»ćž‹ + * RFC2045/RFC2046/RFC2047/RFC2048/RFC2049è§„èŒƒäž­ćźšäč‰çš„æ•°æźç±»ćž‹ă€‚ + * ćŠ‚æ™źé€šæ–‡æœŹïŒˆtext/plainïŒ‰ă€PNGć›Ÿćƒ(image/png)、GIFć›Ÿćœą(image/gif)、JPEGć›Ÿćœą(image/jpeg)。 + * ćŠ‚æžœæœȘæŒ‡ćźšmimeç±»ćž‹ïŒŒćˆ™æ čæźé‡ćźšć‘è”„æșè·ŻćŸ„è‡Ș抹ćŒș配。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + mime?: string; + /** + * é‡ćźšć‘çš„è”„æșæ•°æźçŒ–码 + * 橂æœȘèźŸçœźïŒŒćˆ™äœżç”šé»˜èź€ć€Œ"UTF-8"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + encoding?: string; + /** + * èźŸçœźé‡ćźšć‘è”„æșæ•°æźçš„httpć€Žæ•°æź + * ćŻèźŸçœźæ ‡æłšhttpć€Žæ•°æźïŒˆćŠ‚Content-type,äčŸćŻèźŸçœźè‡Ș漚ä艿•°æźă€‚ + * é€šćžžćŻé€šèż‡æ­€ć±žæ€§æ„èźŸçœźæ‹ŠæˆȘ蔄æșçš„çŒ“ć­˜ç­–ç•„ïŒˆćŠ‚Cache-controlïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + header?: any; +} + +/** + * 拊æˆȘWebviewçȘ—揣URLèŻ·æ±‚çš„ć±žæ€§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewOverrideUrlOptions { + /** + * 拊æˆȘURLèŻ·æ±‚ç”Ÿæ•ˆæ—¶æœș + * ćŻć–ć€ŒïŒš + * "instant" - èĄšç€șç«‹ćłç”Ÿæ•ˆïŒŒćłè°ƒç”šoverrideUrlLoadingæ–čæł•ćŽç«‹ćłç”Ÿæ•ˆïŒ› + * "touchstart" - èĄšç€ș甚户操䜜WebviewçȘ—ćŁïŒˆè§Šć‘touchstartäș‹ä»¶ïŒ‰ćŽç”Ÿæ•ˆïŒŒćŠ‚æžœç”šæˆ·æČĄæœ‰æ“äœœWebviewçȘ—ćŁćˆ™äžćŻčURLèŻ·æ±‚æ“äœœèż›èĄŒæ‹ŠæˆȘ怄理。 + * é»˜èź€ć€Œäžș"instant"。 + * - instant: + * ç«‹ćłç”Ÿæ•ˆïŒŒćłè°ƒç”šoverrideUrlLoadingæ–čæł•ćŽç«‹ćłç”Ÿæ•ˆă€‚ + * + * - : + * èĄšç€ș甚户操䜜WebviewçȘ—ćŁïŒˆè§Šć‘touchstartäș‹ä»¶ïŒ‰ćŽç”Ÿæ•ˆă€‚ + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + effect?: 'instant' | ''; + /** + * 拊æˆȘæšĄćŒ + * ćŻć–ć€ŒïŒš + * "allow"èĄšç€șæ»Ąè¶łmatchć±žæ€§ćźšäč‰çš„æĄä»¶æ—¶äžæ‹ŠæˆȘurlç»§ç»­ćŠ èœœïŒŒäžæ»Ąè¶łmatchć±žæ€§ćźšäč‰çš„æĄä»¶æ—¶æ‹ŠæˆȘurlè·łèœŹćč¶è§Šć‘callbackć›žè°ƒïŒ› + * "reject"èĄšç€șæ»Ąè¶łmatchć±žæ€§ćźšäč‰çš„æäș€æ—¶æ‹ŠæˆȘurlè·łèœŹćč¶è§Šć‘callbackć›žè°ƒïŒŒäžæ»Ąè¶łmatchć±žæ€§ćźšäč‰çš„æĄä»¶æ—¶äžæ‹ŠæˆȘurlç»§ç»­ćŠ èœœă€‚ + * é»˜èź€ć€Œäžș"reject"。 + * - allow: + * æ»Ąè¶łmatchć±žæ€§ćźšäč‰çš„æĄä»¶æ—¶äžæ‹ŠæˆȘurlç»§ç»­ćŠ èœœïŒŒäžæ»Ąè¶łmatchć±žæ€§ćźšäč‰çš„æĄä»¶æ—¶æ‹ŠæˆȘurlè·łèœŹćč¶è§Šć‘callbackć›žè°ƒă€‚ + * + * - reject: + * æ»Ąè¶łmatchć±žæ€§ćźšäč‰çš„æäș€æ—¶æ‹ŠæˆȘurlè·łèœŹćč¶è§Šć‘callbackć›žè°ƒïŒŒäžæ»Ąè¶łmatchć±žæ€§ćźšäč‰çš„æĄä»¶æ—¶äžæ‹ŠæˆȘurlç»§ç»­ćŠ èœœă€‚ + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + mode?: 'allow' | 'reject'; + /** + * ćŒșé…æ˜ŻćŠéœ€èŠć€„ç†çš„URLèŻ·æ±‚ + * æ”ŻæŒæ­Łćˆ™èĄšèŸŸćŒïŒŒé»˜èź€ć€ŒäžșćŻč所有URLćœ°ć€ç”Ÿæ•ˆïŒˆç›žćœ“äșŽæ­Łćˆ™èĄšèŸŸćŒâ€œ.*â€ïŒ‰ă€‚ + * ćŠ‚æžœmodeć€Œäžș"allow"ćˆ™ć…èźžćŒș配的URLèŻ·æ±‚è·łèœŹïŒŒmodeć€Œäžș"reject"ćˆ™æ‹ŠæˆȘćŒș配的URLèŻ·æ±‚ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + match?: string; + /** + * 排陀拊æˆȘć€„ç†èŻ·æ±‚ç±»ćž‹ + * 䞍拊æˆȘć€„ç†æŒ‡ćźšç±»ćž‹çš„URLèŻ·æ±‚ïŒŒç›ŽæŽ„äœżç”šçł»ç»Ÿé»˜èź€ć€„ç†é€»èŸ‘ă€‚ + * ćŻć–ć€ŒïŒš + * "none"èĄšç€ș䞍排陀任䜕URLèŻ·æ±‚ïŒˆćłæ‹ŠæˆȘć€„ç†æ‰€æœ‰URLèŻ·æ±‚ïŒ‰ïŒ› + * "redirect"èĄšç€ș排陀拊æˆȘ怄理301/302è·łèœŹçš„èŻ·æ±‚ïŒˆè°šæ…Žäœżç”šïŒŒéža标筟的hrefè§Šć‘çš„URLèŻ·æ±‚ćŻèƒœäŒšèŻŻćˆ€æ–­äžș302è·łèœŹïŒ‰ă€‚ + * é»˜èź€ć€Œäžș"none"。 + * - none: + * 䞍排陀任䜕URLèŻ·æ±‚ïŒˆćłæ‹ŠæˆȘć€„ç†æ‰€æœ‰URLèŻ·æ±‚ïŒ‰ă€‚ + * + * - redirect: + * 排陀拊æˆȘ怄理301/302è·łèœŹçš„èŻ·æ±‚ïŒˆè°šæ…Žäœżç”šïŒŒéža标筟的hrefè§Šć‘çš„URLèŻ·æ±‚ćŻèƒœäŒšèŻŻćˆ€æ–­äžș302è·łèœŹïŒ‰ă€‚ + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + exclude?: 'none' | 'redirect'; +} + +/** + * 监搬WebviewçȘ—ćŁè”„æșćŠ èœœçš„ć±žæ€§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewListenResourceOptions { + /** + * ćŒșé…æ˜ŻćŠéœ€èŠć€„ç†çš„URL蔄æș + * æ”ŻæŒæ­Łćˆ™èĄšèŸŸćŒïŒŒé»˜èź€ć€ŒäžșćŻč所有URL蔄æșèŻ·æ±‚ç”Ÿæ•ˆïŒˆç›žćœ“äșŽæ­Łćˆ™èĄšèŸŸćŒâ€œ.*â€ïŒ‰ă€‚ + * ćŠ‚æžœWebviewćŠ èœœçš„è”„æșćŒșé…æĄä»¶ïŒŒćˆ™è§Šć‘ć›žè°ƒäș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + match?: string; +} + +/** + * XMLHttpRequestæšĄć—çźĄç†çœ‘ç»œèŻ·æ±‚ïŒŒäžŽæ ‡ć‡†HTML侭的XMLHttpRequestç”šé€”äž€è‡ŽïŒŒć·źćˆ«ćœšäșŽć‰è€…ćŻä»„èż›èĄŒè·šćŸŸèźżé—źă€‚é€šèż‡plus.netćŻèŽ·ć–çœ‘ç»œèŻ·æ±‚çźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ +interface PlusNet { + /** + * è·šćŸŸçœ‘ç»œèŻ·æ±‚ćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + XMLHttpRequest?: PlusNetXMLHttpRequest; + /** + * HTTPèŻ·æ±‚èż›ćșŠäș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + ProgressEvent?: PlusNetProgressEvent; +} + +/** + * è·šćŸŸçœ‘ç»œèŻ·æ±‚ćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ +interface PlusNetXMLHttpRequest { + /** + * HTTP èŻ·æ±‚çš„çŠ¶æ€ + * ćœ“äž€äžȘ XMLHttpRequest ćˆæŹĄćˆ›ć»șæ—¶ïŒŒèż™äžȘć±žæ€§çš„ć€Œä»Ž 0 ćŒ€ć§‹ïŒŒç›Žćˆ°æŽ„æ”¶ćˆ°ćźŒæ•Žçš„ HTTP 操ćș”ïŒŒèż™äžȘć€ŒćąžćŠ ćˆ° 4。 + * 5 äžȘçŠ¶æ€äž­æŻäž€äžȘ郜有䞀äžȘç›žć…łè”çš„éžæ­ŁćŒçš„ćç§°ïŒŒäž‹èĄšćˆ—ć‡șäș†çŠ¶æ€ă€ćç§°ć’Œć«äč‰ïŒš + * 0 UninitializedæœȘćˆć§‹ćŒ–çŠ¶æ€ă€‚XMLHttpRequestćŻčè±Ąć·Č戛ć»ș或ć·Čèą«abort()æ–čæł•é‡çœźă€‚ + * 1 Openopen()æ–čæł•ć·Čè°ƒç”šïŒŒäœ†æ˜Żsend()æ–čæł•æœȘè°ƒç”šă€‚èŻ·æ±‚èż˜æČĄæœ‰èą«ć‘送。 + * 2 Sentsend()æ–čæł•ć·Č调甚HTTP èŻ·æ±‚ć·Č揑送戰WebæœćŠĄć™šă€‚æœȘæŽ„æ”¶ćˆ°ć“ćș”。 + * 3 ReceivingïŒŒæ‰€æœ‰ć“ćș”ć€Žéƒšéƒœć·Čç»æŽ„æ”¶ćˆ°ă€‚ć“ćș”äœ“ćŒ€ć§‹æŽ„收䜆æœȘćźŒæˆă€‚ + * 4 LoadedHTTP操ćș”ć·Čç»ćźŒć…šæŽ„æ”¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + readyState?: number; + /** + * èŻ·æ±‚ä»ŽæœćŠĄć™šæŽ„æ”¶ćˆ°çš„ć“ćș”æ•°æź + * ćŠ‚æžœæČĄæœ‰ä»ŽæœćŠĄć™šæŽ„æ”¶ćˆ°æ•°æźïŒŒćˆ™äžșnull + * 搩戙æ čæźresponseTypeç±»ćž‹ć†łćźšïŒš + * ćŠ‚æžœresponseTypeèźŸçœźäžșç©ș歗笩äžČ或"text"ïŒŒćˆ™èż”ć›žç©ș歗笩äžČ + * ćŠ‚æžœresponseTypeèźŸçœźäžș"document"ïŒŒćˆ™èż”ć›žDocumentćŻčè±ĄïŒ› + * ćŠ‚æžœresponseTypeèźŸçœźäžș"json"ïŒŒćˆ™èż”ć›žJSONćŻčè±ĄïŒ› + * è‹„æœćŠĄć™šèż”ć›žçš„æ•°æźäžŽèźŸçœźçš„responseTypeç±»ćž‹äžćŒșé…ïŒŒćˆ™èż”ć›žnull。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + response?: string; + /** + * èŻ·æ±‚ä»ŽæœćŠĄć™šæŽ„æ”¶ćˆ°çš„ć“ćș”æ•°æźïŒˆć­—çŹŠäžČæ•°æźïŒ‰ + * ćŠ‚æžœèż˜æČĄæœ‰æŽ„æ”¶ćˆ°æ•°æźçš„èŻïŒŒæ­€ć±žæ€§ć€Œäžșç©ș歗笩äžČ + * ćŠ‚æžœreadyState氏äșŽ3ïŒŒæ­€ć±žæ€§ć€Œäžșç©ș歗笩äžČ + * ćŠ‚æžœreadyStateäžș3ïŒŒæ­€ć±žæ€§ć€Œèż”ć›žç›źć‰ć·Č经掄收的HTTP操ćș”éƒšćˆ†æ•°æźć€ŒïŒ› + * ćŠ‚æžœreadyStateäžș4ïŒŒæ­€ć±žæ€§ć€Œäżć­˜äș†ćꌿ•Žçš„HTTP操ćș”æ•°æźäœ“ă€‚ + * ćŠ‚æžœHTTPèŻ·æ±‚èż”ć›žçš„æ•°æźć€Žäž­ćŒ…ć«äș†Content-Typeć€Œäž­æŒ‡ćźšć­—çŹŠçŒ–ç ïŒŒć°±äœżç”šèŻ„çŒ–ç ïŒŒćŠćˆ™ïŒŒäœżç”šUTF-8歗笩集。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + responseText?: string; + /** + * èŻ·æ±‚ć“ćș”æ•°æźresponse的类枋 + * é»˜èź€ć€Œäžșç©ș歗笩äžČïŒŒćłreponseäžșStringïŒŒç±»ćž‹ćŻèźŸçœźïŒš"document"èĄšç€șDocumentćŻčè±ĄïŒŒ"json"èĄšç€șJSONćŻčè±ĄïŒŒ"text"èĄšç€ș歗笩äžČ。 + * æ­€ć€Œćż…éĄ»ćœšè°ƒç”šsendæ–čæł•äč‹ć‰èźŸçœźïŒŒćŠćˆ™èźŸçœźçš„ć€Œäžç”Ÿæ•ˆïŒŒä»äœżç”šäč‹ć‰èźŸçœźçš„ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + responseType?: string; + /** + * èŻ·æ±‚ć“ćș”çš„DocumentćŻčè±Ą + * ćŻčèŻ·æ±‚çš„ć“ćș”ïŒŒè§Łæžäžș XML ćč¶äœœäžș Document ćŻčè±Ąèż”ć›žă€‚ + * ćŠ‚æžœèŻ·æ±‚æœȘæˆćŠŸïŒŒæˆ–ć“ćș”çš„æ•°æźæ— æł•èą«è§ŁæžäžșXMLïŒŒćˆ™èż”ć›žnull。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + responseXML?: string; + /** + * æœćŠĄć™šèż”ć›žçš„HTTPçŠ¶æ€ä»Łç  + * æœćŠĄć™šèż”ć›žçš„HTTPçŠ¶æ€ä»Łç ïŒŒćŠ‚200èĄšç€șæˆćŠŸïŒŒè€Œ404èĄšç€ș"Not Found"é”™èŻŻïŒ› + * ćœ“readyState氏äșŽ3çš„æ—¶ć€™æ­€ć±žæ€§ć€Œäžș0。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + status?: number; + /** + * æœćŠĄć™šèż”ć›žçš„HTTPçŠ¶æ€æèż° + * æ­€ć±žæ€§ć€Œç”šćç§°è€Œäžæ˜Żæ•°ć­—æŒ‡ćźšäș†èŻ·æ±‚çš„HTTPçš„çŠ¶æ€ä»Łç ă€‚ + * äčŸć°±æ˜ŻèŻŽïŒŒćœ“çŠ¶æ€äžș200çš„æ—¶ć€™ćźƒæ˜Ż"OK"ïŒ›ćœ“çŠ¶æ€äžș404çš„æ—¶ć€™ćźƒæ˜Ż"Not Found"。 + * 撌statusć±žæ€§ç±»äŒŒïŒŒćœ“readyState氏äșŽ3çš„æ—¶ć€™èŻ»ć–èż™äž€ć±žæ€§äŒšèż”ć›žç©ș歗笩äžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + statusText?: string; + /** + * èŻ·æ±‚æœćŠĄć™šçš„è¶…æ—¶æ—¶é—ŽïŒŒć•äœäžșæŻ«ç§’ïŒˆms + * æ•°ć€Œç±»ćž‹ïŒŒć•äœäžșmsïŒŒć…¶é»˜èź€ć€Œäžș120秒。 + * è¶…æ—¶æ—¶é—ŽäžșæœćŠĄć™šć“ćș”èŻ·æ±‚çš„æ—¶é—ŽïŒˆäžæ˜ŻHttpèŻ·æ±‚ćźŒæˆçš„æ€»æ—¶é—ŽïŒ‰ïŒŒćŠ‚æžœèźŸçœźäžș0ćˆ™èĄšç€șæ°žèżœäžè¶…æ—¶ă€‚ + * ćż…éĄ»ćœšèŻ·æ±‚ć‘è”·ć‰èźŸçœźïŒŒćŠćˆ™ćœ“ć‰èŻ·æ±‚ć°†äžç”Ÿæ•ˆïŒŒćœšćœ“ć‰èŻ·æ±‚ćźŒæˆćŽé‡æ–°ć‘è”·æ–°èŻ·æ±‚æ—¶ç”Ÿæ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + timeout?: number; + /** + * æ˜ŻćŠæ”ŻæŒè·šćŸŸèŻ·æ±‚ + * æ­€ćŻčè±Ąćˆ›ć»ș的HTTPèŻ·æ±‚éƒœæ”ŻæŒè·šćŸŸïŒŒæ‰€ä»„æ°žèżœèż”ć›žtrue。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + withCredentials?: boolean; + /** + * çœ‘ç»œèŻ·æ±‚çŠ¶æ€ć‘ç”Ÿć˜ćŒ–äș‹ä»¶ + * çœ‘ç»œèŻ·æ±‚çŠ¶æ€ć‘ç”Ÿć˜ćŒ–æ—¶è§Šć‘ïŒŒé€šćžžćœšć‡œæ•°äž­ćˆ€æ–­ćŻčè±Ąçš„stateć±žæ€§ć€Œæ„èŽ·ć–ćœ“ć‰èŻ·æ±‚çš„çŠ¶æ€ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + onreadystatechange?: Function; + /** + * çœ‘ç»œèŻ·æ±‚ćŒ€ć§‹äș‹ä»¶ + * é€šćžžćœšè°ƒç”šsendæ–čæł•ćŒ€ć§‹ć‘è”·HTTPèŻ·æ±‚æ—¶è§Šć‘ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + onloadstart?: (result: PlusNetProgressEvent) => void; + /** + * çœ‘ç»œèŻ·æ±‚äŒ èŸ“æ•°æźäș‹ä»¶ + * 通澾朹HTTPèŻ·æ±‚é“ŸæŽ„ć·Č经ć»șç«‹ïŒŒćŒ€ć§‹äŒ èŸ“æ•°æźæ—¶è§Šć‘ïŒŒćœšæ•°æźäŒ èŸ“çš„èż‡çš‹äž­ćŻèƒœć€šæŹĄè§Šć‘ïŒŒæ­€äș‹ä»¶äžŽonreadystatechangeäș‹ä»¶è§Šć‘状态3ç±»äŒŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + onprogress?: (result: PlusNetProgressEvent) => void; + /** + * çœ‘ç»œèŻ·æ±‚ć–æ¶ˆäș‹ä»¶ + * é€šćžžćœšè°ƒç”šabortæ–čæł•ć–æ¶ˆHTTPèŻ·æ±‚æ—¶è§Šć‘ă€‚ + * æ­€äș‹ä»¶ćœšonreadystatechangeäș‹ä»¶è§Šć‘状态4äș‹ä»¶äč‹ćŽă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + onabort?: (result: PlusNetProgressEvent) => void; + /** + * çœ‘ç»œèŻ·æ±‚é”™èŻŻäș‹ä»¶ + * 通澾朹HTTPèŻ·æ±‚ć‘ç”Ÿé”™èŻŻæ—¶è§Šć‘ïŒŒćŠ‚æ— æł•èżžæŽ„ćˆ°æœćŠĄć™šç­‰ć„ç§é”™èŻŻéƒœè§Šć‘æ­€äș‹ä»¶ă€‚ + * æ­€äș‹ä»¶ćœšonreadystatechangeäș‹ä»¶è§Šć‘状态4äș‹ä»¶äč‹ćŽă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + onerror?: (result: PlusNetProgressEvent) => void; + /** + * çœ‘ç»œèŻ·æ±‚æˆćŠŸäș‹ä»¶ + * 通澾朹HTTPèŻ·æ±‚æˆćŠŸćźŒæˆæ—¶è§Šć‘ïŒŒćŠ‚æžœHTTPèŻ·æ±‚ć‘ç”Ÿé”™èŻŻćˆ™äžè§Šć‘æ­€äș‹ä»¶ă€‚ + * æ­€äș‹ä»¶ćœšonreadystatechangeäș‹ä»¶è§Šć‘状态4äș‹ä»¶äč‹ćŽă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + onload?: (result: PlusNetProgressEvent) => void; + /** + * çœ‘ç»œèŻ·æ±‚è¶…æ—¶äș‹ä»¶ + * 通澾朹HTTPèŻ·æ±‚è¶…æ—¶æ—¶è§Šć‘ïŒŒæ­€æ—¶äžäŒšè§Šć‘onerroräș‹ä»¶ă€‚ + * æ­€äș‹ä»¶ćœšonreadystatechangeäș‹ä»¶è§Šć‘状态4äș‹ä»¶äč‹ćŽă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + ontimeout?: (result: PlusNetProgressEvent) => void; + /** + * çœ‘ç»œèŻ·æ±‚ç»“æŸäș‹ä»¶ + * 通澾朹HTTPèŻ·æ±‚ç»“æŸæ—¶è§Šć‘ïŒŒäžçźĄæ˜ŻHTTPèŻ·æ±‚ć€±èŽ„ă€æˆćŠŸă€æˆ–è¶…æ—¶äč‹ćŽéƒœäŒšè§Šć‘æ­€äș‹ä»¶ă€‚ + * æ­€äș‹ä»¶ćœšonreadystatechangeäș‹ä»¶è§Šć‘状态4äș‹ä»¶äč‹ćŽă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + onloadend?: (result: PlusNetProgressEvent) => void; + /** + * ć–æ¶ˆćœ“ć‰ć“ćș”ïŒŒć…łé—­èżžæŽ„ćč¶äž”结束任䜕æœȘć†łçš„çœ‘ç»œæŽ»ćŠš + * æ­€æ–čæł•把XMLHttpRequestćŻčè±Ąé‡çœźäžșreadyStateäžș0的状态ćč¶äž”ć–æ¶ˆæ‰€æœ‰æœȘć†łçš„çœ‘ç»œæŽ»ćŠšă€‚ + * 调甚歀æ–čæł•ćŽć°†ćœæ­ąè§Šć‘XMLHttpRequestćŻčè±Ąçš„æ‰€æœ‰äș‹ä»¶ă€‚ + * äŸ‹ćŠ‚ïŒŒćŠ‚æžœèŻ·æ±‚ç”šäș†ć€Șé•żæ—¶é—ŽïŒŒè€Œäž”ć“ćș”äžć†ćż…èŠçš„æ—¶ć€™ïŒŒćŻä»„è°ƒç”šèż™äžȘæ–čæł•。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + abort(): void; + /** + * èŽ·ć–HTTP操ćș”ć€ŽéƒšäżĄæŻ + * 把HTTP操ćș”ć€ŽéƒšäœœäžșæœȘè§Łæžçš„ć­—çŹŠäžČèż”ć›žă€‚ ćŠ‚æžœreadyState氏äșŽ3ïŒŒèż™äžȘæ–čæł•èż”ć›žnull。 + * ćŠćˆ™ïŒŒćźƒèż”ć›žæœćŠĄć™šć‘é€çš„æ‰€æœ‰ HTTP 操ćș”çš„ć€Žéƒšă€‚ć€Žéƒšäœœäžș捕äžȘ的歗笩äžČèż”ć›žïŒŒäž€èĄŒäž€äžȘć€Žéƒšă€‚æŻèĄŒç”šæąèĄŒçŹŠ"\r\n"éš”ćŒ€ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + getAllResponseHeaders(): string; + /** + * èŽ·ć–æŒ‡ćźšçš„HTTP操ćș”ć€Žéƒšçš„ć€Œ + * ć…¶ć‚æ•°æ˜ŻèŠèż”ć›žçš„ HTTP 操ćș”ć€Žéƒšçš„ćç§°ă€‚ćŻä»„äœżç”šä»»äœ•ć€§ć°ć†™æ„ćˆ¶ćźšèż™äžȘć€Žéƒšćć­—ïŒŒć’Œć“ćș”ć€Žéƒšçš„æŻ”èŸƒæ˜ŻäžćŒșćˆ†ć€§ć°ć†™çš„ă€‚ + * èŻ„æ–čæł•çš„èż”ć›žć€Œæ˜ŻæŒ‡ćźšçš„ HTTP 操ćș”ć€Žéƒšçš„ć€ŒïŒŒćŠ‚æžœæČĄæœ‰æŽ„æ”¶ćˆ°èż™äžȘć€Žéƒšæˆ–è€…readyState氏äșŽ3戙äžșç©ș歗笩äžČ。 + * ćŠ‚æžœæŽ„æ”¶ćˆ°ć€šäžȘæœ‰æŒ‡ćźšćç§°çš„ć€ŽéƒšïŒŒèż™äžȘć€Žéƒšçš„ć€Œèą«èżžæŽ„è”·æ„ćč¶èż”ć›žïŒŒäœżç”šé€—ć·ć’Œç©șæ Œćˆ†éš”ćŒ€ć„äžȘć€Žéƒšçš„ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + getResponseHeader(headerName?: string): string; + /** + * 戝構挖HTTPèŻ·æ±‚ć‚æ•°ïŒŒäŸ‹ćŠ‚URL撌HTTPæ–čæł•ïŒŒäœ†æ˜Żćč¶äžć‘é€èŻ·æ±‚ + * èż™äžȘæ–čæł•ćˆć§‹ćŒ–èŻ·æ±‚ć‚æ•°ä»„äŸ› send() æ–čæł•çšćŽäœżç”šă€‚ćźƒæŠŠreadyStateèźŸçœźäžș1ïŒŒćˆ é™€äč‹ć‰æŒ‡ćźšçš„æ‰€æœ‰èŻ·æ±‚ć€ŽéƒšïŒŒä»„ćŠäč‹ć‰æŽ„æ”¶çš„æ‰€æœ‰ć“ćș”ć€ŽéƒšïŒŒćč¶äž”把responseText、responseXML、status ä»„ćŠ statusText ć‚æ•°èźŸçœźäžșćźƒä»Źçš„é»˜èź€ć€Œă€‚ + * ćœ“readyStateäžș0çš„æ—¶ć€™ïŒˆćœ“XMLHttpRequestćŻčè±Ąćˆšćˆ›ć»ș或者abort()æ–čæł•è°ƒç”šćŽïŒ‰ä»„ćŠćœ“readyStateäžș4时ć·Čç»æŽ„æ”¶ć“ćș”æ—¶ïŒ‰ïŒŒè°ƒç”šèż™äžȘæ–čæł•æ˜Żćź‰ć…šçš„ă€‚ + * ćœ“é’ˆćŻčä»»äœ•ć…¶ä»–çŠ¶æ€è°ƒç”šçš„æ—¶ć€™ïŒŒopen()æ–čæł•çš„èĄŒäžșæ˜ŻäžșæŒ‡ćźšçš„ă€‚ + * 陀äș†äżć­˜äŸ›send()æ–čæł•äœżç”šçš„èŻ·æ±‚ć‚æ•°ïŒŒä»„ćŠé‡çœź XMLHttpRequest ćŻčè±Ąä»„äŸżć€ç”šïŒŒopen()æ–čæł•æČĄæœ‰ć…¶ä»–çš„èĄŒäžș。 + * 芁ç‰čćˆ«æłšæ„ïŒŒćœ“èż™äžȘæ–čæł•è°ƒç”šçš„æ—¶ć€™ïŒŒćźžçŽ°é€šćžžäžäŒšæ‰“ćŒ€äž€äžȘ戰WebæœćŠĄć™šçš„çœ‘ç»œèżžæŽ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + open(method?: string, url?: string, username?: string, password?: string): void; + /** + * é‡ć†™æœćŠĄć™šèż”ć›žçš„MIME类枋 + * æ­€æ–čæł•芆盖HTTPèŻ·æ±‚èż”ć›žæ•°æźć€Ž"Content-Type"ć­—æź”ć€Œäž­ćŒ…ć«çš„IMIEç±»ćž‹ïŒŒćŠ‚æžœèźŸçœźçš„MIMEç±»ćž‹æ— æ•ˆćˆ™ç»§ç»­äœżç”š"Content-Type"ć­—æź”ć€Œäž­ćŒ…ć«çš„IMIE类枋。 + * ćŠ‚æžœMIMEç±»ćž‹äž­æŒ‡ćźšäș†ć­—çŹŠé›†ç±»ćž‹ïŒˆcharsetïŒ‰ïŒŒćˆ™éœ€æŒ‰ç…§æŒ‡ćźšçš„ć­—çŹŠé›†ç±»ćž‹ćŻčæŽ„æ”¶ćˆ°çš„æ•°æźäœ“ïŒˆresposeïŒ‰èż›èĄŒć€„ç†ïŒŒćŠćˆ™é»˜èź€äžșUTF-8歗笩集。 + * æłšæ„ïŒšæ­€æ–čæł•éœ€ćœšsendæ–čæł•ć‰è°ƒç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + overrideMimeType(mime?: string): void; + /** + * 揑送HTTPèŻ·æ±‚ + * æ­€æ–čæł•è§Šć‘HTTPèŻ·æ±‚ć‘é€ïŒŒćŠ‚æžœäč‹ć‰æČĄæœ‰è°ƒç”šopen()ïŒŒæˆ–è€…æ›Žć…·äœ“ćœ°èŻŽïŒŒćŠ‚æžœreadyStateäžæ˜Ż1send()抛ć‡ș侀äžȘćŒ‚ćžžă€‚ćŠćˆ™ïŒŒć°†ć‘é€HTTPèŻ·æ±‚ïŒŒèŻ„èŻ·æ±‚ç”±ä»„äž‹ć‡ éƒšćˆ†ç»„æˆïŒš + * äč‹ć‰è°ƒç”šopen()æ—¶æŒ‡ćźšçš„HTTPæ–čæł•、URL + * äč‹ć‰è°ƒç”šsetRequestHeader()æ—¶æŒ‡ćźšçš„èŻ·æ±‚ć€ŽéƒšïŒˆćŠ‚æžœæœ‰çš„èŻïŒ‰ïŒ› + * äŒ é€’ç»™èż™äžȘæ–čæł•çš„bodyć‚æ•°ă€‚ + * äž€æ—ŠèŻ·æ±‚ć‘é€äș†ïŒŒsend()把readyStateèźŸçœźäžș2ćč¶è§Šć‘onreadystatechangeäș‹ä»¶ïŒ› + * ćŠ‚æžœæœćŠĄć™šć“ćș”ćžŠæœ‰äž€äžȘHTTPé‡ćźšć‘ïŒŒsend()æ–čæł•ćœšćŽć°çșżçš‹è‡ȘćŠšé”ä»Žé‡ćźšć‘ïŒ› + * ćœ“æ‰€æœ‰çš„HTTP操ćș”ć€Žéƒšć·Č经掄收send()æˆ–ćŽć°çșżçš‹æŠŠreadyStateèźŸçœźäžș3ćč¶è§Šć‘onreadystatechangeäș‹ä»¶ïŒ› + * ćŠ‚æžœć“ćș”èŸƒé•żïŒŒsend()æˆ–ćŽć°çșżçš‹ćŻèƒœćœšçŠ¶æ€3äž­è§Šć‘ć€šæŹĄonreadystatechangeäș‹ä»¶ïŒ› + * æœ€ćŽïŒŒćœ“ć“ćș”ćꌿˆïŒŒsend()æˆ–ćŽć°çșżçš‹æŠŠreadyStateèźŸçœźäžș4ćč¶æœ€ćŽäž€æŹĄè§Šć‘onreadystatechangeäș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + send(body?: string): void; + /** + * æŒ‡ćźšäž€äžȘHTTPèŻ·æ±‚çš„Header + * Http的Headerćș”èŻ„ćŒ…ć«ćœšé€šèż‡ćŽç»­send()è°ƒç”šè€Œć‘è”·çš„èŻ·æ±‚äž­ă€‚ + * æ­€æ–čæł•ćȘæœ‰ćœ“readyStateäžș1çš„æ—¶ć€™æ‰èƒœè°ƒç”šïŒŒäŸ‹ćŠ‚ïŒŒćœšè°ƒç”šäș†open()äč‹ćŽïŒŒäœ†ćœšè°ƒç”šsend()äč‹ć‰ă€‚ + * ćŠ‚æžœćžŠæœ‰æŒ‡ćźšćç§°çš„ć€Žéƒšć·Čç»èą«æŒ‡ćźšäș†ïŒŒèż™äžȘć€Žéƒšçš„æ–°ć€Œć°±æ˜ŻïŒšäč‹ć‰æŒ‡ćźšçš„ć€ŒïŒŒćŠ äžŠé€—ć·ă€ä»„ćŠèż™äžȘè°ƒç”šæŒ‡ćźšçš„ć€ŒïŒˆćœąæˆäž€äžȘæ•°ç»„ïŒ‰ă€‚ + * ćŠ‚æžœWebæœćŠĄć™šć·Čç»äżć­˜äș†ć’ŒäŒ é€’ç»™open()的URLç›žć…łè”çš„cookieïŒŒé€‚ćœ“çš„Cookie或Cookie2怎郚äčŸè‡ȘćŠšćœ°ćŒ…ć«ćˆ°èŻ·æ±‚äž­ïŒŒćŻä»„é€šèż‡è°ƒç”šsetRequestHeader()æ„æŠŠèż™äș›cookieæ·»ćŠ ćˆ°ć€Žéƒšă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + setRequestHeader(headerName?: string, headerValue?: string): void; +} + +/** + * HTTPèŻ·æ±‚èż›ćșŠäș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ +interface PlusNetProgressEvent { + /** + * äș‹ä»¶çš„ç›źæ ‡ćŻčè±Ą + * 通矄HTTPèŻ·æ±‚èż›ćșŠäș‹ä»¶çš„XMLHttpRequestćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + target?: PlusNetXMLHttpRequest; + /** + * èż›ćșŠäżĄæŻæ˜ŻćŠćŻèźĄçź— + * HTTPèŻ·æ±‚èż›ćșŠäżĄæŻæ˜ŻćŠæœ‰æ•ˆïŒŒćŠ‚æžœHTTPèŻ·æ±‚ć€Žäž­ćŒ…ć«Content-Lengthć€ŽäżĄæŻćˆ™äžștrueïŒŒćŠćˆ™äžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + lengthComputable?: number; + /** + * ćœ“ć‰ć·Čç»æŽ„æ”¶ćˆ°çš„æ•°æźé•żćșŠ + * HTTPèŻ·æ±‚æŽ„æ”¶ćˆ°çš„æ•°æźé•żćșŠïŒŒć•䜍äžșć­—èŠ‚ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + loaded?: number; + /** + * æ€»æ•°æźé•żćșŠ + * HTTPèŻ·æ±‚èż”ć›žçš„æ€»æ•°æźé•żćșŠïŒŒć•䜍äžșć­—èŠ‚ă€‚ + * ćŠ‚æžœæ— æł•èŽ·ć–ćˆ™èźŸçœźäžș0。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + total?: number; +} + +/** + * ZipæšĄć—çźĄç†æ–‡ä»¶ćŽ‹çŒ©ć’Œè§ŁćŽ‹ïŒŒé€šèż‡plus.zipćŻèŽ·ć–ćŽ‹çŒ©çźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ +interface PlusZip { + /** + * JSONćŻčè±ĄïŒŒé…çœźć›Ÿç‰‡ćŽ‹çŒ©èœŹæąçš„ć‚æ•° + * èźŸçœźwidth/heightć±žæ€§ćˆ™èĄšç€ș需ćŻčć›Ÿç‰‡èż›èĄŒçŒ©æ”ŸèœŹæąæ“äœœïŒ› + * èźŸçœźrotateć±žæ€§ćˆ™èĄšç€ș需ćŻčć›Ÿç‰‡èż›èĄŒæ—‹èœŹèœŹæąæ“äœœïŒ› + * èźŸçœźclipć±žæ€§ćˆ™èĄšç€ș需ćŻčć›Ÿç‰‡èż›èĄŒèŁć‰ȘèœŹæąæ“äœœïŒ› + * ćŠ‚ćŒæ—¶èźŸçœźäș†ć€šäžȘèœŹæąæ“äœœïŒŒćˆ™æŒ‰çŒ©æ”Ÿă€æ—‹èœŹă€èŁć‰ȘéĄșćșèż›èĄŒæ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + CompressImageOptions?: PlusZipCompressImageOptions; + /** + * JSONćŻčè±ĄïŒŒć›Ÿç‰‡èŁć‰ȘćŒșćŸŸçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + ClipImageOptions?: PlusZipClipImageOptions; + /** + * ćŽ‹çŒ©ç”ŸæˆZip文件 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + compress(src?: string, zipfile?: string, successCB?: Function, errorCB?: (result: any) => void): void; + /** + * è§ŁćŽ‹çŒ©Zip文件 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + decompress(zipfile?: string, target?: string, successCB?: Function, errorCB?: (result: any) => void): void; + /** + * ć›Ÿç‰‡ćŽ‹çŒ©èœŹæą + * 揯甹äșŽć›Ÿç‰‡çš„èŽšé‡ćŽ‹çŒ©ă€ć€§ć°çŒ©æ”Ÿă€æ–čć‘æ—‹èœŹă€ćŒșćŸŸèŁć‰Șă€æ ŒćŒèœŹæąç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + compressImage(options?: PlusZipCompressImageOptions, successCB?: (result: any) => void, errorCB?: (result: any) => void): void; +} + +/** + * JSONćŻčè±ĄïŒŒé…çœźć›Ÿç‰‡ćŽ‹çŒ©èœŹæąçš„ć‚æ•° + * èźŸçœźwidth/heightć±žæ€§ćˆ™èĄšç€ș需ćŻčć›Ÿç‰‡èż›èĄŒçŒ©æ”ŸèœŹæąæ“äœœïŒ› + * èźŸçœźrotateć±žæ€§ćˆ™èĄšç€ș需ćŻčć›Ÿç‰‡èż›èĄŒæ—‹èœŹèœŹæąæ“äœœïŒ› + * èźŸçœźclipć±žæ€§ćˆ™èĄšç€ș需ćŻčć›Ÿç‰‡èż›èĄŒèŁć‰ȘèœŹæąæ“äœœïŒ› + * ćŠ‚ćŒæ—¶èźŸçœźäș†ć€šäžȘèœŹæąæ“äœœïŒŒćˆ™æŒ‰çŒ©æ”Ÿă€æ—‹èœŹă€èŁć‰ȘéĄșćșèż›èĄŒæ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ +interface PlusZipCompressImageOptions { + /** + * ćŽ‹çŒ©èœŹæąćŽŸć§‹ć›Ÿç‰‡çš„è·ŻćŸ„ + * æ”ŻæŒä»„äž‹ć›Ÿç‰‡è·ŻćŸ„ïŒš + * 盾ćŻčè·ŻćŸ„ - 盾ćŻčäșŽćœ“ć‰éĄ”靱的hostäœçœźïŒŒćŠ‚"a.jpg"ïŒŒæłšæ„ćœ“ć‰éĄ”éąäžșçœ‘ç»œćœ°ć€ćˆ™äžæ”ŻæŒïŒ› + * 绝ćŻčè·ŻćŸ„ - çł»ç»Ÿç»ćŻčè·ŻćŸ„ïŒŒćŠ‚Androidćčłć°"/storage/sdcard0/Android/data/io.dcloud.HBuilder/.HBuilder/apps/HBuilder/www/.jpg"iOSćčłć°"/var/mobile/Containers/Data/Application/757966CF-345C-4348-B07F-EEF83CF9A369/Library/Pandora/apps/HBuilder/www/a.png" + * 盾ćŻčè·ŻćŸ„URL(RelativeURL) - 仄"_"ćŒ€ć€Žçš„ç›žćŻčè·ŻćŸ„ïŒŒćŠ‚"_www/a.jpg"、"_doc/b.jpg"、"_documents/c.jpg"、"_downloads/d.jpg" + * æœŹćœ°è·ŻćŸ„URL - 仄“file://â€ćŒ€ć€ŽïŒŒćŽéąè·Ÿéšçł»ç»Ÿç»ćŻčè·ŻćŸ„ă€‚ + * - _www/: ćș”甚蔄æșç›źćœ• + * - _doc/: ćș”ç”šç§æœ‰æ–‡æĄŁç›źćœ• + * - _documents/: ć…±äș«æ–‡æĄŁç›źćœ• + * - _downloads/: ć…±äș«äž‹èœœç›źćœ• + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + src?: '_www/' | '_doc/' | '_documents/' | '_downloads/'; + /** + * ćŽ‹çŒ©èœŹæąç›źæ ‡ć›Ÿç‰‡çš„è·ŻćŸ„ + * æ”ŻæŒä»„äž‹ć›Ÿç‰‡è·ŻćŸ„ïŒš + * 绝ćŻčè·ŻćŸ„ - çł»ç»Ÿç»ćŻčè·ŻćŸ„ïŒŒćŠ‚Androidćčłć°"/storage/sdcard0/Android/data/io.dcloud.HBuilder/.HBuilder/apps/HBuilder/doc/.jpg"iOSćčłć°"/var/mobile/Containers/Data/Application/757966CF-345C-4348-B07F-EEF83CF9A369/Library/Pandora/apps/HBuilder/doc/a.png" + * 盾ćŻčè·ŻćŸ„URL(RelativeURL) - 仄"_"ćŒ€ć€Žçš„ç›žćŻčè·ŻćŸ„ïŒŒćŠ‚"_doc/b.jpg"、"_documents/c.jpg"、"_downloads/d.jpg"ïŒŒæłšæ„äžæ”ŻæŒ"_www"ćŒ€ć€Žçš„è·ŻćŸ„ïŒ› + * æœŹćœ°è·ŻćŸ„URL - 仄“file://â€ćŒ€ć€ŽïŒŒćŽéąè·Ÿéšçł»ç»Ÿç»ćŻčè·ŻćŸ„ă€‚ + * æłšæ„ïŒšćŠ‚æžœèźŸçœźçš„è·ŻćŸ„æ— æƒé™èźżé—źïŒŒćˆ™èż”ć›žć€±èŽ„ă€‚ + * - _doc/: ćș”ç”šç§æœ‰æ–‡æĄŁç›źćœ• + * - _documents/: ć…±äș«æ–‡æĄŁç›źćœ• + * - _downloads/: ć…±äș«äž‹èœœç›źćœ• + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + dst?: '_doc/' | '_documents/' | '_downloads/'; + /** + * 芆盖生成新文件 + * ä»…ćœšdstćˆ¶ćźšçš„è·ŻćŸ„æ–‡ä»¶ć­˜ćœšæ—¶æœ‰æ•ˆïŒš + * trueèĄšç€șèŠ†ç›–ć­˜ćœšçš„æ–‡ä»¶ïŒ› + * falseèĄšç€șäžèŠ†ç›–ïŒŒćŠ‚æžœæ–‡ä»¶ć­˜ćœšïŒŒćˆ™èż”ć›žć€±èŽ„ă€‚ + * é»˜èź€ć€Œäžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + overwrite?: boolean; + /** + * ćŽ‹çŒ©èœŹæąćŽçš„ć›Ÿç‰‡æ ŒćŒ + * æ”ŻæŒ"jpg"、"png",ćŠ‚æžœæœȘæŒ‡ćźšćˆ™äœżç”šæșć›Ÿç‰‡çš„æ ŒćŒă€‚ + * - jpg: JPGæ ŒćŒć›Ÿç‰‡ + * - png: PNGæ ŒćŒć›Ÿç‰‡ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + format?: 'jpg' | 'png'; + /** + * ćŽ‹çŒ©ć›Ÿç‰‡çš„èŽšé‡ + * ć–ć€ŒèŒƒć›Žäžș1-1001èĄšç€șäœżç”šæœ€äœŽçš„ć›Ÿç‰‡èŽšé‡ïŒˆèœŹæąćŽçš„ć›Ÿç‰‡æ–‡ä»¶æœ€ć°ïŒ‰ă€100èĄšç€șäœżç”šæœ€é«˜çš„ć›Ÿç‰‡èŽšé‡ïŒˆèœŹæąćŽçš„ć›Ÿç‰‡æ–‡ä»¶æœ€ć€§ïŒ‰ïŒ› + * é»˜èź€ć€Œäžș50。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + quality?: number; + /** + * çŒ©æ”Ÿć›Ÿç‰‡çš„ćźœćșŠ + * æ”ŻæŒćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ă€ç™Ÿćˆ†æŻ”ïŒˆćŠ‚"50%"ïŒ‰ă€è‡ȘćŠšèźĄçź—ïŒˆćŠ‚"auto"ïŒŒćłæ čæźheight侎æșć›Ÿé«˜çš„çŒ©æ”ŸæŻ”äŸ‹èźĄçź—ïŒŒè‹„æœȘèźŸçœźheightćˆ™äœżç”šæșć›Ÿé«˜ćșŠïŒ‰ïŒ› + * é»˜èź€ć€Œäžș"auto"。 + * æłšæ„ïŒšè‹„èźŸçœźäș†widthć±žæ€§ć€Œäžćˆæł•ïŒˆćŠ‚"0px"ïŒ‰ïŒŒćˆ™äžćŻčć›Ÿç‰‡èż›èĄŒçŒ©æ”Ÿæ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + width?: string; + /** + * çŒ©æ”Ÿć›Ÿç‰‡çš„é«˜ćșŠ + * æ”ŻæŒćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ă€ç™Ÿćˆ†æŻ”ïŒˆćŠ‚"50%"ïŒ‰ă€è‡ȘćŠšèźĄçź—ïŒˆćŠ‚"auto"ïŒŒćłæ čæźwidth侎æșć›Ÿćźœçš„çŒ©æ”ŸæŻ”äŸ‹èźĄçź—ïŒŒè‹„æœȘèźŸçœźwidthćˆ™äœżç”šæșć›Ÿé«˜ćșŠïŒ‰ïŒ› + * é»˜èź€ć€Œäžș"auto"。 + * æłšæ„ïŒšè‹„èźŸçœźäș†heightć±žæ€§ć€Œäžćˆæł•ïŒˆćŠ‚"0px"ïŒ‰ïŒŒćˆ™äžćŻčć›Ÿç‰‡èż›èĄŒçŒ©æ”Ÿæ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + height?: string; + /** + * æ—‹èœŹć›Ÿç‰‡çš„è§’ćșŠ + * æ”ŻæŒć€ŒïŒš90-èĄšç€șæ—‹èœŹ90ćșŠïŒ›180-èĄšç€șæ—‹èœŹ180ćșŠïŒ›270-èĄšç€șæ—‹èœŹ270ćșŠă€‚ + * æłšæ„ïŒšè‹„èźŸçœźrotateć±žæ€§ć€Œäžćˆæł•ïŒŒćˆ™äžćŻčć›Ÿç‰‡èż›èĄŒæ—‹èœŹæ“äœœă€‚ + * - 90: æ—‹èœŹ90ćșŠ + * - 180: æ—‹èœŹ180ćșŠ + * - 270: æ—‹èœŹ270ćșŠ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + rotate?: '90' | '180' | '270'; + /** + * èŁć‰Șć›Ÿç‰‡çš„ćŒș㟟 + * ć€Œć‚è€ƒClipImageOptions漚äč‰ïŒŒè‹„èźŸçœźclipć±žæ€§ć€Œäžćˆæł•ïŒŒćˆ™äžćŻčć›Ÿç‰‡èż›èĄŒèŁć‰Șæ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + clip?: PlusZipClipImageOptions; +} + +/** + * JSONćŻčè±ĄïŒŒć›Ÿç‰‡èŁć‰ȘćŒșćŸŸçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ +interface PlusZipClipImageOptions { + /** + * ć›Ÿç‰‡èŁć‰ȘćŒșćŸŸäžŽćŽŸć›Ÿç‰‡äžŠèŸčç•Œçš„ćç§»è·çŠ» + * æ”ŻæŒćƒçŽ ć€ŒïŒˆćŠ‚"10px"ïŒ‰ă€ç™Ÿćˆ†æŻ”ïŒˆćŠ‚"10%"ïŒ‰ïŒ›é»˜èź€ć€Œäžș"0px"。 + * æłšæ„ïŒšćŠ‚æžœtopć€Œè¶…ć‡șćŽŸć›Ÿç‰‡é«˜ćșŠïŒŒćˆ™ć›Ÿç‰‡èفć‰Șć€±èŽ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + top?: string; + /** + * ć›Ÿç‰‡èŁć‰ȘćŒșćŸŸäžŽćŽŸć›Ÿç‰‡ć·ŠèŸčç•Œçš„ćç§»è·çŠ» + * æ”ŻæŒćƒçŽ ć€ŒïŒˆćŠ‚"10px"ïŒ‰ă€ç™Ÿćˆ†æŻ”ïŒˆćŠ‚"10%"ïŒ‰ïŒ›é»˜èź€ć€Œäžș"0px"。 + * æłšæ„ïŒšćŠ‚æžœleftć€Œè¶…ć‡șćŽŸć›Ÿç‰‡ćźœćșŠïŒŒćˆ™ć›Ÿç‰‡èفć‰Șć€±èŽ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + left?: string; + /** + * ć›Ÿç‰‡èŁć‰ȘćŒșćŸŸçš„ćźœćșŠ + * æ”ŻæŒćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ă€ç™Ÿćˆ†æŻ”ïŒˆćŠ‚"50%"ïŒ‰ă€è‡ȘćŠšèźĄçź—ïŒˆćŠ‚"auto"ïŒŒćłä»Žleftäœçœźćˆ°ć›Ÿç‰‡ćłèŸčç•Œçš„ćźœćșŠïŒ‰ïŒ›é»˜èź€ć€Œäžș"auto"。 + * æłšæ„ïŒšćŠ‚æžœleftć€ŒćŠ widthć€Œè¶…ć‡șćŽŸć›Ÿç‰‡ćźœćșŠïŒŒćˆ™äœżç”š"auto"ć€Œèż›èĄŒèŁć‰Ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + width?: string; + /** + * ć›Ÿç‰‡èŁć‰ȘćŒșćŸŸçš„é«˜ćșŠ + * æ”ŻæŒćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ă€ç™Ÿćˆ†æŻ”ïŒˆćŠ‚"50%"ïŒ‰ă€è‡ȘćŠšèźĄçź—ïŒˆćŠ‚"auto"ïŒŒćłä»Žtopäœçœźćˆ°ć›Ÿç‰‡äž‹èŸč界的高ćșŠïŒ‰ïŒ›é»˜èź€ć€Œäžș"auto"。 + * æłšæ„ïŒšćŠ‚æžœtopć€ŒćŠ heightć€Œè¶…ć‡șćŽŸć›Ÿç‰‡é«˜ćșŠïŒŒćˆ™äœżç”š"auto"ć€Œèż›èĄŒèŁć‰Ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + height?: string; +} + +/** + * BarcodeæšĄć—çźĄç†æĄç æ‰«æïŒŒæ”ŻæŒćžžè§çš„æĄç ïŒˆäž€ç»Žç ćŠäșŒç»Žç ïŒ‰çš„æ‰«æèŻ†ćˆ«ćŠŸèƒœă€‚ćŻè°ƒç”šèźŸć€‡çš„æ‘„ćƒć€ŽćŻčæĄç ć›Ÿç‰‡æ‰«æèż›èĄŒæ•°æźèŸ“ć…„ïŒŒè§Łç ćŽèż”ć›žç æ•°æźćŠç ç±»ćž‹ă€‚é€šèż‡plus.barcodećŻèŽ·ć–æĄç ç çźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ +interface PlusBarcode { + /** + * Barcode扫码控件ćŻčè±Ą + * BarcodećŻčè±ĄèĄšç€șæĄç èŻ†ćˆ«æŽ§ä»¶ćŻčè±ĄïŒŒćœšçȘ—ćŁäž­æ˜Ÿç€șæĄç èŻ†ćˆ«æŽ§ä»¶ïŒŒäœżç”šæ­€ćŻčè±ĄćŻè‡Ș漚ä艿Ąç èŻ†ćˆ«ç•Œéąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + Barcode?: PlusBarcodeBarcode; + /** + * Barcodeæ‰«ç æŽ§ä»¶æ ·ćŒ + * èźŸçœźBarcodeæ‰«ç æŽ§ä»¶çš„æ ·ćŒïŒŒćŠ‚æ‰«ç æĄ†ă€æ‰«ç æĄçš„éąœè‰Č等。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + BarcodeStyles?: PlusBarcodeBarcodeStyles; + /** + * æĄç èŻ†ćˆ«æŽ§ä»¶æ‰«æć‚æ•° + * èźŸçœźBarcodeæ‰«ç æŽ§ä»¶çš„æ‰«ç èŻ†ćˆ«ć‚æ•°ïŒŒćŠ‚æ˜ŻćŠäżć­˜æ‰«ç ćŠŸæ—¶çš„æˆȘć›Ÿç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + BarcodeOptions?: PlusBarcodeBarcodeOptions; + /** + * QRäșŒç»Žç ïŒŒæ•°ć€Œäžș0 + * 1994ćčŽç”±æ—„æœŹDenso-Waveć…Źćžć‘æ˜ŽïŒŒQR杄è‡Ș英文Quick Responseçš„çŒ©ć†™ïŒŒćłćż«é€Ÿććș”的意思æșè‡Șć‘æ˜Žè€…ćžŒæœ›QRç ćŻèź©ć…¶ć†…ćźčćż«é€Ÿèą«è§Łç ă€‚ + * ç›źć‰äœżç”šæœ€ćčżæł›çš„äșŒç»Žç ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + QR?: number; + /** + * EANæĄćœąç æ ‡ć‡†ç‰ˆïŒŒæ•°ć€Œäžș1 + * ć›œé™…ç‰©ć“çŒ–ç ćäŒšćœšć…šçƒæŽšćčżćș”ç”šçš„ć•†ć“æĄç ïŒŒæ˜Żç”±13äœæ•°ć­—ç»„æˆă€‚ + * ç›źć‰äœżç”šæœ€ćčżæł›çš„äž€ç»ŽæĄćœąç ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + EAN13?: number; + /** + * ENAæĄćœąç çź€ç‰ˆïŒŒæ•°ć€Œäžș2 + * ć›œé™…ç‰©ć“çŒ–ç ćäŒšćœšć…šçƒæŽšćčżćș”ç”šçš„ć•†ć“æĄç ïŒŒæ˜Żç”±8äœæ•°ć­—ç»„æˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + EAN8?: number; + /** + * AztecäșŒç»Žç ïŒŒæ•°ć€Œäžș3 + * Andrew Longacreć‘æ˜ŽäșŽ1995ćčŽïŒŒèŻ„ä»Łç æ˜Żç”šäșŽć›œé™…ć‡șç‰ˆă€‚æœ€ć°çš„Aztecç çŹŠć·çŒ–ç 13äžȘæ•°ć­—æˆ–12äžȘè‹±æ–‡ć­—æŻă€‚æœ€ć€§çš„Aztecç çŹŠć·çŒ–ç 3832æ•°ć­—æˆ–3067è‹±æ–‡ć­—æŻæˆ–1914ć­—èŠ‚çš„æ•°æźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + AZTEC?: number; + /** + * Data MatrixäșŒç»Žç ïŒŒæ•°ć€Œäžș4 + * Data Matrix掟損Data codeïŒŒç”±çŸŽć›œć›œé™…è”„æ–™ć…Źćž(International Data Matrix, 缀称IDMatrix)äșŽ1989ćčŽć‘æ˜Žă€‚ćŻçŒ–ç ć­—ć…ƒé›†ćŒ…æ‹Źć…šéƒšçš„ASCIIć­—ć…ƒćŠæ‰©ć……ASCIIć­—ć…ƒïŒŒćźčé‡ćŻćŒ…ć«2235äžȘè‹±æ–‡æ•°ć­—è”„æ–™ă€1556äžȘ8äœć…ƒè”„æ–™ïŒŒ3116äžȘæ•°ć­—è”„æ–™ă€‚ç”±äșŽData MatrixäșŒç»ŽæĄç ćȘéœ€èŠèŻ»ć–è”„æ–™çš„20%捳揯çČŸçĄźèŸšèŻ»ïŒŒć› æ­€ćŸˆé€‚ćˆćș”ç”šćœšæĄç ćźčæ˜“ć—æŸçš„ćœșæ‰€ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + DATAMATRIX?: number; + /** + * UPCæĄćœąç æ ‡ć‡†ç‰ˆïŒŒæ•°ć€Œäžș5 + * UPCç æ˜ŻçŸŽć›œç»Ÿäž€ä»Łç ć§”ć‘˜äŒšćˆ¶ćźšçš„äž€ç§ć•†ć“ç”šæĄç ïŒŒäž»èŠç”šäșŽçŸŽć›œć’ŒćŠ æ‹żć€§ćœ°ćŒșïŒŒćžžćœšçŸŽć›œèż›ćŁçš„ć•†ć“äžŠćŻä»„çœ‹ćˆ°ă€‚UPCç æ ‡ć‡†ç‰ˆç”±12äœæ•°ć­—æž„æˆïŒŒæ•…ć…¶ć­—ç é›†äžșæ•°ć­—0~9。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + UPCA?: number; + /** + * UPCæĄćœąç çŒ©çŸ­ç‰ˆïŒŒæ•°ć€Œäžș6 + * UPCç æ˜ŻçŸŽć›œç»Ÿäž€ä»Łç ć§”ć‘˜äŒšćˆ¶ćźšçš„äž€ç§ć•†ć“ç”šæĄç ïŒŒäž»èŠç”šäșŽçŸŽć›œć’ŒćŠ æ‹żć€§ćœ°ćŒșïŒŒćžžćœšçŸŽć›œèż›ćŁçš„ć•†ć“äžŠćŻä»„çœ‹ćˆ°ă€‚UPC码猩短版由8äœæ•°ć­—æž„æˆïŒŒæ•…ć…¶ć­—ç é›†äžșæ•°ć­—0~9。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + UPCE?: number; + /** + * CodabaræĄćœąç ïŒŒæ•°ć€Œäžș7 + * Codabarç æœ€ćˆæ˜Żäžșé›¶ć”źä»·æ Œæ ‡ç­Ÿçł»ç»Ÿè€Œç ”ćˆ¶ćŒ€ć‘çš„ă€‚1975ćčŽïŒŒNational Retail Merchants AssociationNRMA选择äș†ć…¶ćźƒçŹŠć·ç±»ćž‹äœœäžșæ ‡ć‡†ćŽïŒŒCodabarćŒ€ć§‹ćœšć€šäžȘæ–č靱甹äșŽéžé›¶ć”źćș”ç”šéą†ćŸŸïŒŒćŠ‚ć›ŸäčŠéŠ†ă€èŽ§èżć’ŒćŒ»èŻäžšă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + CODABAR?: number; + /** + * Code39æĄćœąç ïŒŒæ•°ć€Œäžș8 + * Code 39ç æ˜ŻIntermec慬揾äșŽ1975ćčŽæŽšć‡șçš„äž€ç»ŽæĄç ïŒŒ 39ç æ˜Żäž€ç§ćŻäŸ›äœżç”šè€…ćŒć‘æ‰«çž„çš„ćˆ†æ•ŁćŒæĄç ïŒŒäčŸć°±æ˜ŻèŻŽç›žäžŽäž€è”„æ–™ç äč‹é—ŽïŒŒ39ç ćż…éĄ»ćŒ…ć«äž€äžȘäžć…·ä»»äœ•æ„äč‰çš„ç©ș癜(æˆ–ç»†ç™œïŒŒć…¶é€»èŸ‘ć€Œäžș0)䞔 39ç ć…·æœ‰æ”ŻæŽæ–‡æ•°ć­—çš„èƒœćŠ›ïŒŒçŒ–ç è§„ćˆ™çź€ć•ă€èŻŻç çŽ‡äœŽă€æ‰€èƒœèĄšç€ș歗笩äžȘæ•°ć€šç­‰ç‰čç‚č39码朹搄äžȘéą†ćŸŸæœ‰ç€æžäžșćčżæł›çš„ćș”甚。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + CODE39?: number; + /** + * Code93æĄćœąç ïŒŒæ•°ć€Œäžș9 + * Code 93ç çš„æĄç çŹŠć·æ˜Żç”±Intermec慬揾äșŽ1982ćčŽèźŸèźĄçš„ æäŸ›æ›Žé«˜çš„毆ćșŠć’Œæ•°æźćź‰ć…šćąžćŒșcode39 ă€‚ćźƒæ˜Żäž€äžȘć­—æŻïŒŒé•żćșŠćŻć˜çŹŠć·ă€‚ä»Łç 93䞻芁甚äșŽç”±ćŠ æ‹żć€§é‚źæ”żçŒ–ç èĄ„ć……æäŸ›çš„è”„æ–™ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + CODE93?: number; + /** + * Code128æĄćœąç ïŒŒæ•°ć€Œäžș10 + * CODE128ç æ˜Ż1981ćčŽćŒ•ć…„çš„äž€ç§é«˜ćŻ†ćșŠæĄç ïŒŒCODE128 ç ćŻèĄšç€ș从 ASCII 0 戰ASCII 127 ć…±128äžȘć­—çŹŠïŒŒæ•…ç§°128码。CODE128ç æ˜Żćčżæł›ćș”ç”šćœšäŒäžšć†…éƒšçźĄç†ă€ç”Ÿäș§æ”çš‹ă€ç‰©æ”æŽ§ćˆ¶çł»ç»Ÿæ–čéąçš„æĄç ç ćˆ¶ïŒŒç”±äșŽć…¶äŒ˜è‰Żçš„ç‰čæ€§ćœšçźĄç†äżĄæŻçł»ç»Ÿçš„èźŸèźĄäž­èą«ćčżæł›äœżç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + CODE128?: number; + /** + * ITFæĄćœąç ïŒŒæ•°ć€Œäžș11 + * ITFæĄç ïŒŒćˆç§°äș€ć‰äșŒäș”æĄç ïŒŒç”±14äœæ•°ć­—ć­—çŹŠä»ŁèĄšç»„æˆă€‚äž»èŠç”šäșŽèżèŸ“ćŒ…èŁ…ïŒŒæ˜Żć°ćˆ·æĄä»¶èŸƒć·źïŒŒäžć…èźžć°ćˆ·EAN-13撌UPC-AæĄç æ—¶ćș”é€‰ç”šçš„äž€ç§æĄç ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + ITF?: number; + /** + * MaxiCodeäșŒç»Žç ïŒŒæ•°ć€Œäžș12 + * 1996ćčŽæ—¶ïŒŒçŸŽć›œè‡ȘćŠšèŸšèŻ†ćäŒšïŒˆAIMUSAïŒ‰ćˆ¶ćźšç»Ÿäž€çš„çŹŠć·è§„æ ŒïŒŒç§°äžșMaxicodeäșŒç»ŽæĄç ïŒŒä蟿œ‰äșșç§°USS-MaxicodeäșŒç»ŽæĄç ïŒˆUniform Symbology Specification-MaxicodeïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + MAXICODE?: number; + /** + * PDF 417äșŒç»ŽæĄç ïŒŒæ•°ć€Œäžș13 + * PDF417æĄç æ˜Żç”±çŸŽć›œSYMBOLć…Źćžć‘æ˜Žçš„ïŒŒPDFPortable Data FileïŒ‰æ„æ€æ˜Żâ€œäŸżæșæ•°æźæ–‡ä»¶â€ă€‚ç»„æˆæĄç çš„æŻäž€äžȘæĄç ć­—çŹŠç”±4äžȘæĄć’Œ4äžȘç©șć…±17äžȘæšĄć—æž„æˆïŒŒæ•…ç§°äžșPDF417æĄç ă€‚PDF417æĄç æœ€ć€§çš„äŒ˜ćŠżćœšäșŽć…¶ćșžć€§çš„æ•°æźćźčé‡ć’ŒæžćŒș的çș é”™èƒœćŠ›ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + PDF417?: number; + /** + * RSS 14æĄćœąç»„ćˆç ïŒŒæ•°ć€Œäžș14 + * RSSæĄç æ˜Żæœ‰ć›œé™…ç‰©ć“çŒ–ç ćäŒšEANć’ŒçŸŽć›œç»Ÿäž€ä»Łç ć§”ć‘˜äŒšUCCćŒ€ć‘çš„RSSReduced Space SymbologyïŒ‰æĄç çŹŠć·ă€‚ćźƒæ˜Żäž€ç§äž€ç»Žç ć’ŒäșŒç»Žç çš„ç»„ćˆç ă€‚ć’Œć…¶ćźƒçșżæ€§æĄç ç›žæŻ”RSSçł»ćˆ—ç ćˆ¶ć…·æœ‰æ›Žé«˜çš„ćŻ†ćșŠïŒŒć› äžșćźƒćŻä»„èĄšç€șæ›Žć€šçš„ć­—çŹŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + RSS14?: number; + /** + * æ‰©ć±•ćŒRSSæĄćœąç»„ćˆç ïŒŒæ•°ć€Œäžș15 + * RSSæĄç æ˜Żæœ‰ć›œé™…ç‰©ć“çŒ–ç ćäŒšEANć’ŒçŸŽć›œç»Ÿäž€ä»Łç ć§”ć‘˜äŒšUCCćŒ€ć‘çš„RSSReduced Space SymbologyïŒ‰æĄç çŹŠć·ă€‚ćźƒæ˜Żäž€ç§äž€ç»Žç ć’ŒäșŒç»Žç çš„ç»„ćˆç ă€‚ć’Œć…¶ćźƒçșżæ€§æĄç ç›žæŻ”RSSçł»ćˆ—ç ćˆ¶ć…·æœ‰æ›Žé«˜çš„ćŻ†ćșŠïŒŒć› äžșćźƒćŻä»„èĄšç€șæ›Žć€šçš„ć­—çŹŠă€‚æ‰©ć±•ćŒRSSç æ˜Żé•żćșŠćŻä»„揘挖的çșżæ€§ç ćˆ¶ïŒŒèƒœć€ŸćŻč74äžȘæ•°ć­—ć­—çŹŠæˆ–41äžȘć­—æŻć­—çŹŠçš„AIć•ć…ƒæ•°æźäŒ æ•°æźèż›èĄŒçŒ–ç ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + RSSEXPANDED?: number; + /** + * é€šèż‡ć›Ÿç‰‡æ‰«ç èŻ†ćˆ« + * ç›ŽæŽ„èŸ“ć…„ć›Ÿç‰‡æ‰«ç èŻ†ćˆ«ïŒŒæˆćŠŸæ‰«æćˆ°æĄç æ•°æźćŽé€šèż‡successCallbackć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCallbackć›žè°ƒèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + scan(path?: string, successCB?: (result0: number, result1: string, result2: string) => void, errorCB?: (result: any) => void, filters?: any []): void; + /** + * 戛ć»șBarcodećŻčè±Ą + * 调甚歀æ–čæł•ćˆ›ć»ș搎ćč¶äžäŒšæ˜Ÿç€ș需芁调甚WebviewçȘ—ćŁçš„appendæ–čæł•ć°†ć…¶æ·»ćŠ ćˆ°WebviewçȘ—ćŁćŽæ‰èƒœæ˜Ÿç€ș。 + * æłšæ„ïŒšæ­€æ—¶éœ€èŠé€šèż‡stylesć‚æ•°çš„top/left/width/heightć±žæ€§èźŸçœźæŽ§ä»¶çš„äœçœźćŠć€§ć°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + create(id?: string, filters?: any [], styles?: PlusBarcodeBarcodeStyles): PlusBarcodeBarcode; + /** + * 柄扟ć·Čç»ćˆ›ć»ș的BarcodećŻčè±Ą + * 调甚歀æ–čæł•æŸ„æ‰ŸæŒ‡ćźšid的BarcodećŻčè±ĄïŒŒćŠ‚æžœäžć­˜ćœšćˆ™èż”ć›žnull。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + getBarcodeById(id?: string): PlusBarcodeBarcode; +} + +/** + * Barcode扫码控件ćŻčè±Ą + * BarcodećŻčè±ĄèĄšç€șæĄç èŻ†ćˆ«æŽ§ä»¶ćŻčè±ĄïŒŒćœšçȘ—ćŁäž­æ˜Ÿç€șæĄç èŻ†ćˆ«æŽ§ä»¶ïŒŒäœżç”šæ­€ćŻčè±ĄćŻè‡Ș漚ä艿Ąç èŻ†ćˆ«ç•Œéąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ +interface PlusBarcodeBarcode { + /** + * æĄç èŻ†ćˆ«æˆćŠŸäș‹ä»¶ + * Barcodeæ‰«ç æŽ§ä»¶èŻ†ćˆ«ćˆ°æœ‰æ•ˆçš„æĄç æ•°æźæ—¶è§Šć‘çš„æˆćŠŸäș‹ä»¶ïŒŒćč¶èż”ć›žæ‰«ç ç»“æžœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + onmarked?: (result0: number, result1: string, result2: string) => void; + /** + * æĄç èŻ†ćˆ«é”™èŻŻäș‹ä»¶ + * ææŽ§ä»¶èŻ†ćˆ«èż‡çš‹äž­ć‘ç”Ÿé”™èŻŻæ—¶è§Šć‘çš„ć€±èŽ„äș‹ä»¶ïŒŒćč¶èż”ć›žé”™èŻŻäżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + onerror?: (result: any) => void; + /** + * ćŒ€ć§‹æĄç èŻ†ćˆ« + * ćŒ€ć§‹è°ƒç”šçł»ç»Ÿæ‘„ćƒć€ŽèŽ·ć–ć›Ÿç‰‡æ•°æźèż›èĄŒæ‰«ç èŻ†ćˆ«ïŒŒćœ“èŻ†ćˆ«ć‡șæĄç æ•°æźæ—¶é€šèż‡onmarkedć›žè°ƒć‡œæ•°èż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + start(optons?: PlusBarcodeBarcodeOptions): void; + /** + * ç»“æŸæĄç èŻ†ćˆ« + * 结束ćŻčæ‘„ćƒć€ŽèŽ·ć–ć›Ÿç‰‡æ•°æźèż›èĄŒæĄç èŻ†ćˆ«æ“äœœïŒŒćŒæ—¶ć…łé—­æ‘„ćƒć€Žçš„è§†éą‘æ•èŽ·ă€‚ + * ç»“æŸćŽćŻè°ƒç”šstartæ–čæł•é‡æ–°ćŒ€ć§‹èŻ†ćˆ«ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + cancel(): void; + /** + * ć…łé—­æĄç èŻ†ćˆ«æŽ§ä»¶ + * é‡Šæ”ŸæŽ§ä»¶ć ç”šçł»ç»Ÿè”„æșïŒŒè°ƒç”šcloseæ–čæł•ćŽæŽ§ä»¶ćŻčè±Ąć°†äžćŻäœżç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + close(): void; + /** + * æ˜ŻćŠćŒ€ćŻé—Ș慉灯 + * èźŸçœźBarcodeæ‰«ç æŽ§ä»¶ćœšæ‰«ç æ—¶æ˜ŻćŠćŒ€ćŻæ‘„ćƒć€Žçš„é—Șć…‰çŻïŒŒé»˜èź€ć€ŒäžșäžćŒ€ćŻé—Ș慉灯。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + setFlash(open?: boolean): void; + /** + * èźŸçœźBarcodeæ‰«ç æŽ§ä»¶çš„é…çœźć‚æ•° + * 甹äșŽćŠšæ€æ›Žæ–°Barcodeæ‰«ç æŽ§ä»¶çš„ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + setStyles(styles?: PlusBarcodeBarcodeStyles): void; +} + +/** + * Barcodeæ‰«ç æŽ§ä»¶æ ·ćŒ + * èźŸçœźBarcodeæ‰«ç æŽ§ä»¶çš„æ ·ćŒïŒŒćŠ‚æ‰«ç æĄ†ă€æ‰«ç æĄçš„éąœè‰Č等。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ +interface PlusBarcodeBarcodeStyles { + /** + * æĄç èŻ†ćˆ«æŽ§ä»¶èƒŒæ™Żéąœè‰Č + * 鱜è‰Čć€Œæ”ŻæŒ(ć‚è€ƒCSS鱜è‰Č规范)ïŒšéąœè‰Č損称(ć‚è€ƒCSS Color Names)/ćć…­èż›ćˆ¶ć€Œ/rgbć€ŒïŒŒé»˜èź€ć€Œäžșçșąè‰Č。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + background?: string; + /** + * æ‰«ç æĄ†éąœè‰Č + * 鱜è‰Čć€Œæ”ŻæŒ(ć‚è€ƒCSS鱜è‰Č规范)ïŒšéąœè‰Č損称(ć‚è€ƒCSS Color Names)/ćć…­èż›ćˆ¶ć€Œ/rgbć€Œ/rgbać€ŒïŒŒé»˜èź€ć€Œäžșçșąè‰Č。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + frameColor?: string; + /** + * æ‰«ç æĄéąœè‰Č + * 鱜è‰Čć€Œæ”ŻæŒ(ć‚è€ƒCSS鱜è‰Č规范)ïŒšéąœè‰Č損称(ć‚è€ƒCSS Color Names)/ćć…­èż›ćˆ¶ć€Œ/rgbć€Œ/rgbać€ŒïŒŒé»˜èź€ć€Œäžșçșąè‰Č。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + scanbarColor?: string; + /** + * Barcodeæ‰«ç æŽ§ä»¶ć·ŠäžŠè§’çš„ćž‚ç›Žćç§»é‡ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶WebviewçȘ—ćŁçš„é«˜ćșŠïŒ› + * è‡ȘćŠšèźĄçź—ïŒŒćŠ‚"auto",æ čæźheightć€Œè‡ȘćŠšèźĄçź—ïŒŒç›žćŻčäșŽçˆ¶WebviewçȘ—ćŁćž‚ç›Žć±…äž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + top?: string; + /** + * Barcodeæ‰«ç æŽ§ä»¶ć·ŠäžŠè§’çš„æ°Žćčłćç§»é‡ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶WebviewçȘ—ćŁçš„ćźœćșŠïŒ› + * è‡ȘćŠšèźĄçź—ïŒŒćŠ‚"auto"æ čæźwidthć€Œè‡ȘćŠšèźĄçź—ïŒŒç›žćŻčäșŽçˆ¶WebviewçȘ—ćŁæ°Žćčłć±…䞭。 + * é»˜èź€ć€Œäžș"0px"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + left?: string; + /** + * Barcodeæ‰«ç æŽ§ä»¶çš„ćźœćșŠ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶WebviewçȘ—ćŁçš„ćźœćșŠă€‚ + * é»˜èź€ć€Œäžș"100%"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + width?: string; + /** + * Barcode扫码控件的高ćșŠ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶WebviewçȘ—ćŁçš„é«˜ćșŠă€‚ + * é»˜èź€ć€Œäžș"100%"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + height?: string; + /** + * Barcodeæ‰«ç æŽ§ä»¶ćœšWebviewçȘ—ćŁçš„ćžƒć±€æšĄćŒ + * ćŻć–ć€ŒïŒš + * "static" - é™æ€ćžƒć±€æšĄćŒïŒŒćŠ‚æžœéĄ”éąć­˜ćœšæ»šćŠšæĄćˆ™éšçȘ—ćŁć†…ćźčæ»šćŠšïŒ› + * "absolute" - 绝ćŻčćžƒć±€æšĄćŒïŒŒćŠ‚æžœéĄ”éąć­˜ćœšæ»šćŠšæĄäžéšçȘ—ćŁć†…ćźčæ»šćŠšïŒ› + * é»˜èź€ć€Œäžș"static"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + position?: string; +} + +/** + * æĄç èŻ†ćˆ«æŽ§ä»¶æ‰«æć‚æ•° + * èźŸçœźBarcodeæ‰«ç æŽ§ä»¶çš„æ‰«ç èŻ†ćˆ«ć‚æ•°ïŒŒćŠ‚æ˜ŻćŠäżć­˜æ‰«ç ćŠŸæ—¶çš„æˆȘć›Ÿç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ +interface PlusBarcodeBarcodeOptions { + /** + * æ˜ŻćŠäżć­˜æ‰«ç æˆćŠŸæ—¶çš„æˆȘć›Ÿ + * ćŠ‚æžœèźŸçœźäžștruećˆ™ćœšæ‰«ç æˆćŠŸæ—¶ć°†ć›Ÿç‰‡äżć­˜ïŒŒćč¶é€šèż‡onmarkedć›žè°ƒć‡œæ•°çš„fileć‚æ•°èż”ć›žäżć­˜æ–‡ä»¶çš„è·ŻćŸ„ă€‚ + * é»˜èź€ć€ŒäžșfalseïŒŒäžäżć­˜æˆȘć›Ÿă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + conserve?: boolean; + /** + * äżć­˜æ‰«ç æˆćŠŸæ—¶ć›Ÿç‰‡äżć­˜è·ŻćŸ„ + * ćŻé€šèż‡æ­€ć‚æ•°èźŸçœźäżć­˜æˆȘć›Ÿçš„è·ŻćŸ„ć’Œćç§°ïŒŒćŠ‚æžœèźŸçœźć›Ÿç‰‡æ–‡ä»¶ćç§°ćˆ™ćż…éĄ»æŒ‡ćźšæ–‡ä»¶çš„ćŽçŒ€ćïŒˆćż…éĄ»æ˜Ż.pngïŒ‰ïŒŒćŠćˆ™èź€äžșæ˜ŻæŒ‡ćźšç›źćœ•ïŒŒæ–‡ä»¶ćç§°ćˆ™è‡ȘćŠšç”Ÿæˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + filename?: string; + /** + * æ‰«ç æˆćŠŸæ—¶æ˜ŻćŠéœ€èŠéœ‡ćŠšæé†’ + * ćŠ‚æžœèźŸçœźäžștruećˆ™ćœšæ‰«ç æˆćŠŸæ—¶éœ‡ćŠšèźŸć€‡ïŒŒfalse戙侍震抹。 + * é»˜èź€ć€Œäžștrue。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + vibrate?: boolean; + /** + * æ‰«ç æˆćŠŸæ—¶æ’­æ”Ÿçš„æç€ș音 + * ćŻć–ć€ŒïŒš + * "none" - 䞍播攟提ç€șéŸłïŒ› + * "default" - æ’­æ”Ÿé»˜èź€æç€șéŸłïŒˆ5+ćŒ•æ“Žć†…çœźïŒ‰ă€‚ + * é»˜èź€ć€Œäžș"default"。 + * - none: æ‰«ç æˆćŠŸæ—¶äžæ’­æ”Ÿæç€ș音 + * - default: æ‰«ç æˆćŠŸæ—¶æ’­æ”Ÿé»˜èź€æç€ș音 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + sound?: 'none' | 'default'; +} + +/** + * MapsæšĄć—çźĄç†ćœ°ć›ŸæŽ§ä»¶ïŒŒç”šäșŽćœšwebéĄ”éąäž­æ˜Ÿç€șćœ°ć›ŸæŽ§ä»¶ïŒŒæäŸ›ć„ç§æŽ„ćŁæ“äœœćœ°ć›ŸæŽ§ä»¶ïŒŒćŠ‚æ·»ćŠ æ ‡ç‚čă€è·Żçșżç­‰ă€‚é€šèż‡plus.mapsćŻèŽ·ć–ćœ°ć›ŸçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMaps { + /** + * ćœ°ć›ŸæŽ§ä»¶ćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + Map?: PlusMapsMap; + /** + * ćœ°ć›ŸæŽ§ä»¶ćŻčè±Ąçš„ć‚æ•° + * èźŸçœźćœ°ć›ŸćŻčè±Ąæ˜Ÿç€șæ—¶äœżç”šçš„ć‚æ•°ïŒŒćŠ‚ćœ°ć›Ÿçš„äž­ćżƒäœçœźă€çŒ©æ”Ÿçș§ćˆ«ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + MapStyles?: PlusMapsMapStyles; + /** + * ćœ°ç†çŒ–ç èœŹæąçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + GeocodeOptions?: PlusMapsGeocodeOptions; + /** + * ćœ°ć›Ÿćæ ‡èœŹæąçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + CoordinateConvertOptions?: PlusMapsCoordinateConvertOptions; + /** + * PointćŻčè±Ąç”šäșŽèĄšç€șćœ°ć›Ÿć…ƒçŽ çš„ćæ ‡ + * ćžžç”šèŻ­ćŻčćœ°ć›ŸäžŠć…ƒçŽ èż›èĄŒćźšäœæ—¶äœżç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + Point?: PlusMapsPoint; + /** + * 朰理ćŒș㟟 + * æœ‰è„żć—ćŠäžœćŒ—ćæ ‡ç‚čæ•°æźç»„æˆçš„çŸ©ćœąćŒș柟。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + Bounds?: PlusMapsBounds; + /** + * ćœ°ć›Ÿè§†ć›Ÿç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + MapType?: PlusMapsMapType; + /** + * ćœ°ć›ŸèŠ†ç›–ç‰©ćŸșç±»ćŻčè±Ą + * Overlayæ˜Żćœ°ć›ŸäžŠæ˜Ÿç€ș慃箠的ćŸș类甚äșŽæŠœè±Ąćœ°ć›Ÿć…ƒçŽ ïŒŒäžç”šäșŽćźžäŸ‹ćŒ–。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + Overlay?: PlusMapsOverlay; + /** + * ćœ°ć›ŸäžŠæ˜Ÿç€ș的标ç‚čćŻčè±Ą + * 从OverlayćŻčè±Ąç»§æ‰żè€Œæ„ïŒŒćŻé€šèż‡MapćŻčè±Ąçš„addOverlay()æ–čæł•ć°†ćŻčè±Ąæ·»ćŠ ćœ°ć›Ÿäž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + Marker?: PlusMapsMarker; + /** + * ćœ°ć›ŸäžŠæ˜Ÿç€șçš„æ°”æłĄćŻčè±Ą + * æ­€ćŻčè±Ąäžèƒœç›ŽæŽ„æ·»ćŠ ćˆ°ćœ°ć›ŸäžŠæ˜Ÿç€șćȘćŻć…łè”ćˆ°ćœ°ć›Ÿæ ‡ç‚č芆盖物䞊甚户ç‚čć‡»æ ‡ç‚č时ćŒčć‡ș星ç€ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + Bubble?: PlusMapsBubble; + /** + * ćœ°ć›ŸäžŠæ˜Ÿç€ș的朆月ćŻčè±Ą + * 从OverlayćŻčè±Ąç»§æ‰żè€Œæ„ïŒŒćŻé€šèż‡MapćŻčè±Ąçš„addOverlay()æ–čæł•ć°†ćŻčè±Ąæ·»ćŠ ćœ°ć›Ÿäž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + Circle?: PlusMapsCircle; + /** + * ćœ°ć›ŸäžŠæ˜Ÿç€ș的折çșżćŻčè±Ą + * 从OverlayćŻčè±Ąç»§æ‰żè€Œæ„ïŒŒćŻé€šèż‡MapćŻčè±Ąçš„addOverlay()æ–čæł•ć°†ćŻčè±Ąæ·»ćŠ ćœ°ć›Ÿäž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + Polyline?: PlusMapsPolyline; + /** + * ćœ°ć›ŸäžŠæ˜Ÿç€ș的怚èŸčćœąćŻčè±Ą + * 从OverlayćŻčè±Ąç»§æ‰żè€Œæ„ïŒŒćŻé€šèż‡MapćŻčè±Ąçš„addOverlay()æ–čæł•ć°†ćŻčè±Ąæ·»ćŠ ćœ°ć›Ÿäž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + Polygon?: PlusMapsPolygon; + /** + * ćœ°ć›ŸæŁ€çŽąćŻčè±Ą + * SearchćŻčè±Ąç”šäșŽçźĄç†ćœ°ć›ŸäžŠçš„æŁ€çŽąćŠŸèƒœïŒŒćŒ…æ‹ŹäœçœźæŁ€çŽąă€ć‘šèŸčæŁ€çŽąć’ŒèŒƒć›ŽæŁ€çŽąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + Search?: PlusMapsSearch; + /** + * æŁ€çŽąç­–ç•„ç±»ćž‹ + * 朹çșżè·ŻæŁ€çŽąæ—¶èźŸçœźæŁ€çŽąç­–ç•„æ—¶äœżç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + SearchPolicy?: PlusMapsSearchPolicy; + /** + * äżć­˜äœçœźæŁ€çŽąă€ć‘šèŸčæŁ€çŽąć’ŒèŒƒć›ŽæŁ€çŽąèż”ć›žçš„ç»“æžœ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + SearchPoiResult?: PlusMapsSearchPoiResult; + /** + * äżć­˜äœçœźæŁ€çŽąă€ć‘šèŸčæŁ€çŽąć’ŒèŒƒć›ŽæŁ€çŽąèż”ć›žçš„ç»“æžœ + * äžćŻé€šèż‡newæ“äœœçŹŠćˆ›ć»șSearchRouteResultćŻčè±ĄïŒŒćœšè§Šć‘onRouteSearchComplete()时è‡Ș抹戛ć»ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + SearchRouteResult?: PlusMapsSearchRouteResult; + /** + * æŁ€çŽąç»“æžœçš„äœçœźç‚č + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + Position?: PlusMapsPosition; + /** + * ćœ°ć›Ÿäž­çš„è·ŻçșżćŻčè±Ą + * 从OverlayćŻčè±Ąç»§æ‰żè€Œæ„ïŒŒćŻé€šèż‡MapćŻčè±Ąçš„addOverlay()æ–čæł•ć°†ćŻčè±Ąæ·»ćŠ ćœ°ć›Ÿäž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + Route?: PlusMapsRoute; + /** + * è°ƒç”šçł»ç»ŸçŹŹäž‰æ–č繋ćșèż›èĄŒćŻŒèˆȘ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + openSysMap(dst?: PlusMapsPoint, des?: string, src?: PlusMapsPoint): void; + /** + * 戛ć»șMapćŻčè±Ą + * 调甚歀æ–čæł•ćˆ›ć»ș搎ćč¶äžäŒšæ˜Ÿç€ș需芁调甚WebviewçȘ—ćŁçš„appendæ–čæł•ć°†ć…¶æ·»ćŠ ćˆ°WebviewçȘ—ćŁćŽæ‰èƒœæ˜Ÿç€ș。 + * æłšæ„ïŒšæ­€æ—¶éœ€èŠé€šèż‡stylesć‚æ•°çš„top/left/width/heightć±žæ€§èźŸçœźæŽ§ä»¶çš„äœçœźćŠć€§ć°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + create(id?: string, styles?: PlusMapsMapStyles): PlusMapsMap; + /** + * 柄扟ć·Čç»ćˆ›ć»ș的MapćŻčè±Ą + * 调甚歀æ–čæł•æŸ„æ‰ŸæŒ‡ćźšid的MapćŻčè±ĄïŒŒćŠ‚æžœäžć­˜ćœšćˆ™èż”ć›žnull。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getMapById(id?: string): PlusMapsMap; +} + +/** + * ćœ°ć›ŸæŽ§ä»¶ćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsMap { + /** + * 甚户ç‚čć‡»ćœ°ć›Ÿäș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + onclick?: (result: PlusMapsPoint) => void; + /** + * ćœ°ć›ŸçŠ¶æ€æ”č揘äș‹ä»¶ + * ç”šæˆ·æ‹–ćŠšă€çŒ©æ”Ÿćœ°ć›Ÿç­‰æ“äœœćźŒæˆćŽè§Šć‘ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + onstatuschanged?: (result: any) => void; + /** + * 静态æ–čæł•ïŒŒèźĄçź—éąç§Ż + * èźĄçź—æŒ‡ćźšćœ°ç†ćŒșćŸŸçš„éąç§ŻïŒŒć•äœäžșćčłæ–č米。 + * æłšïŒšæ­€ćŠŸèƒœä»…ç™ŸćșŠćœ°ć›Ÿæ”ŻæŒïŒŒé«˜ćŸ·ćœ°ć›Ÿæš‚äžæ”ŻæŒæ­€ćŠŸèƒœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + calculateArea(bounds?: PlusMapsBounds, successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; + /** + * 静态æ–čæł•ïŒŒèźĄçź—è·çŠ» + * èźĄçź—ä»ŽpointStartćæ ‡ç‚č戰pointEndćæ ‡çš„ćźžé™…ç›Žçșżè·çŠ»ïŒŒć•äœäžșç±łïŒˆmïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + calculateDistance(pointStart?: PlusMapsPoint, pointEnd?: PlusMapsPoint, successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; + /** + * 静态æ–čæł•ïŒŒćæ ‡èœŹæą + * 氆第侉æ–čćæ ‡çł»ćæ ‡èœŹæąæˆćœ“ć‰ćœ°ć›Ÿçš„ćæ ‡çł»ćæ ‡ă€‚ + * èœŹæąæˆćŠŸé€šèż‡successCallbackèż”ć›žïŒŒèœŹæąć€±èŽ„ćˆ™é€šèż‡errorCallbackèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + convertCoordinates(point?: PlusMapsPoint, options?: PlusMapsCoordinateConvertOptions, successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; + /** + * 静态æ–čæł•ïŒŒćœ°ç†çŒ–ç  + * ć°†ćœ°ç†äœçœźäżĄæŻèœŹæąäžșćæ ‡ç‚č。 + * èœŹæąæˆćŠŸé€šèż‡successCallbackèż”ć›žïŒŒèœŹæąć€±èŽ„ćˆ™é€šèż‡errorCallbackèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + geocode(address?: string, options?: PlusMapsGeocodeOptions, successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; + /** + * 静态æ–čæł•ïŒŒćć‘ćœ°ç†çŒ–ç  + * ć°†ćæ ‡ç‚čèœŹæąäžșćœ°ç†äœçœźäżĄæŻă€‚ + * èœŹæąæˆćŠŸé€šèż‡successCallbackèż”ć›žïŒŒèœŹæąć€±èŽ„ćˆ™é€šèż‡errorCallbackèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + reverseGeocode(point?: PlusMapsPoint, options?: PlusMapsGeocodeOptions, successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; + /** + * ć‘ćœ°ć›Ÿäž­æ·»ćŠ èŠ†ç›–ç‰© + * æ­€æ–čæł•甚äșŽć‘ćœ°ć›Ÿäž­æ·»ćŠ èŠ†ç›–ç‰©ă€‚ + * æ”ŻæŒć„ç§ä»Žmaps.OverlayćŻčè±Ąç»§æ‰żçš„ć„ç§èŠ†ç›–ç‰©ćŻčè±ĄïŒ› + * ćŠ‚æžœæ·»ćŠ äžæ”ŻæŒçš„ćŻčè±Ąćˆ™ç›ŽæŽ„èż”ć›žfalse + * ćŒäž€èŠ†ç›–ç‰©ćŻčè±ĄćȘèƒœæ·»ćŠ ćˆ°ćœ°ć›Ÿäž­äž€æŹĄïŒŒć·Čćœšćœ°ć›Ÿäž­çš„èŠ†ç›–ç‰©ć†æŹĄæ·»ćŠ æ—¶ćˆ™èż”ć›žfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + addOverlay(overlay?: PlusMapsOverlay): boolean; + /** + * èźŸçœźćœ°ć›Ÿćˆć§‹äž­ćżƒç‚čć’ŒçŒ©æ”Ÿçș§ćˆ« + * 甹äșŽèźŸçœźćœ°ć›Ÿçš„ćˆć§‹äž­ćżƒç‚čć’ŒçŒ©æ”Ÿçș§ćˆ«ïŒŒé€šćžžćœšćˆ›ć»șćœ°ć›ŸćŽç«‹ćłè°ƒç”šă€‚ + * é»˜èź€äž­ćżƒç‚čäžșć€©ćź‰é—šïŒŒé»˜èź€çŒ©æ”Ÿçș§ćˆ«äžș12 + * èŻ„æ–čæł•èźŸçœźçš„äž­ćżƒç‚čć’ŒçŒ©æ”Ÿçș§ćˆ«ćŻé€šèż‡reset()æ–čæł•æąć€ïŒ› + * ćŠ‚æžœćœšćœ°ć›Ÿæ˜Ÿç€șćŽè°ƒç”šć°†æ”čć˜ćœ°ć›Ÿçš„äž­ćżƒç‚čć’ŒçŒ©æ”Ÿçș§ćˆ«ćč¶ç«‹ćłæ›Žæ–°ïŒŒćč¶ć°†ćˆć§‹ć€Œæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + centerAndZoom(center?: PlusMapsPoint, zoom?: number): void; + /** + * æž…é™€ćœ°ć›Ÿäž­æ‰€æœ‰èŠ†ç›–ç‰©ćŻčè±Ą + * æ­€æ–čæł•甚äșŽæž…é™€ćœ°ć›Ÿäž­æ‰€æœ‰èŠ†ç›–ç‰©ćŻčè±Ąă€‚ + * æž…é™€ćœ°ć›Ÿäž­çš„èŠ†ç›–ç‰©ćŻčè±ĄćŽäŒšè‡ȘćŠšæ›Žæ–°ćœ°ć›Ÿè§†ć›Ÿă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + clearOverlays(): void; + /** + * ć…łé—­ćœ°ć›ŸæŽ§ä»¶ + * ć…łé—­ćœ°ć›ŸæŽ§ä»¶ć°†äŒšé”€æŻćœ°ć›Ÿäœżç”šçš„è”„æșïŒŒäžćŻć†äœżç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + close(): void; + /** + * èŽ·ć–ćœ“ć‰ćœ°ć›ŸćŻè§†èŒƒć›Žçš„ćœ°ç†ćŒș㟟 + * ćœ“æ—‹èœŹæˆ–äżŻè§†æ—¶ïŒŒæ˜Żćœ“ć‰ćœ°ć›ŸćŻè§†èŒƒć›Žçš„æœ€ć€§ć€–æŽ„çŸ©ćœąćœ°ç†ćŒș柟。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getBounds(): PlusMapsBounds; + /** + * èŽ·ć–ćœ°ć›Ÿäž­ćżƒç‚čäœçœź + * æ­€æ–čæł•甚äșŽèŽ·ć–èźŸçœźçš„ćœ°ć›Ÿäž­ćżƒç‚čäœçœźïŒˆcenterAndZoom/setCenterïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getCenter(): PlusMapsPoint; + /** + * èŽ·ć–ćœ“ć‰ćœ°ć›Ÿæ˜Ÿç€șçš„ćœ°ć›Ÿäž­ćżƒç‚čäœçœź + * æ­€æ–čæł•甚äșŽèŽ·ć–ćœ“ć‰ćœ°ć›Ÿæ˜Ÿç€șçš„ćœ°ć›Ÿäž­ćżƒç‚čäœçœźïŒŒèŽ·ć–æˆćŠŸćŽé€šèż‡callbackć›žè°ƒèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getCurrentCenter(callback?: (result0: number, result1: PlusMapsPoint) => void): boolean; + /** + * èŽ·ć–ćœ°ć›Ÿçš„æ˜Ÿç€ș类枋 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getMapType(): PlusMapsMapType; + /** + * èŽ·ć–ç”šæˆ·çš„ćœ“ć‰äœçœźäżĄæŻ + * æ­€æ–čæł•甚äșŽèŽ·ć–ç”šæˆ·çš„ćœ“ć‰äœçœźäżĄæŻïŒŒèŽ·ć–æˆćŠŸćŽé€šèż‡callbackć›žè°ƒèż”ć›žă€‚ + * èŽ·ć–ç”šæˆ·ćœ“ć‰äœçœźäżĄæŻć°†æ‰“ćŒ€ćźšäœèźŸć€‡ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getUserLocation(callback?: (result0: number, result1: PlusMapsPoint) => void): boolean; + /** + * èŽ·ć–ćœ°ć›Ÿçš„çŒ©æ”Ÿçș§ćˆ« + * æ­€æ–čæł•甚äșŽèźŸçœźćœ°ć›Ÿçš„猩攟çș§ćˆ«ïŒŒç”šäșŽćˆ‡æąćœ“ć‰æ˜Ÿç€șćœ°ć›ŸçŒ©æ”Ÿçș§ćˆ«ă€‚ + * èŻ„æ–čæł•æ”čć˜çŒ©æ”Ÿçș§ćˆ«ćŽćœ°ć›Ÿæ˜Ÿç€ș憅ćźčć°†ç«‹ćłæ›Žæ–°ïŒ› + * èŻ„æ–čæł•䞍䌚æ”čć˜ćœ°ć›Ÿæ˜Ÿç€șćŒșćŸŸïŒŒä»„ćœ“ć‰ćœ°ć›Ÿæ˜Ÿç€ș的侭濃ç‚čäœçœźæ„çŒ©æ”Ÿćœ°ć›Ÿă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getZoom(): number; + /** + * éšè—ćœ°ć›ŸæŽ§ä»¶ + * æ­€æ–čæł•甚äșŽéšè—ćœ°ć›ŸæŽ§ä»¶ïŒŒé€šćžžćœšæ˜Ÿç€șćŽè°ƒç”šæ­€æ–čæł•æ„éšè—ă€‚ + * ćŠ‚æžœćœ°ć›Ÿć·Čç»éšè—ć†è°ƒç”šæ­€æ–čæł•ć°†æ— æ•ˆæžœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + hide(): void; + /** + * èŽ·ć–æ˜ŻćŠæ˜Ÿç€șç”šæˆ·äœçœź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + isShowUserLocation(): boolean; + /** + * èŽ·ć–æ˜ŻćŠæ˜Ÿç€șćœ°ć›Ÿć†…çœźçŒ©æ”ŸæŽ§ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + isShowZoomControls(): boolean; + /** + * èŽ·ć–æ˜ŻćŠæ‰“ćŒ€ćœ°ć›Ÿäș€é€šäżĄæŻć›Ÿć±‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + isTraffic(): boolean; + /** + * ä»Žćœ°ć›Ÿäž­ćˆ é™€èŠ†ç›–ç‰©ćŻčè±Ą + * æ­€æ–čæł•甚äșŽä»Žćœ°ć›Ÿäž­ćˆ é™€èŠ†ç›–ç‰©ćŻčè±Ąă€‚ + * æ”ŻæŒć„ç§ä»Žmaps.OverlayćŻčè±Ąç»§æ‰żçš„ć„ç§èŠ†ç›–ç‰©ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + removeOverlay(overlay?: PlusMapsOverlay): void; + /** + * é‡çœźćœ°ć›Ÿ + * æ­€æ–čæł•甚äșŽé‡æ–°èźŸçœźćœ°ć›ŸïŒŒæąć€ćœ°ć›Ÿçš„ćˆć§‹ćŒ–æ—¶çš„äž­ćżƒç‚čć’ŒçŒ©æ”Ÿçș§ćˆ«ă€‚ + * èŻ„æ–čæł•ć°†ćŻŒè‡Žæ˜Ÿç€ș憅ćźčć°†ç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + reset(): void; + /** + * é‡èźŸćœ°ć›ŸæŽ§ä»¶ć€§ć° + * æ­€æ–čæł•甚äșŽé‡æ–°èźĄçź—ćœ°ć›ŸæŽ§ä»¶ć€§ć°ïŒŒäżæŒäžŽæž„é€ æ—¶äŒ ć…„DOMć…ƒçŽ çš„ć€§ć°ćŠäœçœźäž€è‡Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + resize(): void; + /** + * èźŸçœźćœ°ć›Ÿçš„äž­ćżƒç‚č + * æ­€æ–čæł•甚äșŽèźŸçœźćœ°ć›Ÿçš„äž­ćżƒç‚č甚äșŽćˆ‡æąćœ“ć‰æ˜Ÿç€șćœ°ć›Ÿäœçœźă€‚ + * èŻ„æ–čæł•æ”č揘侭濃ç‚čćŽćœ°ć›Ÿæ˜Ÿç€ș憅ćźčć°†ç«‹ćłæ›Žæ–°ïŒ› + * èŻ„æ–čæł•䞍䌚æ”čć˜ćœ°ć›Ÿæ˜Ÿç€ș的猩攟çș§ćˆ«ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setCenter(center?: PlusMapsPoint): void; + /** + * èźŸçœźćœ°ć›Ÿçš„è§†ć›Ÿç±»ćž‹ + * æ­€æ–čæł•甚äșŽèźŸçœźćœ°ć›Ÿç±»ćž‹ïŒŒé»˜èź€äžșæ™źé€šèĄ—é“è§†ć›Ÿă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setMapType(type?: PlusMapsMapType): void; + /** + * èźŸçœźćœ°ć›ŸæŽ§ä»¶çš„é…çœźć‚æ•° + * 甹äșŽćŠšæ€æ›Žæ–°ćœ°ć›ŸæŽ§ä»¶çš„ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setStyles(styles?: PlusMapsMapStyles): void; + /** + * æ˜ŻćŠæ‰“ćŒ€ćœ°ć›Ÿäș€é€šäżĄæŻć›Ÿć±‚ + * æ­€æ–čæł•甚äșŽèźŸçœźæ˜ŻćŠæ‰“ćŒ€ćœ°ć›Ÿäș€é€šäżĄæŻć›Ÿć±‚ïŒŒé»˜èź€äžæ˜Ÿç€ș。 + * èŻ„æ–čæł•æ”čć˜æ˜ŻćŠæ˜Ÿç€șäș€é€šć›Ÿć±‚ćŽćœ°ć›Ÿæ˜Ÿç€ș憅ćźčć°†ç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setTraffic(traffic?: boolean): void; + /** + * èźŸçœźćœ°ć›Ÿçš„çŒ©æ”Ÿçș§ćˆ« + * æ­€æ–čæł•甚äșŽèźŸçœźćœ°ć›Ÿçš„猩攟çș§ćˆ«ïŒŒç”šäșŽćˆ‡æąćœ“ć‰æ˜Ÿç€șćœ°ć›ŸçŒ©æ”Ÿçș§ćˆ«ă€‚ + * èŻ„æ–čæł•æ”čć˜çŒ©æ”Ÿçș§ćˆ«ćŽćœ°ć›Ÿæ˜Ÿç€ș憅ćźčć°†ç«‹ćłæ›Žæ–°ïŒ› + * èŻ„æ–čæł•䞍䌚æ”čć˜ćœ°ć›Ÿæ˜Ÿç€șćŒșćŸŸïŒŒä»„ćœ“ć‰ćœ°ć›Ÿæ˜Ÿç€ș的侭濃ç‚čäœçœźæ„çŒ©æ”Ÿćœ°ć›Ÿă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setZoom(zoom?: number): void; + /** + * 星ç€șćœ°ć›ŸæŽ§ä»¶ + * æ­€æ–čæł•甚äșŽæ˜Ÿç€șćœ°ć›ŸæŽ§ä»¶ïŒŒé€šćžžćœšéšè—ćŽè°ƒç”šæ­€æ–čæł•杄星ç€ș。 + * ćŠ‚æžœćœ°ć›Ÿć·Č经星ç€șć†è°ƒç”šæ­€æ–čæł•ć°†æ— æ•ˆæžœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + show(): void; + /** + * 星ç€șç”šæˆ·äœçœź + * æ­€æ–čæł•ć°†ćœšćœ°ć›ŸäžŠæ˜Ÿç€șç”šæˆ·äœçœźäżĄæŻă€‚ + * 星ç€șç”šæˆ·äœçœźć°†æ‰“ćŒ€ćźšäœèźŸć€‡ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + showUserLocation(display?: boolean): void; + /** + * èźŸçœźæ˜ŻćŠæ˜Ÿç€șćœ°ć›Ÿć†…çœźçŒ©æ”ŸæŽ§ä»¶ + * æ­€æ–čæł•ć°†ćœšćœ°ć›ŸäžŠæ˜Ÿç€șć†…çœźçŒ©æ”ŸæŽ§ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + showZoomControls(display?: boolean): void; +} + +/** + * ćœ°ć›ŸæŽ§ä»¶ćŻčè±Ąçš„ć‚æ•° + * èźŸçœźćœ°ć›ŸćŻčè±Ąæ˜Ÿç€șæ—¶äœżç”šçš„ć‚æ•°ïŒŒćŠ‚ćœ°ć›Ÿçš„äž­ćżƒäœçœźă€çŒ©æ”Ÿçș§ćˆ«ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsMapStyles { + /** + * ćœ°ć›Ÿçš„äž­ćżƒäœçœź + * æœȘèźŸçœźćˆ™äœżç”šćœ°ć›Ÿçš„é»˜èź€äž­ćżƒç‚čïŒˆç”±ćœ°ć›ŸäŸ›ćș”ć•†çĄźćźšïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + center?: PlusMapsPoint; + /** + * ćœ°ć›Ÿçš„çŒ©æ”Ÿçș§ćˆ« + * æœ‰æ•ˆèŒƒć›Žäžș1-22ïŒŒé»˜èź€ć€Œäžș12ïŒŒèźŸçœźæ— æ•ˆçš„ć€Œćˆ™äœżç”šé»˜èź€ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + zoom?: number; + /** + * ćœ°ć›Ÿçš„è§†ć›Ÿç±»ćž‹ + * ćŻèźŸçœźæ™źé€šèĄ—é“è§†ć›Ÿă€ć«æ˜Ÿè§†ć›ŸïŒŒé»˜èź€ć€Œäžșæ™źé€šèĄ—é“è§†ć›Ÿă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + type?: PlusMapsMapType; + /** + * ćœ°ć›Ÿçš„æ˜ŻćŠæ˜Ÿç€șäș€é€šäżĄæŻ + * trueèĄšç€ș星ç€șćœ°ć›Ÿçš„äș€é€šäżĄæŻć›Ÿć±‚falsećˆ™äžæ˜Ÿç€șïŒŒé»˜èź€ć€Œäžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + traffic?: boolean; + /** + * æ˜ŻćŠæ˜Ÿç€șćœ°ć›Ÿçš„ć†…çœźçŒ©æ”ŸæŽ§ä»¶ + * trueèĄšç€ș星ç€șćœ°ć›Ÿçš„ć†…çœźçŒ©æ”ŸæŽ§ä»¶ïŒŒfalsećˆ™äžæ˜Ÿç€șïŒŒé»˜èź€ć€Œäžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + zoomControls?: boolean; + /** + * ćœ°ć›ŸæŽ§ä»¶ć·ŠäžŠè§’çš„ćž‚ç›Žćç§»é‡ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶WebviewçȘ—ćŁçš„é«˜ćșŠïŒ› + * è‡ȘćŠšèźĄçź—ïŒŒćŠ‚"auto",æ čæźheightć€Œè‡ȘćŠšèźĄçź—ïŒŒç›žćŻčäșŽçˆ¶WebviewçȘ—ćŁćž‚ç›Žć±…äž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + top?: string; + /** + * ćœ°ć›ŸæŽ§ä»¶ć·ŠäžŠè§’çš„æ°Žćčłćç§»é‡ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶WebviewçȘ—ćŁçš„ćźœćșŠïŒ› + * è‡ȘćŠšèźĄçź—ïŒŒćŠ‚"auto"æ čæźwidthć€Œè‡ȘćŠšèźĄçź—ïŒŒç›žćŻčäșŽçˆ¶WebviewçȘ—ćŁæ°Žćčłć±…䞭。 + * é»˜èź€ć€Œäžș"0px"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + left?: string; + /** + * ćœ°ć›ŸæŽ§ä»¶çš„ćźœćșŠ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶WebviewçȘ—ćŁçš„ćźœćșŠă€‚ + * é»˜èź€ć€Œäžș"100%"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + width?: string; + /** + * ćœ°ć›ŸæŽ§ä»¶çš„é«˜ćșŠ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶WebviewçȘ—ćŁçš„é«˜ćșŠă€‚ + * é»˜èź€ć€Œäžș"100%"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + height?: string; + /** + * ćœ°ć›ŸæŽ§ä»¶ćœšWebviewçȘ—ćŁçš„ćžƒć±€æšĄćŒ + * ćŻć–ć€ŒïŒš + * "static" - é™æ€ćžƒć±€æšĄćŒïŒŒćŠ‚æžœéĄ”éąć­˜ćœšæ»šćŠšæĄćˆ™éšçȘ—ćŁć†…ćźčæ»šćŠšïŒ› + * "absolute" - 绝ćŻčćžƒć±€æšĄćŒïŒŒćŠ‚æžœéĄ”éąć­˜ćœšæ»šćŠšæĄäžéšçȘ—ćŁć†…ćźčæ»šćŠšïŒ› + * é»˜èź€ć€Œäžș"static"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + position?: string; +} + +/** + * ćœ°ç†çŒ–ç èœŹæąçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsGeocodeOptions { + /** + * æșæ•°æźçš„ćæ ‡çł»ç±»ćž‹ + * ä»…ćœšćć‘ćœ°ç†çŒ–ç èœŹæąæ—¶ç”Ÿæ•ˆă€‚ + * “wgs84â€ïŒšèĄšç€șWGS-84ćæ ‡çł»ïŒ› “gcj02â€ïŒšèĄšç€șć›œæ”‹ć±€ç»çșŹćșŠćæ ‡çł»ïŒ› “bd09â€ïŒšèĄšç€ș癟ćșŠćąšćĄæ‰˜ćæ ‡çł»ïŒ› “bd09llâ€ïŒšèĄšç€ș癟ćșŠç»çșŹćșŠćæ ‡çł»ïŒ› + * é»˜èź€äœżç”šwgs84ćæ ‡çł»ă€‚ + * - wgs84: WGS-84ćæ ‡çł»ïŒŒćłGPSèźŸć€‡é‡‡é›†çš„ćŽŸć§‹GPSćæ ‡ + * - gcj02: ć›œæ”‹ć±€ç»çșŹćșŠćæ ‡çł»ïŒŒsosoćœ°ć›Ÿă€aliyunćœ°ć›Ÿă€mapabcćœ°ć›Ÿć’Œamapćœ°ć›Ÿæ‰€ç”šçš„ćæ ‡çł» + * - bd09: 癟ćșŠćąšćĄæ‰˜ćæ ‡çł» + * - bd09ll: 癟ćșŠç»çșŹćșŠćæ ‡çł» + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + coordType?: 'wgs84' | 'gcj02' | 'bd09' | 'bd09ll'; + /** + * æșćœ°ć€æ‰€ć±žçš„ćŸŽćž‚ + * ä»…ćœšćœ°ç†çŒ–ç èœŹæąæ—¶ç”Ÿæ•ˆïŒŒćŠ‚æžœäžæŒ‡ćźšćˆ™ćœšć…šć›œèŒƒć›Žć†…ćŒșé…èœŹæąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + city?: string; +} + +/** + * ćœ°ć›Ÿćæ ‡èœŹæąçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsCoordinateConvertOptions { + /** + * æșæ•°æźçš„ćæ ‡çł»ç±»ćž‹ + * “wgs84â€ïŒšèĄšç€șWGS-84ćæ ‡çł»ïŒ› “gcj02â€ïŒšèĄšç€șć›œæ”‹ć±€ç»çșŹćșŠćæ ‡çł»ïŒ› “bd09â€ïŒšèĄšç€ș癟ćșŠćąšćĄæ‰˜ćæ ‡çł»ïŒ› “bd09llâ€ïŒšèĄšç€ș癟ćșŠç»çșŹćșŠćæ ‡çł»ïŒ› + * é»˜èź€äœżç”šwgs84ćæ ‡çł»ă€‚ + * - wgs84: WGS-84ćæ ‡çł»ïŒŒćłGPSèźŸć€‡é‡‡é›†çš„ćŽŸć§‹GPSćæ ‡ + * - gcj02: ć›œæ”‹ć±€ç»çșŹćșŠćæ ‡çł»ïŒŒsosoćœ°ć›Ÿă€aliyunćœ°ć›Ÿă€mapabcćœ°ć›Ÿć’Œamapćœ°ć›Ÿæ‰€ç”šçš„ćæ ‡çł» + * - bd09: 癟ćșŠćąšćĄæ‰˜ćæ ‡çł» + * - bd09ll: 癟ćșŠç»çșŹćșŠćæ ‡çł» + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + coordType?: 'wgs84' | 'gcj02' | 'bd09' | 'bd09ll'; +} + +/** + * PointćŻčè±Ąç”šäșŽèĄšç€șćœ°ć›Ÿć…ƒçŽ çš„ćæ ‡ + * ćžžç”šèŻ­ćŻčćœ°ć›ŸäžŠć…ƒçŽ èż›èĄŒćźšäœæ—¶äœżç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsPoint { + /** + * èźŸçœźćæ ‡ç‚č的经ćșŠ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setLng(lng?: number): void; + /** + * èŽ·ć–ćæ ‡çš„ç»ćșŠ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getLng(): number; + /** + * èźŸçœźćæ ‡çš„çșŹćșŠ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setLat(): void; + /** + * èŽ·ć–ćæ ‡çš„çșŹćșŠ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getLat(): number; + /** + * ćˆ€æ–­äž€äžȘćæ ‡ç‚čæ˜ŻćŠç›žç­‰ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + equals(pt?: PlusMapsPoint): boolean; +} + +/** + * 朰理ćŒș㟟 + * æœ‰è„żć—ćŠäžœćŒ—ćæ ‡ç‚čæ•°æźç»„æˆçš„çŸ©ćœąćŒș柟。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsBounds { + /** + * èźŸçœźćœ°ç†ćŒșćŸŸçš„äžœćŒ—ćæ ‡ç‚č + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setNorthEase(point?: PlusMapsPoint): void; + /** + * 朰理ćŒșćŸŸçš„äžœćŒ—ćæ ‡ç‚č + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getNorthEase(): PlusMapsPoint; + /** + * èźŸçœźćœ°ç†ćŒșćŸŸçš„è„żć—ćæ ‡ç‚č + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setSouthWest(point?: PlusMapsPoint): void; + /** + * 朰理ćŒșćŸŸçš„è„żć—ćæ ‡ç‚č + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getSouthWest(): PlusMapsPoint; + /** + * ćˆ€æ–­ćˆ¶ćźšçš„ćæ ‡æ˜ŻćŠćœšćœ°ç†ćŒș柟侭 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + contains(point?: PlusMapsPoint): boolean; + /** + * ćˆ€æ–­äž€äžȘ朰理ćŒșćŸŸæ˜ŻćŠç›žç­‰ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + equals(bounds?: PlusMapsBounds): boolean; + /** + * èŽ·ć–ćœ°ç†ćŒș柟的侭濃ç‚čćæ ‡ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getCenter(): PlusMapsPoint; +} + +/** + * ćœ°ć›Ÿè§†ć›Ÿç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsMapType { + /** + * æ™źé€šèĄ—é“è§†ć›Ÿç±»ćž‹ + * ćœ°ć›Ÿè§†ć›Ÿç±»ćž‹ćžžé‡ïŒŒæ™źé€šèĄ—é“è§†ć›Ÿă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + MAPTYPE_NORMAL?: number; + /** + * ć«æ˜Ÿè§†ć›Ÿ + * ćœ°ć›Ÿè§†ć›Ÿç±»ćž‹ćžžé‡ïŒŒć«æ˜Ÿè§†ć›Ÿă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + MAPTYPE_SATELLITE?: number; +} + +/** + * ćœ°ć›ŸèŠ†ç›–ç‰©ćŸșç±»ćŻčè±Ą + * Overlayæ˜Żćœ°ć›ŸäžŠæ˜Ÿç€ș慃箠的ćŸș类甚äșŽæŠœè±Ąćœ°ć›Ÿć…ƒçŽ ïŒŒäžç”šäșŽćźžäŸ‹ćŒ–。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsOverlay { + /** + * ćˆ€æ–­ćœ°ć›ŸèŠ†ç›–ç‰©æ˜ŻćŠćŻè§ + * ćœ°ć›ŸèŠ†ç›–ç‰©ćŻčè±Ąé»˜èź€äžșćŻè§ïŒ›ćœ°ć›ŸèŠ†ç›–ç‰©ćŻčè±Ąæ˜ŻćŠćŻè§ç”±ć…¶è‡Șèș«çŠ¶æ€ć†łćźšïŒŒäžçźĄć…¶æ˜ŻćŠè૿·»ćŠ ćˆ°ćœ°ć›Ÿć±‚äž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + isVisible(): boolean; + /** + * 星ç€șćœ°ć›ŸäžŠçš„èŠ†ç›–ç‰© + * 澾甹äșŽćœ°ć›ŸèŠ†ç›–ç‰©ćœšéšè—ćŽè°ƒç”šæ­€æ–čæł•杄星ç€ș。 + * ćȘæœ‰æ·»ćŠ ćˆ°ćœ°ć›ŸäžŠçš„èŠ†ç›–ç‰©æ‰èƒœçœ‹ćˆ°æ•ˆæžœïŒ› + * ćŠ‚æžœèŠ†ç›–ç‰©ćŻčè±Ąć·Čç»ćœšćœ°ć›ŸäžŠæ˜Ÿç€șć†è°ƒç”šæ­€æ–čæł•ć°†æ— æ•ˆæžœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + show(): void; + /** + * éšè—ćœ°ć›ŸäžŠçš„èŠ†ç›–ç‰© + * 澾甹äșŽćœ°ć›ŸèŠ†ç›–ç‰©ćœšæ˜Ÿç€șćŽè°ƒç”šæ­€æ–čæł•æ„éšè—ă€‚ + * ćȘæœ‰æ·»ćŠ ćˆ°ćœ°ć›ŸäžŠçš„èŠ†ç›–ç‰©æ‰èƒœçœ‹ćˆ°æ•ˆæžœïŒ› + * ćŠ‚æžœèŠ†ç›–ç‰©ćŻčè±Ąć·Čç»ćœšćœ°ć›ŸäžŠéšè—ć†è°ƒç”šæ­€æ–čæł•ć°†æ— æ•ˆæžœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + hide(): void; +} + +/** + * ćœ°ć›ŸäžŠæ˜Ÿç€ș的标ç‚čćŻčè±Ą + * 从OverlayćŻčè±Ąç»§æ‰żè€Œæ„ïŒŒćŻé€šèż‡MapćŻčè±Ąçš„addOverlay()æ–čæł•ć°†ćŻčè±Ąæ·»ćŠ ćœ°ć›Ÿäž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsMarker { + /** + * 甚户ç‚čć‡»ćœ°ć›Ÿæ ‡ç‚čäș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + onclick?: (result: PlusMapsOverlay) => void; + /** + * 甚户拖拜标ç‚čäș‹ä»¶ + * ćŻè°ƒç”šæ ‡ç‚čćŻčè±Ąçš„markObj.setDraggable(true)æ–čæł•èźŸçœźæ ‡ç‚čć…èźžæ‹–æ‹œïŒŒćœ“ç”šæˆ·æ‹–æ‹œæ ‡ç‚čćŻčè±Ąæ—¶è§Šć‘æ­€äș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + onDrag?: (result: any) => void; + /** + * 芆盖物星ç€șćˆ°æœ€äžŠć±‚ + * 澾甹äșŽèŠ†ç›–ç‰©ç›žäș’芆盖时调敎芆盖物的星ç€șéĄșćșă€‚ + * ćȘæœ‰æ·»ćŠ ćˆ°ćœ°ć›ŸäžŠçš„èŠ†ç›–ç‰©æ‰èƒœçœ‹ćˆ°æ•ˆæžœïŒ› + * ćŠ‚æžœèŠ†ç›–ç‰©ćŻčè±Ąć·Čç»ćœšćœ°ć›ŸäžŠéšè—ć†è°ƒç”šæ­€æ–čæł•ć°†æ— æ•ˆæžœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + bringToTop(): void; + /** + * èźŸçœźæ ‡ç‚čćŻčè±Ąçš„ćæ ‡ + * 标ç‚čćœšèźŸçœźæ–°ćæ ‡ćŽć°†ćœšćœ°ć›ŸäžŠç«‹ćłæ›Žæ–°æ ‡ç‚čäœçœźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setPoint(point?: PlusMapsPoint): void; + /** + * èŽ·ć–æ ‡ç‚čçš„ćæ ‡ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getPoint(): PlusMapsPoint; + /** + * èźŸçœźæ ‡ç‚č䞊星ç€șçš„ć›Ÿæ ‡ + * è‹„æœȘèźŸçœźćˆ™æ˜Ÿç€șé»˜èź€æ ‡ç‚čć›Ÿæ ‡ïŒŒć·Čæ·»ćŠ çš„æ ‡ç‚čćœšèźŸçœźæ–°ć€ŒćŽć°†ćœšćœ°ć›ŸäžŠç«‹ćłæ›Žæ–°æ ‡ç‚č憅ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setIcon(icon?: string): void; + /** + * èźŸçœźæ ‡ç‚č䞊星ç€șçš„ć›Ÿæ ‡æ•°ç»„ + * èźŸçœźć›Ÿæ ‡æ•°ç»„ćŽćˆ™æŒ‰ç…§æŒ‡ćźšçš„é—Žéš”æ—¶é—Žèœźæ’­æ•°ç»„äž­ć›Ÿæ ‡ă€‚ + * èźŸçœźć›Ÿæ ‡æ•°ç»„ćŽć°†ćżœç•„setIconæ–čæł•èźŸçœźçš„ć›Ÿæ ‡ïŒŒæœȘèźŸçœźćˆ™æ˜Ÿç€șsetIconèźŸçœźçš„ć›Ÿæ ‡ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setIcons(icons?: any []): void; + /** + * èźŸçœźæ ‡ç‚č䞊星ç€șçš„æ–‡æœŹæ ‡æłš + * è‹„æœȘèźŸçœźćˆ™äžæ˜Ÿç€șæ ‡æłšïŒˆé»˜èź€äžșç©ș歗笩äžČć·Čæ·»ćŠ çš„æ ‡ç‚čćœšèźŸçœźæ–°ć€ŒćŽć°†ćœšćœ°ć›ŸäžŠç«‹ćłæ›Žæ–°æ ‡ç‚č憅ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setLabel(label?: string): void; + /** + * èŽ·ć–æ ‡ç‚č䞊星ç€șçš„æ–‡æœŹæ ‡æłš + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getLabel(): string; + /** + * èźŸçœźæ ‡ç‚čçš„æ°”æłĄć†…ćźč + * èźŸçœźæ°”æłĄć†…ćźčćŽïŒŒç”šæˆ·ç‚čć‡»æ ‡ç‚č时ćŒčć‡ș戙ćŒčć‡șæ°”æłĄă€‚ + * æłšæ„ïŒšç”šæˆ·ç‚čć‡»æ ‡ç‚čæ—¶ć…ˆćŒčć‡ș标ç‚čć…łè”çš„æ°”æłĄïŒŒć†ć“ćș”æ ‡ç‚č的onclickäș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setBubble(buuble?: PlusMapsBubble, pop?: boolean): void; + /** + * èŽ·ć–æ ‡ç‚č䞊星ç€șçš„æ–‡æœŹæ ‡æłš + * ćŠ‚æžœæČĄæœ‰èźŸçœźć…łè”çš„æ°”æłĄćŻčè±Ąćˆ™èż”ć›žnull。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getBubble(): PlusMapsBubble; + /** + * 隐藏标ç‚č䞊星ç€șçš„æ°”æłĄ + * ćŠ‚æžœæČĄæœ‰èźŸçœźć…łè”çš„æ°”æłĄćŻčè±Ąæˆ–è€…æ°”æłĄćŻčè±ĄæČĄæœ‰ćŒčć‡ș星ç€șïŒŒćˆ™äžćšä»»äœ•æ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + hideBubble(): void; + /** + * èźŸçœźæ ‡ç‚čçš„æ˜ŻćŠć…èźžæ‹–æ‹œ + * èźŸçœźæ ‡ç‚čćŻæ‹–æ‹œćŽïŒŒç”šæˆ·æŒ‰äœæ ‡ç‚čćŽæ‹–ćŠšïŒŒæ ‡ç‚čäŒšè·Ÿéšæ‰‹çš„æ‹–æ‹œè€Œç§»ćŠšă€‚ + * æ‹–æ‹œćŽäŒšæ›Žæ–°æ ‡ç‚čçš„ćæ ‡äżĄæŻă€‚ + * æłšïŒšæ‹–ćŠšć‰éœ€èŠć…ˆćœšæ ‡ç‚čäžŠé•żæŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setDraggable(draggable?: boolean): void; + /** + * èŽ·ć–æ ‡ç‚čæ˜ŻćŠć…èźžæ‹–拜 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + isDraggable(): boolean; +} + +/** + * ćœ°ć›ŸäžŠæ˜Ÿç€șçš„æ°”æłĄćŻčè±Ą + * æ­€ćŻčè±Ąäžèƒœç›ŽæŽ„æ·»ćŠ ćˆ°ćœ°ć›ŸäžŠæ˜Ÿç€șćȘćŻć…łè”ćˆ°ćœ°ć›Ÿæ ‡ç‚č芆盖物䞊甚户ç‚čć‡»æ ‡ç‚č时ćŒčć‡ș星ç€ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsBubble { + /** + * 甚户ç‚čć‡»æ°”æłĄäș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + onclick?: (result: PlusMapsOverlay) => void; + /** + * èźŸçœźæ°”æłĄäžŠæ˜Ÿç€șçš„ć›Ÿæ ‡ + * è‹„äžșèźŸçœźćˆ™æ— é»˜èź€ć›Ÿæ ‡ïŒŒć·Čæ·»ćŠ çš„æ˜Ÿç€șçš„æ°”æłĄćœšèźŸçœźæ–°ć€ŒćŽć°†ćœšćœ°ć›ŸäžŠç«‹ćłæ›Žæ–°ć†…ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setIcon(icon?: string): void; + /** + * èźŸçœźæ°”æłĄäžŠæ˜Ÿç€șçš„æ–‡ć­—ć†…ćźč + * è‹„æœȘèźŸçœźćˆ™äžæ˜Ÿç€șæ–‡ć­—ïŒˆé»˜èź€äžșç©ș歗笩äžČć·Čæ·»ćŠ çš„æ˜Ÿç€șçš„æ°”æłĄćœšèźŸçœźæ–°ć€ŒćŽć°†ćœšćœ°ć›ŸäžŠç«‹ćłæ›Žæ–°ć†…ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setLabel(label?: string): void; + /** + * èŽ·ć–æ°”æłĄäžŠæ˜Ÿç€șçš„æ–‡ć­—ć†…ćźč + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getLabel(): string; + /** + * èŽ·ć–æ°”æłĄæ‰€ć±žçš„æ ‡ç‚čćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + belongMarker(): PlusMapsMarker; + /** + * ä»Žć›Ÿç‰‡ćŠ èœœæ°”æłĄæ˜Ÿç€ș的憅ćźč + * é€šèż‡ćŠ èœœć›Ÿç‰‡æ„è‡Ș漚ä艿°”æłĄæ˜Ÿç€ș的憅ćźčïŒŒćŠ èœœć›Ÿç‰‡ćŽć°†æž…ç©șæ°”æłĄäœżç”šçš„ć›Ÿæ ‡ćŠæ–‡ć­—ć†…ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + loadImage(path?: string): void; + /** + * ä»Žć›Ÿç‰‡æ•°æźćŠ èœœæ°”æłĄæ˜Ÿç€ș的憅ćźč + * é€šèż‡ćŠ èœœć›Ÿç‰‡æ•°æźæ„è‡Ș漚ä艿°”æłĄæ˜Ÿç€ș的憅ćźčïŒŒćŠ èœœć›Ÿç‰‡ćŽć°†æž…ç©șæ°”æłĄäœżç”šçš„ć›Ÿæ ‡ćŠæ–‡ć­—ć†…ćźč。 + * ć›Ÿç‰‡æ•°æźćŻé€šèż‡Canvasè‡Ș漚äč‰ç»˜ćˆ¶ćŽè°ƒç”štoDataURLæ„èŽ·ć–ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + loadImageDataURL(data?: string): void; +} + +/** + * ćœ°ć›ŸäžŠæ˜Ÿç€ș的朆月ćŻčè±Ą + * 从OverlayćŻčè±Ąç»§æ‰żè€Œæ„ïŒŒćŻé€šèż‡MapćŻčè±Ąçš„addOverlay()æ–čæł•ć°†ćŻčè±Ąæ·»ćŠ ćœ°ć›Ÿäž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsCircle { + /** + * èźŸçœźćœ†ćœˆäž­ćżƒç‚č的经çșŹćșŠćæ ‡ + * èŻ„æ–čæł•èźŸçœźć°†ćŻŒè‡Žćœ°ć›Ÿäž­çš„ćœ†ćœˆç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setCenter(point?: PlusMapsPoint): void; + /** + * èŽ·ć–ćœ†ćœˆäž­ćżƒç‚čçš„ćæ ‡ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getCenter(): PlusMapsPoint; + /** + * èźŸçœźćœ†ćœˆçš„ćŠćŸ„ïŒŒć•äœäžș米 + * èŻ„æ–čæł•èźŸçœźć°†ćŻŒè‡Žćœ°ć›Ÿäž­çš„ćœ†ćœˆç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setRadius(radius?: number): void; + /** + * èŽ·ć–ćœ†ćœˆçš„ćŠćŸ„ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getRadius(): number; + /** + * èźŸçœźćœ†ćœˆçš„èŸčæĄ†éąœè‰Č + * ćœ†ćœˆé»˜èź€çš„ćœ†ćœˆèŸčæĄ†éąœè‰Čäžș黑è‰Č"#000000"ïŒŒèŻ„æ–čæł•èźŸçœźć°†ćŻŒè‡Žćœ°ć›Ÿäž­çš„ćœ†ćœˆç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setStrokeColor(color?: string): void; + /** + * èŽ·ć–ćœ†ćœˆçš„èŸčæĄ†éąœè‰Č + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getStrokeColor(): string; + /** + * èźŸçœźćœ†ćœˆçš„èŸčæĄ†éąœè‰Č + * ćœ†ćœˆé»˜èź€ć€Œäžșäžé€æ˜Žă€‚ + * ćŠ‚æžœèźŸçœźçš„ć€Œäžćˆæł•ćˆ™äżæŒćŽŸæœ‰çš„é€æ˜ŽćșŠïŒ›èŻ„æ–čæł•èźŸçœźć°†ćŻŒè‡Žćœ°ć›Ÿäž­çš„ćœ†ćœˆç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setStrokeOpacity(opacity?: number): void; + /** + * èŽ·ć–ćœ†ćœˆèŸčæĄ†çš„é€æ˜ŽćșŠ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getStrokeOpacity(): number; + /** + * èźŸçœźćœ†ćœˆçš„ćĄ«ć……éąœè‰Č + * ćœ†ćœˆé»˜èź€çš„ćœ†ćœˆćĄ«ć……éąœè‰Čäžș无è‰ČïŒŒèŻ„æ–čæł•èźŸçœźć°†ćŻŒè‡Žćœ°ć›Ÿäž­çš„ćœ†ćœˆç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setFillColor(color?: string): void; + /** + * èŽ·ć–ćœ†ćœˆçš„ćĄ«ć……éąœè‰Č + * ćŠ‚æžœćĄ«ć……éąœè‰Čäžș无è‰ČïŒŒćˆ™èż”ć›žç©ș歗笩äžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getFillColor(): string; + /** + * èźŸçœźćœ†ćœˆćĄ«ć……éąœè‰Č的透明ćșŠ + * ćœ†ćœˆé»˜èź€ć€Œäžșäžé€æ˜Žă€‚ + * ćŠ‚æžœèźŸçœźçš„ć€Œäžćˆæł•ćˆ™äżæŒćŽŸæœ‰çš„é€æ˜ŽćșŠïŒ›èŻ„æ–čæł•èźŸçœźć°†ćŻŒè‡Žćœ°ć›Ÿäž­çš„ćœ†ćœˆç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setFillOpacity(opacity?: number): void; + /** + * èŽ·ć–ćœ†ćœˆćĄ«ć……è‰Č的透明ćșŠ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getFillOpacity(): number; + /** + * èźŸçœźćœ†ćœˆèŸčæĄ†çš„çșżæĄćźœćșŠ + * 朆月èŸčæĄ†çš„é»˜èź€ć€Œäžș5。 + * ćŠ‚æžœèźŸçœźçš„ć€Œäžćˆæł•ćˆ™äżæŒćŽŸæœ‰çš„ćźœćșŠïŒ›èŻ„æ–čæł•èźŸçœźć°†ćŻŒè‡Žćœ°ć›Ÿäž­çš„ćœ†ćœˆç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setLineWidth(width?: number): void; + /** + * èŽ·ć–ćœ†ćœˆèŸčæĄ†çš„çșżæĄćźœćșŠ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getLineWidth(): number; +} + +/** + * ćœ°ć›ŸäžŠæ˜Ÿç€ș的折çșżćŻčè±Ą + * 从OverlayćŻčè±Ąç»§æ‰żè€Œæ„ïŒŒćŻé€šèż‡MapćŻčè±Ąçš„addOverlay()æ–čæł•ć°†ćŻčè±Ąæ·»ćŠ ćœ°ć›Ÿäž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsPolyline { + /** + * èźŸçœźæŠ˜çșżçš„饶ç‚čćæ ‡ + * èŻ„æ–čæł•èźŸçœźć°†ćŻŒè‡Žćœ°ć›Ÿäž­çš„æŠ˜çșżç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setPath(points?: any []): void; + /** + * èŽ·ć–æŠ˜çșżçš„饶ç‚čćæ ‡ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getPath(): any []; + /** + * èźŸçœźæŠ˜çșżçš„éąœè‰Č + * 折çșżé»˜èź€çš„éąœè‰Čäžș黑è‰Č"#000000"ïŒŒèŻ„æ–čæł•èźŸçœźć°†ćŻŒè‡Žćœ°ć›Ÿäž­çš„æŠ˜çșżç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setStrokeColor(color?: string): void; + /** + * èŽ·ć–æŠ˜çșżçš„éąœè‰Č + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getStrokeColor(): string; + /** + * èźŸèźŸçœźæŠ˜çșżçš„透明ćșŠ + * 折çșżé»˜èź€ć€Œäžșäžé€æ˜Žă€‚ + * ćŠ‚æžœèźŸçœźçš„ć€Œäžćˆæł•ćˆ™äżæŒćŽŸæœ‰çš„é€æ˜ŽćșŠïŒ›èŻ„æ–čæł•èźŸçœźć°†ćŻŒè‡Žćœ°ć›Ÿäž­çš„æŠ˜çșżç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setStrokeOpacity(opacity?: number): void; + /** + * èŽ·ć–æŠ˜çșżçš„透明ćșŠ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getStrokeOpacity(): number; + /** + * èźŸçœźæŠ˜çșżçš„çșżæĄćźœćșŠ + * 折çșżçșżæĄçš„ćźœćșŠé»˜èź€ć€Œäžș5。 + * ćŠ‚æžœèźŸçœźçš„ć€Œäžćˆæł•ćˆ™äżæŒćŽŸæœ‰çš„ćźœćșŠïŒ›èŻ„æ–čæł•èźŸçœźć°†ćŻŒè‡Žćœ°ć›Ÿäž­çš„æŠ˜çșżç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setLineWidth(width?: number): void; + /** + * èŽ·ć–æŠ˜çșżçš„çșżæĄćźœćșŠ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getLineWidth(): number; +} + +/** + * ćœ°ć›ŸäžŠæ˜Ÿç€ș的怚èŸčćœąćŻčè±Ą + * 从OverlayćŻčè±Ąç»§æ‰żè€Œæ„ïŒŒćŻé€šèż‡MapćŻčè±Ąçš„addOverlay()æ–čæł•ć°†ćŻčè±Ąæ·»ćŠ ćœ°ć›Ÿäž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsPolygon { + /** + * èźŸçœźć€šèŸčćœąçš„éĄ¶ç‚čćæ ‡ + * èŻ„æ–čæł•èźŸçœźć°†ćŻŒè‡Žćœ°ć›Ÿäž­çš„ć€šèŸčćœąç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setPath(points?: any []): void; + /** + * èŽ·ć–ć€šèŸčćœąçš„éĄ¶ç‚čćæ ‡ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getPath(): any []; + /** + * èźŸçœźć€šèŸčćœąçš„éąœè‰Č + * 〚èŸčćœąèŸčæĄ†é»˜èź€çš„éąœè‰Čäžș黑è‰Č"#000000"ïŒŒèŻ„æ–čæł•èźŸçœźć°†ćŻŒè‡Žćœ°ć›Ÿäž­çš„ć€šèŸčćœąç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setStrokeColor(color?: string): void; + /** + * èŽ·ć–ć€šèŸčćœąèŸčæĄ†çš„éąœè‰Č + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getStrokeColor(): string; + /** + * èźŸçœźć€šèŸčćœąçš„é€æ˜ŽćșŠ + * 〚èŸčćœąèŸčæĄ†é»˜èź€ć€Œäžșäžé€æ˜Žă€‚ + * ćŠ‚æžœèźŸçœźçš„ć€Œäžćˆæł•ćˆ™äżæŒćŽŸæœ‰çš„é€æ˜ŽćșŠïŒ›èŻ„æ–čæł•èźŸçœźć°†ćŻŒè‡Žćœ°ć›Ÿäž­çš„ć€šèŸčćœąç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setStrokeOpacity(opacity?: number): void; + /** + * èŽ·ć–ć€šèŸčćœąèŸčæĄ†çš„é€æ˜ŽćșŠ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getStrokeOpacity(): number; + /** + * èźŸçœźć€šèŸčćœąçš„ćĄ«ć……éąœè‰Č + * 〚èŸčćœąé»˜èź€ćĄ«ć……éąœè‰Čäžș无è‰ČïŒŒèŻ„æ–čæł•èźŸçœźć°†ćŻŒè‡Žćœ°ć›Ÿäž­çš„ć€šèŸčćœąç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setFillColor(color?: string): void; + /** + * èŽ·ć–ć€šèŸčćœąçš„ćĄ«ć……è‰Č + * ćŠ‚æžœćĄ«ć……è‰Čäžș无è‰ČïŒŒćˆ™èż”ć›žç©ș歗笩äžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getFillColor(): string; + /** + * èźŸçœźć€šèŸčćœąćĄ«ć……è‰Č的透明ćșŠ + * 〚èŸčćœąćĄ«ć……è‰Čé»˜èź€ć€Œäžșäžé€æ˜Žă€‚ + * ćŠ‚æžœèźŸçœźçš„ć€Œäžćˆæł•ćˆ™äżæŒćŽŸæœ‰çš„é€æ˜ŽćșŠïŒ›èŻ„æ–čæł•èźŸçœźć°†ćŻŒè‡Žćœ°ć›Ÿäž­çš„ć€šèŸčćœąç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setFillOpacity(opacity?: number): void; + /** + * èŽ·ć–ć€šèŸčćœąćĄ«ć……è‰Č的透明ćșŠ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getFillOpacity(): number; + /** + * èźŸçœźć€šèŸčćœąçš„èŸčæĄ†ćźœćșŠ + * 〚èŸčćœąèŸčæĄ†çš„ćźœćșŠé»˜èź€ć€Œäžș5。 + * ćŠ‚æžœèźŸçœźçš„ć€Œäžćˆæł•ćˆ™äżæŒćŽŸæœ‰çš„ćźœćșŠïŒ›èŻ„æ–čæł•èźŸçœźć°†ćŻŒè‡Žćœ°ć›Ÿäž­çš„ć€šèŸčćœąç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setLineWidth(width?: number): void; + /** + * èŽ·ć–ć€šèŸčćœąèŸčæĄ†çš„ćźœćșŠ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getLineWidth(): number; +} + +/** + * ćœ°ć›ŸæŁ€çŽąćŻčè±Ą + * SearchćŻčè±Ąç”šäșŽçźĄç†ćœ°ć›ŸäžŠçš„æŁ€çŽąćŠŸèƒœïŒŒćŒ…æ‹ŹäœçœźæŁ€çŽąă€ć‘šèŸčæŁ€çŽąć’ŒèŒƒć›ŽæŁ€çŽąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsSearch { + /** + * ć…Žè¶Łç‚čæŁ€çŽąćźŒæˆäș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + onPoiSearchComplete?: (result0: number, result1: PlusMapsSearchPoiResult) => void; + /** + * çșżè·ŻæŁ€çŽąćźŒæˆäș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + onRouteSearchComplete?: (result0: number, result1: PlusMapsSearchRouteResult) => void; + /** + * èźŸçœźæŁ€çŽąèż”ć›žç»“æžœæŻéĄ”çš„äżĄæŻæ•°ç›ź + * ćœ°ć›ŸæŁ€çŽąç»“æžœæ˜ŻæŒ‰éĄ”èż”ć›žçš„ïŒŒé»˜èź€æŁ€çŽąæŻéĄ”èż”ć›ž10æĄäżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setPageCapacity(capacity?: number): void; + /** + * èŽ·ć–æŁ€çŽąèż”ć›žç»“æžœæŻéĄ”çš„äżĄæŻæ•°ç›ź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getPageCapacity(): number; + /** + * ćŸŽćž‚ć…Žè¶Łç‚čæŁ€çŽą + * æŁ€çŽąç»“æžœć°†é€šèż‡onPoiSearchCompleteäș‹ä»¶èż”曞。 + * ćŠ‚æžœè°ƒç”šæ­€æ–čæł•æ—¶ć·Čç»ć€„äșŽPOIæŁ€çŽąæ“äœœäž­ïŒŒćˆ™ç»ˆæ­ąäžŠæŹĄæŁ€çŽąæ“äœœïŒŒé‡æ–°ćŒ€ć§‹æ–°çš„æŁ€çŽąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + poiSearchInCity(city?: string, key?: string, index?: number): boolean; + /** + * 摹èŸčæŁ€çŽą + * 摹èŸčæŁ€çŽąæ čæźäž­ćżƒç‚čă€ćŠćŸ„äžŽæŁ€çŽąèŻèż›èĄŒæŁ€çŽąïŒŒæŁ€çŽąćźŒæˆćŽè§Šć‘onPoiSearchComplete()äș‹ä»¶ă€‚ + * 苄调甚歀æ–čæł•æ—¶ćŻčè±Ąć€„äșŽPOIæŁ€çŽąæ“äœœäž­ïŒŒćˆ™ç»ˆæ­ąäžŠæŹĄæŁ€çŽąæ“äœœïŒŒé‡æ–°ćŒ€ć§‹æ–°çš„æŁ€çŽąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + poiSearchNearBy(key?: string, pt?: PlusMapsPoint, radius?: number, index?: number): boolean; + /** + * æŒ‡ćźšèŒƒć›ŽæŁ€çŽą + * æ čæźèŒƒć›Žć’ŒæŁ€çŽąèŻèż›èĄŒæŁ€çŽąïŒŒæŁ€çŽąćźŒæˆćŽè§Šć‘onPoiSearchComplete()äș‹ä»¶ă€‚ + * 苄调甚歀æ–čæł•æ—¶ćŻčè±Ąć€„äșŽPOIæŁ€çŽąæ“äœœäž­ïŒŒćˆ™ç»ˆæ­ąäžŠæŹĄæŁ€çŽąæ“äœœïŒŒé‡æ–°ćŒ€ć§‹æ–°çš„æŁ€çŽąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + poiSearchInbounds(): boolean; + /** + * èźŸçœźć…Źäș€è·ŻçșżæŁ€çŽąç­–ç•„ + * é»˜èź€é‡‡ç”šmaps.SearchPolicy.TRANSIT_TIME_FIRST策畄。 + * éœ€ćœšè°ƒç”štransitSearch()æ–čæł•ć‰èźŸçœźçš„ç­–ç•„æ‰ç”Ÿæ•ˆïŒ› + * ćŠ‚æžœèźŸçœźéžæł•ć€Œćˆ™èź€äžșèźŸçœźć€±èŽ„ïŒŒé‡‡ç”šäžŠæŹĄèźŸçœźçš„æŁ€çŽąç­–ç•„ćč¶èż”曞false。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setTransitPolicy(policy?: PlusMapsSearchPolicy): boolean; + /** + * 慬äș€è·ŻçșżæŁ€çŽą + * æŁ€çŽąćźŒæˆćŽè§Šć‘onRouteSearchComplete()äș‹ä»¶ă€‚ + * 苄调甚歀æ–čæł•æ—¶ćŻčè±Ąć€„äșŽæŁ€çŽąæ“äœœäž­ïŒŒćˆ™ç»ˆæ­ąäžŠæŹĄæŁ€çŽąæ“äœœïŒŒé‡æ–°ćŒ€ć§‹æ–°çš„æŁ€çŽąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + transitSearch(start?: string, end?: string, city?: string): boolean; + /** + * èźŸçœźé©ŸèœŠè·ŻçșżæŁ€çŽąç­–ç•„ + * èźŸçœźé©ŸèœŠè·ŻçșżæŁ€çŽąç­–ç•„ïŒŒé»˜èź€é‡‡ç”šmaps.SearchPolicy.DRIVING_TIME_FIRST策畄。 + * ćŠ‚æžœèźŸçœźéžæł•ć€Œćˆ™èź€äžșèźŸçœźć€±èŽ„ïŒŒé‡‡ç”šäžŠæŹĄèźŸçœźçš„æŁ€çŽąç­–ç•„ćč¶èż”曞falseïŒ›éœ€ćœšè°ƒç”šdrivingSearch()æ–čæł•ć‰èźŸçœźçš„ç­–ç•„æ‰ç”Ÿæ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setDrivingPolicy(policy?: PlusMapsSearchPolicy): boolean; + /** + * é©ŸèœŠè·ŻçșżæŁ€çŽą + * 甹äșŽé©ŸèœŠè·ŻçșżæŁ€çŽąïŒŒæŁ€çŽąćźŒæˆćŽè§Šć‘onRouteSearchComplete()äș‹ä»¶ă€‚ + * 调甚歀æ–čæł•æ—¶ćŻčè±Ąć€„äșŽæŁ€çŽąæ“äœœäž­ïŒŒćˆ™ç»ˆæ­ąäžŠæŹĄæŁ€çŽąæ“äœœïŒŒé‡æ–°ćŒ€ć§‹æ–°çš„æŁ€çŽąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + drivingSearch(start?: string, startCity?: string, end?: string, endCity?: string): boolean; + /** + * æ­„èĄŒè·ŻçșżæŁ€çŽą + * 甹äșŽæ­„èĄŒè·ŻçșżæŁ€çŽąïŒŒæŁ€çŽąćźŒæˆćŽè§Šć‘onRouteSearchComplete()äș‹ä»¶ă€‚ + * 调甚歀æ–čæł•æ—¶ćŻčè±Ąć€„äșŽæŁ€çŽąæ“äœœäž­ïŒŒćˆ™ç»ˆæ­ąäžŠæŹĄæŁ€çŽąæ“äœœïŒŒé‡æ–°ćŒ€ć§‹æ–°çš„æŁ€çŽąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + walkingSearch(start?: string, startCity?: string, end?: string, endCity?: string): boolean; +} + +/** + * æŁ€çŽąç­–ç•„ç±»ćž‹ + * 朹çșżè·ŻæŁ€çŽąæ—¶èźŸçœźæŁ€çŽąç­–ç•„æ—¶äœżç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsSearchPolicy { + /** + * æ—¶é—ŽäŒ˜ć…ˆ + * æŁ€çŽąç­–ç•„ç±»ćž‹ćžžé‡ïŒŒç”šäșŽć…Źäș€æŁ€çŽąç­–ç•„ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + TRANSIT_TIME_FIRST?: number; + /** + * æœ€ć°‘æąäč˜äŒ˜ć…ˆ + * æŁ€çŽąç­–ç•„ç±»ćž‹ćžžé‡ïŒŒç”šäșŽć…Źäș€æŁ€çŽąç­–ç•„ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + TRANSIT_TRANSFER_FIRST?: number; + /** + * æœ€ć°‘æ­„èĄŒè·çŠ»äŒ˜ć…ˆ + * æŁ€çŽąç­–ç•„ç±»ćž‹ćžžé‡ïŒŒç”šäșŽć…Źäș€æŁ€çŽąç­–ç•„ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + TRANSIT_WALK_FIRST?: number; + /** + * é€‰æ‹©èœŠç„šèŠ±é”€æœ€ć°‘äŒ˜ć…ˆ + * æŁ€çŽąç­–ç•„ç±»ćž‹ćžžé‡ïŒŒç”šäșŽć…Źäș€æŁ€çŽąç­–ç•„ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + TRANSIT_FEE_FIRST?: number; + /** + * æœ€çŸ­è·çŠ»äŒ˜ć…ˆ + * æŁ€çŽąç­–ç•„ç±»ćž‹ćžžé‡ïŒŒç”šäșŽé©ŸèœŠæŁ€çŽąç­–ç•„ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + DRIVING_DIS_FIRST?: number; + /** + * æ— é«˜é€Ÿć…Źè·Żçșżè·Ż + * æŁ€çŽąç­–ç•„ç±»ćž‹ćžžé‡ïŒŒç”šäșŽé©ŸèœŠæŁ€çŽąç­–ç•„ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + DRIVING_NO_EXPRESSWAY?: number; + /** + * æœ€ć°‘èŽčç”šäŒ˜ć…ˆ + * æŁ€çŽąç­–ç•„ç±»ćž‹ćžžé‡ïŒŒç”šäșŽé©ŸèœŠæŁ€çŽąç­–ç•„ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + DRIVING_FEE_FIRST?: number; +} + +/** + * äżć­˜äœçœźæŁ€çŽąă€ć‘šèŸčæŁ€çŽąć’ŒèŒƒć›ŽæŁ€çŽąèż”ć›žçš„ç»“æžœ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsSearchPoiResult { + /** + * POIæŁ€çŽąæ€»ç»“æžœæ•° + * POIæŁ€çŽąæ€»ç»“æžœæ•°ïŒŒè‹„æČĄæœ‰æŁ€çŽąćˆ°ćˆ™èż”ć›ž0。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + totalNumber?: number; + /** + * ćœ“ć‰éĄ”çš„POIæŁ€çŽąç»“æžœæ•° + * ćœ“ć‰éĄ”POIæŁ€çŽąç»“æžœæ•°ïŒŒè‹„æČĄæœ‰æŁ€çŽąćˆ°ćˆ™èż”ć›ž0。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + currentNumber?: number; + /** + * æœŹæŹĄPOIæŁ€çŽąçš„æ€»éĄ”æ•° + * æœŹæŹĄPOIæŁ€çŽąçš„æ€»éĄ”æ•°ïŒŒè‹„æČĄæœ‰æŁ€çŽąćˆ°ćˆ™èż”ć›ž0。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + pageNumber?: number; + /** + * èŽ·ć–ćœ“ć‰éĄ”çš„çŽąćŒ• + * ćœ“ć‰éĄ”çš„çŽąćŒ•ć€ŒïŒŒä»Ž0ćŒ€ć§‹ïŒŒćł0èĄšç€ș珏䞀饔。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + pageIndex?: number; + /** + * æœŹæŹĄPOIæŁ€çŽąç»“æžœæ•°ç»„ + * POIæŁ€çŽąç»“æžœæ•°ç»„ïŒŒArray数组ćŻčè±ĄïŒŒæ•°ç»„ć†…ćźčäžșPositionćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + poiList?: any []; + /** + * èŽ·ć–æŒ‡ćźšçŽąćŒ•çš„æŁ€çŽąç»“æžœ + * ćŠ‚æžœindexć€Œè¶…ć‡șèŒƒć›Žćˆ™èż”ć›žnullćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getPosition(): PlusMapsPosition; +} + +/** + * äżć­˜äœçœźæŁ€çŽąă€ć‘šèŸčæŁ€çŽąć’ŒèŒƒć›ŽæŁ€çŽąèż”ć›žçš„ç»“æžœ + * äžćŻé€šèż‡newæ“äœœçŹŠćˆ›ć»șSearchRouteResultćŻčè±ĄïŒŒćœšè§Šć‘onRouteSearchComplete()时è‡Ș抹戛ć»ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsSearchRouteResult { + /** + * çșżè·Żçš„è”·ç‚čäœçœź + * çșżè·ŻæŁ€çŽąç»“æžœçš„è”·ć§‹äœçœźç‚čćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + startPosition?: PlusMapsPosition; + /** + * çșżè·Żçš„终ç‚čäœçœź + * çșżè·ŻæŁ€çŽąç»“æžœçš„ç»ˆç‚čäœçœźç‚čćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + endPosition?: PlusMapsPosition; + /** + * æœŹæŹĄçșżè·ŻæŁ€çŽąçš„æ€»æ–čæĄˆæ•° + * çșżè·ŻæŁ€çŽąç»“æžœçš„æ–čæĄˆæ•°ç›źïŒŒè‹„æœȘæŁ€çŽąćˆ°æœ‰æ•ˆç»“æžœćˆ™èż”ć›ž0。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + routeNumber?: number; + /** + * çșżè·ŻæŁ€çŽąç»“æžœæ•°ç»„ + * çșżè·ŻæŁ€çŽąç»“æžœæ•°ç»„ïŒŒArray数组ćŻčè±ĄïŒŒæ•°ç»„ć†…ćźčäžșRoutećŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + routeList?: any []; + /** + * èŽ·ć–æŒ‡ćźšçŽąćŒ•çš„çșżè·Żæ–čæĄˆ + * ćŠ‚æžœindexć€Œè¶…ć‡șèŒƒć›Žćˆ™èż”ć›žnullćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getRoute(index?: number): PlusMapsRoute; +} + +/** + * æŁ€çŽąç»“æžœçš„äœçœźç‚č + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsPosition { + /** + * äœçœźç‚č的经çșŹćșŠćæ ‡ + * ćŠ‚æžœæČĄæœ‰ç»çșŹćșŠćæ ‡äżĄæŻïŒˆćŠ‚æžœć…Źäș€ă€ćœ°é“è·Żçșżæ•°æźç­‰ïŒ‰ïŒŒćˆ™ć…¶ć€Œäžșundefined。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + point?: PlusMapsPoint; + /** + * äœçœźç‚čçš„ćœ°ć€äżĄæŻ + * ćŠ‚æžœæČĄæœ‰äœçœźç‚čçš„ćœ°ć€äżĄæŻćˆ™èż”ć›žç©ș歗笩äžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + address?: string; + /** + * äœçœźç‚čçš„æ‰€ć±žćŸŽćž‚äżĄæŻ + * ćŠ‚æžœæČĄæœ‰äœçœźç‚čçš„æ‰€ć±žćŸŽćž‚äżĄæŻćˆ™èż”ć›žç©ș歗笩äžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + city?: string; + /** + * äœçœźç‚č的損称 + * ćŠ‚æžœæČĄæœ‰äœçœźç‚čçš„ćç§°ćˆ™èż”ć›žç©ș歗笩äžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + name?: string; + /** + * äœçœźç‚čçš„ç””èŻäżĄæŻ + * ćŠ‚æžœæČĄæœ‰äœçœźç‚čçš„ç””èŻäżĄæŻćˆ™èż”ć›žç©ș歗笩äžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + phone?: string; + /** + * äœçœźç‚čçš„é‚źçŒ–äżĄæŻ + * ćŠ‚æžœæČĄæœ‰äœçœźç‚čçš„é‚źçŒ–äżĄæŻćˆ™èż”ć›žç©ș歗笩äžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + postcode?: string; +} + +/** + * ćœ°ć›Ÿäž­çš„è·ŻçșżćŻčè±Ą + * 从OverlayćŻčè±Ąç»§æ‰żè€Œæ„ïŒŒćŻé€šèż‡MapćŻčè±Ąçš„addOverlay()æ–čæł•ć°†ćŻčè±Ąæ·»ćŠ ćœ°ć›Ÿäž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsRoute { + /** + * è·Żçșżè”·ç‚čćœ°ç†ćæ ‡ç‚č + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + startPoint?: PlusMapsPoint; + /** + * è·Żçșżç»ˆç‚čćœ°ç†ćæ ‡ç‚č + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + endPoint?: PlusMapsPoint; + /** + * è·Żçșżćæ ‡ç‚čæź”æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + pointCount?: PlusMapsPoint; + /** + * è·Żçșżçš„ćœ°ç†ćæ ‡ç‚č数组 + * è·Żçșżçš„ćœ°ç†ćæ ‡ç‚čæ•°ç»„ïŒŒæ•°ç»„äž­äżć­˜PointćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + pointList?: any []; + /** + * è·Żçșżæ€»è·çŠ» + * è·Żçșżä»Žè”·ć§‹ç‚č戰终ç‚čçš„è·çŠ»ïŒŒć•äœäžș米。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + distance?: number; + /** + * çșżè·Żçš„æç€șäżĄæŻ + * çșżè·Żæç€șäżĄæŻïŒŒæČĄæœ‰æç€șäżĄæŻćˆ™èż”ć›žç©ș歗笩äžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + routeTip?: string; +} + +/** + * OAuthæšĄć—çźĄç†ćźąæˆ·ç«Żçš„ç”šæˆ·ç™»ćœ•æŽˆæƒéȘŒèŻćŠŸèƒœïŒŒć…èźžćș”ç”šèźżé—źçŹŹäž‰æ–čćčłć°çš„蔄æșă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ +interface PlusOauth { + /** + * ç™»ćœ•æŽˆæƒèź€èŻæœćŠĄćŻčè±Ą + * AuthServicećŻčè±Ąç”šäșŽèĄšç€șç™»ćœ•æŽˆæƒèź€èŻæœćŠĄïŒŒćœšJSäž­äžșćŻčè±ĄïŒŒç”šäșŽć‘çł»ç»Ÿèż›èĄŒç™»ćœ•æŽˆæƒèź€èŻæ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + AuthService?: PlusOauthAuthService; + /** + * JSONćŻčè±ĄïŒŒæŽˆæƒèź€èŻć‚æ•°é€‰éĄč + * æ­€ćŻčè±Ąæ”ŻæŒçš„ć±žæ€§ć€Œç”±ç™»ćœ•æŽˆæƒèź€èŻæœćŠĄćźšäč‰ă€‚ + * äŸ‹ćŠ‚â€œćŸźäżĄâ€ïŒŒćˆ™ćŻé…çœźä»„äž‹ć‚æ•°ïŒš + * scope - ćș”ç”šæŽˆæƒäœœç”šćŸŸïŒ› + * state - 甹äșŽäżæŒèŻ·æ±‚ć’Œć›žè°ƒçš„çŠ¶æ€ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + AuthOptions?: PlusOauthAuthOptions; + /** + * ç™»ćœ•æŽˆæƒèź€èŻäżĄæŻ + * æ­€ćŻčè±Ąä»…ćźšä艿 ‡ć‡†ć±žæ€§ïŒŒç™»ćœ•æŽˆæƒèź€èŻæœćŠĄćŻæ‰©ć±•è‡Ș漚ä艿•°æźă€‚ + * äŸ‹ćŠ‚â€œćŸźäżĄâ€ç™»ćœ•æŽˆæƒæœćŠĄïŒŒćˆ™ćŒ…æ‹Źä»„äž‹æ•°æźïŒš + * unionid - ç”šæˆ·ç»Ÿäž€æ ‡èŻ†ïŒŒé’ˆćŻč侀äžȘćŸźäżĄćŒ€æ”Ÿćčłć°ćžć·äž‹çš„ćș”ç”šïŒŒćŒäž€ç”šæˆ·çš„unionidæ˜Żć”Żäž€çš„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + AuthInfo?: PlusOauthAuthInfo; + /** + * ç™»ćœ•æŽˆæƒç”šæˆ·äżĄæŻ + * 甹äșŽäżć­˜ç™»ćœ•æŽˆæƒç”šæˆ·çš„äżĄæŻă€‚ + * æ­€ćŻčè±Ąä»…ćźšä艿 ‡ć‡†ć±žæ€§ïŒŒç™»ćœ•æŽˆæƒèź€èŻæœćŠĄćŻæ‰©ć±•è‡Ș漚ä艿•°æźă€‚ + * äŸ‹ćŠ‚â€œćŸźäżĄâ€ç™»ćœ•æŽˆæƒæœćŠĄïŒŒćŻèƒœćŒ…æ‹Źä»„äž‹è‡Ș漚ä艿•°æźïŒš + * privilege - 甚户ç‰čæƒäżĄæŻïŒŒjsonæ•°ç»„ïŒŒćŠ‚ćŸźäżĄæČƒćĄç”šæˆ·äžșchinaunicom + * unionid - ç”šæˆ·ç»Ÿäž€æ ‡èŻ†ïŒŒé’ˆćŻč侀äžȘćŸźäżĄćŒ€æ”Ÿćčłć°ćžć·äž‹çš„ćș”ç”šïŒŒćŒäž€ç”šæˆ·çš„unionidæ˜Żć”Żäž€çš„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + UserInfo?: PlusOauthUserInfo; + /** + * èŽ·ć–ç™»ćœ•æŽˆæƒèź€èŻæœćŠĄćˆ—èĄš + * èŽ·ć–ç»ˆç«Żæ”ŻæŒçš„æƒç™»ćœ•èź€èŻæœćŠĄćˆ—èĄšïŒŒćŻç”šäșŽæç€șç”šæˆ·èż›èĄŒç™»ćœ•ćčłć°çš„é€‰æ‹©ă€‚èŽ·ć–ç™»ćœ•æŽˆæƒèź€èŻæœćŠĄæˆćŠŸćŽé€šèż‡successCBć›žè°ƒèż”ć›žæ”ŻæŒçš„æ‰€æœ‰æœćŠĄćˆ—èĄšïŒŒèŽ·ć–æœćŠĄć€±èŽ„ćˆ™é€šèż‡errorCBć›žè°ƒèż”ć›žć€±èŽ„äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + getServices(successCB?: (result: PlusOauth []) => void, errorCB?: (result: any) => void): void; +} + +/** + * ç™»ćœ•æŽˆæƒèź€èŻæœćŠĄćŻčè±Ą + * AuthServicećŻčè±Ąç”šäșŽèĄšç€șç™»ćœ•æŽˆæƒèź€èŻæœćŠĄïŒŒćœšJSäž­äžșćŻčè±ĄïŒŒç”šäșŽć‘çł»ç»Ÿèż›èĄŒç™»ćœ•æŽˆæƒèź€èŻæ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ +interface PlusOauthAuthService { + /** + * ç™»ćœ•æŽˆæƒèź€èŻæœćŠĄæ ‡èŻ† + * 甹äșŽèĄšç€șç™»ćœ•æŽˆæƒèź€èŻæœćŠĄæ ‡èŻ†ïŒš + * "weixin" - èĄšç€șćŸźäżĄç™»ćœ•æŽˆæƒïŒ› + * "qq" - èĄšç€șQQç™»ćœ•æŽˆæƒïŒ› + * "sinaweibo" - èĄšç€ș新æ”ȘćŸźćšç™»ćœ•æŽˆæƒïŒ› + * "qihoo" - èĄšç€ș360èŽŠć·ç™»ćœ•ïŒˆä»…360æ‰‹ćŠ©æ”ćș”ç”šçŽŻćąƒäž‹æ”ŻæŒïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + id?: string; + /** + * ç™»ćœ•æŽˆæƒèź€èŻæœćŠĄæèż° + * 甹äșŽæèż°ç™»ćœ•æŽˆæƒèź€èŻæœćŠĄçš„äżĄæŻïŒš + * "ćŸźäżĄ" - èĄšç€șćŸźäżĄç™»ćœ•æŽˆæƒïŒ› + * "QQ" - èĄšç€șQQç™»ćœ•æŽˆæƒïŒ› + * "新æ”ȘćŸźćš" - èĄšç€ș新æ”ȘćŸźćšç™»ćœ•æŽˆæƒïŒ› + * "360èŽŠć·" - èĄšç€ș360èŽŠć·ç™»ćœ•ïŒˆä»…360æ‰‹ćŠ©æ”ćș”ç”šçŽŻćąƒäž‹æ”ŻæŒïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + description?: string; + /** + * æŽˆæƒèź€èŻç»“æžœæ•°æź + * 甹äșŽäżć­˜ç™»ćœ•æŽˆæƒèź€èŻèŽ·ć–çš„èź€èŻäżĄæŻïŒŒćŠ‚æžœć€Œäžș"undefined"ćˆ™èĄšç€șæœȘèż›èĄŒæŽˆæƒèź€èŻæˆ–è€…æ˜ŻæŽˆæƒèź€èŻć€±èŽ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + authResult?: PlusOauthAuthInfo; + /** + * ç™»ćœ•æŽˆæƒèź€èŻç”šæˆ·äżĄæŻ + * 甹äșŽäżć­˜ç™»ćœ•æŽˆæƒèź€èŻèŽ·ć–çš„ç”šæˆ·äżĄæŻïŒŒćŠ‚æžœć€Œäžș"undefined"ćˆ™èĄšç€șæœȘèŽ·ć–èż‡ç”šæˆ·äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + userInfo?: PlusOauthUserInfo; + /** + * ç™»ćœ•æŽˆæƒèź€èŻæ‰©ć±•äżĄæŻ + * 甹äșŽäżć­˜ç™»ćœ•æŽˆæƒèź€èŻæœćŠĄèż”ć›žçš„æ‰©ć±•äżĄæŻïŒŒć…·äœ“ć†…ćźčç”±ć„ç™»ćœ•ćčłć°ć†łćźšïŒŒćŠ‚æžœæČĄæœ‰æ‰©ć±•äżĄæŻćˆ™äžșundefined。 + * äŸ‹ćŠ‚â€œćŸźäżĄâ€ïŒŒćˆ™ćŻäżć­˜ä»„äž‹æ•°æźïŒš + * state - 甹äșŽäżæŒèŻ·æ±‚ć’Œć›žè°ƒçš„çŠ¶æ€ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + extra?: any; + /** + * èŻ·æ±‚æŽˆæƒèź€èŻ + * ć‘ćŒ€æ”Ÿćčłć°èŻ·æ±‚èż›èĄŒæŽˆæƒèź€èŻïŒŒéœ€æäŸ›æŽˆæƒćŸŸïŒˆscopeïŒ‰ïŒŒç”šæˆ·ćœšç»ˆç«ŻçĄźèź€ćŽé€šèż‡æˆćŠŸć›žè°ƒèż”ć›žæŽˆæƒäžŽæ—¶ç„šæźïŒˆcodeïŒ‰ă€‚ + * ćŒ€ć‘è€…ćŻä»„ć°†æŽˆæƒäžŽæ—¶ç„šæźïŒˆcode提äș€ćˆ°äžšćŠĄæœćŠĄć™šïŒŒćˆäžšćŠĄæœćŠĄć™šä»ŽćŸźäżĄćŒ€æ”Ÿćčłć°èŽ·ć–æŽˆæƒç™»ćœ•ç­‰ç›žć…łäżĄæŻïŒŒéżć…ć°†appsecretç­‰äżĄæŻäżć­˜ćœšćźąæˆ·ç«ŻćŻèƒœćŒ•è”·æł„éœČ的闼鱘。 + * æłšæ„ïŒšç›źć‰ä»…ćŸźäżĄćčłć°æ”ŻæŒèŻ·æ±‚æŽˆæƒèź€èŻïŒŒć…¶ćźƒćčłć°è°ƒç”šæ­€æ–čæł•ć°†èż”ć›žé”™èŻŻć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + authorize(successCallback?: (result: any) => void, errorCallback?: (result: any) => void, options?: PlusOauthAuthOptions): void; + /** + * èŻ·æ±‚ç™»ćœ•æŽˆæƒèź€èŻæ“äœœ + * ćŻčæŒ‡ćźšçš„ç™»ćœ•æŽˆæƒèź€èŻæœćŠĄèż›èĄŒç™»ćœ•èź€èŻæ“äœœïŒŒćœšç™»ćœ•ć‰ćŻé€šèż‡ćŻčè±Ąçš„authResultć±žæ€§ćˆ€æ–­æ˜ŻćŠć·Čç»ç™»ćœ•èź€èŻèż‡ïŒŒé€šćžžćȘ需芁ćŻčæČĄæœ‰èż›èĄŒèż‡ç™»ćœ•èź€èŻçš„æœćŠĄèż›èĄŒç™»ćœ•èź€èŻæ“äœœă€‚ + * æŽˆæƒèź€èŻæ“äœœæˆćŠŸćŽé€šèż‡successCBć›žè°ƒć‡œæ•°é€šçŸ„ïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBć›žè°ƒć‡œæ•°é€šçŸ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + login(successCallback?: (result: any) => void, errorCallback?: (result: any) => void, options?: PlusOauthAuthOptions): void; + /** + * æłšé”€ç™»ćœ•æŽˆæƒèź€èŻ + * ćŻčæŒ‡ćźšçš„ç™»ćœ•æŽˆæƒèź€èŻæœćŠĄæłšé”€ç™»ćœ•èź€èŻæ“äœœïŒŒæłšé”€æŽˆæƒèź€èŻćŽïŒŒć†æŹĄæ“äœœæ—¶éœ€é‡æ–°èż›èĄŒç™»ćœ•èź€èŻæ“äœœă€‚ + * ćŠ‚æžœçŹŹäž‰æ–čćčłć°äžéœ€èŠæłšé”€æ“äœœïŒŒćˆ™æƒ…ć†”äżć­˜çš„ç›žć…łç™»ćœ•èź€èŻç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + logout(successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; + /** + * èŽ·ć–ç™»ćœ•æŽˆæƒç”šæˆ·äżĄæŻ + * èŽ·ć–ç™»ćœ•æŽˆæƒèź€èŻçš„ç”šæˆ·äżĄæŻïŒŒćœšèŽ·ć–ć‰ćŻé€šèż‡ćŻčè±Ąçš„userInfoć±žæ€§ćˆ€æ–­æ˜ŻćŠć·Čç»èŽ·ć–èż‡ïŒŒé€šćžžćȘ需芁ćŻčæČĄæœ‰èŽ·ć–èż‡ç”šæˆ·äżĄæŻçš„æœćŠĄèż›èĄŒæ“äœœă€‚ + * èŽ·ć–ç”šæˆ·äżĄæŻæ“äœœæˆćŠŸćŽé€šèż‡successCallbackć›žè°ƒć‡œæ•°é€šçŸ„ïŒŒć€±èŽ„ćˆ™é€šèż‡errorCallbackć›žè°ƒć‡œæ•°é€šçŸ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + getUserInfo(successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; + /** + * æ·»ćŠ ç”šæˆ·æ‰‹æœșć·äżĄæŻ + * æ‰“ćŒ€ç™»ćœ•æŽˆæƒæœćŠĄçš„æ·»ćŠ ç”šæˆ·æ‰‹æœșć·ç•Œéąèż›èĄŒæ“äœœïŒŒæ·»ćŠ ç”šæˆ·æ‰‹æœșć·æ“äœœæˆćŠŸćŽé€šèż‡successCallbackć›žè°ƒć‡œæ•°é€šçŸ„ïŒŒćŠćˆ™é€šèż‡errorCallbackć›žè°ƒć‡œæ•°é€šçŸ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + addPhoneNumber(successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; +} + +/** + * JSONćŻčè±ĄïŒŒæŽˆæƒèź€èŻć‚æ•°é€‰éĄč + * æ­€ćŻčè±Ąæ”ŻæŒçš„ć±žæ€§ć€Œç”±ç™»ćœ•æŽˆæƒèź€èŻæœćŠĄćźšäč‰ă€‚ + * äŸ‹ćŠ‚â€œćŸźäżĄâ€ïŒŒćˆ™ćŻé…çœźä»„äž‹ć‚æ•°ïŒš + * scope - ćș”ç”šæŽˆæƒäœœç”šćŸŸïŒ› + * state - 甹äșŽäżæŒèŻ·æ±‚ć’Œć›žè°ƒçš„çŠ¶æ€ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ +interface PlusOauthAuthOptions { + /** + * ç”łèŻ·çš„æƒé™äœœç”šèŒƒć›Ž + * ćŠ‚æžœć­˜ćœšć€šäžȘæƒé™ïŒŒćˆ™ä»„","çŹŠć·ćˆ†ć‰Č。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + scope?: string; + /** + * ćźąæˆ·ç«Żçš„ćœ“ć‰çŠ¶æ€ïŒŒćŻä»„æŒ‡ćźšä»»æ„ć€ŒïŒŒç™»ćœ•èź€èŻćŽćŽŸć°äžćŠšçš„èż”ć›žäżć­˜ćˆ°AuthServicećŻčè±Ąçš„extraäž­ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + state?: string; + /** + * ç™»ćœ•æŽˆæƒèź€èŻæœćŠĄćčłć°ç”łèŻ·çš„appid + * ćŠšæ€èźŸçœźç™»ćœ•æŽˆæƒæœćŠĄäž­éœ€èŠäœżç”šçš„appidïŒŒä»…éœ€èŠæ­€ć‚æ•°çš„ç™»ćœ•æŽˆæƒæœćŠĄïŒˆćŠ‚â€œćŸźäżĄç™»ćœ•â€ă€â€œQQç™»ćœ•â€ïŒ‰æ”ŻæŒă€‚ + * ćŠ‚æžœæœȘèźŸçœźćˆ™äœżç”šèżèĄŒçŽŻćąƒäž­ć†…çœźçš„appidć€ŒïŒˆćŠ‚ćœšHBuilder侭揯朹manifest.json的SDKé…çœźéĄčäž­èż›èĄŒèźŸçœźïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + appid?: string; + /** + * ç™»ćœ•æŽˆæƒèź€èŻæœćŠĄćčłć°ç”łèŻ·çš„appkey + * ćŠšæ€èźŸçœźç™»ćœ•æŽˆæƒæœćŠĄäž­éœ€èŠäœżç”šçš„appkeyïŒŒä»…éœ€èŠæ­€ć‚æ•°çš„ç™»ćœ•æŽˆæƒæœćŠĄïŒˆćŠ‚â€œæ–°æ”ȘćŸźćšç™»ćœ•â€ă€â€œ360ç™»ćœ•â€ïŒ‰æ”ŻæŒă€‚ + * ćŠ‚æžœæœȘèźŸçœźćˆ™äœżç”šèżèĄŒçŽŻćąƒäž­ć†…çœźçš„appkeyć€ŒïŒˆćŠ‚ćœšHBuilder侭揯朹manifest.json的SDKé…çœźéĄčäž­èż›èĄŒèźŸçœźïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + appkey?: string; + /** + * ç™»ćœ•æŽˆæƒèź€èŻæœćŠĄćčłć°ç”łèŻ·çš„appsecret + * ćŠšæ€èźŸçœźç™»ćœ•æŽˆæƒæœćŠĄäž­éœ€èŠäœżç”šçš„appsecretïŒŒä»…éœ€èŠæ­€ć‚æ•°çš„ç™»ćœ•æŽˆæƒæœćŠĄïŒˆćŠ‚â€œćŸźäżĄç™»ćœ•â€ă€â€œæ–°æ”ȘćŸźćšç™»ćœ•â€ïŒ‰æ”ŻæŒă€‚ + * ćŠ‚æžœæœȘèźŸçœźćˆ™äœżç”šèżèĄŒçŽŻćąƒäž­ć†…çœźçš„appkeyć€ŒïŒˆćŠ‚ćœšHBuilder侭揯朹manifest.json的SDKé…çœźéĄčäž­èż›èĄŒèźŸçœźïŒ‰ïŒ›ćœ“ćŒ€æ”Ÿćčłć°ç”łèŻ·çš„appsecretć€Œæ¶‰ćŠćˆ°ćź‰ć…šé—źéą˜æ—¶ïŒŒćŻćœšćș”ç”šèżèĄŒæ—¶ä»ŽæœćŠĄć™šèŽ·ć–ïŒŒç„¶ćŽé€šèż‡æ­€apićŠšæ€èźŸçœźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + appsecret?: string; + /** + * ç™»ćœ•æŽˆæƒèź€èŻæœćŠĄćčłć°ç”łèŻ·çš„redirect_url + * ćŠšæ€èźŸçœźç™»ćœ•æŽˆæƒæœćŠĄäž­éœ€èŠäœżç”šçš„redirect_urlïŒŒä»…éœ€èŠæ­€ć‚æ•°çš„ç™»ćœ•æŽˆæƒæœćŠĄïŒˆćŠ‚â€œæ–°æ”ȘćŸźćšç™»ćœ•â€ïŒ‰æ”ŻæŒă€‚ + * ćŠ‚æžœæœȘèźŸçœźćˆ™äœżç”šèżèĄŒçŽŻćąƒäž­ć†…çœźçš„redirect_urlć€ŒïŒˆćŠ‚ćœšHBuilder侭揯朹manifest.json的SDKé…çœźéĄčäž­èż›èĄŒèźŸçœźïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + redirect_url?: string; +} + +/** + * ç™»ćœ•æŽˆæƒèź€èŻäżĄæŻ + * æ­€ćŻčè±Ąä»…ćźšä艿 ‡ć‡†ć±žæ€§ïŒŒç™»ćœ•æŽˆæƒèź€èŻæœćŠĄćŻæ‰©ć±•è‡Ș漚ä艿•°æźă€‚ + * äŸ‹ćŠ‚â€œćŸźäżĄâ€ç™»ćœ•æŽˆæƒæœćŠĄïŒŒćˆ™ćŒ…æ‹Źä»„äž‹æ•°æźïŒš + * unionid - ç”šæˆ·ç»Ÿäž€æ ‡èŻ†ïŒŒé’ˆćŻč侀äžȘćŸźäżĄćŒ€æ”Ÿćčłć°ćžć·äž‹çš„ćș”ç”šïŒŒćŒäž€ç”šæˆ·çš„unionidæ˜Żć”Żäž€çš„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ +interface PlusOauthAuthInfo { + /** + * ç™»ćœ•æŽˆæƒçš„èźżé—źä»€ç‰Œ + * ćŠ‚æžœç™»ćœ•æŽˆæƒæœćŠĄäžæ”ŻæŒæ­€ć±žæ€§ïŒŒćˆ™èż”ć›ž"undefined"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + access_token?: string; + /** + * ç™»ćœ•æŽˆæƒç”šæˆ·çš„ć”Żäž€æ ‡èŻ† + * ćŠ‚æžœç™»ćœ•æŽˆæƒæœćŠĄäžæ”ŻæŒæ­€ć±žæ€§ïŒŒćˆ™èż”ć›ž"undefined"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + openid?: string; + /** + * ç™»ćœ•æŽˆæƒèźżé—źä»€ç‰Œèż‡æœŸæ—¶é—Ž + * ć•äœäžșç§’ïŒŒćŠ‚æžœç™»ćœ•æŽˆæƒæœćŠĄäžæ”ŻæŒæ­€ć±žæ€§ïŒŒćˆ™èż”ć›ž"undefined"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + expires_in?: string; + /** + * ç™»ćœ•æŽˆæƒçš„æ›Žæ–°ä»€ç‰Œ + * ç”šæ„èŽ·ć–äž‹äž€æŹĄçš„èźżé—źä»€ç‰ŒïŒŒćŠ‚æžœç™»ćœ•æŽˆæƒæœćŠĄäžæ”ŻæŒæ­€ć±žæ€§ïŒŒćˆ™èż”ć›ž"undefined"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + refresh_token?: string; + /** + * ç™»ćœ•æŽˆæƒçš„æƒé™èŒƒć›Ž + * ćŠ‚æžœć­˜ćœšć€šäžȘæƒé™ïŒŒćˆ™ä»„","çŹŠć·ćˆ†ć‰Č。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + scope?: string; +} + +/** + * ç™»ćœ•æŽˆæƒç”šæˆ·äżĄæŻ + * 甹äșŽäżć­˜ç™»ćœ•æŽˆæƒç”šæˆ·çš„äżĄæŻă€‚ + * æ­€ćŻčè±Ąä»…ćźšä艿 ‡ć‡†ć±žæ€§ïŒŒç™»ćœ•æŽˆæƒèź€èŻæœćŠĄćŻæ‰©ć±•è‡Ș漚ä艿•°æźă€‚ + * äŸ‹ćŠ‚â€œćŸźäżĄâ€ç™»ćœ•æŽˆæƒæœćŠĄïŒŒćŻèƒœćŒ…æ‹Źä»„äž‹è‡Ș漚ä艿•°æźïŒš + * privilege - 甚户ç‰čæƒäżĄæŻïŒŒjsonæ•°ç»„ïŒŒćŠ‚ćŸźäżĄæČƒćĄç”šæˆ·äžșchinaunicom + * unionid - ç”šæˆ·ç»Ÿäž€æ ‡èŻ†ïŒŒé’ˆćŻč侀äžȘćŸźäżĄćŒ€æ”Ÿćčłć°ćžć·äž‹çš„ćș”ç”šïŒŒćŒäž€ç”šæˆ·çš„unionidæ˜Żć”Żäž€çš„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ +interface PlusOauthUserInfo { + /** + * ç™»ćœ•æŽˆæƒç”šæˆ·çš„ć”Żäž€æ ‡èŻ† + * ćŠ‚æžœç™»ćœ•æŽˆæƒæœćŠĄäžæ”ŻæŒæ­€ć±žæ€§ïŒŒćˆ™èż”ć›ž"undefined"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + openid?: string; + /** + * ç™»ćœ•æŽˆæƒç”šæˆ·çš„ć€Žćƒć›Ÿç‰‡ćœ°ć€ + * 芁求äžș"http://"或"https://"ćŒ€ć€Žçš„ćœ°ć€ïŒŒćŠ‚æžœç™»ćœ•æŽˆæƒæœćŠĄäžæ”ŻæŒæ­€ć±žæ€§ïŒŒćˆ™èż”ć›ž"undefined"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + headimgurl?: string; + /** + * ç™»ćœ•æŽˆæƒç”šæˆ·çš„æ˜”ç§° + * ćŠ‚æžœç™»ćœ•æŽˆæƒæœćŠĄäžæ”ŻæŒæ­€ć±žæ€§ïŒŒćˆ™èż”ć›ž"undefined"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + nickname?: string; + /** + * ç™»ćœ•æŽˆæƒç”šæˆ·çš„é‚źçź±ćœ°ć€ + * ćŠ‚æžœç™»ćœ•æŽˆæƒæœćŠĄäžæ”ŻæŒæ­€ć±žæ€§ïŒŒćˆ™èż”ć›ž"undefined"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + email?: string; + /** + * ç™»ćœ•æŽˆæƒç”šæˆ·çš„ç””èŻć·ç  + * ćŠ‚æžœç™»ćœ•æŽˆæƒæœćŠĄäžæ”ŻæŒæ­€ć±žæ€§ïŒŒćˆ™èż”ć›ž"undefined"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + phonenumber?: string; + /** + * ç™»ćœ•æŽˆæƒç”šæˆ·çš„æ€§ćˆ« + * 1äžș男性2äžșć„łæ€§ă€‚ + * ćŠ‚æžœç™»ćœ•æŽˆæƒæœćŠĄäžæ”ŻæŒæ­€ć±žæ€§ïŒŒćˆ™èż”ć›ž"undefined"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + sex?: string; + /** + * ç™»ćœ•æŽˆæƒç”šæˆ·æłšć†Œçš„çœä»œäżĄæŻ + * ćŠ‚æžœç™»ćœ•æŽˆæƒæœćŠĄäžæ”ŻæŒæ­€ć±žæ€§ïŒŒćˆ™èż”ć›ž"undefined"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + province?: string; + /** + * ç™»ćœ•æŽˆæƒç”šæˆ·æłšć†Œçš„ćŸŽćž‚äżĄæŻ + * ćŠ‚æžœç™»ćœ•æŽˆæƒæœćŠĄäžæ”ŻæŒæ­€ć±žæ€§ïŒŒćˆ™èż”ć›ž"undefined"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + city?: string; + /** + * ç™»ćœ•æŽˆæƒç”šæˆ·æłšć†Œçš„ć›œćź¶äżĄæŻ + * ćŠ‚æžœç™»ćœ•æŽˆæƒæœćŠĄäžæ”ŻæŒæ­€ć±žæ€§ïŒŒćˆ™èż”ć›ž"undefined"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + country?: string; +} + +/** + * PaymentæšĄć—çźĄç†æ”Żä»˜ćŠŸèƒœïŒŒç”šäșŽæäŸ›çœ‘éĄ”ćź‰ć…šæ”Żä»˜èƒœćŠ›ïŒŒæ”ŻæŒé€šèż‡WebæŽ„ćŁèż›èĄŒæ”Żä»˜æ“äœœă€‚é€šèż‡plus.paymentćŻèŽ·ć–æ”Żä»˜çźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ +interface PlusPayment { + /** + * æ”Żä»˜é€šé“ćŻčè±Ą + * PaymentChannelćŻčè±ĄèĄšç€șç‰čćźšçš„æ”Żä»˜é€šé“ïŒŒç”šäșŽć‘çł»ç»ŸèŻ·æ±‚æ”Żä»˜æ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + PaymentChannel?: PlusPaymentPaymentChannel; + /** + * IAPèźąć•æ•°æźćŻčè±Ą + * æèż°IAPć•†ć“èźąć•äżĄæŻïŒŒćŠ‚æ ‡èŻ†ă€æ•°é‡ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + OrderStatementIAP?: PlusPaymentOrderStatementIAP; + /** + * æ”Żä»˜æ“äœœç»“æžœćŻčè±Ą + * PaymentResultćŻčè±ĄèĄšç€șæ”Żä»˜æ“äœœèż”ć›žç»“æžœïŒŒç”šäșŽçĄźèꀿ”Żä»˜æ“äœœæˆćŠŸă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + PaymentResult?: PlusPaymentPaymentResult; + /** + * IAP敆擁ćŻčè±Ą + * æèż°IAPć•†ć“èŻŠç»†äżĄæŻïŒŒćŠ‚æ ‡èŻ†ă€ä»·æ Œă€æ ‡éą˜ă€æèż°äżĄæŻç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + IAPProduct?: PlusPaymentIAPProduct; + /** + * 莭äč°IAP敆擁ćŻčè±Ą + * æèż°èŽ­äč°çš„IAPć•†ć“èŻŠç»†äżĄæŻïŒŒćŠ‚æ ‡èŻ†ă€æ•°é‡ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + IAPProductInfo?: PlusPaymentIAPProductInfo; + /** + * 莭äč°IAP敆擁äș€æ˜“äżĄæŻćŻčè±Ą + * æèż°èŽ­äč°çš„IAP敆擁äș€æ˜“èŻŠç»†äżĄæŻïŒŒćŠ‚èŽ­äč°ć•†ć“äżĄæŻă€äș€æ˜“æ—„æœŸă€èźąć•æ ‡èŻ†ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + IAPTransaction?: PlusPaymentIAPTransaction; + /** + * èŽ·ć–æ”Żä»˜é€šé“ + * ćœšèż›èĄŒæ”Żä»˜æ“äœœć‰éœ€èŽ·ć–ç»ˆç«Żæ”ŻæŒçš„æ”Żä»˜é€šé“ćˆ—èĄšïŒŒç”šäșŽæç€șç”šæˆ·èż›èĄŒé€‰æ‹©ă€‚ + * èŽ·ć–æ”Żä»˜é€šé“æˆćŠŸćŽé€šèż‡successCBć›žè°ƒèż”ć›žæ”ŻæŒçš„æ‰€æœ‰é€šé“ćˆ—èĄšïŒŒèŽ·ć–æ”Żä»˜é€šé“ćˆ—èĄšć€±èŽ„ćˆ™é€šèż‡errorCBć›žè°ƒèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + getChannels(successCB?: (result: PlusPayment []) => void, errorCB?: (result: any) => void): void; + /** + * èŻ·æ±‚æ”Żä»˜æ“äœœ + * è°ƒç”šæŒ‡ćźšçš„æ”Żä»˜é€šé“èż›èĄŒæ”Żä»˜æ“äœœïŒŒć…¶äž­statementćŒ…ć«æ”Żä»˜æ“äœœçš„ç›žć…łäżĄæŻïŒŒæ”Żä»˜æšĄć—ć°†ćŒčć‡șæ”Żä»˜ç•ŒéąäŸ›ç”šæˆ·èż›èĄŒæ”Żä»˜äżĄæŻçš„èŸ“ć…„çĄźèź€æ“äœœă€‚ + * ç”šæˆ·æ”Żä»˜æ“äœœæˆćŠŸćŽé€šèż‡successCBć›žè°ƒèż”ć›žæ”Żä»˜æ“äœœç»“æžœïŒŒæ”Żä»˜æ“äœœć€±èŽ„ćˆ™é€šèż‡errorCBć›žè°ƒèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + request(channel?: PlusPaymentPaymentChannel, statement?: string, successCB?: (result: PlusPaymentPaymentResult) => void, errorCB?: (result: any) => void): void; +} + +/** + * æ”Żä»˜é€šé“ćŻčè±Ą + * PaymentChannelćŻčè±ĄèĄšç€șç‰čćźšçš„æ”Żä»˜é€šé“ïŒŒç”šäșŽć‘çł»ç»ŸèŻ·æ±‚æ”Żä»˜æ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ +interface PlusPaymentPaymentChannel { + /** + * æ”Żä»˜é€šé“æ ‡èŻ† + * 甹äșŽæ ‡èŻ†æ”Żä»˜é€šé“ïŒš + * "alipay" - èĄšç€șæ”Żä»˜ćźïŒ› + * "wxpay" - èĄšç€șćŸźäżĄæ”Żä»˜ïŒ› + * "appleiap" - èĄšç€șè‹č果ćș”ç”šć†…æ”Żä»˜ïŒ› + * "qhpay" - èĄšç€ș360èšćˆæ”Żä»˜ïŒˆä»…360æ‰‹ćŠ©æ”ćș”ç”šçŽŻćąƒäž‹æ”ŻæŒïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + id?: string; + /** + * æ”Żä»˜é€šé“æèż° + * æ”Żä»˜é€šé“çš„æèż°äżĄæŻïŒŒćŠ‚â€œæ”Żä»˜ćźâ€ă€â€œćŸźäżĄâ€ă€â€œIn-App Purchase”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + description?: string; + /** + * æ”Żä»˜é€šé“æœćŠĄæ˜ŻćŠćź‰èŁ… + * 通澾ç‰čćźšçš„æ”Żä»˜é€šé“äŸè”–çł»ç»Ÿćź‰èŁ…ç›žć…łçš„æœćŠĄïŒŒæ­€ć±žæ€§ç”šäșŽæ ‡èŻ†ć…¶æœćŠĄæ˜ŻćŠćź‰èŁ…ïŒŒćŠ‚æžœæČĄæœ‰ćź‰èŁ…ćˆ™äžșfalseïŒŒćŠćˆ™äžștrue。 + * è‹„çł»ç»ŸçŽŻćąƒäž­æČĄæœ‰ćź‰èŁ…ç›žć…łçš„æœćŠĄïŒŒćˆ™ćŻèƒœćŻŒè‡Žè°ƒç”šæ”Żä»˜æ“äœœć€±èŽ„ïŒŒèż™æ—¶ćŻä»„è°ƒç”šinstallServiceæ–čæł•èż›èĄŒćź‰èŁ…ă€‚ + * æłšæ„ïŒšćŠ‚æžœæ”Żä»˜é€šé“äžéœ€èŠäŸè”–çł»ç»Ÿćź‰èŁ…æœćŠĄïŒŒćˆ™æ°žèżœèż”ć›žtrueă€‚äŸ‹ćŠ‚æ”Żä»˜ćźïŒŒćŠ‚æžœèźŸć€‡äžŠæœȘćź‰èŁ…æ”Żä»˜ćźćźąæˆ·ç«Żćˆ™è°ƒç”šWapéĄ”éąèż›èĄŒæ”Żä»˜ïŒŒć› æ­€ć€Œć›șćźšèż”ć›žtrue + * è€ŒćŸźäżĄæ”Żä»˜ćˆ™äŸè”–ćŸźäżĄćźąæˆ·ç«ŻïŒŒćŠ‚æžœèźŸć€‡äžŠæœȘćź‰èŁ…ćŸźäżĄćźąæˆ·ç«Żćˆ™serviceReadyć€Œäžșfalse歀时ćș”èŻ„æç€șç”šæˆ·ćź‰èŁ…ćŸźäżĄćźąæˆ·ç«Żæ‰èƒœèż›èĄŒæ”Żä»˜æ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + serviceReady?: boolean; + /** + * ćź‰èŁ…æ”Żä»˜é€šé“äŸè”–çš„æœćŠĄ + * ćŻčäșŽæŸäș›æ”Żä»˜é€šé“ïŒŒé€šćžžç‰čćźšçš„æ”Żä»˜é€šé“äŸè”–çł»ç»Ÿćź‰èŁ…ç›žć…łçš„æœćŠĄïŒŒè°ƒç”šæ­€æ–čæł•ć°†ćź‰èŁ…ć…¶äŸè”–çš„æ”Żä»˜æœćŠĄă€‚ + * ćŠ‚æ”Żä»˜ćźïŒŒćˆ™ćœšçł»ç»Ÿäž­ćź‰èŁ…æ”Żä»˜ćźćźąæˆ·ç«Żçš‹ćșă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + installService(): void; + /** + * 搑IAPæœćŠĄć™šèŻ·æ±‚æ”Żä»˜èźąć• + * IAPæ”Żä»˜ćœšè°ƒç”šplus.payment.requestæ–čæł•æ”Żä»˜ć‰éĄ»ć…ˆć‘æœćŠĄć™šèŻ·æ±‚èŽ·ć–ć•†ć“çš„èŻŠç»†äżĄæŻïŒŒćŠćˆ™äŒšæ”Żä»˜ć€±èŽ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + requestOrder(ids?: any [], successCB?: (result: PlusPayment []) => void, errorCB?: (result: any) => void): void; + /** + * 搑IAPæœćŠĄć™šèŻ·æ±‚ć·Č经莭äč°çš„éžæ¶ˆè€—æ€§ć•†ć“ć’Œèźąé˜…ć•†ć“ + * æłšæ„ïŒšäžèƒœèŽ·ć–ć·Č莭äč°çš„æ¶ˆè€—æ€§ć•†ć“ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + restoreComplateRequest(options?: any, successCB?: (result: PlusPayment []) => void): void; +} + +/** + * IAPèźąć•æ•°æźćŻčè±Ą + * æèż°IAPć•†ć“èźąć•äżĄæŻïŒŒćŠ‚æ ‡èŻ†ă€æ•°é‡ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ +interface PlusPaymentOrderStatementIAP { + /** + * ć•†ć“çš„æ ‡èŻ† + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + productid?: string; + /** + * 莭äč°ç”šæˆ·ćç§° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + username?: string; + /** + * ć•†ć“æ•°é‡ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + quantity?: string; +} + +/** + * æ”Żä»˜æ“äœœç»“æžœćŻčè±Ą + * PaymentResultćŻčè±ĄèĄšç€șæ”Żä»˜æ“äœœèż”ć›žç»“æžœïŒŒç”šäșŽçĄźèꀿ”Żä»˜æ“äœœæˆćŠŸă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ +interface PlusPaymentPaymentResult { + /** + * æ”Żä»˜é€šé“ćŻčè±Ą + * 甹äșŽć‘è”·æ”Żä»˜æ“äœœçš„æ”Żä»˜é€šé“ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + channel?: PlusPaymentPaymentChannel; + /** + * äș€æ˜“çŒ–ć·äżĄæŻ + * ćŠ‚æžœæ”Żä»˜ćčłć°äžæ”ŻæŒæ­€æ•°æźćˆ™èż”曞undefined。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + tradeno?: string; + /** + * äș€æ˜“æèż°äżĄæŻ + * ćŠ‚æžœæ”Żä»˜ćčłć°äžæ”ŻæŒæ­€æ•°æźćˆ™èż”曞undefined。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + description?: boolean; + /** + * æŸ„æ‰Ÿæ”Żä»˜äș€æ˜“äżĄæŻćœ°ć€ + * 甹äșŽć‘æ”Żä»˜ćčłć°æŸ„èŻąäș€æ˜“äżĄæŻïŒŒćŠ‚æžœæ”Żä»˜ćčłć°äžæ”ŻæŒæ­€æ•°æźćˆ™èż”曞undefined。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + url?: boolean; + /** + * æ”Żä»˜æ“äœœæŒ‡çșčäżĄæŻ + * 甹äșŽć‘æ”Żä»˜ćčłć°æŸ„èŻąæ”Żä»˜èźąć•äżĄæŻïŒŒćŠ‚æžœæ”Żä»˜ćčłć°äžæ”ŻæŒæ­€æ•°æźćˆ™èż”曞undefined。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + signature?: string; + /** + * æ”Żä»˜ćčłć°èż”ć›žçš„ćŽŸć§‹æ•°æź + * ćŠ‚æžœæ”Żä»˜ćčłć°èż”曞key-value类枋歗珊äžČïŒŒćˆ™ç»„ćˆæˆçŹŠćˆJSONæ ŒćŒçš„ć­—çŹŠäžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + rawdata?: string; +} + +/** + * IAP敆擁ćŻčè±Ą + * æèż°IAPć•†ć“èŻŠç»†äżĄæŻïŒŒćŠ‚æ ‡èŻ†ă€ä»·æ Œă€æ ‡éą˜ă€æèż°äżĄæŻç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ +interface PlusPaymentIAPProduct { + /** + * ć•†ć“çš„æ ‡èŻ† + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + productid?: string; + /** + * ć•†ć“çš„ä»·æ Œ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + price?: string; + /** + * ć•†ć“æ ‡éą˜ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + title?: string; + /** + * ć•†ć“çš„æèż°äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + description?: string; +} + +/** + * 莭äč°IAP敆擁ćŻčè±Ą + * æèż°èŽ­äč°çš„IAPć•†ć“èŻŠç»†äżĄæŻïŒŒćŠ‚æ ‡èŻ†ă€æ•°é‡ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ +interface PlusPaymentIAPProductInfo { + /** + * ć•†ć“çš„æ ‡èŻ† + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + productIdentifier?: string; + /** + * ć•†ć“çš„æ•°é‡ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + quantity?: string; +} + +/** + * 莭äč°IAP敆擁äș€æ˜“äżĄæŻćŻčè±Ą + * æèż°èŽ­äč°çš„IAP敆擁äș€æ˜“èŻŠç»†äżĄæŻïŒŒćŠ‚èŽ­äč°ć•†ć“äżĄæŻă€äș€æ˜“æ—„æœŸă€èźąć•æ ‡èŻ†ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ +interface PlusPaymentIAPTransaction { + /** + * 莭äč°ć•†ć“çš„äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + payment?: string; + /** + * 莭äč°ć•†ć“çš„äș€æ˜“æ—„期 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + transactionDate?: string; + /** + * 莭äč°ć•†ć“çš„äș€æ˜“èźąć•æ ‡è݆ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + transactionIdentifier?: string; + /** + * 莭äč°ć•†ć“çš„äș€æ˜“æ”¶æź + * base64çŒ–ç æ ŒćŒć­—çŹŠäžČæ•°æźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + transactionReceipt?: string; + /** + * 莭äč°ć•†ć“çš„äș€æ˜“状态 + * ćŻć–ć€ŒïŒš"1"äžșæ”Żä»˜æˆćŠŸïŒ›"2"äžșæ”Żä»˜ć€±èŽ„ïŒ›"3"äžșæ”Żä»˜ć·Čæąć€ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + transactionState?: string; +} + +/** + * PushæšĄć—çźĄç†æŽšé€æ¶ˆæŻćŠŸèƒœïŒŒćŻä»„ćźžçŽ°ćœšçșżă€çŠ»çșżçš„æ¶ˆæŻæŽšé€ïŒŒé€šèż‡plus.pushćŻèŽ·ć–æŽšé€æ¶ˆæŻçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ +interface PlusPush { + /** + * JSONćŻčè±ĄïŒŒèŽ·ć–çš„ćźąæˆ·ç«Żæ ‡èŻ†äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + ClientInfo?: PlusPushClientInfo; + /** + * JSONćŻčè±ĄïŒŒæŽšé€æ¶ˆæŻćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + PushMessage?: PlusPushPushMessage; + /** + * JSONćŻčè±ĄïŒŒèŽ·ćźąæˆ·ç«Żćˆ›ć»șæœŹćœ°æ¶ˆæŻçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + MessageOptions?: PlusPushMessageOptions; + /** + * æ·»ćŠ æŽšé€æ¶ˆæŻäș‹ä»¶ç›‘搏晚 + * æ·»ćŠ æŽšé€æ¶ˆæŻäș‹ä»¶ç›‘ćŹć™šïŒŒćœ“æŒ‡ćꚿŽšé€äș‹ä»¶ć‘ć‡șæ—¶è§Šć‘ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + addEventListener(type?: string, listener?: (result: string) => void, capture?: boolean): void; + /** + * æž…ç©șæ‰€æœ‰æŽšé€æ¶ˆæŻ + * æž…ç©șçł»ç»Ÿæ¶ˆæŻäž­ćżƒæ‰€æœ‰çš„æŽšé€æ¶ˆæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + clear(): void; + /** + * 戛ć»șæœŹćœ°æ¶ˆæŻ + * ćœšæœŹćœ°ç›ŽæŽ„ćˆ›ć»șæŽšé€æ¶ˆæŻïŒŒćč¶æ·»ćŠ ćˆ°çł»ç»Ÿæ¶ˆæŻäž­ćżƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + createMessage(content?: string, payload?: string, options?: PlusPushMessageOptions): void; + /** + * èŽ·ć–æ‰€æœ‰æŽšé€æ¶ˆæŻ + * èŽ·ć–ćźąæˆ·ç«ŻæŽ„æ”¶ćˆ°çš„æ‰€æœ‰æŽšé€æ¶ˆæŻă€‚ + * ä»…ćŒ…æ‹Źćœšçł»ç»Ÿæ¶ˆæŻäž­ćżƒæ˜Ÿç€șçš„æŽšé€æ¶ˆæŻïŒŒäžćŒ…æ‹Źè°ƒç”šsetAutoNotification(false)æ–čæł•èźŸçœźäžæ˜Ÿç€șæŽšé€æ¶ˆæŻćŽæŽ„æ”¶ćˆ°çš„æ¶ˆæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + getAllMessage(): PlusPushPushMessage; + /** + * èŽ·ć–ćźąæˆ·ç«ŻæŽšé€æ ‡èŻ†äżĄæŻ + * ćźąæˆ·ç«Żæ ‡èŻ†äżĄæŻç”šäșŽäžšćŠĄæœćŠĄć™šäž‹ć‘æŽšé€æ¶ˆæŻæ—¶æäș€ç»™æŽšé€æœćŠĄć™šçš„æ•°æźïŒŒç”šäșŽèŻŽæ˜Žäž‹ć‘æŽšé€æ¶ˆæŻçš„æŽ„æ”¶è€…ïŒˆćźąæˆ·ç«ŻïŒ‰ă€‚éœ€èŠćźąæˆ·ç«ŻćœšçŹŹäž€æŹĄèżèĄŒæ—¶æäș€ćˆ°äžšćŠĄæœćŠĄć™šäżć­˜ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + getClientInfo(): PlusPushClientInfo; + /** + * èźŸçœźçš‹ćșæ˜ŻćŠć°†æ¶ˆæŻæ˜Ÿç€șćœšçł»ç»Ÿæ¶ˆæŻäž­ćżƒ + * é»˜èź€æƒ…ć†”äž‹çš‹ćșćœšæŽ„æ”¶ćˆ°æŽšé€æ¶ˆæŻćŽć°†äŒšćœšçł»ç»Ÿæ¶ˆæŻäž­ćżƒæ˜Ÿç€șïŒŒé€šèż‡æ­€æ–čæł•ćŻć…łé—­é»˜èź€èĄŒäžșïŒŒæŽ„æ”¶ćˆ°æŽšé€æ¶ˆæŻćŽäžćœšçł»ç»Ÿæ¶ˆæŻäž­ćżƒæ˜Ÿç€șïŒŒé€šèż‡addEventListeneræ–čæł•的“receive”äș‹ä»¶ç›‘ćŹć€„ç†æŽ„æ”¶ćˆ°çš„æ¶ˆæŻă€‚ + * ćœšèż™ç§æšĄćŒäž‹ćŻé€šèż‡createMessageæ–čæł•ćˆ›ć»șćœšçł»ç»Ÿæ¶ˆæŻäž­ćżƒæ˜Ÿç€șçš„æ¶ˆæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + setAutoNotification(notify?: boolean): void; + /** + * ćˆ é™€æŽšé€æ¶ˆæŻ + * ćˆ é™€çł»ç»Ÿæ¶ˆæŻäž­ćżƒæŒ‡ćźšçš„æŽšé€æ¶ˆæŻïŒŒćŻé€šèż‡getAllMessageæ–čæł•èŽ·ć–æ‰€æœ‰çš„æ¶ˆæŻćŽèż›èĄŒæ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + remove(message?: PlusPushPushMessage): void; +} + +/** + * JSONćŻčè±ĄïŒŒèŽ·ć–çš„ćźąæˆ·ç«Żæ ‡èŻ†äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ +interface PlusPushClientInfo { + /** + * èźŸć€‡ä»€ç‰ŒïŒˆiOSèźŸć€‡ć”Żäž€æ ‡èŻ†ïŒ‰ïŒŒç”šäșŽAPNSæœćŠĄæŽšé€äž­æ ‡èŻ†èźŸć€‡çš„èș«ä»œ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + token?: string; + /** + * æŽšé€æœćŠĄä»€ç‰ŒïŒˆèźŸć€‡ć”Żäž€æ ‡èŻ†ïŒ‰ïŒŒç”šäșŽæ ‡èŻ†æŽšé€äżĄæŻæŽ„æ”¶è€…èș«ä»œ + * 第侉æ–čæŽšé€æœćŠĄć™šçźĄç†çš„èźŸć€‡ć”Żäž€æ ‡èŻ†ïŒŒćœšiOSćčłć°æ­€ć€Œé€šćžžäžŽtokenäžćŒïŒ›ćœšć…¶ćźƒćčłć°æ­€ć€Œé€šćžžäžŽtokenć€Œäž€è‡Žă€‚ + * æ­€ć€ŒäžŽèźŸć€‡ćŠćș”ç”šéƒœç›žć…łïŒŒćłäžćŒçš„apk/ipaćź‰èŁ…ćˆ°ćŒäž€ć°èźŸć€‡äžŠçš„ć€Œéƒœäžç›žćŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + clientid?: string; + /** + * 第侉æ–čæŽšé€æœćŠĄçš„ćș”甚标è݆ + * 第侉æ–čæŽšé€æœćŠĄć™šçźĄç†çš„ćș”ç”šæ ‡èŻ†ïŒŒé€šćžžéœ€èŠćœšçŹŹäž‰æ–čæŽšé€æœćŠĄć™šćčłć°èż›èĄŒæłšć†ŒèŽ·ć–ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + appid?: string; + /** + * 第侉æ–čæŽšé€æœćŠĄć™šçš„ćș”ç”šé”źć€Œ + * 第侉æ–čæŽšé€æœćŠĄć™šçźĄç†çš„ćș”ç”šé”źć€ŒïŒŒé€šćžžéœ€èŠćœšçŹŹäž‰æ–čæŽšé€æœćŠĄć™šćčłć°èż›èĄŒæłšć†ŒèŽ·ć–ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + appkey?: string; +} + +/** + * JSONćŻčè±ĄïŒŒæŽšé€æ¶ˆæŻćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ +interface PlusPushPushMessage { + /** + * æŽšé€æ¶ˆæŻæ˜Ÿç€șçš„æ ‡éą˜ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + title?: string; + /** + * æŽšé€æ¶ˆæŻæ˜Ÿç€ș的憅ćźč + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + content?: string; + /** + * æŽšé€æ¶ˆæŻæ‰żèœœçš„æ•°æź + * ćŠ‚æžœæŽšé€æ¶ˆæŻäž­äŒ èŸ“çš„æ•°æźäžçŹŠćˆJSONæ ŒćŒïŒŒćˆ™äœœäžșStringç±»ćž‹æ•°æźäżć­˜ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + payload?: any; + /** + * Apple APNSæŽšé€ćèźźæ•°æź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + aps?: any; +} + +/** + * JSONćŻčè±ĄïŒŒèŽ·ćźąæˆ·ç«Żćˆ›ć»șæœŹćœ°æ¶ˆæŻçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ +interface PlusPushMessageOptions { + /** + * èŠćŻćŠšæ”ćș”甚的appid + * é»˜èź€ć€Œäžșćœ“ć‰æ”ćș”甚的appid。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + appid?: string; + /** + * æ˜ŻćŠèŠ†ç›–äžŠäž€æŹĄæç€șçš„æ¶ˆæŻ + * ćŻć–ć€Œtrue或falsetrueäžș芆盖falseäžèŠ†ç›–ïŒŒé»˜èź€äžșpermissionäž­èźŸçœźçš„coverć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + cover?: boolean; + /** + * 提ç€șæ¶ˆæŻć»¶èżŸæ˜Ÿç€ș的时闎 + * ćœ“èźŸć€‡æŽ„æ”¶ćˆ°æŽšé€æ¶ˆæŻćŽïŒŒćŻäžç«‹ćłæ˜Ÿç€șïŒŒè€Œæ˜Żć»¶èżŸäž€æź”æ—¶é—Žæ˜Ÿç€șïŒŒć»¶èżŸæ—¶é—Žć•äœäžșsïŒŒé»˜èź€äžș0sïŒŒç«‹ćłæ˜Ÿç€ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + delay?: number; + /** + * æŽšé€æ¶ˆæŻçš„ć›Ÿæ ‡ + * æœŹćœ°ć›Ÿç‰‡ćœ°ć€ïŒŒç›žćŻčè·ŻćŸ„ - 盾ćŻčäșŽćœ“ć‰éĄ”靱的hostäœçœźïŒŒćŠ‚"a.jpg"ïŒŒæłšæ„ćœ“ć‰éĄ”éąäžșçœ‘ç»œćœ°ć€ćˆ™äžæ”ŻæŒïŒ› 绝ćŻčè·ŻćŸ„ - çł»ç»Ÿç»ćŻčè·ŻćŸ„ïŒŒćŠ‚Androidćčłć°"/sdcard/logo.png"ïŒŒæ­€ç±»è·ŻćŸ„é€šćžžé€šèż‡ć…¶ćźƒ5+ APIèŽ·ć–çš„ïŒ› æ‰©ć±•ç›žćŻčè·ŻćŸ„URL(RelativeURL) - 仄"_"ćŒ€ć€Žçš„ç›žćŻčè·ŻćŸ„ïŒŒćŠ‚"_www/a.jpg" æœŹćœ°è·ŻćŸ„URL - 仄“file://â€ćŒ€ć€ŽïŒŒćŽéąè·Ÿéšçł»ç»Ÿç»ćŻčè·ŻćŸ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + icon?: string; + /** + * æŽšé€æ¶ˆæŻçš„æç€ș音 + * 星ç€șæ¶ˆæŻæ—¶çš„æ’­æ”Ÿçš„æç€șéŸłïŒŒćŻć–ć€ŒïŒš + * “system”-èĄšç€șäœżç”šçł»ç»Ÿé€šçŸ„æç€șéŸłïŒ› + * “none”-èĄšç€șäžäœżç”šæç€șéŸłïŒ› + * é»˜èź€ć€Œäžș“system”。 + * - system: äœżç”šçł»ç»Ÿé€šçŸ„æç€ș音 + * - none: äžäœżç”šæç€ș音 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + sound?: 'system' | 'none'; + /** + * æŽšé€æ¶ˆæŻçš„æ ‡éą˜ + * ćœšçł»ç»Ÿæ¶ˆæŻäž­ćżƒæ˜Ÿç€șçš„é€šçŸ„æ¶ˆæŻæ ‡éą˜ïŒŒé»˜èź€ć€Œäžș繋ćșçš„ćç§°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + title?: string; + /** + * æ¶ˆæŻäžŠæ˜Ÿç€ș的提ç€șæ—¶é—Ž + * é»˜èź€äžșćœ“ć‰æ—¶é—ŽïŒŒćŠ‚æžœć»¶èżŸæ˜Ÿç€șćˆ™äœżç”šć»¶æ—¶ćŽæ˜Ÿç€șæ¶ˆæŻçš„æ—¶é—Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + when?: Date; +} + +/** + * ShareæšĄć—çźĄç†ćźąæˆ·ç«Żçš„ç€Ÿäș€ćˆ†äș«ćŠŸèƒœïŒŒæäŸ›è°ƒç”šç»ˆç«Żç€Ÿäș€èœŻä»¶çš„ćˆ†äș«èƒœćŠ›ă€‚é€šèż‡plus.sharećŻèŽ·ć–ç€Ÿäș€ćˆ†äș«çźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ +interface PlusShare { + /** + * JSONćŻčè±ĄïŒŒćˆ†äș«æŽˆæƒèź€èŻć‚æ•°é€‰éĄč + * æ­€ćŻčè±Ąæ”ŻæŒçš„ć±žæ€§ć€Œç”±ćˆ†äș«æœćŠĄçš„æŽˆæƒèź€èŻæšĄć—ćźšäč‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + AuthOptions?: PlusShareAuthOptions; + /** + * 戆äș«æŽˆæƒæŽ§ä»¶ćŻčè±Ą + * AuthorizećŻčè±ĄèĄšç€ș戆äș«æŽ§ä»¶ćŻčè±ĄïŒŒç”šäșŽćœšçȘ—ćŁäž­æ˜Ÿç€ș戆äș«æŽ§ä»¶ïŒŒäœżç”šæ­€ćŻčè±ĄćŻè‡Ș漚äč‰ćˆ†äș«æŽˆæƒç•Œéąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + Authorize?: PlusShareAuthorize; + /** + * JSONćŻčè±ĄïŒŒç”šæˆ·äœçœźäżĄæŻ + * GeoPositionćŻčè±Ąç”šäșŽèĄšç€șç”šæˆ·ćˆ†äș«æ¶ˆæŻæ—¶çš„äœçœźäżĄæŻă€‚ç”šäșŽæ ‡èŻ†ćˆ†äș«æ“äœœæ—¶ç”šæˆ·çš„äœçœźäżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + GeoPosition?: PlusShareGeoPosition; + /** + * 戆äș«æœćŠĄćŻčè±Ą + * ShareServicećŻčè±Ąç”šäșŽèĄšç€ș戆äș«æœćŠĄïŒŒćœšJSäž­äžșćŻčè±ĄïŒŒç”šäșŽć‘çł»ç»ŸèŻ·æ±‚ćˆ†äș«æ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + ShareService?: PlusShareShareService; + /** + * 戆äș«æœćŠĄæ ‡è݆ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + ShareServerIdentity?: PlusShareShareServerIdentity; + /** + * JSONćŻčè±ĄïŒŒćˆ†äș«æ¶ˆæŻćŻčè±Ą + * ShareMessagećŻčè±Ąç”šäșŽèĄšç€ș戆äș«æ¶ˆæŻć†…ćźčïŒŒćœšJSäž­äžșJSONćŻčè±ĄïŒŒç”šäșŽć‘çł»ç»Ÿć‘é€ćˆ†äș«äżĄæŻæ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + ShareMessage?: PlusShareShareMessage; + /** + * JSONćŻčè±ĄïŒŒäżć­˜ćˆ†äș«æ¶ˆæŻæ‰©ć±•äżĄæŻ + * ShareMessageExtraćŻčè±Ąç”šäșŽäżć­˜ć„ćˆ†äș«ćčłć°æ‰©ć±•çš„ć‚æ•°ïŒŒç”šäșŽè‡Ș漚äč‰ćˆ†äș«ćŠŸèƒœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + ShareMessageExtra?: PlusShareShareMessageExtra; + /** + * JSONćŻčè±ĄïŒŒćŸźäżĄć°çš‹ćșäżĄæŻ + * 甹äșŽé…çœźćˆ†äș«ć°çš‹ćșçš„ć‚æ•°ïŒŒćŠ‚ć°çš‹ćșæ ‡èŻ†ă€éĄ”éąè·ŻćŸ„ç­‰ă€‚ + * æłšæ„ïŒšćˆ†äș«çš„ć°çš‹ćșéœ€èŠćœšćŸźäżĄćŒ€æ”Ÿćčłć°ć…łè”çš„ćŒ€ć‘è€…èŽŠć·äž‹ïŒŒćŠćˆ™äŒšćˆ†äș«ć€±èŽ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + WeixinMiniProgramOptions?: PlusShareWeixinMiniProgramOptions; + /** + * èŽ·ć–ćˆ†äș«æœćŠĄ + * èŽ·ć–ç»ˆç«Żæ”ŻæŒçš„ćˆ†äș«é€šé“ćˆ—èĄšïŒŒćŻç”šäșŽæç€șç”šæˆ·èż›èĄŒćˆ†äș«æœćŠĄć™šçš„é€‰æ‹©ă€‚èŽ·ć–ćˆ†äș«æœćŠĄæˆćŠŸćŽé€šèż‡successCBć›žè°ƒèż”ć›žæ”ŻæŒçš„æ‰€æœ‰æœćŠĄćˆ—èĄšïŒŒèŽ·ć–æœćŠĄć€±èŽ„ćˆ™é€šèż‡errorCBć›žè°ƒèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + getServices(successCB?: (result: PlusShare []) => void, errorCB?: (result: any) => void): void; + /** + * äœżç”šçł»ç»Ÿç»„ä»¶ć‘é€ćˆ†äș« + * è°ƒç”šçł»ç»Ÿćˆ†äș«ç»„ä»¶ćˆ†äș«æ¶ˆæŻïŒŒé€šèż‡msgć‚æ•°èźŸçœźćˆ†äș«ć†…ćźč。 + * ć‘é€æˆćŠŸćŽé€šèż‡successCBć›žè°ƒć‡œæ•°é€šçŸ„æ“äœœćźŒæˆïŒŒć‘é€ć€±èŽ„ćˆ™é€šèż‡errorCBć›žè°ƒèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + sendWithSystem(msg?: PlusShareShareMessage, successCB?: Function, errorCB?: (result: any) => void): void; +} + +/** + * JSONćŻčè±ĄïŒŒćˆ†äș«æŽˆæƒèź€èŻć‚æ•°é€‰éĄč + * æ­€ćŻčè±Ąæ”ŻæŒçš„ć±žæ€§ć€Œç”±ćˆ†äș«æœćŠĄçš„æŽˆæƒèź€èŻæšĄć—ćźšäč‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ +interface PlusShareAuthOptions { + /** + * 戆äș«æœćŠĄćčłć°ç”łèŻ·çš„appid + * ćŠšæ€èźŸçœźćˆ†äș«æœćŠĄæŽˆæƒèź€èŻæ—¶éœ€èŠäœżç”šçš„appidïŒŒä»…éœ€èŠæ­€ć‚æ•°çš„ćˆ†äș«æœćŠĄïŒˆćŠ‚â€œćŸźäżĄâ€ă€â€œQQâ€ïŒ‰æ”ŻæŒă€‚ + * ćŠ‚æžœæœȘèźŸçœźćˆ™äœżç”šèżèĄŒçŽŻćąƒäž­ć†…çœźçš„appidć€ŒïŒˆćŠ‚ćœšHBuilder侭揯朹manifest.json的“SDKé…çœźâ€éĄčäž­èż›èĄŒèźŸçœźïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + appid?: string; + /** + * 戆äș«æœćŠĄćčłć°ç”łèŻ·çš„appkey + * ćŠšæ€èźŸçœźćˆ†äș«æœćŠĄæŽˆæƒèź€èŻæ—¶éœ€èŠäœżç”šçš„appkeyïŒŒä»…éœ€èŠæ­€ć‚æ•°çš„ćˆ†äș«æœćŠĄïŒˆćŠ‚â€œæ–°æ”ȘćŸźćšâ€ïŒ‰æ”ŻæŒă€‚ + * ćŠ‚æžœæœȘèźŸçœźćˆ™äœżç”šèżèĄŒçŽŻćąƒäž­ć†…çœźçš„appkeyć€ŒïŒˆćŠ‚ćœšHBuilder侭揯朹manifest.json的“SDKé…çœźâ€éĄčäž­èż›èĄŒèźŸçœźïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + appkey?: string; + /** + * 戆äș«æœćŠĄćčłć°ç”łèŻ·çš„appsecret + * ćŠšæ€èźŸçœźćˆ†äș«æœćŠĄäž­éœ€èŠäœżç”šçš„appsecretïŒŒä»…éœ€èŠæ­€ć‚æ•°çš„ćˆ†äș«æœćŠĄïŒˆćŠ‚â€œćŸźäżĄâ€ă€â€œæ–°æ”ȘćŸźćšâ€ïŒ‰æ”ŻæŒă€‚ + * ćŠ‚æžœæœȘèźŸçœźćˆ™äœżç”šèżèĄŒçŽŻćąƒäž­ć†…çœźçš„appsecretć€ŒïŒˆćŠ‚ćœšHBuilder侭揯朹manifest.json的“SDKé…çœźâ€éĄčäž­èż›èĄŒèźŸçœźïŒ‰ïŒ›ćœ“ćŒ€æ”Ÿćčłć°ç”łèŻ·çš„appsecretć€Œæ¶‰ćŠćˆ°ćź‰ć…šé—źéą˜æ—¶ïŒŒćŻćœšćș”ç”šèżèĄŒæ—¶ä»ŽæœćŠĄć™šèŽ·ć–ïŒŒç„¶ćŽé€šèż‡æ­€apićŠšæ€èźŸçœźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + appsecret?: string; + /** + * 戆äș«æœćŠĄćčłć°ç”łèŻ·çš„redirect_url + * ćŠšæ€èźŸçœźćˆ†äș«æœćŠĄäž­éœ€èŠäœżç”šçš„redirect_urlïŒŒä»…éœ€èŠæ­€ć‚æ•°çš„ç™»ćœ•æŽˆæƒæœćŠĄïŒˆćŠ‚â€œæ–°æ”ȘćŸźćšç™»ćœ•â€ïŒ‰æ”ŻæŒă€‚ + * ćŠ‚æžœæœȘèźŸçœźćˆ™äœżç”šèżèĄŒçŽŻćąƒäž­ć†…çœźçš„redirect_urlć€ŒïŒˆćŠ‚ćœšHBuilder侭揯朹manifest.json的SDKé…çœźéĄčäž­èż›èĄŒèźŸçœźïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + redirect_url?: string; +} + +/** + * 戆äș«æŽˆæƒæŽ§ä»¶ćŻčè±Ą + * AuthorizećŻčè±ĄèĄšç€ș戆äș«æŽ§ä»¶ćŻčè±ĄïŒŒç”šäșŽćœšçȘ—ćŁäž­æ˜Ÿç€ș戆äș«æŽ§ä»¶ïŒŒäœżç”šæ­€ćŻčè±ĄćŻè‡Ș漚äč‰ćˆ†äș«æŽˆæƒç•Œéąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ +interface PlusShareAuthorize { + /** + * 戆äș«æŽ§ä»¶ćŠ èœœćꌿˆäș‹ä»¶ + * 戆äș«æŽˆæƒæŽ§ä»¶ć†…ćźčćŠ èœœćźŒæˆäș‹ä»¶ïŒŒé€šèż‡è°ƒç”šloadæ–čæł•ćŠ èœœćˆ†äș«æŽˆæƒæŽ§ä»¶ć†…ćźčïŒŒćœ“ć†…ćźčćŠ èœœćźŒæˆæ—¶è§Šć‘ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + onloaded?: (result: any) => void; + /** + * 戆äș«æŽˆæƒèź€èŻæˆćŠŸäș‹ä»¶ + * ç”šæˆ·ćœšćˆ†äș«æŽˆæƒæŽ§ä»¶äžŠèŸ“ć…„æ“äœœæŽˆæƒæˆćŠŸæ—¶è§Šć‘ïŒŒäș‹ä»¶æ–čæł•æ ŒćŒć‚è€ƒShareSuccessCallbackć›žè°ƒć‡œæ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + onauthenticated?: Function; + /** + * 戆äș«æŽˆæƒèź€èŻć€±èŽ„äș‹ä»¶ + * ç”šæˆ·ćœšćˆ†äș«æŽˆæƒæŽ§ä»¶äžŠèŸ“ć…„æ“äœœæŽˆæƒèź€èŻé”™èŻŻæ—¶è§Šć‘ïŒŒäș‹ä»¶æ–čæł•æ ŒćŒć‚è€ƒShareErrorCallbackć›žè°ƒć‡œæ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + onerror?: (result: any) => void; + /** + * ćŠ èœœćˆ†äș«æŽˆæƒéĄ”靱 + * 戛ć»ș戆äș«æŽˆæƒéĄ”éąćŽïŒŒéœ€èŠè°ƒç”šæ­€æ–čæł•æŒ‡ćźšćˆ†äș«æœćŠĄæ ‡èŻ†æ„ćŠ èœœæŽˆæƒéĄ”éąæ•°æźïŒŒæ­€æ ‡èŻ†ćŻäœżç”šShareServicećŻčè±Ąçš„idć±žæ€§ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + load(id?: string): void; + /** + * èźŸçœźćˆ†äș«æŽˆæƒæŽ§ä»¶æ˜ŻćŠćŻè§ + * 戛ć»ș戆äș«æŽˆæƒéĄ”éąćŽïŒŒè°ƒç”šæ­€æ–čæł•èźŸçœźćˆ†äș«æŽˆæƒæŽ§ä»¶ćœšéĄ”éąäž­æ˜ŻćŠćŻè§ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + setVisible(visible?: boolean): void; +} + +/** + * JSONćŻčè±ĄïŒŒç”šæˆ·äœçœźäżĄæŻ + * GeoPositionćŻčè±Ąç”šäșŽèĄšç€șç”šæˆ·ćˆ†äș«æ¶ˆæŻæ—¶çš„äœçœźäżĄæŻă€‚ç”šäșŽæ ‡èŻ†ćˆ†äș«æ“äœœæ—¶ç”šæˆ·çš„äœçœźäżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ +interface PlusShareGeoPosition { + /** + * ç”šæˆ·äœçœźçš„çșŹćșŠćæ ‡äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + latitude?: number; + /** + * ç”šæˆ·äœçœźçš„ç»ćșŠćæ ‡äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + longitude?: number; +} + +/** + * 戆äș«æœćŠĄćŻčè±Ą + * ShareServicećŻčè±Ąç”šäșŽèĄšç€ș戆äș«æœćŠĄïŒŒćœšJSäž­äžșćŻčè±ĄïŒŒç”šäșŽć‘çł»ç»ŸèŻ·æ±‚ćˆ†äș«æ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ +interface PlusShareShareService { + /** + * 戆äș«æœćŠĄæ ‡è݆ + * 甹äșŽèĄšç€ș戆äș«æœćŠĄæ ‡èŻ†ïŒš + * "sinaweibo" - èĄšç€ș新æ”ȘćŸźćšïŒ› + * "tencentweibo" - èĄšç€șè…ŸèźŻćŸźćšïŒ› + * "weixin" - èĄšç€șćŸźäżĄïŒ› + * "qq" - èĄšç€șè…ŸèźŻQQ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + id?: PlusShareShareServerIdentity; + /** + * 戆äș«æœćŠĄæèż° + * 甹äșŽæèż°ćˆ†äș«æœćŠĄçš„äżĄæŻïŒš + * ćŠ‚â€œæ–°æ”ȘćŸźćšâ€ă€â€œè…ŸèźŻćŸźćšâ€ă€â€œćŸźäżĄâ€ă€â€œQQ”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + description?: string; + /** + * æ˜ŻćŠæŽˆæƒèź€èŻ + * 甹äșŽæ ‡èŻ†æ­€ćˆ†äș«æ˜ŻćŠć·Čç»æŽˆæƒèź€èŻèż‡ïŒŒtrueèĄšç€șć·ČćźŒæˆæŽˆæƒèź€èŻïŒ›falseèĄšç€șæœȘćźŒæˆæŽˆæƒèź€èŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + authenticated?: boolean; + /** + * æŽˆæƒèź€èŻäżĄæŻ + * ä»…ćœšauthenticatedäžștrueæ—¶æœ‰æ•ˆïŒŒæ ‡èŻ†ćźąæˆ·èź€èŻæ ‡èŻ†äżĄæŻïŒŒç”šäșŽć‘é€ćˆ†äș«äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + accessToken?: string; + /** + * æ˜ŻćŠć­˜ćœšćŻčćș”çš„ćˆ†äș«ćźąæˆ·ç«Ż + * ćŻčäșŽæŸäș›ćˆ†äș«æœćŠĄïŒŒćŻç›ŽæŽ„è°ƒç”šæœŹćœ°ćźąæˆ·ç«Żçš‹ćșèż›èĄŒæŽˆæƒèź€èŻïŒŒæ­€ć±žæ€§ćłćŻæäŸ›æ­€ç›žć…łäżĄæŻïŒŒè‹„æČĄæœ‰ćź‰èŁ…æœŹćœ°ćźąæˆ·ç«Żćˆ™ćŻèƒœè°ƒç”šć…¶ćźƒæ–čćŒèż›èĄŒćˆ†äș«æ“äœœïŒŒćŠ‚WAPæ–čćŒç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + nativeClient?: boolean; + /** + * æŽˆæƒèź€èŻæ“äœœ + * ćŻčæŒ‡ćźšçš„ćˆ†äș«æœćŠĄèż›èĄŒæŽˆæƒèź€èŻæ“äœœïŒŒćœšæŽˆæƒć‰ćŻé€šèż‡ShareService.authenticatedć±žæ€§ćˆ€æ–­æ˜ŻćŠć·Čç»æŽˆæƒèż‡ïŒŒé€šćžžćȘ需芁ćŻčæČĄæœ‰èż›èĄŒèż‡æŽˆæƒèź€èŻçš„æœćŠĄèż›èĄŒæŽˆæƒèź€èŻæ“äœœă€‚ + * æŽˆæƒèź€èŻæ“äœœæˆćŠŸćŽé€šèż‡successCBć›žè°ƒć‡œæ•°é€šçŸ„æ“äœœćźŒæˆïŒŒæ“äœœć€±èŽ„ćˆ™é€šèż‡errorCBć›žè°ƒèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + authorize(successCallback?: (result: PlusShareShareService) => void, errorCallback?: (result: any) => void, options?: PlusShareAuthOptions): void; + /** + * ć–æ¶ˆæŽˆæƒèź€èŻ + * ćŻčæŒ‡ćźšçš„ćˆ†äș«æœćŠĄć–æ¶ˆæŽˆæƒèź€èŻæ“äœœïŒŒć–æ¶ˆæŽˆæƒèź€èŻćŽïŒŒć†æŹĄćˆ†äș«æ—¶éœ€é‡æ–°èż›èĄŒæŽˆæƒæ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + forbid(): void; + /** + * 揑送戆äș« + * 揑送戆äș«æ¶ˆæŻïŒŒćˆ†äș«æ¶ˆæŻçš„憅ćźčé€šèż‡msgèźŸçœźă€‚ + * ć‘é€æˆćŠŸćŽé€šèż‡successCBć›žè°ƒć‡œæ•°é€šçŸ„æ“äœœćźŒæˆïŒŒć‘é€ć€±èŽ„ćˆ™é€šèż‡errorCBć›žè°ƒèż”ć›žă€‚è‹„ćˆ†äș«æœćŠĄæČĄæœ‰èż›èĄŒæŽˆæƒèź€èŻæˆ–æŽˆæƒèź€èŻć€±æ•ˆćˆ™è§Šć‘ć€±èŽ„ć›žè°ƒć‡œæ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + send(msg?: PlusShareShareMessage, successCB?: Function, errorCB?: (result: any) => void): void; + /** + * è°ƒç”šćŸźäżĄć°çš‹ćș + * æłšæ„ïŒšéœ€ćœšćŸźäżĄćŒ€æ”Ÿćčłć°ć°†ćș”ç”šć…łè”ć°çš‹ćșæ‰èƒœæ­Łćžžè°ƒç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + launchMiniProgram(options?: PlusShareWeixinMiniProgramOptions): void; +} + +/** + * 戆äș«æœćŠĄæ ‡è݆ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ +interface PlusShareShareServerIdentity { + /** + * 新æ”ȘćŸźćš + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + sinaweibo?: string; + /** + * è…ŸèźŻćŸźćš + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + tencentweibo?: string; + /** + * ćŸźäżĄ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + weixin?: string; +} + +/** + * JSONćŻčè±ĄïŒŒćˆ†äș«æ¶ˆæŻćŻčè±Ą + * ShareMessagećŻčè±Ąç”šäșŽèĄšç€ș戆äș«æ¶ˆæŻć†…ćźčïŒŒćœšJSäž­äžșJSONćŻčè±ĄïŒŒç”šäșŽć‘çł»ç»Ÿć‘é€ćˆ†äș«äżĄæŻæ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ +interface PlusShareShareMessage { + /** + * 戆äș«æ¶ˆæŻçš„类枋 + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + type?: string; + /** + * 戆äș«æ¶ˆæŻçš„æ–‡ć­—憅ćźč + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + content?: string; + /** + * 戆äș«æ¶ˆæŻçš„ć›Ÿç‰‡ + * 戆äș«æ¶ˆæŻäž­ćŒ…ć«çš„ć›Ÿç‰‡è·ŻćŸ„ïŒŒä»…æ”ŻæŒæœŹćœ°è·ŻćŸ„ă€‚ + * è‹„ćˆ†äș«ćčłć°ä»…æ”ŻæŒæäș€äž€ćŒ ć›Ÿç‰‡ïŒŒäŒ ć…„ć€šćŒ ć›Ÿç‰‡ćˆ™ä»…æäș€çŹŹäž€ćŒ ć›Ÿç‰‡ă€‚ + * ćŠ‚æžœæœȘæŒ‡ćźštypeç±»ćž‹ïŒŒäŒ˜ć…ˆçș§éĄșćșäžșpictures>contentïŒˆćłèźŸçœźäș†picturesćˆ™èź€äžș戆äș«ć›Ÿç‰‡ç±»ćž‹ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + pictures?: any []; + /** + * 戆äș«æ¶ˆæŻçš„çŒ©ç•„ć›Ÿ + * 戆äș«æ¶ˆæŻäž­ćŒ…ć«çš„çŒ©ç•„ć›Ÿè·ŻćŸ„ïŒŒæ”ŻæŒæœŹćœ°è·ŻćŸ„ćŠçœ‘ç»œè·ŻćŸ„ă€‚ + * è‹„ćˆ†äș«ćčłć°ä»…æ”ŻæŒæäș€äž€ćŒ ć›Ÿç‰‡ïŒŒäŒ ć…„ć€šćŒ ć›Ÿç‰‡ćˆ™ä»…æäș€çŹŹäž€ćŒ ć›Ÿç‰‡ă€‚ + * ćŠ‚æžœćˆ†äș«ćčłć°çš„äżĄæŻäžæ”ŻæŒçŒ©ç•„ć›ŸïŒŒè‹„æČĄæœ‰èźŸçœźæ¶ˆæŻçš„ć›Ÿç‰‡ïŒˆpicturesïŒ‰ćˆ™äœżç”šçŒ©ç•„ć›ŸïŒŒćŠćˆ™ćżœç•„ć…¶ć±žæ€§ć€Œă€‚ + * æłšæ„ïŒšć›Ÿç‰‡æœ‰ć€§ć°é™ćˆ¶ïŒŒæŽšèć›Ÿç‰‡ć°äșŽ20Kb。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + thumbs?: any []; + /** + * 戆äș«çš„怚ćȘ’䜓蔄æș + * 戆äș«çš„怚ćȘ’䜓蔄æșćœ°ć€ïŒŒćœ“typeć€Œäžș"music"、"video"æ—¶æœ‰æ•ˆă€‚ + * æłšæ„ïŒš + * ćŸźäżĄćˆ†äș«ćčłć°æ”ŻæŒéŸłäčă€è§†éą‘ç±»ćž‹ïŒŒä»…æ”ŻæŒçœ‘ç»œćœ°ć€ïŒˆä»„http://或https://ćŒ€ć€ŽïŒ‰ïŒ› + * QQ戆äș«ćčłć°æ”ŻæŒéŸłäčç±»ćž‹ïŒŒä»…æ”ŻæŒçœ‘ç»œè·ŻćŸ„ïŒˆä»„http://或https://ćŒ€ć€ŽïŒ‰ïŒ› + * 新æ”ȘćŸźćšćˆ†äș«ćčłć°æ”ŻæŒè§†éą‘ç±»ćž‹ïŒŒä»…æ”ŻæŒæœŹćœ°æ–‡ä»¶è·ŻćŸ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + media?: string; + /** + * 戆äș«ç‹Źç«‹çš„铟掄 + * 戆äș«è”„æșćœ°ć€ïŒŒä»…æ”ŻæŒçœ‘ç»œćœ°ć€ïŒˆä»„http://或https://ćŒ€ć€ŽïŒ‰ă€‚ + * ćŠ‚æžœæœȘæŒ‡ćźštypeç±»ćž‹ïŒŒäŒ˜ć…ˆçș§éĄșćșäžșhref>pictures>contentïŒˆćłèźŸçœźäș†hrefćˆ™èź€äžș戆äș«çœ‘éĄ”ç±»ćž‹ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + href?: string; + /** + * 戆äș«æ¶ˆæŻçš„æ ‡éą˜ + * ä»…ćŸźäżĄćˆ†äș«çœ‘éĄ”ă€éŸłéą‘ă€è§†éą‘ă€ć°çš‹ćșç±»ćž‹æ—¶æ”ŻæŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + title?: string; + /** + * 戆äș«æ¶ˆæŻäž­ćŒ…ć«çš„ç”šæˆ·ćœ°ç†äżĄæŻæ•°æź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + geo?: PlusShareGeoPosition; + /** + * 戆äș«æ¶ˆæŻæ‰©ć±•ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + extra?: PlusShareShareMessageExtra; + /** + * 戆äș«ćŸźäżĄć°çš‹ćșć‚æ•° + * ä»…ćŸźäżĄćˆ†äș«ć°çš‹ćșç±»ćž‹æ—¶æ”ŻæŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + miniProgram?: PlusShareWeixinMiniProgramOptions; + /** + * 戆äș«æ¶ˆæŻçš„æšĄćŒ + * ćŻć–ć€ŒïŒš + * "auto" - è‡ȘćŠšé€‰æ‹©ïŒŒćŠ‚æžœć·Čç»ćź‰èŁ…ćŸźćšćźąæˆ·ç«Żćˆ™é‡‡ç”šçŒ–èŸ‘ç•Œéąèż›èĄŒćˆ†äș«ïŒŒćŠćˆ™é‡‡ç”šæ— ç•Œéąćˆ†äș«ïŒ› + * "slient" - é™é»˜ćˆ†äș«ïŒŒé‡‡ç”šæ— ç•ŒéąæšĄćŒèż›èĄŒćˆ†äș«ïŒ› + * "editable" - èż›ć…„çŒ–èŸ‘ç•ŒéąïŒŒç”šæˆ·çĄźèź€ćˆ†äș«ć†…ćźčćŽć‘é€ïŒŒćŠ‚æžœćœ“ć‰æœȘćź‰èŁ…ćŸźćšćźąæˆ·ç«Żćˆ™è§Šć‘é”™èŻŻć›žè°ƒă€‚ + * é»˜èź€ć€Œäžș"auto"。 + * 仅新æ”ȘćŸźćšćˆ†äș«æ—¶ç”Ÿæ•ˆïŒ‰ + * - auto: + * è‡ȘćŠšé€‰æ‹©ïŒŒćŠ‚æžœć·Čç»ćź‰èŁ…ćŸźćšćźąæˆ·ç«Żćˆ™é‡‡ç”šçŒ–èŸ‘ç•Œéąèż›èĄŒćˆ†äș«ïŒŒćŠćˆ™é‡‡ç”šæ— ç•Œéąćˆ†äș« + * + * - slient: + * é™é»˜ćˆ†äș«ïŒŒé‡‡ç”šæ— ç•ŒéąæšĄćŒèż›èĄŒćˆ†äș« + * + * - editable: + * èż›ć…„çŒ–èŸ‘ç•ŒéąïŒŒç”šæˆ·çĄźèź€ćˆ†äș«ć†…ćźčćŽć‘é€ïŒŒćŠ‚æžœćœ“ć‰æœȘćź‰èŁ…ćŸźćšćźąæˆ·ç«Żćˆ™è§Šć‘é”™èŻŻć›žè°ƒ + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + interface?: 'auto' | 'slient' | 'editable'; +} + +/** + * JSONćŻčè±ĄïŒŒäżć­˜ćˆ†äș«æ¶ˆæŻæ‰©ć±•äżĄæŻ + * ShareMessageExtraćŻčè±Ąç”šäșŽäżć­˜ć„ćˆ†äș«ćčłć°æ‰©ć±•çš„ć‚æ•°ïŒŒç”šäșŽè‡Ș漚äč‰ćˆ†äș«ćŠŸèƒœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ +interface PlusShareShareMessageExtra { + /** + * ćŸźäżĄćˆ†äș«ćœșæ™ŻïŒŒä»…ćŸźäżĄćˆ†äș«ćčłć°æœ‰æ•ˆ + * ćŻć–ć€ŒïŒš + * "WXSceneSession"戆äș«ćˆ°ćŸźäżĄçš„â€œæˆ‘çš„ć„œć‹â€ïŒ› + * "WXSceneTimeline"戆äș«ćˆ°ćŸźäżĄçš„â€œæœ‹ć‹ćœˆâ€äž­ïŒ› + * "WXSceneFavorite"戆äș«ćˆ°ćŸźäżĄçš„â€œæˆ‘çš„æ”¶è—â€äž­ă€‚ + * é»˜èź€ć€Œäžș"WXSceneSession"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + scene?: string; +} + +/** + * JSONćŻčè±ĄïŒŒćŸźäżĄć°çš‹ćșäżĄæŻ + * 甹äșŽé…çœźćˆ†äș«ć°çš‹ćșçš„ć‚æ•°ïŒŒćŠ‚ć°çš‹ćșæ ‡èŻ†ă€éĄ”éąè·ŻćŸ„ç­‰ă€‚ + * æłšæ„ïŒšćˆ†äș«çš„ć°çš‹ćșéœ€èŠćœšćŸźäżĄćŒ€æ”Ÿćčłć°ć…łè”çš„ćŒ€ć‘è€…èŽŠć·äž‹ïŒŒćŠćˆ™äŒšćˆ†äș«ć€±èŽ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ +interface PlusShareWeixinMiniProgramOptions { + /** + * ćŸźäżĄć°çš‹ćșID + * æłšæ„ïŒšæ˜ŻćŸźäżĄć°çš‹ćșçš„ćŽŸć§‹ID"g_"ćŒ€ć€Žçš„ć­—çŹŠäžČïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + id?: string; + /** + * ćŸźäżĄć°çš‹ćșæ‰“ćŒ€çš„éĄ”éąè·ŻćŸ„ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + path?: string; + /** + * ćŸźäżĄć°çš‹ćșç‰ˆæœŹç±»ćž‹ + * ćŻć–ć€ŒïŒš + * 0-æ­ŁćŒç‰ˆïŒ› + * 1-æ”‹èŻ•ç‰ˆïŒ› + * 2-䜓éȘŒç‰ˆă€‚ + * é»˜èź€ć€Œäžș0。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + type?: number; + /** + * ć…ŒćźčäœŽç‰ˆæœŹçš„çœ‘éĄ”é“ŸæŽ„ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + webUrl?: string; +} + +/** + * SpeechæšĄć—çźĄç†èŻ­éŸłèŸ“ć…„ćŠŸèƒœïŒŒæäŸ›èŻ­éŸłèŻ†ćˆ«ćŠŸèƒœïŒŒćŻæ”ŻæŒç”šæˆ·é€šèż‡éșŠć…‹éŁŽèźŸć€‡èż›èĄŒèŻ­éŸłèŸ“ć…„ć†…ćźčă€‚é€šèż‡plus.speechćŻèŽ·ć–èŻ­éŸłèŸ“ć…„çźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ +interface PlusSpeech { + /** + * JSONćŻčè±ĄïŒŒèŻ­éŸłèŻ†ćˆ«ć‚æ•° + * æŽ§ćˆ¶èŻ­éŸłèŻ†ćˆ«ćŒ•æ“Žć†…éƒšć‚æ•°ïŒŒćœšJSäž­äžșJSONćŻčè±ĄïŒŒćœšćŻćŠšèŻ­éŸłèŻ†ćˆ«æ—¶äœżç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + SpeechRecognizeOptions?: PlusSpeechSpeechRecognizeOptions; + /** + * èŻ­éŸłèŻ†ćˆ«äș‹ä»¶ç±»ćž‹ + * æèż°èŻ­éŸłèż‡çš‹çš„è§Šć‘äș‹ä»¶ćˆ—èĄšïŒŒćŻä»„é€šèż‡è°ƒç”šplus.sppech.addEventListeneræ–čæł•èż›èĄŒæłšć†Œç›‘ćŹă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + SpeechRecoginzeEvents?: PlusSpeechSpeechRecoginzeEvents; + /** + * ćŻćŠšèŻ­éŸłèŻ†ćˆ« + * ćŻćŠšèŻ­éŸłèŻ†ćˆ«æ—¶è°ƒç”šïŒŒćœ“èŻ­éŸłèŻ†ćˆ«æˆćŠŸćŽé€šèż‡successCallbackć›žè°ƒèż”ć›žèŻ†ćˆ«ć‡șæ–‡æœŹć†…ćźčïŒŒè°ƒç”šèŻ­éŸłèŻ†ćˆ«ć€±èŽ„ćˆ™é€šèż‡errorCallbackć›žè°ƒèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + startRecognize(options?: PlusSpeechSpeechRecognizeOptions, successCB?: (result: string) => void, errorCB?: (result: any) => void): void; + /** + * ćœæ­ąèŻ­éŸłèŻ†ćˆ« + * ćœ“èŻ­éŸłèŻ†ćˆ«ćźŒæˆæ—¶æˆ–ç”šæˆ·ć–æ¶ˆèŻ­éŸłèŻ†ćˆ«æ—¶è°ƒç”šïŒŒè°ƒç”šæ­€æ–čæł•ć°†ćŻŒè‡ŽerrorCallbackć›žè°ƒć‡œæ•°çš„è°ƒç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + stopRecognize(): void; + /** + * ç›‘ćŹèŻ­éŸłèŻ†ćˆ«äș‹ä»¶ + * ć‘èŻ­éŸłèŻ†ćˆ«æšĄć—æ·»ćŠ äș‹ä»¶ç›‘ćŹć™šïŒŒćœ“æŒ‡ćźšçš„äș‹ä»¶ć‘ç”Ÿæ—¶ïŒŒć°†è§Šć‘listenerć‡œæ•°çš„æ‰§èĄŒă€‚ + * ćŻć€šæŹĄè°ƒç”šæ­€æ–čæł•æ·»ćŠ ć€šäžȘç›‘ćŹć™šïŒŒćœ“ç›‘ćŹçš„äș‹ä»¶ć‘ç”Ÿæ—¶ïŒŒć°†æŒ‰ç…§æ·»ćŠ çš„ć…ˆćŽéĄșćșè§Šć‘æ‰§èĄŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + addEventListener(event?: PlusSpeechSpeechRecoginzeEvents, listener?: (result: any) => void, capture?: boolean): void; +} + +/** + * JSONćŻčè±ĄïŒŒèŻ­éŸłèŻ†ćˆ«ć‚æ•° + * æŽ§ćˆ¶èŻ­éŸłèŻ†ćˆ«ćŒ•æ“Žć†…éƒšć‚æ•°ïŒŒćœšJSäž­äžșJSONćŻčè±ĄïŒŒćœšćŻćŠšèŻ­éŸłèŻ†ćˆ«æ—¶äœżç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ +interface PlusSpeechSpeechRecognizeOptions { + /** + * èŻ­éŸłèŻ†ćˆ«æ˜ŻćŠé‡‡ç”šæŒç»­æšĄćŒ + * èźŸçœźäžștrueèĄšç€șèŻ­éŸłćŒ•æ“ŽäžäŒšæ čæźèŻ­éŸłèŸ“ć…„è‡ȘćŠšç»“æŸïŒŒèŻ†ćˆ«ćˆ°æ–‡æœŹć†…ćźčć°†ć€šæŹĄè°ƒç”šsuccessCallbackć‡œæ•°èż”ć›žïŒŒćŠ‚æžœéœ€èŠç»“æŸèŻ­éŸłèŻ†ćˆ«ćˆ™ćż…éĄ»è°ƒç”šstopRecognizeæŽ„ćŁïŒŒé»˜èź€ć€Œäžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + continue?: boolean; + /** + * èŻ­éŸłèŻ†ćˆ«ćŒ•æ“Žæ ‡èŻ† + * 甹äșŽć…Œćźčć€šèŻ­éŸłèŻ†ćˆ«ćŒ•æ“Žçš„æ”è§ˆć™šïŒŒäœżç”šèŻ­éŸłèŻ†ćˆ«ćŽ‚ć•†çš„äș§ć“ćç§°ïŒŒćŠ‚æœȘèźŸçœźæˆ–èźŸçœźäžæ­ŁçĄźćˆ™äœżç”šèżèĄŒçŽŻćąƒé»˜èź€çš„èŻ­éŸłèŻ†ćˆ«ćŒ•æ“Žă€‚ + * æ”ŻæŒä»„äž‹èŻ­éŸłèŻ†ćˆ«ćŒ•æ“ŽïŒš + * "baidu"-癟ćșŠèŻ­éŸłèŻ†ćˆ«ïŒ› + * "iFly"-èźŻéŁžèŻ­éŸłèŻ†ćˆ«ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + engine?: string; + /** + * èŻ­éŸłèŻ†ćˆ«ćŒ•æ“Žçš„èŻ­èš€ + * 甹äșŽćźšäč‰èŻ­éŸłèŻ†ćˆ«ćŒ•æ“Žçš„èŻ­èš€ïŒŒć…¶ć–ć€Œéœ€çŹŠćˆW3C的Language codesè§„èŒƒă€‚ + * ç›źć‰èźŻéŁžèŻ­éŸłæ”ŻæŒä»„äž‹èŻ­èš€ïŒš + * "zh-cn"-äž­æ–‡ïŒŒæ™źé€šèŻïŒ› + * "en-us"-è‹±èŻ­ïŒ› + * "zh-cantonese"-䞭文çČ€èŻ­ïŒ› + * "zh-henanese"-䞭文æČłć—èŻïŒˆç™ŸćșŠèŻ­éŸłèŻ†ćˆ«äžæ”ŻæŒæ­€èŻ­èš€ïŒ‰ă€‚ + * é»˜èź€ć€Œäžș"zh-cn"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + lang?: string; + /** + * æŒ‡ćźšèŻ†ćˆ«ç»“æžœèŻ†ćˆ«ćŒ…æ‹Źć€šć€™é€‰ç»“æžœ + * 甹äșŽæŒ‡ćźšèŻ†ćˆ«ç»“æžœèŻ†ćˆ«ćŒ…æ‹Źć€šć€™é€‰ç»“æžœă€‚ćŠ‚nbest:3ïŒŒèŻ†ćˆ«èż”ć›ž3äžȘć€™é€‰ç»“æžœïŒŒé»˜èź€ć€Œäžș1。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + nbest?: number; + /** + * èŻ†ćˆ«ç»“æžœäž­æ˜ŻćŠćŒ…ć«æ ‡ç‚čçŹŠć· + * trueèĄšç€șèŻ†ćˆ«ç»“æžœæ–‡æœŹäž­ćŒ…ć«æ ‡ç‚čçŹŠć·ïŒŒfalseèĄšç€șèŻ†ćˆ«ç»“æžœæ–‡æœŹäž­äžćŒ…ć«æ ‡ç‚čçŹŠć·ă€‚ + * é»˜èź€ć€Œäžștrue。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + punctuation?: boolean; + /** + * èŻ­éŸłèŻ†ćˆ«è¶…æ—¶æ—¶é—Ž + * èŻ­éŸłèŻ†ćˆ«è¶…æ—¶çš„æ—¶é—ŽïŒŒć•äœäžșmsïŒŒé»˜èź€ć€Œäžș1000ïŒˆćł10ç§’ïŒ‰ă€‚ + * æłšïŒšç™ŸćșŠèŻ­éŸłèŻ†ćˆ«äžæ”ŻæŒæ­€ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + timeout?: number; + /** + * èŻ†ćˆ«æ—¶æ˜ŻćŠæ˜Ÿç€șç”šæˆ·ç•Œéą + * 甹äșŽæŒ‡ćźšèŻ†ćˆ«æ—¶æ˜ŻćŠæ˜Ÿç€șç”šæˆ·ç•ŒéąïŒŒèźŸçœźäžștrueèĄšç€ș星ç€șæ”è§ˆć™šć†…çœźèŻ­éŸłèŻ†ćˆ«ç•ŒéąïŒ›èźŸçœźäžșfalseèĄšç€ș䞍星ç€șæ”è§ˆć™šć†…çœźèŻ­éŸłèŻ†ćˆ«ç•Œéąă€‚é»˜èź€ć€Œäžștrue。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + userInterface?: boolean; + /** + * èŻ­éŸłèŻ†ćˆ«ćŒ€ć§‹äș‹ä»¶ïŒˆć·ČćșŸćŒƒïŒŒäœżç”šstartäș‹ä»¶ïŒ‰ + * äș‹ä»¶ć‡œæ•°ïŒŒèŻ­éŸłèŻ†ćˆ«ćŒ€ć§‹ćŻćŠšïŒŒćœšè°ƒç”šstartRecognizeæ–čæł•ćŽè§Šć‘ïŒŒäžŽonendäș‹ä»¶æˆćŻčè§Šć‘ă€‚ + * æłšïŒšiOSćčłć°æœȘæ”ŻæŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + onstart?: (result: any) => void; + /** + * èŻ­éŸłèŻ†ćˆ«ç»“æŸäș‹ä»¶ïŒˆć·ČćșŸćŒƒïŒŒäœżç”šendäș‹ä»¶ïŒ‰ + * äș‹ä»¶ć‡œæ•°ïŒŒèŻ­éŸłèŻ†ćˆ«ç»“æŸïŒŒćœšè°ƒç”šstopRecognizeæ–čæł•ćŽè§Šć‘ïŒŒæˆ–è€…ćœšćŒ•æ“Žć†…éƒšè‡ȘćŠšćźŒæˆèŻ­éŸłèŻ†ćˆ«ćŽè§Šć‘ïŒŒäžŽonstartäș‹ä»¶æˆćŻčè§Šć‘ă€‚ + * æłšïŒšiOSćčłć°æœȘæ”ŻæŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + onend?: (result: any) => void; +} + +/** + * èŻ­éŸłèŻ†ćˆ«äș‹ä»¶ç±»ćž‹ + * æèż°èŻ­éŸłèż‡çš‹çš„è§Šć‘äș‹ä»¶ćˆ—èĄšïŒŒćŻä»„é€šèż‡è°ƒç”šplus.sppech.addEventListeneræ–čæł•èż›èĄŒæłšć†Œç›‘ćŹă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ +interface PlusSpeechSpeechRecoginzeEvents { + /** + * ćŒ€ć§‹èŻ­éŸłèŻ†ćˆ« + * 调甚plus.speech.startRecognizeæ–čæł•ćŒ€ć§‹èŻ­éŸłèŻ†ćˆ«æ—¶è§Šć‘ă€‚ + * æ— ć›žè°ƒć‡œæ•°ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + start?: string; + /** + * 音量揘挖 + * ćŒ€ć§‹èŻ­éŸłèŻ†ćˆ«ćŽïŒŒéșŠć…‹éŁŽćœ•ćˆ¶ćˆ°çš„èŻ­éŸłéŸłé‡ć˜ćŒ–æ—¶è§Šć‘ă€‚ + * ć›žè°ƒć‡œæ•°ć‚æ•°event={volume:"Numberç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Ž0-1"}。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + volumeChange?: string; + /** + * äžŽæ—¶èŻ­éŸłèŻ†ćˆ«ç»“æžœ + * èż”ć›žäžŽæ—¶èŻ­éŸłèŻ†ćˆ«ç»“æžœæ—¶è§Šć‘ă€‚ + * ć›žè°ƒć‡œæ•°ć‚æ•°event={partialResult:"Stringç±»ćž‹ïŒŒäžŽæ—¶èŻ†ćˆ«ç»“æžœ"}。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + recognizing?: string; + /** + * æœ€ç»ˆèŻ­éŸłèŻ†ćˆ« + * èż”ć›žæœ€ç»ˆèŻ­éŸłèŻ†ćˆ«ç»“æžœă€‚ + * ć›žè°ƒć‡œæ•°ć‚æ•°event={result:"Stringç±»ćž‹ïŒŒæœ€äœłèŻ†ćˆ«ç»“æžœ",results:"Stringæ•°ç»„ç±»ćž‹ïŒŒæ‰€æœ‰ć€™é€‰ç»“æžœ"}。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + recognition?: string; + /** + * ç»“æŸèŻ­éŸłèŻ†ćˆ« + * 调甚plus.speech.stopRecognizeæ–čæł•ç»“æŸèŻ­éŸłèŻ†ćˆ«æˆ–èŻ­éŸłèŻ†ćˆ«ćźŒæˆćŽè‡ȘćŠšç»“æŸæ—¶è§Šć‘ă€‚ + * æ— ć›žè°ƒć‡œæ•°ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + end?: string; + /** + * èŻ­éŸłèŻ†ćˆ«é”™èŻŻ + * èŻ­éŸłèŻ†ćˆ«ć‘ç”Ÿé”™èŻŻæ—¶è§Šć‘ă€‚ + * ć›žè°ƒć‡œæ•°ć‚æ•°event={code:"Numberç±»ćž‹ïŒŒé”™èŻŻçŒ–ç ",message:"Stringç±»ćž‹ïŒŒé”™èŻŻæèż°äżĄæŻ"}。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + error?: string; +} + +/** + * StatisticæšĄć—çźĄç†ç»ŸèźĄćŠŸèƒœïŒŒç”šäșŽæäŸ›ćș”ç”šć†…ç»ŸèźĄçš„èƒœćŠ›ïŒŒæ”ŻæŒç»ŸèźĄć’Œćˆ†æžç”šæˆ·ć±žæ€§ć’Œç”šæˆ·èĄŒäžșæ•°æźă€‚é€šèż‡plus.statisticćŻèŽ·ć–ç»ŸèźĄçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/statistic.html](http://www.html5plus.org/doc/zh_cn/statistic.html) + */ +interface PlusStatistic { + /** + * è§Šć‘äș‹ä»¶ + * è§Šć‘æŒ‡ćźšçš„ç»ŸèźĄäș‹ä»¶ïŒŒè§Šć‘çš„äș‹ä»¶ćż…éĄ»èŠć…ˆćœšç»ŸèźĄçœ‘ç«™äžŠæłšć†Œäș‹ä»¶ID。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/statistic.html](http://www.html5plus.org/doc/zh_cn/statistic.html) + */ + eventTrig(id?: string, value?: any): void; + /** + * çČŸçĄźæŒç»­äș‹ä»¶ + * çČŸçĄźæ—¶é•żçš„æŒç»­äș‹ä»¶ç»ŸèźĄïŒŒè§Šć‘çš„äș‹ä»¶ćż…éĄ»èŠć…ˆćœšç»ŸèźĄçœ‘ç«™äžŠæłšć†Œäș‹ä»¶ID。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/statistic.html](http://www.html5plus.org/doc/zh_cn/statistic.html) + */ + eventDuration(id?: string, duration?: number, value?: any): void; + /** + * ćŒ€ć§‹æŒç»­äș‹ä»¶ïŒˆèż‡æœŸAPIïŒŒäžæŽšèäœżç”šïŒ‰ + * ćŒ€ć§‹æŒ‡ćźšçš„æŒç»­äș‹ä»¶ç»ŸèźĄïŒŒćœ“äș‹ä»¶ç»“束时调甚eventEndæ–čæł•ïŒŒïŒŒè§Šć‘çš„äș‹ä»¶ćż…éĄ»èŠć…ˆćœšç»ŸèźĄçœ‘ç«™äžŠæłšć†Œäș‹ä»¶ID。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/statistic.html](http://www.html5plus.org/doc/zh_cn/statistic.html) + */ + eventStart(id?: string, value?: string): void; + /** + * 结束持续äș‹ä»¶ïŒˆèż‡æœŸAPIïŒŒäžæŽšèäœżç”šïŒ‰ + * ç»“æŸæŒ‡ćźšçš„æŒç»­äș‹ä»¶ç»ŸèźĄïŒŒéœ€ć…ˆè°ƒç”ševentStartæ–čæł•ćŒ€ć§‹æŒç»­äș‹ä»¶ç»ŸèźĄïŒŒè§Šć‘çš„äș‹ä»¶ćż…éĄ»èŠć…ˆćœšç»ŸèźĄçœ‘ç«™äžŠæłšć†Œäș‹ä»¶ID。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/statistic.html](http://www.html5plus.org/doc/zh_cn/statistic.html) + */ + eventEnd(id?: string, label?: string): void; +} diff --git a/types/html5plus/tsconfig.json b/types/html5plus/tsconfig.json new file mode 100644 index 0000000000..634c3eb205 --- /dev/null +++ b/types/html5plus/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "html5plus-tests.ts" + ] +} \ No newline at end of file diff --git a/types/html5plus/tslint.json b/types/html5plus/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/html5plus/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} From 44231510355e31da2b44fb51fccd5231e553e2d4 Mon Sep 17 00:00:00 2001 From: Adam Zerella Date: Mon, 4 Mar 2019 19:29:13 +1100 Subject: [PATCH 312/924] Updated export type --- types/pretty-time/index.d.ts | 6 ++++-- types/pretty-time/pretty-time-tests.ts | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/types/pretty-time/index.d.ts b/types/pretty-time/index.d.ts index c46273abaa..0dadc88091 100644 --- a/types/pretty-time/index.d.ts +++ b/types/pretty-time/index.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 3.3 -export type Increment = +type Increment = | 'ns' | 'nano' | 'nanosecond' @@ -37,4 +37,6 @@ export type Increment = | 'week' | 'weeks'; -export default function(time: number[], smallest?: Increment, digits?: number): string; +declare function prettyTime(time: number[], smallest?: Increment, digits?: number): string; + +export = prettyTime; diff --git a/types/pretty-time/pretty-time-tests.ts b/types/pretty-time/pretty-time-tests.ts index c6f2e926ae..895042ecd1 100644 --- a/types/pretty-time/pretty-time-tests.ts +++ b/types/pretty-time/pretty-time-tests.ts @@ -1,4 +1,4 @@ -import DateTime from "pretty-time"; +import DateTime = require("pretty-time"); DateTime([1200708, 795428088]); From c9bb0dc4f70dc428be05b67079dbda3bd3e47f77 Mon Sep 17 00:00:00 2001 From: Federico Della Rovere Date: Mon, 4 Mar 2019 09:47:28 +0100 Subject: [PATCH 313/924] fix descrition issue --- types/twitch-ext/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/twitch-ext/index.d.ts b/types/twitch-ext/index.d.ts index b8d29c5818..6c3126c049 100644 --- a/types/twitch-ext/index.d.ts +++ b/types/twitch-ext/index.d.ts @@ -207,9 +207,9 @@ interface TwitchExtConfiguration { /** * This function can be called by the front end to set an extension configuration. - * @param segment The string-encoded configuration. - * @param version The configuration segment to set. - * @param content The version of configuration with which the segment is stored. + * @param segment The configuration segment to set. Valid value. "broadcaster". + * @param version The version of configuration with which the segment is stored. + * @param content The string-encoded configuration. */ set(segment: "broadcaster", version: string, content: string): void; } From c01da43b4223ce947278a719e1ff232e291db3d9 Mon Sep 17 00:00:00 2001 From: taoqf Date: Mon, 4 Mar 2019 17:14:53 +0800 Subject: [PATCH 314/924] add type for dv --- types/dv/dv-tests.ts | 18 ++ types/dv/index.d.ts | 446 +++++++++++++++++++++++++++++++++++++++++ types/dv/tsconfig.json | 23 +++ types/dv/tslint.json | 1 + 4 files changed, 488 insertions(+) create mode 100644 types/dv/dv-tests.ts create mode 100644 types/dv/index.d.ts create mode 100644 types/dv/tsconfig.json create mode 100644 types/dv/tslint.json diff --git a/types/dv/dv-tests.ts b/types/dv/dv-tests.ts new file mode 100644 index 0000000000..f49a7ef683 --- /dev/null +++ b/types/dv/dv-tests.ts @@ -0,0 +1,18 @@ +import dv = require('dv'); +import fs = require('fs'); + +const image = new dv.Image('png', fs.readFileSync('textpage300.png')); +const tesseract = new dv.Tesseract('eng', image); +console.log(tesseract.findText('plain')); + +const barcodes = new dv.Image('png', fs.readFileSync('form2.png')); +const open = barcodes.thin('bg', 8, 5).dilate(3, 3); +const openMap = open.distanceFunction(8); +const openMask = openMap.threshold(10).erode(22, 22); +const boxes = openMask.invert().connectedComponents(8); +for (const i in boxes) { + const boxImage = barcodes.crop( + boxes[i].x, boxes[i].y, + boxes[i].width, boxes[i].height); + // Do something useful with our image. +} diff --git a/types/dv/index.d.ts b/types/dv/index.d.ts new file mode 100644 index 0000000000..6aec428e5e --- /dev/null +++ b/types/dv/index.d.ts @@ -0,0 +1,446 @@ +// Type definitions for dv 2.1 +// Project: https://github.com/creatale/node-dv +// Definitions by: taoqf +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +export interface Box { + x: number; + y: number; + width: number; + height: number; +} + +export interface Point { + x: number; + y: number; +} + +export interface Segment { + p1: Point; + p2: Point; + error: number; +} + + +export interface Skew { + angle: number; + confidence: number; +} + +export interface Component { + x: number; + y: number; + width: number; + height: number; +} + +export class Image { + /** + * Creates a copy of otherImage. + */ + constructor(otherImage: Image); + /** + * Creates a 32 bit imagen from three 8 bit images, where each image represents one channel of RGB or HSV. + */ + constructor(image1: Image, image2: Image, image3: Image); + /** + * Creates an empty image with the specified dimensions (!!! note: this constructor is experimental and likely to change). + */ + constructor(width: number, height: number, depth: number); + /** + * Creates an image from a Buffer object, that contains the PNG/JPG encoded image. + */ + constructor(type: 'png' | 'jpg', buffer: Buffer); + constructor(type: 'rgba' | 'rgb' | 'gray', buffer: Buffer, width: number, height: number); + + public readonly width: number; + public readonly height: number; + /** + * The depth of the image in bits per pixel, i.e. one of 32 (color), 8 (grayscale) or 1 (monochrome). + */ + public readonly depth: number; + + /** + * Returns the (boolean) inverse of this image. + */ + public invert(): Image; + /** + * Returns the (boolean) union of two images with equal depth, aligning them to the upper left corner. + */ + public or(otherImage: Image): Image; + /** + * Returns the (boolean) difference of two images with equal depth, aligning them to the upper left corner. + */ + public and(otherImage: Image): Image; + /** + * Returns the (boolean) exclusive disjunction of two images with equal depth, aligning them to the upper left corner. + */ + public xor(otherImage: Image): Image; + /** + * If the images are monochrome, dispatches to Leptonica's pixOr. Otherwise, returns the channelwise addition of b to a, clipped at 255. + */ + public add(otherImage: Image): Image; + /** If the images are monochrome, dispatches to Leptonica's pixSubtract and is equivalent to a.and(b.invert()). For grayscale images, returns the pixelwise subtraction of b from a, clipped at zero. For color, the entire RGB value is subtracted instead of doing channelwise subtraction (ask Leptonica why). + * @example: + * redness = colorImage.toGray(1, 0, 0).subtract(colorImage.toGray(0, 0.5, 0.5)) + */ + public subtract(otherImage: Image): Image; + /** + * Applies a convoltuion kernel with the specified dimensions. Image convolution is an operation where each destination pixel is computed based on a weighted sum of a set of nearby source pixels. + */ + public convolve(halfWidth: number, halfHeight: number): Image; + + /** + * Unsharp Masking creates an unsharp mask using halfWidth. The fraction determines how much of the edge is added back into image. The resulting image appears clearer, but it is generally less accurate. + */ + public unsharp(halfWidth: number, fraction: number): Image; + /** + * Rotates the image around its center by the specified angle in degrees. + */ + public rotate(angle: number): Image; + /** + * Scales an image proportionally by scale (1.0 = 100%). + */ + public scale(scale: number): Image; + + /** + * Scales an image by scaleX and scaleY (1.0 = 100%). + */ + public scale(scaleX: number, scaleY: number): Image; + + /** + * Crops an image from this image by the specified rectangle and returns the resulting image. + */ + public crop(box: Box): Image; + public crop(x: number, y: number, width: number, height: number): Image; + /** + * Creates a mask by testing if pixels (RGB, HSV, ...) are between lower and upper. Formally speaking: + * lower1 ≀ pixel1 ≀ upper1 + * ∧ lower2 ≀ pixel2 ≀ upper2 + * ∧ lower3 ≀ pixel3 ≀ upper3 + */ + public inRange(lower1: number, lower2: number, lower3: number, upper1: number, upper2: number, upper3: number): Image; + /** + * Only available for grayscale images. Returns the histogram in an array of length 256, where each entry represents the fraction (0.0 to 1.0) of that color in the image. + * The mask parameter is optional and must be a monochrome image of same width and height; only pixels where mask is 0 will be counted. + */ + public histogram(mask?: Image): Image; + /** + * Computes the horizontal or vertical projection of an 1bpp or 8bpp image. + */ + public projection(mode: 'horizontal' | 'vertical'): number[]; + /** + * Sets the specified value to each pixel set in the mask. + */ + public setMasked(mask: Image, value: number): Image; + /** + * Available for grayscale and color images. Channelwise maps each pixel of image using mapping, which must be an array of length 256 with integer values between 0 and 255. + * !!! !!! Note: this function actually changes the image! + * The mask parameter is optional and must be a monochrome image of same width and height; only pixels where mask is 0 will be modified. + */ + public applyCurve(mapping: number[], mask?: Image): this; + /** + * Applies a rank (0.0 ... 1.0) filter of the specified width and height (think of it as radius) to this image and returns the result. If you set rank to 0.5 you'll get a Median Filter. Note that this type of filter works best with odd sizes like 3 or 5. + */ + public rankFilter(width: number, height: number, rank: number): Image; + /** + * Color image quantization using an octree based algorithm. colors must be between 2 and 256. Note that support for the resulting palette image is highly experimental at this point; only toGray() and toBuffer('png') are guaranteed to work. + */ + public octreeColorQuant(colors: number): Image; + /** + * Color image quantization using median cut algorithm. colors must be between 2 and 256. Note that support for the resulting palette image is highly experimental at this point; only toGray() and toBuffer('png') are guaranteed to work. + */ + public medianCutQuant(colors: number): Image; + /** + * Converts a grayscale image to monochrome using a global threshold. value must be between 0 and 255. + */ + public threshold(value: number): Image; + /** + * Converts an image to grayscale using default settings. Can be used to convert monochrome images back to grayscale. + */ + public toGray(): Image; + /** + * Converts an RGB image to grayscale using the specified widths for each channel. + */ + public toGray(redWeight: number, greenWeight: number, blueWeight: number): Image; + /** + * Converts an RGB image to grayscale by selecting either the 'min' or 'max' channel. This can act as a simple color filter: 'max' maps colored pixels towards white, while 'min' maps colored pixels towards black. + */ + public toGray(selector: 'min' | 'max'): Image; + /** + * Converts a grayscale image to a color image. + */ + public toColor(): Image; + /** + * Converts from RGB to HSV color space. HSV has the following ranges: + * Hue: [0 .. 239] + * Saturation: [0 .. 255] + * Value: [0 .. 255] + */ + public toHSV(): Image; + /** + * Converts from HSV to RGB color space. + */ + public toRGB(): Image; + /** + * Applies an Erode Filter and returns the result. + */ + public erode(width: number, height: number): Image; + /** + * Applies a Dilate Filter and returns the result. + */ + public dilate(width: number, height: number): Image; + /** + * Applies an Open Filter and returns the result. + */ + public open(width: number, height: number): Image; + /** + * Applies a Close Filter and returns the result. + */ + public close(width: number, height: number): Image; + /** + * Applies morphological thinning of type (fg or bg) with the specified connectivitiy (4 or 8) and maxIterations (0 to iterate until complete). + */ + public thin(type: 'fg' | 'bg', connectivity: number, maxIterations: number): Image; + /** + * Scales an 8bpp image for maximum dynamic range. scale must be either log or linear. + */ + public maxDynamicRange(scale: 'log' | 'linear'): Image; + /** + * Applies Otsu's Method for computing the threshold of a grayscale image. It computes a threshold for each tile of the specified size and performs the threshold operation, resulting in a binary image for each tile. These are stitched into the final result. + * The smooth size controls the a convolution kernel applied to threshold array (use 0 for no smoothing). The score factor controls the fraction of the max. Otsu score (typically 0.1; use 0.0 for standard Otsu). + */ + public otsuAdaptiveThreshold(tileWidth: number, tileHeight: number, smoothWidth: number, smoothHeight: number, scoreFactor: number): Image; + /** + * Detects Line Segments with the specified accuracy (3 is a good start). The number of found line segments can be limited using maxLineSegments (0 is unlimited). + */ + public lineSegments(accuracy: number, maxLineSegments: number, useWeightedMeanShift: boolean): Segment[]; + /** + * Only available for monochrome images. Tries to find the skew of this image. The resulting angle is in degree. The confidence is between 0.0 and 1.0. + */ + public findSkew(): Skew; + /** + * Only available for monochrome images. Tries to extract connected components (think of flood fill). The connectivity can be specified as 4 or 8 directions. + */ + public connectedComponents(connectivity: 4 | 8): Component[]; + /** + * The Distance Function works on 1bpp images. It labels each pixel with the largest distance between this and any other pixel in its connected component. The connectivity is either 4 or 8. + */ + public distanceFunction(connectivity: 4 | 8): Image; + /** + * !!! Note: this function actually changes the image! + * Fills a specified rectangle with white. + */ + public clearBox(box: Box): this; + public clearBox(x: number, y: number, width: number, height: number): this; + /** + * !!! Note: this function actually changes the image! + * Draws a filled rectangle to this image with the specified value. Works for 8bpp and 1bpp images. + */ + public fillBox(box: Box, value: number): this; + public fillBox(x: number, y: number, width: number, height: number, value: number): this; + /** + * !!! Note: this function actually changes the image! + * Draws a filled rectangle to this image in the specified color with an optional blending parameter (0.0: transparent; 1.0: no transparency). + */ + public fillBox(box: Box, r: number, g: number, b: number, fraction?: number): this; + public fillBox(x: number, y: number, width: number, height: number, r: number, g: number, b: number, fraction?: number): this; + /** + * !!! Note: this function actually changes the image! + * Draws a rectangle to this image with the specified border. The possible pixel manipulating operations are set, clear and flip. + */ + public drawBox(box: Box, borderWidth: number, operation: 'set' | 'clear' | 'flip'): this; + public drawBox(x: number, y: number, width: number, height: number, borderWidth: number, operation: 'set' | 'clear' | 'flip'): this; + /** + * !!! Note: this function actually changes the image! + * Draws a rectangle to this image with the specified border in the specified color with an optional blending parameter (0.0: transparent; 1.0: no transparency). + */ + public drawBox(box: Box, borderWidth: number, red: number, green: number, blue: number, frac?: number): this; + public drawBox(x: number, y: number, width: number, height: number, borderWidth: number, red: number, green: number, blue: number, frac?: number): this; + /** + * !!! Note: this function actually changes the image! + * Draws a line between p1 and p2 to this image with the specified line width. The possible pixel manipulating operations are set, clear and flip. + */ + public drawLine(p1: Point, p2: Point, width: number, operation: 'set' | 'clear' | 'flip'): this; + /** + * !!! Note: this function actually changes the image! + * Draws a line between p1 and p2 to this image with the specified line width in the specified color with an optional blending parameter (0.0: transparent; 1.0: no transparency). + */ + public drawLine(p1: Point, p2: Point, width: number, red: number, green: number, blue: number, frac?: number): this; + /** + * !!! Note: this function actually changes the image! + * Draws an image to this image with the specified destination box. + */ + public drawImage(image: Image, box: Box): this; + public drawImage(image: Image, x: number, y: number, width: number, height: number): this; + /** + * Converts the Image in the specified format to a buffer. + * Specifying raw returns the raw image data as buffer. For color images, the result contains three bytes per pixel in the order R, G, B; for grayscale and monochrome images, it contains one byte per pixel. + * Specifying png returns a PNG encoded image as buffer. + * Specifying jpg returns a JPG encoded image as buffer. + */ + public toBuffer(format?: 'raw' | 'png' | 'jpg'): Buffer; +} + +export interface Rect { + // todo +} + +export interface Region { + box: Box; + text: string, + confidence: number; +} + +export type Paragaph = Region; + +export interface Textline { + box: Box; +} + +export type Word = Region; + +export interface Choice { + text: string, + confidence: number; +} + +export interface Symbol extends Region { + choices: Choice[]; +} + +export type Text = Choice; + +/** + * A Tesseract object represents an optical character recognition engine, that reads text using Tesseract from an image. Tesseract supports many langauges and fonts (see Tesseract/Downloads). New language files have to be installed in node-dv/tessdata. + */ +export class Tesseract { + /** + * Creates a Tesseract engine with language set to english. + */ + constructor(); + constructor(datapath: string); + /** + * Creates a Tesseract engine with the specified language. + */ + constructor(datapath: string, lang: string); + /** + * Creates a Tesseract engine with the specified language and image. + */ + constructor(datapath: string, lang: string, image: Image); + + /** + * Accessor for the input image. + */ + public image: Image; + /** + * Accessor for the rectangle that specifies a "visible" area on the image. + */ + public rectangle: Rect; + /** + * Accessor for the page segmentation mode. Valid values are: osd_only, auto_osd, auto_only, auto, single_column, single_block_vert_text, single_block, single_line, single_word, circle_word, single_char, sparse_text, sparse_text_osd. + */ + public pageSegMode: 'osd_only' | 'auto_osd' | 'auto_only' | 'auto' | 'single_column' | 'single_block_vert_text' | 'single_block' | 'single_line' | 'single_word' | 'circle_word' | 'single_char' | 'sparse_text' | 'sparse_text_osd' + [key: string]: unknown; + + /** + * Clears the tesseract image and its last results. + */ + public clear(): void; + /** + * Clears all adaptive classifiers (use this when results vary during scanning). + */ + public clearAdaptiveClassifier(): void; + /** + * Returns the binarized image Tesseract uses for its recognition. + */ + public thresholdImage(): Image; + /** + * Returns an array of objects, You can omit text information by setting recognize = false, which is considerably faster. + */ + public findRegions(recognize: boolean): Region[]; + /** + * Returns an array of objects, You can omit text information by setting recognize = false, which is considerably faster. + */ + public findParagraphs(recognize: boolean): Paragaph[]; + /** + * Returns an array of objects, You can omit text information by setting recognize = false, which is considerably faster. + */ + public findTextLines(recognize: boolean): Textline[]; + /** + * Returns an array of objects, You can omit text information by setting recognize = false, which is considerably faster. + */ + public findWords(recognize: boolean): Word[]; + /** + * Returns an array of objects, You can omit text information by setting recognize = false, which is considerably faster. + */ + public findSymbols(recognize: boolean): Symbol[]; + /** + * Returns text in the specified format. Valid formats are: plain, unlv. + */ + public findText(format: 'plain' | 'unlv', withConfidence?: boolean): string; + public findText(format: 'hocr' | 'box', pageNumber: number): string; +} + +export interface Barcodeformat { + QR_CODE: boolean; + DATA_MATRIX: boolean; + PDF_417: boolean; + UPC_E: boolean; + UPC_A: boolean; + EAN_8: boolean; + EAN_13: boolean; + CODE_128: boolean; + CODE_39: boolean; + ITF: boolean; + AZTEC: boolean; +} + +export interface BarCode { + type: string; + data: string; + buffer: Buffer; + points: Point[]; +} + +/** + * A ZXing object represents a barcode reader. By default it attempts to decode all barcode formats that ZXing supports. + */ +export class ZXing { + constructor(image?: Image); + + /** + * Accessor for the input image this barcode reader operates on. + */ + public image: Image; + /** + * List of barcodes the reader tries to find. It's specified as an object and missing properties account as false + */ + public formats: Barcodeformat; + /** + * If try harder is enabled, the barcode reader spends more time trying to find a barcode (optimize for accuracy, not speed). + */ + public tryHarder: boolean; + /** + * Returns the first barcode found as an object with the following format: + */ + public findCode(): BarCode; + /** + * enotes the barcodes type. + */ + public readonly type: 'None' | 'QR_CODE' | 'DATA_MATRIX' | 'PDF_417' | 'UPC_E' | 'UPC_A' | 'EAN_8' | 'EAN_13' | 'CODE_128' | 'CODE_39' | 'ITF' | 'AZTEC'; + /** + * denotes the stringified data read from the barcode. + */ + public readonly data: string; + /** + * denotes the decoded binary data of the barcode before conversion into another character encoding. + */ + public readonly buffer: Buffer; + /** + * denotes the points in pixels which were used by the barcode reader to detect the barcode. + */ + public readonly points: Point[]; +} diff --git a/types/dv/tsconfig.json b/types/dv/tsconfig.json new file mode 100644 index 0000000000..ad0aaa212b --- /dev/null +++ b/types/dv/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "dv-tests.ts" + ] +} \ No newline at end of file diff --git a/types/dv/tslint.json b/types/dv/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/dv/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 246c3ed34bd24c811e2b4b02fc9e9db62445b92e Mon Sep 17 00:00:00 2001 From: Oliver Joseph Ash Date: Mon, 4 Mar 2019 10:57:08 +0000 Subject: [PATCH 315/924] Attempt to fix adone build errors Re. https://github.com/DefinitelyTyped/DefinitelyTyped/pull/33228#issuecomment-469030749 --- types/adone/tslint.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/adone/tslint.json b/types/adone/tslint.json index 8c265eebb4..2a9ae5c804 100644 --- a/types/adone/tslint.json +++ b/types/adone/tslint.json @@ -13,6 +13,7 @@ "no-unnecessary-qualifier": false, "unified-signatures": false, "space-before-function-paren": false, - "await-promise": false + "await-promise": false, + "no-restricted-globals": false } } \ No newline at end of file From 4f2a0af1575d74c5f3d0047f3690bc41857a12f6 Mon Sep 17 00:00:00 2001 From: Jonas Keisel Date: Mon, 4 Mar 2019 12:02:58 +0100 Subject: [PATCH 316/924] Added Stripe PaymentIntents --- types/stripe/index.d.ts | 543 ++++++++++++++++++++++++++++++++++- types/stripe/stripe-tests.ts | 45 +++ 2 files changed, 587 insertions(+), 1 deletion(-) diff --git a/types/stripe/index.d.ts b/types/stripe/index.d.ts index 41e591c839..23b1a96ead 100644 --- a/types/stripe/index.d.ts +++ b/types/stripe/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for stripe 6.19 +// Type definitions for stripe 6.25 // Project: https://github.com/stripe/stripe-node/ // Definitions by: William Johnston // Peter Harris @@ -17,6 +17,7 @@ // Slava Yultyyev // Corey Psoinos // Saransh Kataria +// Jonas Keisel // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -53,6 +54,7 @@ declare class Stripe { events: Stripe.resources.Events; invoices: Stripe.resources.Invoices; invoiceItems: Stripe.resources.InvoiceItems; + paymentIntents: Stripe.resources.PaymentIntents; payouts: Stripe.resources.Payouts; plans: Stripe.resources.Plans; /** @@ -2980,6 +2982,411 @@ declare namespace Stripe { type PayoutTypes = "bank_account" | "card"; } + namespace paymentIntents { + interface IPaymentIntent extends IResourceObject { + /** + * Value is "payment_intent". + */ + object: 'payment_intent'; + + /** + * The amount in cents that is to be collected from this PaymentIntent. + */ + amount: number; + + /** + * The amount that can be captured with from this PaymentIntent (in cents). + */ + amount_capturable: number; + + /** + * The amount that was collected from this PaymentIntent (in cents). + */ + amount_received: number; + + /** + * ID of the Connect application that created the PaymentIntent. [Expandable] + */ + application?: string | applications.IApplication | null; + + /** + * A fee in cents that will be applied to the invoice and transferred to the application owner's Stripe account. + */ + application_fee_amount?: number | null; + + /** + * Populated when `status` is `canceled`, this is the time at which the PaymentIntent was canceled. + * Measured in seconds since the Unix epoch. + */ + canceled_at: number | null; + + /** + * User-given reason for cancellation of this PaymentIntent. + */ + cancelation_reason: + | 'duplicate' + | 'fraudulent' + | 'requested_by_customer' + | 'failed_invoice' + | null; + + /** + * Capture method of this PaymentIntent. + */ + capture_method: 'automatic' | 'manual'; + + /** + * Charges that were created by this PaymentIntent, if any. + */ + charges: IList; + + /** + * The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key. Please refer to dynamic authentication guide on how client_secret should be handled. + */ + client_secret: string; + + /** + * Confirmation method of this PaymentIntent. + */ + confirmation_method: 'secret' | 'publishable'; + + /** + * Time at which the object was created. Measured in seconds since the Unix epoch. + */ + created: number; + + /** + * Three-letter ISO currency code, in lowercase. Must be a supported currency. + */ + currency: string; + + /** + * ID of the Customer this PaymentIntent is for if one exists. [Expandable] + */ + customer: string | customers.ICustomer | null; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description?: string; + + /** + * The payment error encountered in the previous PaymentIntent confirmation. + */ + last_payment_error: IStripeError | null; + + livemode: boolean; + + metadata: IMetadata; + + /** + * If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source. + */ + next_action: + | IPaymentIntentNextActionUseStripeSdk + | IPaymentIntentNextActionRedirectToUrl; + + /** + * The account (if any) for which the funds of the PaymentIntent are intended. See the PaymentIntents Connect usage guide for details. [Expandable] + */ + on_behalf_of?: string | null; + + /** + * The list of payment method types (e.g. card) that this PaymentIntent is allowed to use. + */ + payment_method_types: string[]; + + /** + * Email address that the receipt for the resulting payment will be sent to. + */ + receipt_email: string | null; + + /** + * ID of the review associated with this PaymentIntent, if any. [Expandable] + */ + review?: string | reviews.IReview | null; + + /** + * Shipping information for this PaymentIntent. + */ + shipping?: IShippingInformation | null; + + /** + * ID of the source used in this PaymentIntent. [Expandable] + */ + source: + | string + | cards.ICard + | bitcoinReceivers.IBitcoinReceiver + | bankAccounts.IBankAccount; + + /** + * Extra information about a PaymentIntent. This will appear on your customer’s statement when this PaymentIntent succeeds in creating a charge. + */ + statement_descriptor: string | null; + + /** + * The several states the PaymentIntent goes through until it it either canceled or succeeds. + */ + status: + | 'requires_payment_method' + | 'requires_action' + | 'processing' + | 'requires_authorization' + | 'requires_capture' + | 'canceled' + | 'succeeded'; + + /** + * The data with which to automatically create a Transfer when the payment is finalized. + */ + transfer_data: IPaymentIntentTransferData | null; + + /** + * A string that identifies the resulting payment as part of a group. + */ + transfer_group: string | null; + } + + interface IPaymentIntentTransferData { + /** + * The account (if any) the payment will be attributed to for tax reporting, and where funds from the payment will be transferred to upon payment success. [Expandable] + */ + destination: + | string + | bankAccounts.IBankAccount + | cards.ICardHash + | accounts.IAccountCreationOptions; + } + + interface IPaymentIntentNextActionRedirectToUrl { + type: 'redirect_to_url'; + /** + * Contains instructions for authenticating a payment by redirecting your customer to another page or application. + */ + redirect_to_url: { return_url: string; url: string }; + } + + interface IPaymentIntentNextActionUseStripeSdk { + type: 'use_stripe_sdk'; + /** + * When confirming a PaymentIntent with js, js depends on the contents of this object to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by js. + */ + use_stripe_sdk: any; + } + + interface IPaymentIntentCreationOptions { + /** + * Amount intended to be collected by this PaymentIntent (in cents). + */ + amount: number; + + /** + * Three-letter ISO currency code, in lowercase. Must be a supported currency. + */ + currency: string; + + /** + * The list of payment method types (e.g. card) that this PaymentIntent is allowed to use. + */ + payment_method_types: string[]; + + /** + * The amount of the application fee in cents (if any) that will be applied to the payment and transferred to the application owner’s Stripe account. To use an application fee, the request must be made on behalf of another account, using the `Stripe-Account` header or an OAuth key. + */ + application_fee_amount?: number; + + /** + * Capture method of this PaymentIntent. + */ + capture_method?: 'automatic' | 'manual'; + + /** + * Attempt to confirm this PaymentIntent immediately. If the payment method attached is a card, a return_url must be provided in case additional authentication is required. + */ + confirm?: boolean; + + /** + * ID of the customer this PaymentIntent is for if one exists. + */ + customer?: string; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. This can be unset by updating the value to null and then saving. + */ + description?: string | null; + + /** + * A set of key/value pairs that you can attach to an object. It can be + * useful for storing additional information about the object in a structured + * format. You can unset an individual key by setting its value to null and + * then saving. To clear all keys, set metadata to null, then save. + */ + metadata?: IOptionsMetadata; + + /** + * The Stripe account ID for which these funds are intended. + */ + on_behalf_of?: string; + + /** + * Email address that the receipt for the resulting payment will be sent to. + */ + receipt_email?: string; + + /** + * The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method’s app or site. If you’d prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. This param can only be used if `confirm=true`. + */ + return_url?: string; + + /** + * Set to `true` to save this PaymentIntent’s payment method to the associated Customer, if the payment method is not already attached. This parameter only applies to the payment method passed in the same request or the current payment method attached to the PaymentIntent and must be specified again if a new payment method is added. + */ + save_payment_method?: boolean; + + /** + * Shipping information for this PaymentIntent. + */ + shipping?: IShippingInformation; + + /** + * ID of the Source object to attach to this PaymentIntent. + */ + source?: string; + + /** + * Extra information about a PaymentIntent. This will appear on your customer’s statement when this PaymentIntent succeeds in creating a charge. + */ + statement_descriptor?: string; + + /** + * The parameters used to automatically create a Transfer when the payment succeeds. + */ + transfer_data?: IPaymentIntentTransferData; + + /** + * A string that identifies the resulting payment as part of a group. + */ + transfer_group?: string; + } + + interface IPaymentIntentUpdateOptions { + /** + * Amount intended to be collected by this PaymentIntent (in cents). + */ + amount?: number; + + /** + * The amount of the application fee in cents (if any) that will be applied to the payment and transferred to the application owner’s Stripe account. To use an application fee, the request must be made on behalf of another account, using the `Stripe-Account` header or an OAuth key. + */ + application_fee_amount?: number; + + /** + * Three-letter ISO currency code, in lowercase. Must be a supported currency. + */ + currency?: string; + + /** + * ID of the customer this PaymentIntent is for if one exists. + */ + customer?: string; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. This can be unset by updating the value to null and then saving. + */ + description?: string | null; + + /** + * A set of key/value pairs that you can attach to an object. It can be + * useful for storing additional information about the object in a structured + * format. You can unset an individual key by setting its value to null and + * then saving. To clear all keys, set metadata to null, then save. + */ + metadata?: IOptionsMetadata; + + /** + * Email address that the receipt for the resulting payment will be sent to. + */ + receipt_email?: string; + + /** + * Set to `true` to save this PaymentIntent’s payment method to the associated Customer, if the payment method is not already attached. This parameter only applies to the payment method passed in the same request or the current payment method attached to the PaymentIntent and must be specified again if a new payment method is added. + */ + save_payment_method?: boolean; + + /** + * Shipping information for this PaymentIntent. + */ + shipping?: IShippingInformation; + + /** + * ID of the Source object to attach to this PaymentIntent. + */ + source?: string; + + /** + * A string that identifies the resulting payment as part of a group. + */ + transfer_group?: string; + } + + interface IPaymentIntentConfirmOptions { + /** + * The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key. Please refer to dynamic authentication guide on how client_secret should be handled. Required if using Publishable Key! + */ + client_secret?: string; + + /** + * Email address that the receipt for the resulting payment will be sent to. + */ + receipt_email?: string | null; + + /** + * The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method’s app or site. If you’d prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter is only used for cards and other redirect-based payment methods. + */ + return_url?: string; + + /** + * Set to `true` to save this PaymentIntent’s payment method to the associated Customer, if the payment method is not already attached. This parameter only applies to the payment method passed in the same request or the current payment method attached to the PaymentIntent and must be specified again if a new payment method is added. + */ + save_payment_method?: boolean; + + /** + * Shipping information for this PaymentIntent. + */ + shipping?: IShippingInformation | null; + + /** + * ID of the source used in this PaymentIntent. + */ + source?: string; + } + + interface IPaymentIntentCaptureOptions { + /** + * The amount to capture (in cents) from the PaymentIntent, which must be less than or equal to the original amount. Any additional amount will be automatically refunded. Defaults to the full `amount_capturable` if not provided. + */ + amount_to_capture?: number; + + /** + * The amount of the application fee (if any) that will be applied to the payment and transferred to the application owner’s Stripe account. To use an application fee, the request must be made on behalf of another account, using the `Stripe-Account` header or an OAuth key. + */ + application_fee_amount?: number; + } + + interface IPaymentIntentListOptions extends IListOptionsCreated { + /** + * Filter links by their expiration status. By default, all links are returned. + */ + expired?: boolean; + + /** + * Only return links for the given file. + */ + file?: boolean; + } + } + namespace plans { interface ITier { /** @@ -6816,6 +7223,140 @@ declare namespace Stripe { del(invoiceItemId: string, response?: IResponseFn): Promise; } + class PaymentIntents extends StripeResource { + /** + * Creates a PaymentIntent object. + */ + create( + data: paymentIntents.IPaymentIntentCreationOptions, + options: HeaderOptions, + response?: IResponseFn, + ): Promise; + create( + data: paymentIntents.IPaymentIntentCreationOptions, + response?: IResponseFn, + ): Promise; + + /** + * Returns a list of PaymentIntents. + * + * @returns A object with a data property that contains an array of up to limit PaymentIntents, starting after PaymentIntent starting_after. Each entry in the array is a separate PaymentIntent object. If no more PaymentIntents are available, the resulting array will be empty. This request should never throw an error. + */ + list( + data: paymentIntents.IPaymentIntentListOptions, + options: HeaderOptions, + response?: IResponseFn>, + ): Promise>; + list( + data: paymentIntents.IPaymentIntentListOptions, + response?: IResponseFn>, + ): Promise>; + list( + options: HeaderOptions, + response?: IResponseFn>, + ): Promise>; + list( + response?: IResponseFn>, + ): Promise>; + + /** + * Updates a PaymentIntent object. + */ + update( + id: string, + data: paymentIntents.IPaymentIntentUpdateOptions, + options: HeaderOptions, + response?: IResponseFn, + ): Promise; + update( + id: string, + data: paymentIntents.IPaymentIntentUpdateOptions, + response?: IResponseFn, + ): Promise; + + /** + * Retrieves the details of a PaymentIntent that has previously been created. + * Client-side retrieval using a publishable key is allowed when the client_secret is provided in the query string. + * When retrieved with a publishable key, only a subset of properties will be returned. Please refer to the payment intent object reference for more details. + */ + retrieve( + id: string, + options: HeaderOptions, + response?: IResponseFn, + ): Promise; + retrieve( + id: string, + response?: IResponseFn, + ): Promise; + + /** + * Confirm that your customer intends to pay with current or provided `source`. Upon confirmation, the PaymentIntent will attempt to initiate a payment. + * + * If the selected source requires additional authentication steps, the PaymentIntent will transition to the `requires_action` status and suggest additional actions via `next_source_action`. If payment fails, the PaymentIntent will transition to the `requires_payment_method` status. If payment succeeds, the PaymentIntent will transition to the `succeeded` status (or `requires_capture`, if `capture_method` is set to `manual`). + * + * When using a publishable key, the client_secret must be provided to confirm the PaymentIntent. + */ + confirm( + paymentIntentId: string, + data: paymentIntents.IPaymentIntentConfirmOptions, + options: HeaderOptions, + response?: IResponseFn, + ): Promise; + confirm( + paymentIntentId: string, + data: paymentIntents.IPaymentIntentConfirmOptions, + response?: IResponseFn, + ): Promise; + + /** + * Capture the funds of an existing uncaptured PaymentIntent where `required_action="requires_capture"`. + * Uncaptured PaymentIntents will be canceled exactly seven days after they are created. + * + * @returns Returns a PaymentIntent object with `status="succeeded"` if the PaymentIntent was capturable. Returns an error if the PaymentIntent was not capturable or an invalid amount to capture was provided. + */ + capture( + paymentIntentId: string, + data: paymentIntents.IPaymentIntentCaptureOptions, + options: HeaderOptions, + response?: IResponseFn, + ): Promise; + capture( + paymentIntentId: string, + data: paymentIntents.IPaymentIntentCaptureOptions, + response?: IResponseFn, + ): Promise; + + /** + * A PaymentIntent object can be canceled when it is in one of these statuses: `requires_payment_method`, `requires_capture`, `requires_confirmation`, `requires_action`. + * Once canceled, no additional charges will be made by the PaymentIntent and any operations on the PaymentIntent will fail with an error. For PaymentIntents with `status='requires_capture'`, the remaining `amount_capturable` will automatically be refunded. + * + * @returns Returns a PaymentIntent object if the cancellation succeeded. Returns an error if the PaymentIntent has already been canceled or is not in a cancelable state. + */ + cancel( + paymentIntentId: string, + data: { + cancellation_reason?: + | 'duplicate' + | 'fraudulent' + | 'requested_by_customer' + | 'failed_invoice'; + }, + options: HeaderOptions, + response?: IResponseFn, + ): Promise; + cancel( + paymentIntentId: string, + data: { + cancellation_reason?: + | 'duplicate' + | 'fraudulent' + | 'requested_by_customer' + | 'failed_invoice'; + }, + response?: IResponseFn, + ): Promise; + } + class Payouts extends StripeResource { /** * To send funds to your own bank account, you create a new payout object. Your Stripe balance must be able to cover the payout amount, or you’ll receive an “Insufficient Funds” error. diff --git a/types/stripe/stripe-tests.ts b/types/stripe/stripe-tests.ts index 154a5e0a58..6fc4a5ac25 100644 --- a/types/stripe/stripe-tests.ts +++ b/types/stripe/stripe-tests.ts @@ -1018,6 +1018,51 @@ stripe.invoices.retrieve("in_15fvyXEe31JkLCeQH7QbgZZb", { expand: ["subscription //#endregion +//#region Payment Intents test +// ################################################################################## +stripe.paymentIntents.create({ + amount: 2000, + currency: "eur", + payment_method_types: ["card"], +}, (err, intent) => {}); + +stripe.paymentIntents.create({ + amount: 2000, + currency: "eur", + payment_method_types: ["card"], +}).then((intent) => {}); + +stripe.paymentIntents.list({}, (err, intent) => {}); +stripe.paymentIntents.list({}).then((intent) => {}); +stripe.paymentIntents.list((err, intent) => {}); +stripe.paymentIntents.list().then((intent) => {}); +stripe.paymentIntents.list({ expired: true }, (err, intent) => {}); +stripe.paymentIntents.list({ expired: true }).then((intent) => {}); + +stripe.paymentIntents.update("pi_Aabcxyz01aDfoo", { + amount: 2001, + currency: 'usd', +}, (err, intent) => {}); +stripe.paymentIntents.update("pi_Aabcxyz01aDfoo", { + amount: 2001, + currency: 'usd', +}).then((intent) => {}); + +stripe.paymentIntents.retrieve("pi_Aabcxyz01aDfoo", (err, intent) => {}); +stripe.paymentIntents.retrieve("pi_Aabcxyz01aDfoo").then((intent) => {}); + +stripe.paymentIntents.confirm("pi_Aabcxyz01aDfoo", {}, (err, intent) => {}); +stripe.paymentIntents.confirm("pi_Aabcxyz01aDfoo", {}).then((intent) => {}); + +stripe.paymentIntents.capture("pi_Aabcxyz01aDfoo", {}, (err, intent) => {}); +stripe.paymentIntents.capture("pi_Aabcxyz01aDfoo", {}).then((intent) => {}); + +stripe.paymentIntents.cancel("pi_Aabcxyz01aDfoo", {}, (err, intent) => {}); +stripe.paymentIntents.cancel("pi_Aabcxyz01aDfoo", {}).then((intent) => {}); +stripe.paymentIntents.cancel("pi_Aabcxyz01aDfoo", { cancellation_reason: 'duplicate' }, (err, intent) => {}); +stripe.paymentIntents.cancel("pi_Aabcxyz01aDfoo", { cancellation_reason: 'requested_by_customer' }).then((intent) => {}); +//#endregion + //#region Payouts tests // ################################################################################## stripe.payouts.create({ From bd701363922cc3c1bdaa9d19e98a2f2faab9b6d7 Mon Sep 17 00:00:00 2001 From: minijus <3633549+minijus@users.noreply.github.com> Date: Mon, 4 Mar 2019 13:33:04 +0200 Subject: [PATCH 317/924] [webpack-dev-server] Add httpProxyMiddleware.Filter support to context property of ProxyConfigArrayItem webpack-dev-server [proxy documentation](https://webpack.js.org/configuration/dev-server/#devserverproxy) gives an example of using Filter function for context property and in reality dev-server supports it. However, it was missing on `@types/webpack-dev-server`. --- types/webpack-dev-server/index.d.ts | 2 +- types/webpack-dev-server/webpack-dev-server-tests.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/types/webpack-dev-server/index.d.ts b/types/webpack-dev-server/index.d.ts index 30fd2482e7..02b22e7817 100644 --- a/types/webpack-dev-server/index.d.ts +++ b/types/webpack-dev-server/index.d.ts @@ -28,7 +28,7 @@ declare namespace WebpackDevServer { type ProxyConfigArrayItem = { path?: string | string[]; - context?: string | string[] + context?: string | string[] | httpProxyMiddleware.Filter } & httpProxyMiddleware.Config; type ProxyConfigArray = ProxyConfigArrayItem[]; diff --git a/types/webpack-dev-server/webpack-dev-server-tests.ts b/types/webpack-dev-server/webpack-dev-server-tests.ts index 755245b035..dc8a1dbdc1 100644 --- a/types/webpack-dev-server/webpack-dev-server-tests.ts +++ b/types/webpack-dev-server/webpack-dev-server-tests.ts @@ -87,6 +87,9 @@ const c3: WebpackDevServer.Configuration = { const c4: WebpackDevServer.Configuration = { writeToDisk: (filePath: string) => true, }; +const c5: WebpackDevServer.Configuration = { + proxy: [{context: (pathname: string) => true}] +}; // API example server = new WebpackDevServer(compiler, config); From aa73bbb298d339129ce6128777e3e78115d93373 Mon Sep 17 00:00:00 2001 From: Jonas Keisel Date: Mon, 4 Mar 2019 12:53:03 +0100 Subject: [PATCH 318/924] fixed spaces; created a cancellation reason type --- types/stripe/index.d.ts | 1049 +++++++++++++++++++-------------------- 1 file changed, 519 insertions(+), 530 deletions(-) diff --git a/types/stripe/index.d.ts b/types/stripe/index.d.ts index 23b1a96ead..d7d198d746 100644 --- a/types/stripe/index.d.ts +++ b/types/stripe/index.d.ts @@ -2983,409 +2983,406 @@ declare namespace Stripe { } namespace paymentIntents { - interface IPaymentIntent extends IResourceObject { - /** - * Value is "payment_intent". - */ - object: 'payment_intent'; - - /** - * The amount in cents that is to be collected from this PaymentIntent. - */ - amount: number; - - /** - * The amount that can be captured with from this PaymentIntent (in cents). - */ - amount_capturable: number; - - /** - * The amount that was collected from this PaymentIntent (in cents). - */ - amount_received: number; - - /** - * ID of the Connect application that created the PaymentIntent. [Expandable] - */ - application?: string | applications.IApplication | null; - - /** - * A fee in cents that will be applied to the invoice and transferred to the application owner's Stripe account. - */ - application_fee_amount?: number | null; - - /** - * Populated when `status` is `canceled`, this is the time at which the PaymentIntent was canceled. - * Measured in seconds since the Unix epoch. - */ - canceled_at: number | null; - - /** - * User-given reason for cancellation of this PaymentIntent. - */ - cancelation_reason: - | 'duplicate' - | 'fraudulent' - | 'requested_by_customer' - | 'failed_invoice' - | null; - - /** - * Capture method of this PaymentIntent. - */ - capture_method: 'automatic' | 'manual'; - - /** - * Charges that were created by this PaymentIntent, if any. - */ - charges: IList; - - /** - * The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key. Please refer to dynamic authentication guide on how client_secret should be handled. - */ - client_secret: string; - - /** - * Confirmation method of this PaymentIntent. - */ - confirmation_method: 'secret' | 'publishable'; - - /** - * Time at which the object was created. Measured in seconds since the Unix epoch. - */ - created: number; - - /** - * Three-letter ISO currency code, in lowercase. Must be a supported currency. - */ - currency: string; - - /** - * ID of the Customer this PaymentIntent is for if one exists. [Expandable] - */ - customer: string | customers.ICustomer | null; - - /** - * An arbitrary string attached to the object. Often useful for displaying to users. - */ - description?: string; - - /** - * The payment error encountered in the previous PaymentIntent confirmation. - */ - last_payment_error: IStripeError | null; - - livemode: boolean; - - metadata: IMetadata; - - /** - * If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source. - */ - next_action: - | IPaymentIntentNextActionUseStripeSdk - | IPaymentIntentNextActionRedirectToUrl; - - /** - * The account (if any) for which the funds of the PaymentIntent are intended. See the PaymentIntents Connect usage guide for details. [Expandable] - */ - on_behalf_of?: string | null; - - /** - * The list of payment method types (e.g. card) that this PaymentIntent is allowed to use. - */ - payment_method_types: string[]; - - /** - * Email address that the receipt for the resulting payment will be sent to. - */ - receipt_email: string | null; - - /** - * ID of the review associated with this PaymentIntent, if any. [Expandable] - */ - review?: string | reviews.IReview | null; - - /** - * Shipping information for this PaymentIntent. - */ - shipping?: IShippingInformation | null; - - /** - * ID of the source used in this PaymentIntent. [Expandable] - */ - source: - | string - | cards.ICard - | bitcoinReceivers.IBitcoinReceiver - | bankAccounts.IBankAccount; - - /** - * Extra information about a PaymentIntent. This will appear on your customer’s statement when this PaymentIntent succeeds in creating a charge. - */ - statement_descriptor: string | null; - - /** - * The several states the PaymentIntent goes through until it it either canceled or succeeds. - */ - status: - | 'requires_payment_method' - | 'requires_action' - | 'processing' - | 'requires_authorization' - | 'requires_capture' - | 'canceled' - | 'succeeded'; - - /** - * The data with which to automatically create a Transfer when the payment is finalized. - */ - transfer_data: IPaymentIntentTransferData | null; - - /** - * A string that identifies the resulting payment as part of a group. - */ - transfer_group: string | null; - } - - interface IPaymentIntentTransferData { - /** - * The account (if any) the payment will be attributed to for tax reporting, and where funds from the payment will be transferred to upon payment success. [Expandable] - */ - destination: - | string - | bankAccounts.IBankAccount - | cards.ICardHash - | accounts.IAccountCreationOptions; - } - - interface IPaymentIntentNextActionRedirectToUrl { - type: 'redirect_to_url'; - /** - * Contains instructions for authenticating a payment by redirecting your customer to another page or application. - */ - redirect_to_url: { return_url: string; url: string }; - } - - interface IPaymentIntentNextActionUseStripeSdk { - type: 'use_stripe_sdk'; - /** - * When confirming a PaymentIntent with js, js depends on the contents of this object to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by js. - */ - use_stripe_sdk: any; - } - - interface IPaymentIntentCreationOptions { - /** - * Amount intended to be collected by this PaymentIntent (in cents). - */ - amount: number; - - /** - * Three-letter ISO currency code, in lowercase. Must be a supported currency. - */ - currency: string; - - /** - * The list of payment method types (e.g. card) that this PaymentIntent is allowed to use. - */ - payment_method_types: string[]; - - /** - * The amount of the application fee in cents (if any) that will be applied to the payment and transferred to the application owner’s Stripe account. To use an application fee, the request must be made on behalf of another account, using the `Stripe-Account` header or an OAuth key. - */ - application_fee_amount?: number; - - /** - * Capture method of this PaymentIntent. - */ - capture_method?: 'automatic' | 'manual'; - - /** - * Attempt to confirm this PaymentIntent immediately. If the payment method attached is a card, a return_url must be provided in case additional authentication is required. - */ - confirm?: boolean; - - /** - * ID of the customer this PaymentIntent is for if one exists. - */ - customer?: string; - - /** - * An arbitrary string attached to the object. Often useful for displaying to users. This can be unset by updating the value to null and then saving. - */ - description?: string | null; - - /** - * A set of key/value pairs that you can attach to an object. It can be - * useful for storing additional information about the object in a structured - * format. You can unset an individual key by setting its value to null and - * then saving. To clear all keys, set metadata to null, then save. - */ - metadata?: IOptionsMetadata; - - /** - * The Stripe account ID for which these funds are intended. - */ - on_behalf_of?: string; - - /** - * Email address that the receipt for the resulting payment will be sent to. - */ - receipt_email?: string; - - /** - * The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method’s app or site. If you’d prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. This param can only be used if `confirm=true`. - */ - return_url?: string; - - /** - * Set to `true` to save this PaymentIntent’s payment method to the associated Customer, if the payment method is not already attached. This parameter only applies to the payment method passed in the same request or the current payment method attached to the PaymentIntent and must be specified again if a new payment method is added. - */ - save_payment_method?: boolean; - - /** - * Shipping information for this PaymentIntent. - */ - shipping?: IShippingInformation; - - /** - * ID of the Source object to attach to this PaymentIntent. - */ - source?: string; - - /** - * Extra information about a PaymentIntent. This will appear on your customer’s statement when this PaymentIntent succeeds in creating a charge. - */ - statement_descriptor?: string; - - /** - * The parameters used to automatically create a Transfer when the payment succeeds. - */ - transfer_data?: IPaymentIntentTransferData; - - /** - * A string that identifies the resulting payment as part of a group. - */ - transfer_group?: string; - } - - interface IPaymentIntentUpdateOptions { - /** - * Amount intended to be collected by this PaymentIntent (in cents). - */ - amount?: number; - - /** - * The amount of the application fee in cents (if any) that will be applied to the payment and transferred to the application owner’s Stripe account. To use an application fee, the request must be made on behalf of another account, using the `Stripe-Account` header or an OAuth key. - */ - application_fee_amount?: number; - - /** - * Three-letter ISO currency code, in lowercase. Must be a supported currency. - */ - currency?: string; - - /** - * ID of the customer this PaymentIntent is for if one exists. - */ - customer?: string; - - /** - * An arbitrary string attached to the object. Often useful for displaying to users. This can be unset by updating the value to null and then saving. - */ - description?: string | null; - - /** - * A set of key/value pairs that you can attach to an object. It can be - * useful for storing additional information about the object in a structured - * format. You can unset an individual key by setting its value to null and - * then saving. To clear all keys, set metadata to null, then save. - */ - metadata?: IOptionsMetadata; - - /** - * Email address that the receipt for the resulting payment will be sent to. - */ - receipt_email?: string; - - /** - * Set to `true` to save this PaymentIntent’s payment method to the associated Customer, if the payment method is not already attached. This parameter only applies to the payment method passed in the same request or the current payment method attached to the PaymentIntent and must be specified again if a new payment method is added. - */ - save_payment_method?: boolean; - - /** - * Shipping information for this PaymentIntent. - */ - shipping?: IShippingInformation; - - /** - * ID of the Source object to attach to this PaymentIntent. - */ - source?: string; - - /** - * A string that identifies the resulting payment as part of a group. - */ - transfer_group?: string; - } - - interface IPaymentIntentConfirmOptions { - /** - * The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key. Please refer to dynamic authentication guide on how client_secret should be handled. Required if using Publishable Key! - */ - client_secret?: string; - - /** - * Email address that the receipt for the resulting payment will be sent to. - */ - receipt_email?: string | null; - - /** - * The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method’s app or site. If you’d prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter is only used for cards and other redirect-based payment methods. - */ - return_url?: string; - - /** - * Set to `true` to save this PaymentIntent’s payment method to the associated Customer, if the payment method is not already attached. This parameter only applies to the payment method passed in the same request or the current payment method attached to the PaymentIntent and must be specified again if a new payment method is added. - */ - save_payment_method?: boolean; - - /** - * Shipping information for this PaymentIntent. - */ - shipping?: IShippingInformation | null; - - /** - * ID of the source used in this PaymentIntent. - */ - source?: string; - } - - interface IPaymentIntentCaptureOptions { - /** - * The amount to capture (in cents) from the PaymentIntent, which must be less than or equal to the original amount. Any additional amount will be automatically refunded. Defaults to the full `amount_capturable` if not provided. - */ - amount_to_capture?: number; - - /** - * The amount of the application fee (if any) that will be applied to the payment and transferred to the application owner’s Stripe account. To use an application fee, the request must be made on behalf of another account, using the `Stripe-Account` header or an OAuth key. - */ - application_fee_amount?: number; - } - - interface IPaymentIntentListOptions extends IListOptionsCreated { - /** - * Filter links by their expiration status. By default, all links are returned. - */ - expired?: boolean; - - /** - * Only return links for the given file. - */ - file?: boolean; - } - } + interface IPaymentIntent extends IResourceObject { + /** + * Value is "payment_intent". + */ + object: 'payment_intent'; + + /** + * The amount in cents that is to be collected from this PaymentIntent. + */ + amount: number; + + /** + * The amount that can be captured with from this PaymentIntent (in cents). + */ + amount_capturable: number; + + /** + * The amount that was collected from this PaymentIntent (in cents). + */ + amount_received: number; + + /** + * ID of the Connect application that created the PaymentIntent. [Expandable] + */ + application?: string | applications.IApplication | null; + + /** + * A fee in cents that will be applied to the invoice and transferred to the application owner's Stripe account. + */ + application_fee_amount?: number | null; + + /** + * Populated when `status` is `canceled`, this is the time at which the PaymentIntent was canceled. + * Measured in seconds since the Unix epoch. + */ + canceled_at: number | null; + + /** + * User-given reason for cancellation of this PaymentIntent. + */ + cancelation_reason: PaymentIntentCancelationReason | null; + + /** + * Capture method of this PaymentIntent. + */ + capture_method: 'automatic' | 'manual'; + + /** + * Charges that were created by this PaymentIntent, if any. + */ + charges: IList; + + /** + * The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key. Please refer to dynamic authentication guide on how client_secret should be handled. + */ + client_secret: string; + + /** + * Confirmation method of this PaymentIntent. + */ + confirmation_method: 'secret' | 'publishable'; + + /** + * Time at which the object was created. Measured in seconds since the Unix epoch. + */ + created: number; + + /** + * Three-letter ISO currency code, in lowercase. Must be a supported currency. + */ + currency: string; + + /** + * ID of the Customer this PaymentIntent is for if one exists. [Expandable] + */ + customer: string | customers.ICustomer | null; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description?: string; + + /** + * The payment error encountered in the previous PaymentIntent confirmation. + */ + last_payment_error: IStripeError | null; + + livemode: boolean; + + metadata: IMetadata; + + /** + * If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source. + */ + next_action: + | IPaymentIntentNextActionUseStripeSdk + | IPaymentIntentNextActionRedirectToUrl; + + /** + * The account (if any) for which the funds of the PaymentIntent are intended. See the PaymentIntents Connect usage guide for details. [Expandable] + */ + on_behalf_of?: string | null; + + /** + * The list of payment method types (e.g. card) that this PaymentIntent is allowed to use. + */ + payment_method_types: string[]; + + /** + * Email address that the receipt for the resulting payment will be sent to. + */ + receipt_email: string | null; + + /** + * ID of the review associated with this PaymentIntent, if any. [Expandable] + */ + review?: string | reviews.IReview | null; + + /** + * Shipping information for this PaymentIntent. + */ + shipping?: IShippingInformation | null; + + /** + * ID of the source used in this PaymentIntent. [Expandable] + */ + source: + | string + | cards.ICard + | bitcoinReceivers.IBitcoinReceiver + | bankAccounts.IBankAccount; + + /** + * Extra information about a PaymentIntent. This will appear on your customer’s statement when this PaymentIntent succeeds in creating a charge. + */ + statement_descriptor: string | null; + + /** + * The several states the PaymentIntent goes through until it it either canceled or succeeds. + */ + status: + | 'requires_payment_method' + | 'requires_action' + | 'processing' + | 'requires_authorization' + | 'requires_capture' + | 'canceled' + | 'succeeded'; + + /** + * The data with which to automatically create a Transfer when the payment is finalized. + */ + transfer_data: IPaymentIntentTransferData | null; + + /** + * A string that identifies the resulting payment as part of a group. + */ + transfer_group: string | null; + } + + interface IPaymentIntentTransferData { + /** + * The account (if any) the payment will be attributed to for tax reporting, and where funds from the payment will be transferred to upon payment success. [Expandable] + */ + destination: + | string + | bankAccounts.IBankAccount + | cards.ICardHash + | accounts.IAccountCreationOptions; + } + + interface IPaymentIntentNextActionRedirectToUrl { + type: 'redirect_to_url'; + /** + * Contains instructions for authenticating a payment by redirecting your customer to another page or application. + */ + redirect_to_url: { return_url: string; url: string }; + } + + interface IPaymentIntentNextActionUseStripeSdk { + type: 'use_stripe_sdk'; + /** + * When confirming a PaymentIntent with js, js depends on the contents of this object to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by js. + */ + use_stripe_sdk: any; + } + + type PaymentIntentCancelationReason = 'duplicate' | 'fraudulent' | 'requested_by_customer' | 'failed_invoice'; + + interface IPaymentIntentCreationOptions { + /** + * Amount intended to be collected by this PaymentIntent (in cents). + */ + amount: number; + + /** + * Three-letter ISO currency code, in lowercase. Must be a supported currency. + */ + currency: string; + + /** + * The list of payment method types (e.g. card) that this PaymentIntent is allowed to use. + */ + payment_method_types: string[]; + + /** + * The amount of the application fee in cents (if any) that will be applied to the payment and transferred to the application owner’s Stripe account. To use an application fee, the request must be made on behalf of another account, using the `Stripe-Account` header or an OAuth key. + */ + application_fee_amount?: number; + + /** + * Capture method of this PaymentIntent. + */ + capture_method?: 'automatic' | 'manual'; + + /** + * Attempt to confirm this PaymentIntent immediately. If the payment method attached is a card, a return_url must be provided in case additional authentication is required. + */ + confirm?: boolean; + + /** + * ID of the customer this PaymentIntent is for if one exists. + */ + customer?: string; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. This can be unset by updating the value to null and then saving. + */ + description?: string | null; + + /** + * A set of key/value pairs that you can attach to an object. It can be + * useful for storing additional information about the object in a structured + * format. You can unset an individual key by setting its value to null and + * then saving. To clear all keys, set metadata to null, then save. + */ + metadata?: IOptionsMetadata; + + /** + * The Stripe account ID for which these funds are intended. + */ + on_behalf_of?: string; + + /** + * Email address that the receipt for the resulting payment will be sent to. + */ + receipt_email?: string; + + /** + * The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method’s app or site. If you’d prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. This param can only be used if `confirm=true`. + */ + return_url?: string; + + /** + * Set to `true` to save this PaymentIntent’s payment method to the associated Customer, if the payment method is not already attached. This parameter only applies to the payment method passed in the same request or the current payment method attached to the PaymentIntent and must be specified again if a new payment method is added. + */ + save_payment_method?: boolean; + + /** + * Shipping information for this PaymentIntent. + */ + shipping?: IShippingInformation; + + /** + * ID of the Source object to attach to this PaymentIntent. + */ + source?: string; + + /** + * Extra information about a PaymentIntent. This will appear on your customer’s statement when this PaymentIntent succeeds in creating a charge. + */ + statement_descriptor?: string; + + /** + * The parameters used to automatically create a Transfer when the payment succeeds. + */ + transfer_data?: IPaymentIntentTransferData; + + /** + * A string that identifies the resulting payment as part of a group. + */ + transfer_group?: string; + } + + interface IPaymentIntentUpdateOptions { + /** + * Amount intended to be collected by this PaymentIntent (in cents). + */ + amount?: number; + + /** + * The amount of the application fee in cents (if any) that will be applied to the payment and transferred to the application owner’s Stripe account. To use an application fee, the request must be made on behalf of another account, using the `Stripe-Account` header or an OAuth key. + */ + application_fee_amount?: number; + + /** + * Three-letter ISO currency code, in lowercase. Must be a supported currency. + */ + currency?: string; + + /** + * ID of the customer this PaymentIntent is for if one exists. + */ + customer?: string; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. This can be unset by updating the value to null and then saving. + */ + description?: string | null; + + /** + * A set of key/value pairs that you can attach to an object. It can be + * useful for storing additional information about the object in a structured + * format. You can unset an individual key by setting its value to null and + * then saving. To clear all keys, set metadata to null, then save. + */ + metadata?: IOptionsMetadata; + + /** + * Email address that the receipt for the resulting payment will be sent to. + */ + receipt_email?: string; + + /** + * Set to `true` to save this PaymentIntent’s payment method to the associated Customer, if the payment method is not already attached. This parameter only applies to the payment method passed in the same request or the current payment method attached to the PaymentIntent and must be specified again if a new payment method is added. + */ + save_payment_method?: boolean; + + /** + * Shipping information for this PaymentIntent. + */ + shipping?: IShippingInformation; + + /** + * ID of the Source object to attach to this PaymentIntent. + */ + source?: string; + + /** + * A string that identifies the resulting payment as part of a group. + */ + transfer_group?: string; + } + + interface IPaymentIntentConfirmOptions { + /** + * The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key. Please refer to dynamic authentication guide on how client_secret should be handled. Required if using Publishable Key! + */ + client_secret?: string; + + /** + * Email address that the receipt for the resulting payment will be sent to. + */ + receipt_email?: string | null; + + /** + * The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method’s app or site. If you’d prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter is only used for cards and other redirect-based payment methods. + */ + return_url?: string; + + /** + * Set to `true` to save this PaymentIntent’s payment method to the associated Customer, if the payment method is not already attached. This parameter only applies to the payment method passed in the same request or the current payment method attached to the PaymentIntent and must be specified again if a new payment method is added. + */ + save_payment_method?: boolean; + + /** + * Shipping information for this PaymentIntent. + */ + shipping?: IShippingInformation | null; + + /** + * ID of the source used in this PaymentIntent. + */ + source?: string; + } + + interface IPaymentIntentCaptureOptions { + /** + * The amount to capture (in cents) from the PaymentIntent, which must be less than or equal to the original amount. Any additional amount will be automatically refunded. Defaults to the full `amount_capturable` if not provided. + */ + amount_to_capture?: number; + + /** + * The amount of the application fee (if any) that will be applied to the payment and transferred to the application owner’s Stripe account. To use an application fee, the request must be made on behalf of another account, using the `Stripe-Account` header or an OAuth key. + */ + application_fee_amount?: number; + } + + interface IPaymentIntentListOptions extends IListOptionsCreated { + /** + * Filter links by their expiration status. By default, all links are returned. + */ + expired?: boolean; + + /** + * Only return links for the given file. + */ + file?: boolean; + } + } namespace plans { interface ITier { @@ -7223,139 +7220,131 @@ declare namespace Stripe { del(invoiceItemId: string, response?: IResponseFn): Promise; } - class PaymentIntents extends StripeResource { - /** - * Creates a PaymentIntent object. - */ - create( - data: paymentIntents.IPaymentIntentCreationOptions, - options: HeaderOptions, - response?: IResponseFn, - ): Promise; - create( - data: paymentIntents.IPaymentIntentCreationOptions, - response?: IResponseFn, - ): Promise; + class PaymentIntents extends StripeResource { + /** + * Creates a PaymentIntent object. + */ + create( + data: paymentIntents.IPaymentIntentCreationOptions, + options: HeaderOptions, + response?: IResponseFn, + ): Promise; + create( + data: paymentIntents.IPaymentIntentCreationOptions, + response?: IResponseFn, + ): Promise; - /** - * Returns a list of PaymentIntents. - * - * @returns A object with a data property that contains an array of up to limit PaymentIntents, starting after PaymentIntent starting_after. Each entry in the array is a separate PaymentIntent object. If no more PaymentIntents are available, the resulting array will be empty. This request should never throw an error. - */ - list( - data: paymentIntents.IPaymentIntentListOptions, - options: HeaderOptions, - response?: IResponseFn>, - ): Promise>; - list( - data: paymentIntents.IPaymentIntentListOptions, - response?: IResponseFn>, - ): Promise>; - list( - options: HeaderOptions, - response?: IResponseFn>, - ): Promise>; - list( - response?: IResponseFn>, - ): Promise>; + /** + * Returns a list of PaymentIntents. + * + * @returns A object with a data property that contains an array of up to limit PaymentIntents, starting after PaymentIntent starting_after. Each entry in the array is a separate PaymentIntent object. If no more PaymentIntents are available, the resulting array will be empty. This request should never throw an error. + */ + list( + data: paymentIntents.IPaymentIntentListOptions, + options: HeaderOptions, + response?: IResponseFn>, + ): Promise>; + list( + data: paymentIntents.IPaymentIntentListOptions, + response?: IResponseFn>, + ): Promise>; + list( + options: HeaderOptions, + response?: IResponseFn>, + ): Promise>; + list( + response?: IResponseFn>, + ): Promise>; - /** - * Updates a PaymentIntent object. - */ - update( - id: string, - data: paymentIntents.IPaymentIntentUpdateOptions, - options: HeaderOptions, - response?: IResponseFn, - ): Promise; - update( - id: string, - data: paymentIntents.IPaymentIntentUpdateOptions, - response?: IResponseFn, - ): Promise; + /** + * Updates a PaymentIntent object. + */ + update( + id: string, + data: paymentIntents.IPaymentIntentUpdateOptions, + options: HeaderOptions, + response?: IResponseFn, + ): Promise; + update( + id: string, + data: paymentIntents.IPaymentIntentUpdateOptions, + response?: IResponseFn, + ): Promise; - /** - * Retrieves the details of a PaymentIntent that has previously been created. - * Client-side retrieval using a publishable key is allowed when the client_secret is provided in the query string. - * When retrieved with a publishable key, only a subset of properties will be returned. Please refer to the payment intent object reference for more details. - */ - retrieve( - id: string, - options: HeaderOptions, - response?: IResponseFn, - ): Promise; - retrieve( - id: string, - response?: IResponseFn, - ): Promise; + /** + * Retrieves the details of a PaymentIntent that has previously been created. + * Client-side retrieval using a publishable key is allowed when the client_secret is provided in the query string. + * When retrieved with a publishable key, only a subset of properties will be returned. Please refer to the payment intent object reference for more details. + */ + retrieve( + id: string, + options: HeaderOptions, + response?: IResponseFn, + ): Promise; + retrieve( + id: string, + response?: IResponseFn, + ): Promise; - /** - * Confirm that your customer intends to pay with current or provided `source`. Upon confirmation, the PaymentIntent will attempt to initiate a payment. - * - * If the selected source requires additional authentication steps, the PaymentIntent will transition to the `requires_action` status and suggest additional actions via `next_source_action`. If payment fails, the PaymentIntent will transition to the `requires_payment_method` status. If payment succeeds, the PaymentIntent will transition to the `succeeded` status (or `requires_capture`, if `capture_method` is set to `manual`). - * - * When using a publishable key, the client_secret must be provided to confirm the PaymentIntent. - */ - confirm( - paymentIntentId: string, - data: paymentIntents.IPaymentIntentConfirmOptions, - options: HeaderOptions, - response?: IResponseFn, - ): Promise; - confirm( - paymentIntentId: string, - data: paymentIntents.IPaymentIntentConfirmOptions, - response?: IResponseFn, - ): Promise; + /** + * Confirm that your customer intends to pay with current or provided `source`. Upon confirmation, the PaymentIntent will attempt to initiate a payment. + * + * If the selected source requires additional authentication steps, the PaymentIntent will transition to the `requires_action` status and suggest additional actions via `next_source_action`. If payment fails, the PaymentIntent will transition to the `requires_payment_method` status. If payment succeeds, the PaymentIntent will transition to the `succeeded` status (or `requires_capture`, if `capture_method` is set to `manual`). + * + * When using a publishable key, the client_secret must be provided to confirm the PaymentIntent. + */ + confirm( + paymentIntentId: string, + data: paymentIntents.IPaymentIntentConfirmOptions, + options: HeaderOptions, + response?: IResponseFn, + ): Promise; + confirm( + paymentIntentId: string, + data: paymentIntents.IPaymentIntentConfirmOptions, + response?: IResponseFn, + ): Promise; - /** - * Capture the funds of an existing uncaptured PaymentIntent where `required_action="requires_capture"`. - * Uncaptured PaymentIntents will be canceled exactly seven days after they are created. - * - * @returns Returns a PaymentIntent object with `status="succeeded"` if the PaymentIntent was capturable. Returns an error if the PaymentIntent was not capturable or an invalid amount to capture was provided. - */ - capture( - paymentIntentId: string, - data: paymentIntents.IPaymentIntentCaptureOptions, - options: HeaderOptions, - response?: IResponseFn, - ): Promise; - capture( - paymentIntentId: string, - data: paymentIntents.IPaymentIntentCaptureOptions, - response?: IResponseFn, - ): Promise; + /** + * Capture the funds of an existing uncaptured PaymentIntent where `required_action="requires_capture"`. + * Uncaptured PaymentIntents will be canceled exactly seven days after they are created. + * + * @returns Returns a PaymentIntent object with `status="succeeded"` if the PaymentIntent was capturable. Returns an error if the PaymentIntent was not capturable or an invalid amount to capture was provided. + */ + capture( + paymentIntentId: string, + data: paymentIntents.IPaymentIntentCaptureOptions, + options: HeaderOptions, + response?: IResponseFn, + ): Promise; + capture( + paymentIntentId: string, + data: paymentIntents.IPaymentIntentCaptureOptions, + response?: IResponseFn, + ): Promise; - /** - * A PaymentIntent object can be canceled when it is in one of these statuses: `requires_payment_method`, `requires_capture`, `requires_confirmation`, `requires_action`. - * Once canceled, no additional charges will be made by the PaymentIntent and any operations on the PaymentIntent will fail with an error. For PaymentIntents with `status='requires_capture'`, the remaining `amount_capturable` will automatically be refunded. - * - * @returns Returns a PaymentIntent object if the cancellation succeeded. Returns an error if the PaymentIntent has already been canceled or is not in a cancelable state. - */ - cancel( - paymentIntentId: string, - data: { - cancellation_reason?: - | 'duplicate' - | 'fraudulent' - | 'requested_by_customer' - | 'failed_invoice'; - }, - options: HeaderOptions, - response?: IResponseFn, - ): Promise; - cancel( - paymentIntentId: string, - data: { - cancellation_reason?: - | 'duplicate' - | 'fraudulent' - | 'requested_by_customer' - | 'failed_invoice'; - }, - response?: IResponseFn, - ): Promise; - } + /** + * A PaymentIntent object can be canceled when it is in one of these statuses: `requires_payment_method`, `requires_capture`, `requires_confirmation`, `requires_action`. + * Once canceled, no additional charges will be made by the PaymentIntent and any operations on the PaymentIntent will fail with an error. For PaymentIntents with `status='requires_capture'`, the remaining `amount_capturable` will automatically be refunded. + * + * @returns Returns a PaymentIntent object if the cancellation succeeded. Returns an error if the PaymentIntent has already been canceled or is not in a cancelable state. + */ + cancel( + paymentIntentId: string, + data: { + cancellation_reason?: paymentIntents.PaymentIntentCancelationReason, + }, + options: HeaderOptions, + response?: IResponseFn, + ): Promise; + cancel( + paymentIntentId: string, + data: { + cancellation_reason?: paymentIntents.PaymentIntentCancelationReason, + }, + response?: IResponseFn, + ): Promise; + } class Payouts extends StripeResource { /** From 1f6c41e790a1576a7ce40c61add8eef37d0110ec Mon Sep 17 00:00:00 2001 From: Simon Schick Date: Mon, 4 Mar 2019 13:24:08 +0100 Subject: [PATCH 319/924] chore(png-async): remove typings --- notNeededPackages.json | 6 +++ types/png-async/index.d.ts | 52 -------------------- types/png-async/png-async-tests.ts | 31 ------------ types/png-async/tsconfig.json | 23 --------- types/png-async/tslint.json | 79 ------------------------------ 5 files changed, 6 insertions(+), 185 deletions(-) delete mode 100644 types/png-async/index.d.ts delete mode 100644 types/png-async/png-async-tests.ts delete mode 100644 types/png-async/tsconfig.json delete mode 100644 types/png-async/tslint.json diff --git a/notNeededPackages.json b/notNeededPackages.json index 4289393363..f590eaabfd 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -1110,6 +1110,12 @@ "sourceRepoURL": "https://github.com/theoephraim/node-pg-migrate#readme", "asOfVersion": "2.15.0" }, + { + "libraryName": "node-png-async", + "typingsPackageName": "node-png-async", + "sourceRepoURL": "https://github.com/kanreisa/node-png-async", + "asOfVersion": "0.9.4" + }, { "libraryName": "node-waves", "typingsPackageName": "node-waves", diff --git a/types/png-async/index.d.ts b/types/png-async/index.d.ts deleted file mode 100644 index cef8207ae2..0000000000 --- a/types/png-async/index.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -// Type definitions for png-async -// Project: https://github.com/kanreisa/node-png-async -// Definitions by: Yuki KAN -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - - -import stream = require('stream'); - -export interface IImageOptions { - width?: number; - height?: number; - fill?: boolean; - checkCRC?: boolean; - deflateChunkSize?: number; - deflateLevel?: number; - deflateStrategy?: EDeflateStrategy; - filterType?: EFilterType; -} - -export declare enum EDeflateStrategy { - DEFAULT_STRATEGY = 0, - FILTERED = 1, - HUFFMAN_ONLY = 2, - RLE = 3, - FIXED = 4, -} - -export declare enum EFilterType { - Auto = -1, - None = 0, - Sub = 1, - Up = 2, - Average = 3, - Paeth = 4, -} - -export declare function createImage(option?: IImageOptions): Image; - -export declare class Image extends stream.Duplex { - width: number; - height: number; - gamma: number; - data: Buffer; - constructor(option?: IImageOptions); - pack(): Image; - parse(data: Buffer, callback?: (err: Error, image: Image) => void): Image; - write(data: any, cb?: any): boolean; - end(data?: any): void; - bitblt(dst: Image, sx: number, sy: number, w: number, h: number, dx: number, dy: number): Image; -} diff --git a/types/png-async/png-async-tests.ts b/types/png-async/png-async-tests.ts deleted file mode 100644 index f108fe66b8..0000000000 --- a/types/png-async/png-async-tests.ts +++ /dev/null @@ -1,31 +0,0 @@ - -import fs = require('fs'); -import png = require('png-async'); - -var devnull = process.platform === 'win32' ? 'nul' : '/dev/null'; - -// stream test -var img = new png.Image({ - width: 1, - height: 1, - fill: true -}) - .pack() - .pipe(png.createImage({ - deflateStrategy: png.EDeflateStrategy.FIXED, - filterType: png.EFilterType.Auto - }) - .on('parsed', function () { - - if (this.data[0] !== 0) { - throw new Error('invalid data'); - } - - this.data[0] = 255; - this.data[3] = 255; - - this.pack().pipe(fs.createWriteStream(devnull)).on('finish', () => { - console.log('done'); - }); - }) - ); diff --git a/types/png-async/tsconfig.json b/types/png-async/tsconfig.json deleted file mode 100644 index 181b899496..0000000000 --- a/types/png-async/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": false, - "strictNullChecks": false, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "png-async-tests.ts" - ] -} \ No newline at end of file diff --git a/types/png-async/tslint.json b/types/png-async/tslint.json deleted file mode 100644 index a41bf5d19a..0000000000 --- a/types/png-async/tslint.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } -} From 51a727e81317ef19933e96b099ccadb874fd1c9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20H=C3=BCbelbauer?= Date: Mon, 4 Mar 2019 13:42:34 +0100 Subject: [PATCH 320/924] Document the timeGutterHeader component --- types/react-big-calendar/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/react-big-calendar/index.d.ts b/types/react-big-calendar/index.d.ts index 7a6bebe1c2..85914eda10 100644 --- a/types/react-big-calendar/index.d.ts +++ b/types/react-big-calendar/index.d.ts @@ -120,6 +120,7 @@ export interface Components { dayWrapper?: React.SFC | React.Component | React.ComponentClass | JSX.Element; dateCellWrapper?: React.SFC | React.Component | React.ComponentClass | JSX.Element; timeSlotWrapper?: React.SFC | React.Component | React.ComponentClass | JSX.Element; + timeGutterHeader?: React.SFC | React.Component | React.ComponentClass | JSX.Element; timeGutterWrapper?: React.SFC | React.Component | React.ComponentClass | JSX.Element; toolbar?: React.ComponentType; agenda?: { From 880c1b9fddafe897597e29d160f9e175e70a8c46 Mon Sep 17 00:00:00 2001 From: Sergei Butko Date: Mon, 4 Mar 2019 14:54:46 +0200 Subject: [PATCH 321/924] Add activeColor and inactiveColor --- types/react-native-tab-view/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/react-native-tab-view/index.d.ts b/types/react-native-tab-view/index.d.ts index a6e6b27735..43517fa20b 100644 --- a/types/react-native-tab-view/index.d.ts +++ b/types/react-native-tab-view/index.d.ts @@ -212,6 +212,8 @@ export type TabBarProps = SceneRendererProps< renderBadge?: (scene: Scene) => ReactNode onTabPress?: (scene: Scene) => void onTabLongPress?: (scene: Scene) => void + activeColor?: string + inactiveColor?: string pressColor?: string pressOpacity?: number scrollEnabled?: boolean From 65a3fe8ce4c08ca1c866c67595c1b08a28f9b105 Mon Sep 17 00:00:00 2001 From: Kenneth Kidmose Johnsen Date: Mon, 4 Mar 2019 15:23:05 +0100 Subject: [PATCH 322/924] Fixed so that getFromUniqueIdentifier return ResumableFile instead of just void --- types/resumablejs/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/resumablejs/index.d.ts b/types/resumablejs/index.d.ts index c87d669a07..48d3f578d8 100644 --- a/types/resumablejs/index.d.ts +++ b/types/resumablejs/index.d.ts @@ -213,7 +213,7 @@ declare namespace Resumable { /** * Look up a ResumableFile object by its unique identifier. **/ - getFromUniqueIdentifier(uniqueIdentifier: string): void; + getFromUniqueIdentifier(uniqueIdentifier: string): ResumableFile; /** * Returns the total size of the upload in bytes. **/ From aad8e76a58b28168ceb10a16a75019d41e48b6ca Mon Sep 17 00:00:00 2001 From: Kenneth Kidmose Johnsen Date: Mon, 4 Mar 2019 15:29:14 +0100 Subject: [PATCH 323/924] added definition credits for proper notifications about issues --- types/resumablejs/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/resumablejs/index.d.ts b/types/resumablejs/index.d.ts index 48d3f578d8..45047b7cf7 100644 --- a/types/resumablejs/index.d.ts +++ b/types/resumablejs/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for Resumable.js v1.0.2 // Project: https://github.com/23/resumable.js // Definitions by: Daniel McAssey +// Kenneth Kidmose Johnsen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace Resumable { From 3cf473bd75fe65923d19cc058fdd0c3405413ba3 Mon Sep 17 00:00:00 2001 From: Jamie Sykes Date: Mon, 4 Mar 2019 15:23:24 +0000 Subject: [PATCH 324/924] Adds collectionsjs type. --- types/collectionsjs/collectionsjs-tests.ts | 57 ++++++++++++++++++++++ types/collectionsjs/index.d.ts | 45 +++++++++++++++++ types/collectionsjs/tsconfig.json | 23 +++++++++ types/collectionsjs/tslint.json | 1 + 4 files changed, 126 insertions(+) create mode 100644 types/collectionsjs/collectionsjs-tests.ts create mode 100644 types/collectionsjs/index.d.ts create mode 100644 types/collectionsjs/tsconfig.json create mode 100644 types/collectionsjs/tslint.json diff --git a/types/collectionsjs/collectionsjs-tests.ts b/types/collectionsjs/collectionsjs-tests.ts new file mode 100644 index 0000000000..2b7a3d5fb0 --- /dev/null +++ b/types/collectionsjs/collectionsjs-tests.ts @@ -0,0 +1,57 @@ +import Collection from 'collectionsjs'; + +const collectable = [ + { name: 'Arya Stark', age: 9 }, + { name: 'Bran Stark', age: 7 }, + { name: 'Jon Snow', age: 14 } +]; + +const collection = new Collection(collectable); + +const item = { 6: 7 }; + +collection.add(item); +collection.all(); +collection.average('age'); +collection.chunk(2).all(); +collection.collect(collectable); + +const characters = [ + { name: 'Ned Stark', age: 40}, + { name: 'Catelyn Stark', age: 35} +]; + +const array = ['a', 'b', 'c']; + +collection.concat(characters); +collection.contains(stark => stark.name === 'John Snow'); +collection.count(); +collection.each(t => t = 3); +collection.filter(stark => stark.age === 14); +collection.find('bran'); +collection.first(item => item.age > 7); +collection.flatten(true); +collection.get(2); +collection.has({ name: 'Bran Stark', age: 7 }); +collection.join(); +collection.keys(); +collection.last(); +collection.map(stark => stark.name); +collection.pluck('name'); +collection.push({name: 'Robb Stark', age: 17}); +collection.reduce((previous, current) => previous + current, 0); +collection.reject(stark => stark.age < 14); +collection.remove({name: 'Robb Stark', age: 17}); +collection.skip(2); +collection.slice(1, 3); +collection.sort(); +collection.sortBy('name'); +collection.stringify(); +collection.sum('age'); +collection.take(2); +collection.macro('addToMembers', (collection, n) => collection.map((collectionItem: any) => collectionItem + n)); +collection.unique(s => s.grade); +collection.values(); +collection.where('age', 14); +collection.where(stark => stark.age === 14); +collection.zip(array); diff --git a/types/collectionsjs/index.d.ts b/types/collectionsjs/index.d.ts new file mode 100644 index 0000000000..ca64acaff8 --- /dev/null +++ b/types/collectionsjs/index.d.ts @@ -0,0 +1,45 @@ +// Type definitions for collectionsjs 0.3 +// Project: https://github.com/logaretm/collectionsjs#readme +// Definitions by: Jaymeh +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.1 + +export default class Collection { + constructor(items?: any); + add(item: any): Collection; + all(): Collection; + average(property?: string | ((property?: number) => number)): number; + chunk(size: number): Collection; + collect(collectable: any[]|string): Collection; + concat(collection: any[]|Collection): Collection; + contains(closure: ((item: any) => boolean)): boolean; + count(): number; + each(callback: (item: any) => void): Collection; + filter(callback: (item: any) => any): Collection; + find(item: any): number; + first(callback?: ((item: any) => any)|null): any; + flatten(deep?: boolean): Collection; + get(index: number): any; + has(item: any): boolean; + join(separator?: string): string; + keys(): Collection; + last(callback?: ((item: any) => any)|null): any; + map(callback: (item: any) => any): Collection; + pluck(property: string): Collection; + push(item: any): Collection; + reduce(callback: (previous: any, current: any) => any, initial: any): any; + reject(callback: (item: any) => any): Collection; + remove(item: any): boolean; + skip(count: number): Collection; + slice(start: number, end?: number): Collection; + sort(compare?: () => any): Collection; + sortBy(property: string, order?: string): Collection; + stringify(): string; + sum(property?: string|null): any; + take(count: number): Collection; + macro(name: string, callback: (...args: any) => any): any; + unique(callback?: string|null|((item: any) => any)): Collection; + values(): Collection; + where(callback: ((item: any) => any)|string, value?: any): Collection; + zip(array: any[]|Collection): Collection; +} diff --git a/types/collectionsjs/tsconfig.json b/types/collectionsjs/tsconfig.json new file mode 100644 index 0000000000..6ec4a9edc3 --- /dev/null +++ b/types/collectionsjs/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "collectionsjs-tests.ts" + ] +} diff --git a/types/collectionsjs/tslint.json b/types/collectionsjs/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/collectionsjs/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From f68540c9d2ba4d390088e2fb46ffe2ce8c8bd010 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Mon, 4 Mar 2019 08:44:15 -0800 Subject: [PATCH 325/924] Update 2 more project urls --- types/electron-spellchecker/index.d.ts | 2 +- types/mathjs/index.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/electron-spellchecker/index.d.ts b/types/electron-spellchecker/index.d.ts index fc10d13f34..6db76278d2 100644 --- a/types/electron-spellchecker/index.d.ts +++ b/types/electron-spellchecker/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for electron-spellchecker 1.1 -// Project: https://github.com/paulcbetts/electron-spellchecker +// Project: https://github.com/electron-userland/electron-spellchecker // Definitions by: Daniel Perez Alvarez // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 diff --git a/types/mathjs/index.d.ts b/types/mathjs/index.d.ts index 20fb7154cb..285aed9e56 100644 --- a/types/mathjs/index.d.ts +++ b/types/mathjs/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for mathjs 5.0 -// Project: http://mathjs.org/ +// Project: https://mathjs.org/ // Definitions by: Ilya Shestakov , // Andy Patterson , // Brad Besserman From 8c43522e3b7311b4b5306252a11d8318ee2dee1c Mon Sep 17 00:00:00 2001 From: James Reggio Date: Mon, 4 Mar 2019 08:51:51 -0800 Subject: [PATCH 326/924] [hoist-non-react-statics] Add support for exotic component in v3.3 --- .../hoist-non-react-statics-tests.tsx | 234 +++++++++++++++--- types/hoist-non-react-statics/index.d.ts | 30 ++- 2 files changed, 223 insertions(+), 41 deletions(-) diff --git a/types/hoist-non-react-statics/hoist-non-react-statics-tests.tsx b/types/hoist-non-react-statics/hoist-non-react-statics-tests.tsx index 05f282cc0c..954e4cc191 100644 --- a/types/hoist-non-react-statics/hoist-non-react-statics-tests.tsx +++ b/types/hoist-non-react-statics/hoist-non-react-statics-tests.tsx @@ -3,60 +3,220 @@ import * as PropTypes from 'prop-types'; import hoistNonReactStatics = require('hoist-non-react-statics'); -class A extends React.Component<{ x: number; y?: number | null }> { - static a = 'a'; +function TestClassComponents() { + class A extends React.Component<{ x: number; y?: number | null }> { + static a = 'a'; - static propTypes = { - x: PropTypes.number.isRequired, - y: PropTypes.number, - }; + static propTypes = { + x: PropTypes.number.isRequired, + y: PropTypes.number, + }; - getA() { - return A.a; + getA() { + return A.a; + } } + + class B extends React.Component { + static b = 'b'; + + static propTypes = { + n: PropTypes.number.isRequired, + }; + + static defaultProps = { + n: 42, + }; + + getB() { + return B.b; + } + } + + const C = hoistNonReactStatics(A, B); + + C.a !== C.b; + + C.propTypes.x; + C.prototype.getA(); + + C.propTypes.n; // $ExpectError + C.defaultProps; // $ExpectError + C.prototype.getB(); // $ExpectError + + ; + + const CWithType: hoistNonReactStatics.NonReactStatics = C; + + CWithType.propTypes; // $ExpectError + CWithType.defaultProps; // $ExpectError + CWithType.prototype.getB(); // $ExpectError + + const D = hoistNonReactStatics(A, B, { a: true, b: true }); + + D.a; + D.b; // $ExpectError + + const DWithType: hoistNonReactStatics.NonReactStatics = D; + const DWithTypeError: hoistNonReactStatics.NonReactStatics = D; // $ExpectError + + DWithType.b; // $ExpectError } -class B extends React.Component { - static b = 'b'; +// NOTE: We use Object.assign() to assign statics to functional components as a +// convenience to avoid having to model the component's type with static fields. - static propTypes = { - n: PropTypes.number.isRequired, - }; +function TestFunctionalComponents() { + const A = ({x, y}: {x: number; y?: number}) =>
{x + (y || 0)}
; - static defaultProps = { - n: 42, - }; + // tslint:disable-next-line:prefer-object-spread + const AWithStatics = Object.assign(A, { + a: 'a', + propTypes: { + x: PropTypes.number.isRequired, + y: PropTypes.number, + }, + }); - getB() { - return B.b; - } + const B = ({n}: {n: number}) =>
{n}
; + + // tslint:disable-next-line:prefer-object-spread + const BWithStatics = Object.assign(B, { + b: 'b', + propTypes: { + n: PropTypes.number.isRequired, + }, + defaultProps: { + n: 42, + }, + }); + + const C = hoistNonReactStatics(AWithStatics, BWithStatics); + + C.a !== C.b; + + C.propTypes.x; + C.propTypes.n; // $ExpectError + C.defaultProps; // $ExpectError + + ; + + const CWithType: hoistNonReactStatics.NonReactStatics = C; + + CWithType.propTypes; // $ExpectError + CWithType.defaultProps; // $ExpectError + + const D = hoistNonReactStatics(AWithStatics, BWithStatics, { a: true, b: true }); + + D.a; + D.b; // $ExpectError + + const DWithType: hoistNonReactStatics.NonReactStatics = D; + const DWithTypeError: hoistNonReactStatics.NonReactStatics = D; // $ExpectError + + DWithType.b; // $ExpectError } -const C = hoistNonReactStatics(A, B); +function TestMemoComponents() { + const A = ({x, y}: {x: number; y?: number}) =>
{x + (y || 0)}
; -C.a !== C.b; + // tslint:disable-next-line:prefer-object-spread + const AWithStatics = Object.assign(A, { + a: 'a', + propTypes: { + x: PropTypes.number.isRequired, + y: PropTypes.number, + }, + }); -C.propTypes.x; -C.prototype.getA(); + const B = React.memo(({n}: {n: number}) =>
{n}
); -C.propTypes.n; // $ExpectError -C.defaultProps; // $ExpectError -C.prototype.getB(); // $ExpectError + // tslint:disable-next-line:prefer-object-spread + const BWithStatics = Object.assign(B, { + b: 'b', + propTypes: { + n: PropTypes.number.isRequired, + }, + defaultProps: { + n: 42, + }, + }); -; + const C = hoistNonReactStatics(AWithStatics, BWithStatics); -const CWithType: hoistNonReactStatics.NonReactStatics = C; + C.a !== C.b; -CWithType.propTypes; // $ExpectError -CWithType.defaultProps; // $ExpectError -CWithType.prototype.getB(); // $ExpectError + C.propTypes.x; + C.propTypes.n; // $ExpectError + C.defaultProps; // $ExpectError -const D = hoistNonReactStatics(A, B, { a: true, b: true }); + ; -D.a; -D.b; // $ExpectError + const CWithType: hoistNonReactStatics.NonReactStatics = C; -const DWithType: hoistNonReactStatics.NonReactStatics = D; -const DWithTypeError: hoistNonReactStatics.NonReactStatics = D; // $ExpectError + CWithType.propTypes; // $ExpectError + CWithType.defaultProps; // $ExpectError -DWithType.b; // $ExpectError + const D = hoistNonReactStatics(AWithStatics, BWithStatics, { a: true, b: true }); + + D.a; + D.b; // $ExpectError + + const DWithType: hoistNonReactStatics.NonReactStatics = D; + const DWithTypeError: hoistNonReactStatics.NonReactStatics = D; // $ExpectError + + DWithType.b; // $ExpectError +} + +function TestForwardRefComponents() { + const A = ({x, y}: {x: number; y?: number}) =>
{x + (y || 0)}
; + + // tslint:disable-next-line:prefer-object-spread + const AWithStatics = Object.assign(A, { + a: 'a', + propTypes: { + x: PropTypes.number.isRequired, + y: PropTypes.number, + }, + }); + + const B = React.forwardRef( + ({n}: {n: number}, ref: React.Ref) =>
{n}
+ ); + + // tslint:disable-next-line:prefer-object-spread + const BWithStatics = Object.assign(B, { + b: 'b', + propTypes: { + n: PropTypes.number.isRequired, + }, + defaultProps: { + n: 42, + }, + }); + + const C = hoistNonReactStatics(AWithStatics, BWithStatics); + + C.a !== C.b; + + C.propTypes.x; + C.propTypes.n; // $ExpectError + C.defaultProps; // $ExpectError + + ; + + const CWithType: hoistNonReactStatics.NonReactStatics = C; + + CWithType.propTypes; // $ExpectError + CWithType.defaultProps; // $ExpectError + + const D = hoistNonReactStatics(AWithStatics, BWithStatics, { a: true, b: true }); + + D.a; + D.b; // $ExpectError + + const DWithType: hoistNonReactStatics.NonReactStatics = D; + const DWithTypeError: hoistNonReactStatics.NonReactStatics = D; // $ExpectError + + DWithType.b; // $ExpectError +} diff --git a/types/hoist-non-react-statics/index.d.ts b/types/hoist-non-react-statics/index.d.ts index 8c874483ac..fc90d9713d 100644 --- a/types/hoist-non-react-statics/index.d.ts +++ b/types/hoist-non-react-statics/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for hoist-non-react-statics 3.0 +// Type definitions for hoist-non-react-statics 3.3 // Project: https://github.com/mridgway/hoist-non-react-statics#readme -// Definitions by: JounQin +// Definitions by: JounQin , James Reggio // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -8,10 +8,12 @@ import * as React from 'react'; interface REACT_STATICS { childContextTypes: true; + contextType: true; contextTypes: true; defaultProps: true; displayName: true; getDefaultProps: true; + getDerivedStateFromError: true; getDerivedStateFromProps: true; mixins: true; propTypes: true; @@ -28,6 +30,23 @@ interface KNOWN_STATICS { arity: true; } +interface MEMO_STATICS { + '$$typeof': true; + compare: true; + defaultProps: true; + displayName: true; + propTypes: true; + type: true; +} + +interface FORWARD_REF_STATICS { + '$$typeof': true; + render: true; + defaultProps: true; + displayName: true; + propTypes: true; +} + declare namespace hoistNonReactStatics { type NonReactStatics< S extends React.ComponentType, @@ -37,8 +56,11 @@ declare namespace hoistNonReactStatics { > = { [key in Exclude< keyof S, - // only extends static properties, exclude instance properties and known react statics - keyof REACT_STATICS | keyof KNOWN_STATICS | keyof C + S extends React.MemoExoticComponent + ? keyof MEMO_STATICS | keyof C + : S extends React.ForwardRefExoticComponent + ? keyof FORWARD_REF_STATICS | keyof C + : keyof REACT_STATICS | keyof KNOWN_STATICS | keyof C >]: S[key] }; } From b37b33f17c898dce5d01fd4d9628d82e67df4352 Mon Sep 17 00:00:00 2001 From: helloworld111gh Date: Mon, 4 Mar 2019 08:56:50 -0800 Subject: [PATCH 327/924] fix version for lolex --- types/lolex/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/lolex/index.d.ts b/types/lolex/index.d.ts index 35c4880a5b..3f7031f266 100644 --- a/types/lolex/index.d.ts +++ b/types/lolex/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for lolex 3 +// Type definitions for lolex 3.1 // Project: https://github.com/sinonjs/lolex // Definitions by: Wim Looman // Josh Goldberg From 31e96442b240412208a07ad4fdba3444fa750736 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20Holhjem?= Date: Mon, 4 Mar 2019 18:00:01 +0100 Subject: [PATCH 328/924] Added allowNew function From documentation: https://github.com/ericgio/react-bootstrap-typeahead/blob/master/docs/Props.md --- types/react-bootstrap-typeahead/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-bootstrap-typeahead/index.d.ts b/types/react-bootstrap-typeahead/index.d.ts index 93fa2c9c6a..18311bccb5 100644 --- a/types/react-bootstrap-typeahead/index.d.ts +++ b/types/react-bootstrap-typeahead/index.d.ts @@ -126,7 +126,7 @@ export interface TypeaheadProps { but not the list of original options unless handled as such by Typeahead's parent. The newly added item will always be returned as an object even if the other options are simply strings, so be sure your onChange callback can handle this. */ - allowNew?: boolean; + allowNew?: boolean | ((results: T[], props: TypeaheadProps) => boolean); /* Autofocus the input when the component initially mounts. */ autoFocus?: boolean; From 2761cb1b444ba0550f31d16e857e77fc60bfab20 Mon Sep 17 00:00:00 2001 From: helloworld111gh Date: Mon, 4 Mar 2019 08:56:50 -0800 Subject: [PATCH 329/924] fix version for lolex --- types/lolex/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/lolex/index.d.ts b/types/lolex/index.d.ts index 35c4880a5b..3f7031f266 100644 --- a/types/lolex/index.d.ts +++ b/types/lolex/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for lolex 3 +// Type definitions for lolex 3.1 // Project: https://github.com/sinonjs/lolex // Definitions by: Wim Looman // Josh Goldberg From b6c52a90ddbf5e08a7d3c47cf0cdf4cbf4947489 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjell=20Die=C3=9Fel?= Date: Mon, 4 Mar 2019 18:07:57 +0100 Subject: [PATCH 330/924] Update jsonwebtoken index.d.ts --- types/jsonwebtoken/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/jsonwebtoken/index.d.ts b/types/jsonwebtoken/index.d.ts index d1c3aeee5f..71a098cb8f 100644 --- a/types/jsonwebtoken/index.d.ts +++ b/types/jsonwebtoken/index.d.ts @@ -17,9 +17,9 @@ export class JsonWebTokenError extends Error { } export class TokenExpiredError extends JsonWebTokenError { - expiredAt: number; + expiredAt: Date; - constructor(message: string, expiredAt: number); + constructor(message: string, expiredAt: Date); } export class NotBeforeError extends JsonWebTokenError { From 6f9e0fddedb7ec27aa6885cd382a8f7bdeb18c9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjell=20Die=C3=9Fel?= Date: Mon, 4 Mar 2019 18:15:30 +0100 Subject: [PATCH 331/924] Update jsonwebtoken index.d.ts --- types/jsonwebtoken/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/jsonwebtoken/index.d.ts b/types/jsonwebtoken/index.d.ts index 71a098cb8f..079fd254dd 100644 --- a/types/jsonwebtoken/index.d.ts +++ b/types/jsonwebtoken/index.d.ts @@ -4,7 +4,8 @@ // Daniel Heim , // Brice BERNARD , // Veli-Pekka KestilĂ€ , -// Daniel Parker +// Daniel Parker , +// Kjell Dießel // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 From 91ad301fb00a5ed1da136b4f129ee1b57a9858df Mon Sep 17 00:00:00 2001 From: helloworld111gh Date: Mon, 4 Mar 2019 09:54:14 -0800 Subject: [PATCH 332/924] update lolex to 3.1 --- types/lolex/index.d.ts | 18 +++++++++++++++++- types/lolex/lolex-tests.ts | 8 ++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/types/lolex/index.d.ts b/types/lolex/index.d.ts index 3f7031f266..052c9c45dc 100644 --- a/types/lolex/index.d.ts +++ b/types/lolex/index.d.ts @@ -9,7 +9,7 @@ /** * Names of clock methods that may be faked by install. */ -type FakeMethod = "setTimeout" | "clearTimeout" | "setImmediate" | "clearImmediate" | "setInterval" | "clearInterval" | "Date" | "nextTick" | "hrtime"; +type FakeMethod = "setTimeout" | "clearTimeout" | "setImmediate" | "clearImmediate" | "setInterval" | "clearInterval" | "Date" | "nextTick" | "hrtime" | "requestIdleCallback" | "cancelIdleCallback"; /** * Global methods avaliable to every clock and also as standalone methods (inside `timers` global object). @@ -126,6 +126,22 @@ export interface LolexClock extends GlobalTimers void; + /** + * Queues the callback to be fired during idle periods to perform background and low priority work on the main event loop. + * + * @param callback Callback to be fired. + * @param timeout The maximum number of ticks before the callback must be fired. + * @remarks Callbacks which have a timeout option will be fired no later than time in milliseconds. + */ + requestIdleCallback: (callback: () => void, timeout?: number) => TTimerId; + + /** + * Clears a timer, as long as it was created using requestIdleCallback. + * + * @param id Timer ID or object. + */ + cancelIdleCallback: (id: TTimerId) => void; + /** * Get the number of waiting timers. * diff --git a/types/lolex/lolex-tests.ts b/types/lolex/lolex-tests.ts index 2a01dd5916..d09cfcc042 100644 --- a/types/lolex/lolex-tests.ts +++ b/types/lolex/lolex-tests.ts @@ -59,10 +59,14 @@ const browserTimeout: number = browserClock.setTimeout(() => {}, 7); const browserInterval: number = browserClock.setInterval(() => {}, 7); const browserImmediate: number = browserClock.setImmediate(() => {}); const browserAnimationFrame: number = browserClock.requestAnimationFrame(() => {}); +const browserIdleCallback: number = browserClock.requestIdleCallback(() => {}); +const browserIdleCallbackWithTimeout: number = browserClock.requestIdleCallback(() => {}, 7); const nodeTimeout: lolex.NodeTimer = nodeClock.setTimeout(() => {}, 7); const nodeInterval: lolex.NodeTimer = nodeClock.setInterval(() => {}, 7); const nodeImmediate: lolex.NodeTimer = nodeClock.setImmediate(() => {}); const nodeAnimationFrame: lolex.NodeTimer = nodeClock.requestAnimationFrame(() => {}); +const nodeIdleCallback: lolex.NodeTimer = nodeClock.requestIdleCallback(() => {}); +const nodeIdleCallbackWithTimeout: lolex.NodeTimer = nodeClock.requestIdleCallback(() => {}, 7); nodeTimeout.ref(); nodeTimeout.unref(); @@ -71,11 +75,15 @@ browserClock.clearTimeout(browserTimeout); browserClock.clearInterval(browserInterval); browserClock.clearImmediate(browserImmediate); browserClock.cancelAnimationFrame(browserAnimationFrame); +browserClock.cancelIdleCallback(browserIdleCallback); +browserClock.cancelIdleCallback(browserIdleCallbackWithTimeout); nodeClock.clearTimeout(nodeTimeout); nodeClock.clearInterval(nodeInterval); nodeClock.clearImmediate(nodeImmediate); nodeClock.cancelAnimationFrame(nodeAnimationFrame); +nodeClock.cancelIdleCallback(nodeIdleCallback); +nodeClock.cancelIdleCallback(nodeIdleCallbackWithTimeout); browserClock.tick(7); browserClock.tick("08"); From 6246216ca57e1354c1353777ea4cced81df8a179 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Mon, 4 Mar 2019 11:03:49 -0800 Subject: [PATCH 333/924] Try bumping deprecated version of p-queue --- notNeededPackages.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notNeededPackages.json b/notNeededPackages.json index 0c03bc3fe6..8aed163ab6 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -1168,7 +1168,7 @@ "libraryName": "p-queue", "typingsPackageName": "p-queue", "sourceRepoURL": "https://github.com/sindresorhus/p-queue", - "asOfVersion": "3.2.0" + "asOfVersion": "3.2.1" }, { "libraryName": "p-throttle", From 8ddaea3e6f7c648947170504085bfa7a3d8ce05b Mon Sep 17 00:00:00 2001 From: fhelwanger Date: Mon, 4 Mar 2019 17:24:19 -0300 Subject: [PATCH 334/924] [expo] Add Accuracy enum --- types/expo/expo-tests.tsx | 10 ++++++++++ types/expo/index.d.ts | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/types/expo/expo-tests.tsx b/types/expo/expo-tests.tsx index f2ce8d8197..bf58451f31 100644 --- a/types/expo/expo-tests.tsx +++ b/types/expo/expo-tests.tsx @@ -57,6 +57,16 @@ const reverseGeocode: Promise = Location.reverseGeocodeA longitude: 0 }); +Location.watchPositionAsync({ + accuracy: Location.Accuracy.BestForNavigation, + timeInterval: 10000, + distanceInterval: 0, + timeout: 10000 +}, (data) => { + data.coords; + data.timestamp; +}); + Accelerometer.addListener((obj) => { obj.x; obj.y; diff --git a/types/expo/index.d.ts b/types/expo/index.d.ts index 7e75c1b7d6..2004d41754 100644 --- a/types/expo/index.d.ts +++ b/types/expo/index.d.ts @@ -2242,6 +2242,15 @@ export namespace Location { function stopGeofencingAsync(taskName: string): Promise; function hasStartedGeofencingAsync(taskName: string): Promise; function setApiKey(key: string): void; + + enum Accuracy { + Lowest = 1, + Low = 2, + Balanced = 3, + High = 4, + Highest = 5, + BestForNavigation = 6 + } } /** From ecef3eeb3e698404be0a256d0c754fcd7f8b3cf9 Mon Sep 17 00:00:00 2001 From: Jamie Sykes Date: Mon, 4 Mar 2019 20:46:43 +0000 Subject: [PATCH 335/924] Adds missing reverse function. --- types/collectionsjs/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/collectionsjs/index.d.ts b/types/collectionsjs/index.d.ts index ca64acaff8..9252953ea3 100644 --- a/types/collectionsjs/index.d.ts +++ b/types/collectionsjs/index.d.ts @@ -30,6 +30,7 @@ export default class Collection { reduce(callback: (previous: any, current: any) => any, initial: any): any; reject(callback: (item: any) => any): Collection; remove(item: any): boolean; + reverse(): Collection; skip(count: number): Collection; slice(start: number, end?: number): Collection; sort(compare?: () => any): Collection; From 07de538eef13e1df3baeff9e752afb978addd13f Mon Sep 17 00:00:00 2001 From: Jamie Sykes Date: Mon, 4 Mar 2019 20:47:04 +0000 Subject: [PATCH 336/924] Adds $ExpectsType to each of the tests. --- types/collectionsjs/collectionsjs-tests.ts | 84 +++++++++++----------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/types/collectionsjs/collectionsjs-tests.ts b/types/collectionsjs/collectionsjs-tests.ts index 2b7a3d5fb0..b415502d67 100644 --- a/types/collectionsjs/collectionsjs-tests.ts +++ b/types/collectionsjs/collectionsjs-tests.ts @@ -6,52 +6,52 @@ const collectable = [ { name: 'Jon Snow', age: 14 } ]; -const collection = new Collection(collectable); - -const item = { 6: 7 }; - -collection.add(item); -collection.all(); -collection.average('age'); -collection.chunk(2).all(); -collection.collect(collectable); - const characters = [ { name: 'Ned Stark', age: 40}, { name: 'Catelyn Stark', age: 35} ]; +const item = { 6: 7 }; + const array = ['a', 'b', 'c']; -collection.concat(characters); -collection.contains(stark => stark.name === 'John Snow'); -collection.count(); -collection.each(t => t = 3); -collection.filter(stark => stark.age === 14); -collection.find('bran'); -collection.first(item => item.age > 7); -collection.flatten(true); -collection.get(2); -collection.has({ name: 'Bran Stark', age: 7 }); -collection.join(); -collection.keys(); -collection.last(); -collection.map(stark => stark.name); -collection.pluck('name'); -collection.push({name: 'Robb Stark', age: 17}); -collection.reduce((previous, current) => previous + current, 0); -collection.reject(stark => stark.age < 14); -collection.remove({name: 'Robb Stark', age: 17}); -collection.skip(2); -collection.slice(1, 3); -collection.sort(); -collection.sortBy('name'); -collection.stringify(); -collection.sum('age'); -collection.take(2); -collection.macro('addToMembers', (collection, n) => collection.map((collectionItem: any) => collectionItem + n)); -collection.unique(s => s.grade); -collection.values(); -collection.where('age', 14); -collection.where(stark => stark.age === 14); -collection.zip(array); +const collection = new Collection(collectable); // $ExpectType Collection + +collection.add(item); // $ExpectType Collection +collection.all(); // $ExpectType Collection +collection.average('age'); // $ExpectType number +collection.chunk(2).all(); // $ExpectType Collection +collection.collect(collectable); // $ExpectType Collection +collection.concat(characters); // $ExpectType Collection +collection.contains(stark => stark.name === 'John Snow'); // $ExpectType boolean +collection.count(); // $ExpectType number +collection.each(t => t = 3); // $ExpectType Collection +collection.filter(stark => stark.age === 14); // $ExpectType Collection +collection.find('bran'); // $ExpectType number +collection.first(item => item.age > 7); // $ExpectType any +collection.flatten(true); // $ExpectType Collection +collection.get(2); // $ExpectType any +collection.has({ name: 'Bran Stark', age: 7 }); // $ExpectType boolean +collection.join(); // $ExpectType string +collection.keys(); // $ExpectType Collection +collection.last(); // $ExpectType any +collection.map(stark => stark.name); // $ExpectType Collection +collection.pluck('name'); // $ExpectType Collection +collection.push({name: 'Robb Stark', age: 17}); // $ExpectType Collection +collection.reduce((previous, current) => previous + current, 0); // $ExpectType any +collection.reject(stark => stark.age < 14); // $ExpectType Collection +collection.remove({name: 'Robb Stark', age: 17}); // $ExpectType boolean +collection.reverse(); // $ExpectType Collection +collection.skip(2); // $ExpectType Collection +collection.slice(1, 3); // $ExpectType Collection +collection.sort(); // $ExpectType Collection +collection.sortBy('name'); // $ExpectType Collection +collection.stringify(); // $ExpectType string +collection.sum('age'); // $ExpectType any +collection.take(2); // $ExpectType Collection +collection.macro('addToMembers', (collection, n) => collection.map((collectionItem: any) => collectionItem + n)); // $ExpectType any +collection.unique(s => s.grade); // $ExpectType Collection +collection.values(); // $ExpectType Collection +collection.where('age', 14); // $ExpectType Collection +collection.where(stark => stark.age === 14); // $ExpectType Collection +collection.zip(array); // $ExpectType Collection From 83d99d609d2afad13a89677c3336be39222d2d6a Mon Sep 17 00:00:00 2001 From: fhelwanger Date: Mon, 4 Mar 2019 17:49:48 -0300 Subject: [PATCH 337/924] [expo] Add Localization --- types/expo/expo-tests.tsx | 23 +++++++++++++++++++++++ types/expo/index.d.ts | 23 +++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/types/expo/expo-tests.tsx b/types/expo/expo-tests.tsx index f2ce8d8197..132290f576 100644 --- a/types/expo/expo-tests.tsx +++ b/types/expo/expo-tests.tsx @@ -37,6 +37,7 @@ import { LinearGradient, Linking, Location, + Localization, MailComposer, MapEvent, MapStyleElement, @@ -1094,6 +1095,28 @@ async () => { }; // #endregion +// #region Localization + +let locale: string = Localization.locale; +let locales: string[] = Localization.locales; +let country: string | undefined = Localization.country; +let isoCurrencyCodes: string[] | undefined = Localization.isoCurrencyCodes; +let timezone: string = Localization.timezone; +let isRTL: boolean = Localization.isRTL; + +async () => { + const localizationData = await Localization.getLocalizationAsync(); + + locale = localizationData.locale; + locales = localizationData.locales; + country = localizationData.country; + isoCurrencyCodes = localizationData.isoCurrencyCodes; + timezone = localizationData.timezone; + isRTL = localizationData.isRTL; +}; + +// #endregion + // #region Contacts Contacts.Fields.ID === 'id'; Contacts.Fields.Name === 'name'; diff --git a/types/expo/index.d.ts b/types/expo/index.d.ts index 7e75c1b7d6..777d574eea 100644 --- a/types/expo/index.d.ts +++ b/types/expo/index.d.ts @@ -2244,6 +2244,29 @@ export namespace Location { function setApiKey(key: string): void; } +/** + * Localization + */ +export namespace Localization { + const locale: string; + const locales: string[]; + const country: string | undefined; + const isoCurrencyCodes: string[] | undefined; + const timezone: string; + const isRTL: boolean; + + interface LocalizationData { + locale: string; + locales: string[]; + country?: string; + isoCurrencyCodes?: string[]; + timezone: string; + isRTL: boolean; + } + + function getLocalizationAsync(): Promise; +} + /** * Magnetometer */ From 3fe737230e2888fa765b59ec9ffd9eff98e336c6 Mon Sep 17 00:00:00 2001 From: Alex Jerabek Date: Mon, 4 Mar 2019 13:44:58 -0800 Subject: [PATCH 338/924] Fixing typo in OfficeTheme.controlForegroundColor --- types/office-js-preview/index.d.ts | 2 +- types/office-js/index.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/office-js-preview/index.d.ts b/types/office-js-preview/index.d.ts index 3a0f28b574..f6fddea95b 100644 --- a/types/office-js-preview/index.d.ts +++ b/types/office-js-preview/index.d.ts @@ -1633,7 +1633,7 @@ declare namespace Office { */ controlBackgroundColor: string; /** - * Gets the Office theme body control color as a hexadecimal color triplet (e.g. "FFA500"). + * Gets the Office theme control foreground color as a hexadecimal color triplet (e.g. "FFA500"). */ controlForegroundColor: string; } diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index 21017ce4be..97c4525703 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -1633,7 +1633,7 @@ declare namespace Office { */ controlBackgroundColor: string; /** - * Gets the Office theme body control color as a hexadecimal color triplet (e.g. "FFA500"). + * Gets the Office theme control foreground color as a hexadecimal color triplet (e.g. "FFA500"). */ controlForegroundColor: string; } From fcfcae44fab848bb9cbbe62b5178a9dc28a4969d Mon Sep 17 00:00:00 2001 From: Chives Date: Mon, 4 Mar 2019 13:48:04 -0800 Subject: [PATCH 339/924] Add type definitions for ResizeObserver API --- types/resize-observer-browser/index.d.ts | 19 +++++++++++++++ .../resize-observer-browser-tests.ts | 13 ++++++++++ types/resize-observer-browser/tsconfig.json | 24 +++++++++++++++++++ types/resize-observer-browser/tslint.json | 1 + 4 files changed, 57 insertions(+) create mode 100644 types/resize-observer-browser/index.d.ts create mode 100644 types/resize-observer-browser/resize-observer-browser-tests.ts create mode 100644 types/resize-observer-browser/tsconfig.json create mode 100644 types/resize-observer-browser/tslint.json diff --git a/types/resize-observer-browser/index.d.ts b/types/resize-observer-browser/index.d.ts new file mode 100644 index 0000000000..83291fe4a0 --- /dev/null +++ b/types/resize-observer-browser/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for non-npm package resize-observer-browser 0.1 +// Project: https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver, https://developers.google.com/web/updates/2016/10/resizeobserver, https://wicg.github.io/ResizeObserver/ +// Definitions by: Chives +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.7 + +export class ResizeObserver { + constructor(callback: ResizeObserverCallback); + disconnect(): void; + observe(target: Element): void; + unobserve(target: Element): void; +} + +export type ResizeObserverCallback = (entries: ResizeObserverEntry[]) => void; + +export interface ResizeObserverEntry { + readonly target: Element; + readonly contentRect: DOMRectReadOnly; +} diff --git a/types/resize-observer-browser/resize-observer-browser-tests.ts b/types/resize-observer-browser/resize-observer-browser-tests.ts new file mode 100644 index 0000000000..5596f13870 --- /dev/null +++ b/types/resize-observer-browser/resize-observer-browser-tests.ts @@ -0,0 +1,13 @@ +import { ResizeObserver } from "resize-observer-browser"; + +function resizeObserverCreates(): void { + const resizeObserver: ResizeObserver = new ResizeObserver((entries) => { + const div = document.getElementById('display-div')!; + const rect = entries[0].contentRect; + div.textContent = `${rect.left} ${rect.right}`; + }); + const div = document.getElementById('resized-div')!; + resizeObserver.observe(div); + resizeObserver.unobserve(div); + resizeObserver.disconnect(); +} diff --git a/types/resize-observer-browser/tsconfig.json b/types/resize-observer-browser/tsconfig.json new file mode 100644 index 0000000000..849758c836 --- /dev/null +++ b/types/resize-observer-browser/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "dom", + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "resize-observer-browser-tests.ts" + ] +} diff --git a/types/resize-observer-browser/tslint.json b/types/resize-observer-browser/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/resize-observer-browser/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From af9058995f6df0e81288249277d69f879360946e Mon Sep 17 00:00:00 2001 From: ExE Boss <3889017+ExE-Boss@users.noreply.github.com> Date: Mon, 4 Mar 2019 23:00:00 +0100 Subject: [PATCH 340/924] =?UTF-8?q?chore(tape=E2=80=91async):=20Require=20?= =?UTF-8?q?TypeScript=C2=A02.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> --- types/tape-async/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/tape-async/index.d.ts b/types/tape-async/index.d.ts index d5b07f37b7..be104ec2b4 100644 --- a/types/tape-async/index.d.ts +++ b/types/tape-async/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/parro-it/tape-async // Definitions by: ExE Boss // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// From 56bcf7fd2418407623b3e95e8320779340bff866 Mon Sep 17 00:00:00 2001 From: Jamie Sykes Date: Mon, 4 Mar 2019 22:01:49 +0000 Subject: [PATCH 341/924] Make use of Generic's and ensure tests are up to date. --- types/collectionsjs/collectionsjs-tests.ts | 65 +++++++++++----------- types/collectionsjs/index.d.ts | 62 ++++++++++----------- 2 files changed, 65 insertions(+), 62 deletions(-) diff --git a/types/collectionsjs/collectionsjs-tests.ts b/types/collectionsjs/collectionsjs-tests.ts index b415502d67..1c3b8a5813 100644 --- a/types/collectionsjs/collectionsjs-tests.ts +++ b/types/collectionsjs/collectionsjs-tests.ts @@ -11,47 +11,50 @@ const characters = [ { name: 'Catelyn Stark', age: 35} ]; -const item = { 6: 7 }; +const item = { name: 'Sansa Stark', age: 13 }; -const array = ['a', 'b', 'c']; +const array = [ + { name: 'Robert Baratheon', age: 40 }, + { name: 'Joffrey Baratheon', age: 13 } +]; -const collection = new Collection(collectable); // $ExpectType Collection +const collection = new Collection(collectable); // $ExpectType Collection<{ name: string; age: number; }> -collection.add(item); // $ExpectType Collection -collection.all(); // $ExpectType Collection +collection.add(item); // $ExpectType Collection<{ name: string; age: number; }> +collection.all(); // $ExpectType Collection<{ name: string; age: number; }> collection.average('age'); // $ExpectType number -collection.chunk(2).all(); // $ExpectType Collection -collection.collect(collectable); // $ExpectType Collection -collection.concat(characters); // $ExpectType Collection +collection.chunk(2).all(); // $ExpectType Collection<{ name: string; age: number; }> +collection.collect(collectable); // $ExpectType Collection<{ name: string; age: number; }> +collection.concat(characters); // $ExpectType Collection<{ name: string; age: number; }> collection.contains(stark => stark.name === 'John Snow'); // $ExpectType boolean collection.count(); // $ExpectType number -collection.each(t => t = 3); // $ExpectType Collection -collection.filter(stark => stark.age === 14); // $ExpectType Collection +collection.each(stark => stark.age = 3); // $ExpectType Collection<{ name: string; age: number; }> +collection.filter(stark => stark.age === 14); // $ExpectType Collection<{ name: string; age: number; }> collection.find('bran'); // $ExpectType number -collection.first(item => item.age > 7); // $ExpectType any -collection.flatten(true); // $ExpectType Collection -collection.get(2); // $ExpectType any +collection.first(item => item.age > 7); // $ExpectType { name: string; age: number; } +collection.flatten(true); // $ExpectType Collection<{ name: string; age: number; }> +collection.get(2); // $ExpectType { name: string; age: number; } collection.has({ name: 'Bran Stark', age: 7 }); // $ExpectType boolean collection.join(); // $ExpectType string -collection.keys(); // $ExpectType Collection -collection.last(); // $ExpectType any -collection.map(stark => stark.name); // $ExpectType Collection -collection.pluck('name'); // $ExpectType Collection -collection.push({name: 'Robb Stark', age: 17}); // $ExpectType Collection -collection.reduce((previous, current) => previous + current, 0); // $ExpectType any -collection.reject(stark => stark.age < 14); // $ExpectType Collection +collection.keys(); // $ExpectType Collection<{ name: string; age: number; }> +collection.last(); // $ExpectType { name: string; age: number; } +collection.map(stark => stark.name); // $ExpectType Collection<{ name: string; age: number; }> +collection.pluck('name'); // $ExpectType Collection<{ name: string; age: number; }> +collection.push({name: 'Robb Stark', age: 17}); // $ExpectType Collection<{ name: string; age: number; }> +collection.reduce((previous, current) => previous.age + current.age, 0); // $ExpectType any +collection.reject(stark => stark.age < 14); // $ExpectType Collection<{ name: string; age: number; }> collection.remove({name: 'Robb Stark', age: 17}); // $ExpectType boolean -collection.reverse(); // $ExpectType Collection -collection.skip(2); // $ExpectType Collection -collection.slice(1, 3); // $ExpectType Collection -collection.sort(); // $ExpectType Collection -collection.sortBy('name'); // $ExpectType Collection +collection.reverse(); // $ExpectType Collection<{ name: string; age: number; }> +collection.skip(2); // $ExpectType Collection<{ name: string; age: number; }> +collection.slice(1, 3); // $ExpectType Collection<{ name: string; age: number; }> +collection.sort(); // $ExpectType Collection<{ name: string; age: number; }> +collection.sortBy('name'); // $ExpectType Collection<{ name: string; age: number; }> collection.stringify(); // $ExpectType string collection.sum('age'); // $ExpectType any -collection.take(2); // $ExpectType Collection +collection.take(2); // $ExpectType Collection<{ name: string; age: number; }> collection.macro('addToMembers', (collection, n) => collection.map((collectionItem: any) => collectionItem + n)); // $ExpectType any -collection.unique(s => s.grade); // $ExpectType Collection -collection.values(); // $ExpectType Collection -collection.where('age', 14); // $ExpectType Collection -collection.where(stark => stark.age === 14); // $ExpectType Collection -collection.zip(array); // $ExpectType Collection +collection.unique(stark => stark.age); // $ExpectType Collection<{ name: string; age: number; }> +collection.values(); // $ExpectType Collection<{ name: string; age: number; }> +collection.where('age', 14); // $ExpectType Collection<{ name: string; age: number; }> +collection.where(stark => stark.age === 14); // $ExpectType Collection<{ name: string; age: number; }> +collection.zip(array); // $ExpectType Collection<{ name: string; age: number; }> diff --git a/types/collectionsjs/index.d.ts b/types/collectionsjs/index.d.ts index 9252953ea3..40c616fcdb 100644 --- a/types/collectionsjs/index.d.ts +++ b/types/collectionsjs/index.d.ts @@ -4,43 +4,43 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 3.1 -export default class Collection { - constructor(items?: any); - add(item: any): Collection; - all(): Collection; +export default class Collection { + constructor(items?: T[]); + add(item: T): Collection; + all(): Collection; average(property?: string | ((property?: number) => number)): number; - chunk(size: number): Collection; - collect(collectable: any[]|string): Collection; - concat(collection: any[]|Collection): Collection; - contains(closure: ((item: any) => boolean)): boolean; + chunk(size: number): Collection; + collect(collectable: T[]): Collection; + concat(collection: T[]|Collection): Collection; + contains(closure: ((item: T) => boolean)): boolean; count(): number; - each(callback: (item: any) => void): Collection; - filter(callback: (item: any) => any): Collection; + each(callback: (item: T) => void): Collection; + filter(callback: (item: T) => boolean): Collection; find(item: any): number; - first(callback?: ((item: any) => any)|null): any; - flatten(deep?: boolean): Collection; - get(index: number): any; - has(item: any): boolean; + first(callback?: ((item: T) => boolean)|null): T; + flatten(deep?: boolean): Collection; + get(index: number): T; + has(item: T): boolean; join(separator?: string): string; - keys(): Collection; - last(callback?: ((item: any) => any)|null): any; - map(callback: (item: any) => any): Collection; - pluck(property: string): Collection; - push(item: any): Collection; - reduce(callback: (previous: any, current: any) => any, initial: any): any; - reject(callback: (item: any) => any): Collection; + keys(): Collection; + last(callback?: ((item: T) => boolean)|null): T; + map(callback: (item: T) => any): Collection; + pluck(property: string): Collection; + push(item: T): Collection; + reduce(callback: (previous: T, current: T) => any, initial: any): any; + reject(callback: (item: T) => boolean): Collection; remove(item: any): boolean; - reverse(): Collection; - skip(count: number): Collection; - slice(start: number, end?: number): Collection; - sort(compare?: () => any): Collection; - sortBy(property: string, order?: string): Collection; + reverse(): Collection; + skip(count: number): Collection; + slice(start: number, end?: number): Collection; + sort(compare?: () => boolean): Collection; + sortBy(property: string, order?: string): Collection; stringify(): string; sum(property?: string|null): any; - take(count: number): Collection; + take(count: number): Collection; macro(name: string, callback: (...args: any) => any): any; - unique(callback?: string|null|((item: any) => any)): Collection; - values(): Collection; - where(callback: ((item: any) => any)|string, value?: any): Collection; - zip(array: any[]|Collection): Collection; + unique(callback?: string|null|((item: T) => any)): Collection; + values(): Collection; + where(callback: ((item: T) => boolean)|string, value?: any): Collection; + zip(array: T[]|Collection): Collection; } From f89faea7bbf9af23606fb837c8f8473410119c1b Mon Sep 17 00:00:00 2001 From: Evgeni Zharkov Date: Tue, 5 Mar 2019 01:40:06 +0300 Subject: [PATCH 342/924] Fix to 0a5d7232d49: change default export --- types/tarantool-driver/index.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/tarantool-driver/index.d.ts b/types/tarantool-driver/index.d.ts index 63b34cb6fa..e8d8e01be3 100644 --- a/types/tarantool-driver/index.d.ts +++ b/types/tarantool-driver/index.d.ts @@ -17,7 +17,7 @@ export interface TarantoolOptions { lazyConnect?: boolean; } -export default class TarantoolConnection extends EventEmitter { +declare class TarantoolConnection extends EventEmitter { constructor(options: TarantoolOptions); /* Connection */ @@ -56,3 +56,5 @@ export default class TarantoolConnection extends EventEmitter { replace(spaceId: number | string, tuple: any[]): Promise; } + +export = TarantoolConnection; From 3d3fee9d5ceabbeaa664fa2e3af2fe4eee5c6775 Mon Sep 17 00:00:00 2001 From: Evgeni Zharkov Date: Tue, 5 Mar 2019 02:01:22 +0300 Subject: [PATCH 343/924] Fix to f89faea: wrap exports into namespace + Changed key in select() method to any[] --- types/tarantool-driver/index.d.ts | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/types/tarantool-driver/index.d.ts b/types/tarantool-driver/index.d.ts index e8d8e01be3..08a5aa4b3f 100644 --- a/types/tarantool-driver/index.d.ts +++ b/types/tarantool-driver/index.d.ts @@ -5,20 +5,22 @@ import { EventEmitter } from "events"; -export interface TarantoolOptions { - host?: string; - port?: number; - username?: string; - password?: string; - reserveHosts?: string[]; - beforeReserve?: number; - timeout?: number; - retryStrategy?: (times: number) => number; - lazyConnect?: boolean; +declare namespace TarantoolConnection { + export interface TarantoolOptions { + host?: string; + port?: number; + username?: string; + password?: string; + reserveHosts?: string[]; + beforeReserve?: number; + timeout?: number; + retryStrategy?: (times: number) => number; + lazyConnect?: boolean; + } } declare class TarantoolConnection extends EventEmitter { - constructor(options: TarantoolOptions); + constructor(options: TarantoolConnection.TarantoolOptions); /* Connection */ @@ -35,7 +37,7 @@ declare class TarantoolConnection extends EventEmitter { select(spaceId: number | string, indexId: number | string, limit: number, offset: number, - iterator: string, key: string | string[]): Promise; + iterator: string, key: any[]): Promise; delete(spaceId: number | string, indexId: number | string, From bb1d194eaec37289f4474bb25cab14a3a8c79b92 Mon Sep 17 00:00:00 2001 From: Dan Chao Date: Fri, 2 Nov 2018 12:16:46 -0700 Subject: [PATCH 344/924] add typings for cassanknex --- types/cassanknex/cassanknex-tests.ts | 74 ++++++++++ types/cassanknex/index.d.ts | 204 +++++++++++++++++++++++++++ types/cassanknex/tsconfig.json | 24 ++++ types/cassanknex/tslint.json | 14 ++ 4 files changed, 316 insertions(+) create mode 100644 types/cassanknex/cassanknex-tests.ts create mode 100644 types/cassanknex/index.d.ts create mode 100644 types/cassanknex/tsconfig.json create mode 100644 types/cassanknex/tslint.json diff --git a/types/cassanknex/cassanknex-tests.ts b/types/cassanknex/cassanknex-tests.ts new file mode 100644 index 0000000000..45e4ba3261 --- /dev/null +++ b/types/cassanknex/cassanknex-tests.ts @@ -0,0 +1,74 @@ +import * as cassanknex from "cassanknex"; + +const knex = cassanknex({ + connection: { + contactPoints: ['127.0.0.1'] + } +}); + +knex.on('ready', (err) => { +}); + +interface BirdRow { + type: string; + canFly: boolean; +} + +const qb = knex("animals") + .insert({ + type: 'Stork', + canFly: true + }) + .into('birds'); + +qb.exec((err, res) => { +}); + +qb.eachRow((n, row) => { +}, (err) => { +}); + +interface FooRow { + id: string; + foo: string; + bar: number; + baz: string[]; +} + +const query2 = knex("keyspace") + .select("id", "foo", "bar", "baz") + .ttl('foo') + .where("id", "=", "1") + .orWhere("id", "in", ["2", "3"]) + .orWhere("baz", "=", ["bar"]) + .andWhere("foo", "IN", ["baz", "bar"]) + .limit(10) + .from("table"); + +query2.stream({ + readable () { + const row = this.read(); + }, + end () {}, + error () {} +}); + +const values = { + id: "foo", + bar: 13, + baz: ["foo", "bar"] +}; + +const query3 = knex("cassanKnexy") + .insert(values) + .usingTimestamp(250000) + .usingTTL(50000) + .into("columnFamily"); + +const [cql, params] = [query3.cql(), query3.bindings()]; + +const query4 = knex("cassanKnexy") + .update("columnFamily") + .add("bar", { foo: "baz" }) // "bar" is a map + .remove("foo", ["bar"]) // "foo" is a set + .where("id", "=", 1); diff --git a/types/cassanknex/index.d.ts b/types/cassanknex/index.d.ts new file mode 100644 index 0000000000..5f5dc72b8c --- /dev/null +++ b/types/cassanknex/index.d.ts @@ -0,0 +1,204 @@ +// Type definitions for cassanknex 1.19 +// Project: https://github.com/azuqua/cassanknex +// Definitions by: Daniel Chao +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +/// + +import { EventEmitter } from "events"; +import { Client, ClientOptions, types, ResultCallback } from "cassandra-driver"; +import * as Long from "long"; +import { Readable } from "stream"; + +declare function CassanKnex (options?: CassanKnex.DriverOptions): CassanKnex.CassanKnex; + +export = CassanKnex; + +/** + * Will return the `never` type if `T[K]` is not a member of `Type`, for all `T[K]`. + */ +type TypeMatchedValue = T[K] extends Type ? This : never; + +type MappedDict = { + [key: string]: B +}; + +type InRestriction = 'in' | 'IN'; + +type ComparisonRestriction = '=' | '<' | '>' | '<=' | '>='; + +declare namespace CassanKnex { + interface DriverOptions { + debug?: boolean; + connection?: Client | ClientOptions; + } + + interface CassanKnex extends EventEmitter { + (keyspace?: string): QueryBuilderRoot; + } + + type SelectAsClause = { + [P in keyof T]: string; + }; + + interface StreamParams { + readable: (this: Readable) => any; + end: (this: Readable) => any; + error: (err: Error) => any; + } + + interface QueryBuilderRoot { + insert (values: Partial | T): InsertQueryBuilder; + select (...columns: Array): SelectQueryBuilder; + select (values: SelectAsClause): SelectQueryBuilder; + update (table: string): UpdateQueryBuilder; + delete (): DeleteQueryBuilder; + alterColumnFamily (columnFamily: string): AlterColumnFamilyQueryBuilder; + createColumnFamily (columnFamily: string): CreateColumnFamilyQueryBuilder; + createColumnFamilyIfNotExists (columnFamily: string): CreateColumnFamilyQueryBuilder; + createIndex (columnFamily: string, indexName: string, column: keyof T): QueryBuilder; + createIndexCustom (columnFamily: string, indexName: string, column: keyof T): QueryBuilder & CreateableIndexBuilder; + createType (typeName: string): CreateTypeQueryBuilder; + createTypeIfNotExists (typeName: string): CreateTypeQueryBuilder; + dropColumnFamily (columnFamily: string): QueryBuilder; + dropColumnFamilyIfExists (columnFamily: string): QueryBuilder; + dropType (): QueryBuilder; + dropTypeIfExists (): QueryBuilder; + truncate (columnFamily: string): QueryBuilder; + alterKeyspace (keyspace: string): KeyspaceQueryBuilder; + createKeyspace (keyspace: string): KeyspaceQueryBuilder; + createKeyspaceIfNotExists (keyspace: string): KeyspaceQueryBuilder; + dropKeyspace (): QueryBuilder; + dropKeyspaceIfExists (): QueryBuilder; + } + + interface QueryBuilder { + cql (): string; + bindings (): any[]; + exec (cb: ResultCallback): undefined; + eachRow (onEachRow: (n: number, row: types.Row) => any, onError: (err: Error) => any): undefined; + stream (params: StreamParams): undefined; + } + + interface FieldValueQueryBuilder { + decimal (columnName: K): TypeMatchedValue; + boolean (columnName: K): TypeMatchedValue; + blob (columnName: K): TypeMatchedValue; + timestamp (columnName: K): TypeMatchedValue; + date (columnName: K): TypeMatchedValue; + inet (columnName: K): TypeMatchedValue; + bigint (columnName: K): TypeMatchedValue; + counter (columnName: K): TypeMatchedValue; + double (columnName: K): TypeMatchedValue; + int (columnName: K): TypeMatchedValue; + float (columnName: K): TypeMatchedValue; + map (columnName: K, a: A, b: B): TypeMatchedValue, this>; + ascii (columnName: K): TypeMatchedValue; + text (columnName: K): TypeMatchedValue; + timeuuid (columnName: K): TypeMatchedValue; + uuid (columnName: K): TypeMatchedValue; + varchar (columnName: K): TypeMatchedValue; + list (columnName: K, typeName: string): TypeMatchedValue; + primary (primaryKey: string): this; + set (columnName: K, a: A): TypeMatchedValue, this>; + } + + interface CreateableColumnFamilyBuilder { + withCaching (): this; + withCompression (): this; + withCompaction (): this; + withClusteringOrderBy (value: K, direction: 'desc' | 'asc'): this; + } + + interface CreateableIndexBuilder { + withOptions (opts: MappedDict): this; + } + + interface KeyspaceableQueryBuilder { + withNetworkTopologyStrategy (strategy: MappedDict): this; + withSimpleStrategy (replicas: number): this; + withDurableWrites (durableWrites: boolean): this; + } + + interface InsertableQueryBuilder { + into (table: string): this; + ifNotExists (): this; + } + + interface TtlableQueryBuilder { + usingTimestamp (timestamp: number): this; + usingTTL (ttl: number): this; + } + + interface WhereableQueryBuilder { + where (lhs: K, comparison: InRestriction, rhs: Array): this; + where (lhs: K, comparison: ComparisonRestriction, rhs: T[K]): this; + orWhere (lhs: K, comparison: InRestriction, rhs: Array): this; + orWhere (lhs: K, comparison: ComparisonRestriction, rhs: T[K]): this; + andWhere (lhs: K, comparison: InRestriction, rhs: Array): this; + andWhere (lhs: K, comparison: ComparisonRestriction, rhs: T[K]): this; + tokenWhere (lhs: K, comparison: InRestriction, rhs: Array): this; + tokenWhere (lhs: K, comparison: ComparisonRestriction, rhs: T[K]): this; + ttl (columnName: K): this; + } + + interface IfableQueryBuilder { + if (lhs: K, comparison: ComparisonRestriction, rhs: T[K] | null): this; + } + + interface LimitableQueryBuilder { + limit (limit: number): this; + limitPerPartition (limit: number): this; + } + + interface FromableQueryBuilder { + from (table: string): this; + } + + interface UpdateableQueryBuilder { + set (key: K, value: T[K]): this; + set (object: Partial): this; + add (key: K, value: { [str: string]: T[K] }): TypeMatchedValue, this>; + add (key: K, value: Array): TypeMatchedValue, this>; + add (object: Partial): this; + remove (key: K, value: Array): this; + remove (object: Partial): this; + increment (column: keyof T, amount: number): this; + increment (object: Partial): this; + decrement (column: keyof T, amount: number): this; + decrement (object: Partial): this; + } + + interface AlterableQueryBuilder { + drop (...columns: K[]): this; + rename (column: K, newColumn: K): this; + alter (column: K, newType: string): this; + } + + type InsertQueryBuilder = QueryBuilder + & InsertableQueryBuilder + & TtlableQueryBuilder; + type SelectQueryBuilder = QueryBuilder + & WhereableQueryBuilder + & LimitableQueryBuilder + & FromableQueryBuilder; + type UpdateQueryBuilder = QueryBuilder + & WhereableQueryBuilder + & UpdateableQueryBuilder + & IfableQueryBuilder + & TtlableQueryBuilder; + type DeleteQueryBuilder = QueryBuilder + & WhereableQueryBuilder + & FromableQueryBuilder; + type CreateColumnFamilyQueryBuilder = QueryBuilder + & FieldValueQueryBuilder + & CreateableColumnFamilyBuilder; + type KeyspaceQueryBuilder = QueryBuilder + & KeyspaceableQueryBuilder; + type CreateTypeQueryBuilder = QueryBuilder + & FieldValueQueryBuilder; + type AlterColumnFamilyQueryBuilder = QueryBuilder + & AlterableQueryBuilder + & FieldValueQueryBuilder; +} diff --git a/types/cassanknex/tsconfig.json b/types/cassanknex/tsconfig.json new file mode 100644 index 0000000000..d77cbaca70 --- /dev/null +++ b/types/cassanknex/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "cassanknex-tests.ts" + ] +} \ No newline at end of file diff --git a/types/cassanknex/tslint.json b/types/cassanknex/tslint.json new file mode 100644 index 0000000000..8bd9293b77 --- /dev/null +++ b/types/cassanknex/tslint.json @@ -0,0 +1,14 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "space-before-function-paren": [true, "always"], + "no-unnecessary-generics": false, + "strict-export-declare-modifiers": false, + "prefer-readonly": false, + "await-promise": false, + "no-for-in-array": false, + "no-void-expression": false, + "expect": false, + "no-declare-current-package": false + } +} \ No newline at end of file From b2d972b0ae8649d0651d8128f935f3de09452bec Mon Sep 17 00:00:00 2001 From: Dan Chao Date: Fri, 2 Nov 2018 13:57:08 -0700 Subject: [PATCH 345/924] expect: true --- types/cassanknex/tslint.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/cassanknex/tslint.json b/types/cassanknex/tslint.json index 8bd9293b77..978a6cf2fc 100644 --- a/types/cassanknex/tslint.json +++ b/types/cassanknex/tslint.json @@ -8,7 +8,7 @@ "await-promise": false, "no-for-in-array": false, "no-void-expression": false, - "expect": false, + "expect": true, "no-declare-current-package": false } } \ No newline at end of file From 08544665c8862d3637605b9390dca5b2bc583187 Mon Sep 17 00:00:00 2001 From: Dan Chao Date: Fri, 2 Nov 2018 13:58:44 -0700 Subject: [PATCH 346/924] fix linting errors --- types/cassanknex/index.d.ts | 102 ++++++++++++++++++------------------ 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/types/cassanknex/index.d.ts b/types/cassanknex/index.d.ts index 5f5dc72b8c..0de4ac8ebc 100644 --- a/types/cassanknex/index.d.ts +++ b/types/cassanknex/index.d.ts @@ -20,9 +20,9 @@ export = CassanKnex; */ type TypeMatchedValue = T[K] extends Type ? This : never; -type MappedDict = { +interface MappedDict { [key: string]: B -}; +} type InRestriction = 'in' | 'IN'; @@ -49,18 +49,18 @@ declare namespace CassanKnex { } interface QueryBuilderRoot { - insert (values: Partial | T): InsertQueryBuilder; - select (...columns: Array): SelectQueryBuilder; - select (values: SelectAsClause): SelectQueryBuilder; - update (table: string): UpdateQueryBuilder; - delete (): DeleteQueryBuilder; - alterColumnFamily (columnFamily: string): AlterColumnFamilyQueryBuilder; - createColumnFamily (columnFamily: string): CreateColumnFamilyQueryBuilder; - createColumnFamilyIfNotExists (columnFamily: string): CreateColumnFamilyQueryBuilder; - createIndex (columnFamily: string, indexName: string, column: keyof T): QueryBuilder; - createIndexCustom (columnFamily: string, indexName: string, column: keyof T): QueryBuilder & CreateableIndexBuilder; - createType (typeName: string): CreateTypeQueryBuilder; - createTypeIfNotExists (typeName: string): CreateTypeQueryBuilder; + insert (values: Partial | T): InsertQueryBuilder; + select (...columns: Array): SelectQueryBuilder; + select (values: SelectAsClause): SelectQueryBuilder; + update (table: string): UpdateQueryBuilder; + delete (): DeleteQueryBuilder; + alterColumnFamily (columnFamily: string): AlterColumnFamilyQueryBuilder; + createColumnFamily (columnFamily: string): CreateColumnFamilyQueryBuilder; + createColumnFamilyIfNotExists (columnFamily: string): CreateColumnFamilyQueryBuilder; + createIndex (columnFamily: string, indexName: string, column: keyof T): QueryBuilder; + createIndexCustom (columnFamily: string, indexName: string, column: keyof T): QueryBuilder & CreateableIndexBuilder; + createType (typeName: string): CreateTypeQueryBuilder; + createTypeIfNotExists (typeName: string): CreateTypeQueryBuilder; dropColumnFamily (columnFamily: string): QueryBuilder; dropColumnFamilyIfExists (columnFamily: string): QueryBuilder; dropType (): QueryBuilder; @@ -82,33 +82,33 @@ declare namespace CassanKnex { } interface FieldValueQueryBuilder { - decimal (columnName: K): TypeMatchedValue; - boolean (columnName: K): TypeMatchedValue; - blob (columnName: K): TypeMatchedValue; - timestamp (columnName: K): TypeMatchedValue; - date (columnName: K): TypeMatchedValue; - inet (columnName: K): TypeMatchedValue; - bigint (columnName: K): TypeMatchedValue; - counter (columnName: K): TypeMatchedValue; - double (columnName: K): TypeMatchedValue; - int (columnName: K): TypeMatchedValue; - float (columnName: K): TypeMatchedValue; - map (columnName: K, a: A, b: B): TypeMatchedValue, this>; - ascii (columnName: K): TypeMatchedValue; - text (columnName: K): TypeMatchedValue; - timeuuid (columnName: K): TypeMatchedValue; - uuid (columnName: K): TypeMatchedValue; - varchar (columnName: K): TypeMatchedValue; - list (columnName: K, typeName: string): TypeMatchedValue; + decimal (columnName: K): TypeMatchedValue; + boolean (columnName: K): TypeMatchedValue; + blob (columnName: K): TypeMatchedValue; + timestamp (columnName: K): TypeMatchedValue; + date (columnName: K): TypeMatchedValue; + inet (columnName: K): TypeMatchedValue; + bigint (columnName: K): TypeMatchedValue; + counter (columnName: K): TypeMatchedValue; + double (columnName: K): TypeMatchedValue; + int (columnName: K): TypeMatchedValue; + float (columnName: K): TypeMatchedValue; + map (columnName: K, a: A, b: B): TypeMatchedValue, this>; + ascii (columnName: K): TypeMatchedValue; + text (columnName: K): TypeMatchedValue; + timeuuid (columnName: K): TypeMatchedValue; + uuid (columnName: K): TypeMatchedValue; + varchar (columnName: K): TypeMatchedValue; + list (columnName: K, typeName: string): TypeMatchedValue; primary (primaryKey: string): this; - set (columnName: K, a: A): TypeMatchedValue, this>; + set (columnName: K, a: A): TypeMatchedValue, this>; } interface CreateableColumnFamilyBuilder { withCaching (): this; withCompression (): this; withCompaction (): this; - withClusteringOrderBy (value: K, direction: 'desc' | 'asc'): this; + withClusteringOrderBy (value: K, direction: 'desc' | 'asc'): this; } interface CreateableIndexBuilder { @@ -132,19 +132,19 @@ declare namespace CassanKnex { } interface WhereableQueryBuilder { - where (lhs: K, comparison: InRestriction, rhs: Array): this; - where (lhs: K, comparison: ComparisonRestriction, rhs: T[K]): this; - orWhere (lhs: K, comparison: InRestriction, rhs: Array): this; - orWhere (lhs: K, comparison: ComparisonRestriction, rhs: T[K]): this; - andWhere (lhs: K, comparison: InRestriction, rhs: Array): this; - andWhere (lhs: K, comparison: ComparisonRestriction, rhs: T[K]): this; - tokenWhere (lhs: K, comparison: InRestriction, rhs: Array): this; - tokenWhere (lhs: K, comparison: ComparisonRestriction, rhs: T[K]): this; - ttl (columnName: K): this; + where (lhs: K, comparison: InRestriction, rhs: Array): this; + where (lhs: K, comparison: ComparisonRestriction, rhs: T[K]): this; + orWhere (lhs: K, comparison: InRestriction, rhs: Array): this; + orWhere (lhs: K, comparison: ComparisonRestriction, rhs: T[K]): this; + andWhere (lhs: K, comparison: InRestriction, rhs: Array): this; + andWhere (lhs: K, comparison: ComparisonRestriction, rhs: T[K]): this; + tokenWhere (lhs: K, comparison: InRestriction, rhs: Array): this; + tokenWhere (lhs: K, comparison: ComparisonRestriction, rhs: T[K]): this; + ttl (columnName: K): this; } interface IfableQueryBuilder { - if (lhs: K, comparison: ComparisonRestriction, rhs: T[K] | null): this; + if (lhs: K, comparison: ComparisonRestriction, rhs: T[K] | null): this; } interface LimitableQueryBuilder { @@ -157,12 +157,12 @@ declare namespace CassanKnex { } interface UpdateableQueryBuilder { - set (key: K, value: T[K]): this; + set (key: K, value: T[K]): this; set (object: Partial): this; - add (key: K, value: { [str: string]: T[K] }): TypeMatchedValue, this>; - add (key: K, value: Array): TypeMatchedValue, this>; + add (key: K, value: { [str: string]: T[K] }): TypeMatchedValue, this>; + add (key: K, value: Array): TypeMatchedValue, this>; add (object: Partial): this; - remove (key: K, value: Array): this; + remove (key: K, value: Array): this; remove (object: Partial): this; increment (column: keyof T, amount: number): this; increment (object: Partial): this; @@ -171,9 +171,9 @@ declare namespace CassanKnex { } interface AlterableQueryBuilder { - drop (...columns: K[]): this; - rename (column: K, newColumn: K): this; - alter (column: K, newType: string): this; + drop (...columns: K[]): this; + rename (column: K, newColumn: K): this; + alter (column: K, newType: string): this; } type InsertQueryBuilder = QueryBuilder From f681ca576b3cbbe8c7785858f542f415e9191344 Mon Sep 17 00:00:00 2001 From: Dan Chao Date: Fri, 2 Nov 2018 14:00:02 -0700 Subject: [PATCH 347/924] semicolon --- types/cassanknex/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/cassanknex/index.d.ts b/types/cassanknex/index.d.ts index 0de4ac8ebc..bd85325b4b 100644 --- a/types/cassanknex/index.d.ts +++ b/types/cassanknex/index.d.ts @@ -21,7 +21,7 @@ export = CassanKnex; type TypeMatchedValue = T[K] extends Type ? This : never; interface MappedDict { - [key: string]: B + [key: string]: B; } type InRestriction = 'in' | 'IN'; From 4ee3aa7569fb9a21baaef713529de9328d4658e3 Mon Sep 17 00:00:00 2001 From: Dan Chao Date: Fri, 2 Nov 2018 14:43:57 -0700 Subject: [PATCH 348/924] move all type aliases to within the namespace --- types/cassanknex/index.d.ts | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/types/cassanknex/index.d.ts b/types/cassanknex/index.d.ts index bd85325b4b..b9b75e92e6 100644 --- a/types/cassanknex/index.d.ts +++ b/types/cassanknex/index.d.ts @@ -15,33 +15,33 @@ declare function CassanKnex (options?: CassanKnex.DriverOptions): CassanKnex.Cas export = CassanKnex; -/** - * Will return the `never` type if `T[K]` is not a member of `Type`, for all `T[K]`. - */ -type TypeMatchedValue = T[K] extends Type ? This : never; - -interface MappedDict { - [key: string]: B; -} - -type InRestriction = 'in' | 'IN'; - -type ComparisonRestriction = '=' | '<' | '>' | '<=' | '>='; - declare namespace CassanKnex { interface DriverOptions { debug?: boolean; connection?: Client | ClientOptions; } + /** + * Will return the `never` type if `T[K]` is not a member of `Type`, for all `T[K]`. + */ + type TypeMatchedValue = T[K] extends Type ? This : never; + + interface MappedDict { + [key: string]: B; + } + + type InRestriction = 'in' | 'IN'; + + type ComparisonRestriction = '=' | '<' | '>' | '<=' | '>='; + + type SelectAsClause = { + [P in keyof T]: string; + }; + interface CassanKnex extends EventEmitter { (keyspace?: string): QueryBuilderRoot; } - type SelectAsClause = { - [P in keyof T]: string; - }; - interface StreamParams { readable: (this: Readable) => any; end: (this: Readable) => any; From 51f148ad836c791c8b947f86a2d366a1d714dfc4 Mon Sep 17 00:00:00 2001 From: Dan Chao Date: Mon, 5 Nov 2018 17:37:33 -0800 Subject: [PATCH 349/924] use import = require syntax per PR feedback --- types/cassanknex/cassanknex-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/cassanknex/cassanknex-tests.ts b/types/cassanknex/cassanknex-tests.ts index 45e4ba3261..550fe141aa 100644 --- a/types/cassanknex/cassanknex-tests.ts +++ b/types/cassanknex/cassanknex-tests.ts @@ -1,4 +1,4 @@ -import * as cassanknex from "cassanknex"; +import cassanknex = require('cassanknex'); const knex = cassanknex({ connection: { From 4ec7a6b59bf208fa631398ef5f7cb9924a3740e4 Mon Sep 17 00:00:00 2001 From: Dan Chao Date: Sun, 2 Dec 2018 13:04:25 -0800 Subject: [PATCH 350/924] re-emable most dts-lint errors --- types/cassanknex/index.d.ts | 176 +++++++++++++++++------------------ types/cassanknex/tslint.json | 15 +-- 2 files changed, 92 insertions(+), 99 deletions(-) diff --git a/types/cassanknex/index.d.ts b/types/cassanknex/index.d.ts index b9b75e92e6..fd7f9c53f4 100644 --- a/types/cassanknex/index.d.ts +++ b/types/cassanknex/index.d.ts @@ -11,7 +11,7 @@ import { Client, ClientOptions, types, ResultCallback } from "cassandra-driver"; import * as Long from "long"; import { Readable } from "stream"; -declare function CassanKnex (options?: CassanKnex.DriverOptions): CassanKnex.CassanKnex; +declare function CassanKnex(options?: CassanKnex.DriverOptions): CassanKnex.CassanKnex; export = CassanKnex; @@ -49,134 +49,134 @@ declare namespace CassanKnex { } interface QueryBuilderRoot { - insert (values: Partial | T): InsertQueryBuilder; - select (...columns: Array): SelectQueryBuilder; - select (values: SelectAsClause): SelectQueryBuilder; - update (table: string): UpdateQueryBuilder; - delete (): DeleteQueryBuilder; - alterColumnFamily (columnFamily: string): AlterColumnFamilyQueryBuilder; - createColumnFamily (columnFamily: string): CreateColumnFamilyQueryBuilder; - createColumnFamilyIfNotExists (columnFamily: string): CreateColumnFamilyQueryBuilder; - createIndex (columnFamily: string, indexName: string, column: keyof T): QueryBuilder; - createIndexCustom (columnFamily: string, indexName: string, column: keyof T): QueryBuilder & CreateableIndexBuilder; - createType (typeName: string): CreateTypeQueryBuilder; - createTypeIfNotExists (typeName: string): CreateTypeQueryBuilder; - dropColumnFamily (columnFamily: string): QueryBuilder; - dropColumnFamilyIfExists (columnFamily: string): QueryBuilder; - dropType (): QueryBuilder; - dropTypeIfExists (): QueryBuilder; - truncate (columnFamily: string): QueryBuilder; - alterKeyspace (keyspace: string): KeyspaceQueryBuilder; - createKeyspace (keyspace: string): KeyspaceQueryBuilder; - createKeyspaceIfNotExists (keyspace: string): KeyspaceQueryBuilder; - dropKeyspace (): QueryBuilder; - dropKeyspaceIfExists (): QueryBuilder; + insert (values: Partial | T): InsertQueryBuilder; + select (...columns: Array): SelectQueryBuilder; + select (values: SelectAsClause): SelectQueryBuilder; + update (table: string): UpdateQueryBuilder; + delete (): DeleteQueryBuilder; + alterColumnFamily (columnFamily: string): AlterColumnFamilyQueryBuilder; + createColumnFamily (columnFamily: string): CreateColumnFamilyQueryBuilder; + createColumnFamilyIfNotExists (columnFamily: string): CreateColumnFamilyQueryBuilder; + createIndex (columnFamily: string, indexName: string, column: keyof T): QueryBuilder; + createIndexCustom (columnFamily: string, indexName: string, column: keyof T): QueryBuilder & CreateableIndexBuilder; + createType (typeName: string): CreateTypeQueryBuilder; + createTypeIfNotExists (typeName: string): CreateTypeQueryBuilder; + dropColumnFamily(columnFamily: string): QueryBuilder; + dropColumnFamilyIfExists(columnFamily: string): QueryBuilder; + dropType(): QueryBuilder; + dropTypeIfExists(): QueryBuilder; + truncate(columnFamily: string): QueryBuilder; + alterKeyspace(keyspace: string): KeyspaceQueryBuilder; + createKeyspace(keyspace: string): KeyspaceQueryBuilder; + createKeyspaceIfNotExists(keyspace: string): KeyspaceQueryBuilder; + dropKeyspace(): QueryBuilder; + dropKeyspaceIfExists(): QueryBuilder; } interface QueryBuilder { - cql (): string; - bindings (): any[]; - exec (cb: ResultCallback): undefined; - eachRow (onEachRow: (n: number, row: types.Row) => any, onError: (err: Error) => any): undefined; - stream (params: StreamParams): undefined; + cql(): string; + bindings(): any[]; + exec(cb: ResultCallback): undefined; + eachRow(onEachRow: (n: number, row: types.Row) => any, onError: (err: Error) => any): undefined; + stream(params: StreamParams): undefined; } interface FieldValueQueryBuilder { - decimal (columnName: K): TypeMatchedValue; - boolean (columnName: K): TypeMatchedValue; - blob (columnName: K): TypeMatchedValue; - timestamp (columnName: K): TypeMatchedValue; - date (columnName: K): TypeMatchedValue; - inet (columnName: K): TypeMatchedValue; - bigint (columnName: K): TypeMatchedValue; - counter (columnName: K): TypeMatchedValue; - double (columnName: K): TypeMatchedValue; - int (columnName: K): TypeMatchedValue; - float (columnName: K): TypeMatchedValue; - map (columnName: K, a: A, b: B): TypeMatchedValue, this>; - ascii (columnName: K): TypeMatchedValue; - text (columnName: K): TypeMatchedValue; - timeuuid (columnName: K): TypeMatchedValue; - uuid (columnName: K): TypeMatchedValue; - varchar (columnName: K): TypeMatchedValue; - list (columnName: K, typeName: string): TypeMatchedValue; - primary (primaryKey: string): this; - set (columnName: K, a: A): TypeMatchedValue, this>; + decimal (columnName: K): TypeMatchedValue; + boolean (columnName: K): TypeMatchedValue; + blob (columnName: K): TypeMatchedValue; + timestamp (columnName: K): TypeMatchedValue; + date (columnName: K): TypeMatchedValue; + inet (columnName: K): TypeMatchedValue; + bigint (columnName: K): TypeMatchedValue; + counter (columnName: K): TypeMatchedValue; + double (columnName: K): TypeMatchedValue; + int (columnName: K): TypeMatchedValue; + float (columnName: K): TypeMatchedValue; + map (columnName: K, a: A, b: B): TypeMatchedValue, this>; + ascii (columnName: K): TypeMatchedValue; + text (columnName: K): TypeMatchedValue; + timeuuid (columnName: K): TypeMatchedValue; + uuid (columnName: K): TypeMatchedValue; + varchar (columnName: K): TypeMatchedValue; + list (columnName: K, typeName: string): TypeMatchedValue; + primary(primaryKey: string): this; + set (columnName: K, a: A): TypeMatchedValue, this>; } interface CreateableColumnFamilyBuilder { - withCaching (): this; - withCompression (): this; - withCompaction (): this; - withClusteringOrderBy (value: K, direction: 'desc' | 'asc'): this; + withCaching(): this; + withCompression(): this; + withCompaction(): this; + withClusteringOrderBy (value: K, direction: 'desc' | 'asc'): this; } interface CreateableIndexBuilder { - withOptions (opts: MappedDict): this; + withOptions(opts: MappedDict): this; } interface KeyspaceableQueryBuilder { - withNetworkTopologyStrategy (strategy: MappedDict): this; - withSimpleStrategy (replicas: number): this; - withDurableWrites (durableWrites: boolean): this; + withNetworkTopologyStrategy(strategy: MappedDict): this; + withSimpleStrategy(replicas: number): this; + withDurableWrites(durableWrites: boolean): this; } interface InsertableQueryBuilder { - into (table: string): this; - ifNotExists (): this; + into(table: string): this; + ifNotExists(): this; } interface TtlableQueryBuilder { - usingTimestamp (timestamp: number): this; - usingTTL (ttl: number): this; + usingTimestamp(timestamp: number): this; + usingTTL(ttl: number): this; } interface WhereableQueryBuilder { - where (lhs: K, comparison: InRestriction, rhs: Array): this; - where (lhs: K, comparison: ComparisonRestriction, rhs: T[K]): this; - orWhere (lhs: K, comparison: InRestriction, rhs: Array): this; - orWhere (lhs: K, comparison: ComparisonRestriction, rhs: T[K]): this; - andWhere (lhs: K, comparison: InRestriction, rhs: Array): this; - andWhere (lhs: K, comparison: ComparisonRestriction, rhs: T[K]): this; - tokenWhere (lhs: K, comparison: InRestriction, rhs: Array): this; - tokenWhere (lhs: K, comparison: ComparisonRestriction, rhs: T[K]): this; - ttl (columnName: K): this; + where (lhs: K, comparison: InRestriction, rhs: Array): this; + where (lhs: K, comparison: ComparisonRestriction, rhs: T[K]): this; + orWhere (lhs: K, comparison: InRestriction, rhs: Array): this; + orWhere (lhs: K, comparison: ComparisonRestriction, rhs: T[K]): this; + andWhere (lhs: K, comparison: InRestriction, rhs: Array): this; + andWhere (lhs: K, comparison: ComparisonRestriction, rhs: T[K]): this; + tokenWhere (lhs: K, comparison: InRestriction, rhs: Array): this; + tokenWhere (lhs: K, comparison: ComparisonRestriction, rhs: T[K]): this; + ttl (columnName: K): this; } interface IfableQueryBuilder { - if (lhs: K, comparison: ComparisonRestriction, rhs: T[K] | null): this; + if (lhs: K, comparison: ComparisonRestriction, rhs: T[K] | null): this; } interface LimitableQueryBuilder { - limit (limit: number): this; - limitPerPartition (limit: number): this; + limit(limit: number): this; + limitPerPartition(limit: number): this; } interface FromableQueryBuilder { - from (table: string): this; + from(table: string): this; } interface UpdateableQueryBuilder { - set (key: K, value: T[K]): this; - set (object: Partial): this; - add (key: K, value: { [str: string]: T[K] }): TypeMatchedValue, this>; - add (key: K, value: Array): TypeMatchedValue, this>; - add (object: Partial): this; - remove (key: K, value: Array): this; - remove (object: Partial): this; - increment (column: keyof T, amount: number): this; - increment (object: Partial): this; - decrement (column: keyof T, amount: number): this; - decrement (object: Partial): this; + set (key: K, value: T[K]): this; + set(object: Partial): this; + add (key: K, value: { [str: string]: T[K] }): TypeMatchedValue, this>; + add (key: K, value: Array): TypeMatchedValue, this>; + add(object: Partial): this; + remove (key: K, value: Array): this; + remove(object: Partial): this; + increment(column: keyof T, amount: number): this; + increment(object: Partial): this; + decrement(column: keyof T, amount: number): this; + decrement(object: Partial): this; } interface AlterableQueryBuilder { - drop (...columns: K[]): this; - rename (column: K, newColumn: K): this; - alter (column: K, newType: string): this; + drop (...columns: K[]): this; + rename (column: K, newColumn: K): this; + alter (column: K, newType: string): this; } - type InsertQueryBuilder = QueryBuilder + type InsertQueryBuilder = QueryBuilder & InsertableQueryBuilder & TtlableQueryBuilder; type SelectQueryBuilder = QueryBuilder diff --git a/types/cassanknex/tslint.json b/types/cassanknex/tslint.json index 978a6cf2fc..4074d3cece 100644 --- a/types/cassanknex/tslint.json +++ b/types/cassanknex/tslint.json @@ -1,14 +1,7 @@ { "extends": "dtslint/dt.json", - "rules": { - "space-before-function-paren": [true, "always"], - "no-unnecessary-generics": false, - "strict-export-declare-modifiers": false, - "prefer-readonly": false, - "await-promise": false, - "no-for-in-array": false, - "no-void-expression": false, - "expect": true, - "no-declare-current-package": false - } + "rules": { + "no-unnecessary-generics": false, + "strict-export-declare-modifiers": false + } } \ No newline at end of file From 9a5fd17efc249b0085813aad11c5589e03425ab9 Mon Sep 17 00:00:00 2001 From: Dan Chao Date: Sun, 2 Dec 2018 13:10:33 -0800 Subject: [PATCH 351/924] fix more linting errors --- types/cassanknex/cassanknex-tests.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/cassanknex/cassanknex-tests.ts b/types/cassanknex/cassanknex-tests.ts index 550fe141aa..b874d2a784 100644 --- a/types/cassanknex/cassanknex-tests.ts +++ b/types/cassanknex/cassanknex-tests.ts @@ -46,11 +46,11 @@ const query2 = knex("keyspace") .from("table"); query2.stream({ - readable () { + readable() { const row = this.read(); }, - end () {}, - error () {} + end() {}, + error() {} }); const values = { From 9d645ea67fcbaf3b9af8799963cd84e46c2a1235 Mon Sep 17 00:00:00 2001 From: Evgeni Zharkov Date: Tue, 5 Mar 2019 02:17:57 +0300 Subject: [PATCH 352/924] Fix to 3d3fee9: redundant export / resolve default export problem --- types/tarantool-driver/index.d.ts | 22 +++++++++---------- .../tarantool-driver-tests.ts | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/types/tarantool-driver/index.d.ts b/types/tarantool-driver/index.d.ts index 08a5aa4b3f..25d0e04a09 100644 --- a/types/tarantool-driver/index.d.ts +++ b/types/tarantool-driver/index.d.ts @@ -6,17 +6,17 @@ import { EventEmitter } from "events"; declare namespace TarantoolConnection { - export interface TarantoolOptions { - host?: string; - port?: number; - username?: string; - password?: string; - reserveHosts?: string[]; - beforeReserve?: number; - timeout?: number; - retryStrategy?: (times: number) => number; - lazyConnect?: boolean; - } + interface TarantoolOptions { + host?: string; + port?: number; + username?: string; + password?: string; + reserveHosts?: string[]; + beforeReserve?: number; + timeout?: number; + retryStrategy?: (times: number) => number; + lazyConnect?: boolean; + } } declare class TarantoolConnection extends EventEmitter { diff --git a/types/tarantool-driver/tarantool-driver-tests.ts b/types/tarantool-driver/tarantool-driver-tests.ts index cf27d123fb..e7fe424afb 100644 --- a/types/tarantool-driver/tarantool-driver-tests.ts +++ b/types/tarantool-driver/tarantool-driver-tests.ts @@ -1,3 +1,3 @@ -import TarantoolDriver from "tarantool-driver"; +import TarantoolDriver = require("tarantool-driver"); new TarantoolDriver({}).connect(); // $ExpectedType Promise From efb1b38208f1e711616035b7350c4e86586d1cc6 Mon Sep 17 00:00:00 2001 From: "Adam A. Zerella" Date: Tue, 5 Mar 2019 12:05:41 +1100 Subject: [PATCH 353/924] Updated export default to export --- types/humanize-ms/humanize-ms-tests.ts | 2 +- types/humanize-ms/index.d.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/types/humanize-ms/humanize-ms-tests.ts b/types/humanize-ms/humanize-ms-tests.ts index 80b675429a..bd329751f3 100644 --- a/types/humanize-ms/humanize-ms-tests.ts +++ b/types/humanize-ms/humanize-ms-tests.ts @@ -1,4 +1,4 @@ -import HumanizeMs from "humanize-ms"; +import HumanizeMs = require("humanize-ms"); HumanizeMs('1s'); diff --git a/types/humanize-ms/index.d.ts b/types/humanize-ms/index.d.ts index ea7e65bc80..40462c5782 100644 --- a/types/humanize-ms/index.d.ts +++ b/types/humanize-ms/index.d.ts @@ -3,4 +3,6 @@ // Definitions by: Adam Zerella // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -export default function(input: string|number): number; +declare function HumanizeMS(input: string|number): number; + +export = HumanizeMS; From 0edcd42252db8dd2350a5d73351e503f61d3ebcd Mon Sep 17 00:00:00 2001 From: taoqf Date: Tue, 5 Mar 2019 10:15:47 +0800 Subject: [PATCH 354/924] fix: tslint --- types/dv/dv-tests.ts | 10 +- types/dv/index.d.ts | 219 ++++++++++++++++++++++++------------------- types/dv/tslint.json | 7 +- 3 files changed, 136 insertions(+), 100 deletions(-) diff --git a/types/dv/dv-tests.ts b/types/dv/dv-tests.ts index f49a7ef683..4dd9f0e88e 100644 --- a/types/dv/dv-tests.ts +++ b/types/dv/dv-tests.ts @@ -10,9 +10,9 @@ const open = barcodes.thin('bg', 8, 5).dilate(3, 3); const openMap = open.distanceFunction(8); const openMask = openMap.threshold(10).erode(22, 22); const boxes = openMask.invert().connectedComponents(8); -for (const i in boxes) { +boxes.forEach((box) => { const boxImage = barcodes.crop( - boxes[i].x, boxes[i].y, - boxes[i].width, boxes[i].height); - // Do something useful with our image. -} + // Do something useful with our image. + box.x, box.y, + box.width, box.height); +}); diff --git a/types/dv/index.d.ts b/types/dv/index.d.ts index 6aec428e5e..5a0447966a 100644 --- a/types/dv/index.d.ts +++ b/types/dv/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/creatale/node-dv // Definitions by: taoqf // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.0 /// @@ -23,7 +24,6 @@ export interface Segment { error: number; } - export interface Skew { angle: number; confidence: number; @@ -55,242 +55,268 @@ export class Image { constructor(type: 'png' | 'jpg', buffer: Buffer); constructor(type: 'rgba' | 'rgb' | 'gray', buffer: Buffer, width: number, height: number); - public readonly width: number; - public readonly height: number; + readonly width: number; + readonly height: number; /** * The depth of the image in bits per pixel, i.e. one of 32 (color), 8 (grayscale) or 1 (monochrome). */ - public readonly depth: number; + readonly depth: number; /** * Returns the (boolean) inverse of this image. */ - public invert(): Image; + invert(): Image; /** * Returns the (boolean) union of two images with equal depth, aligning them to the upper left corner. */ - public or(otherImage: Image): Image; + or(otherImage: Image): Image; /** * Returns the (boolean) difference of two images with equal depth, aligning them to the upper left corner. */ - public and(otherImage: Image): Image; + and(otherImage: Image): Image; /** * Returns the (boolean) exclusive disjunction of two images with equal depth, aligning them to the upper left corner. */ - public xor(otherImage: Image): Image; + xor(otherImage: Image): Image; /** * If the images are monochrome, dispatches to Leptonica's pixOr. Otherwise, returns the channelwise addition of b to a, clipped at 255. */ - public add(otherImage: Image): Image; - /** If the images are monochrome, dispatches to Leptonica's pixSubtract and is equivalent to a.and(b.invert()). For grayscale images, returns the pixelwise subtraction of b from a, clipped at zero. For color, the entire RGB value is subtracted instead of doing channelwise subtraction (ask Leptonica why). + add(otherImage: Image): Image; + + /** + * If the images are monochrome, dispatches to Leptonica's pixSubtract and is equivalent to a.and(b.invert()). + * For grayscale images, returns the pixelwise subtraction of b from a, clipped at zero. + * For color, the entire RGB value is subtracted instead of doing channelwise subtraction (ask Leptonica why). * @example: * redness = colorImage.toGray(1, 0, 0).subtract(colorImage.toGray(0, 0.5, 0.5)) */ - public subtract(otherImage: Image): Image; + subtract(otherImage: Image): Image; /** * Applies a convoltuion kernel with the specified dimensions. Image convolution is an operation where each destination pixel is computed based on a weighted sum of a set of nearby source pixels. */ - public convolve(halfWidth: number, halfHeight: number): Image; + convolve(halfWidth: number, halfHeight: number): Image; /** - * Unsharp Masking creates an unsharp mask using halfWidth. The fraction determines how much of the edge is added back into image. The resulting image appears clearer, but it is generally less accurate. + * Unsharp Masking creates an unsharp mask using halfWidth. + * The fraction determines how much of the edge is added back into image. + * The resulting image appears clearer, but it is generally less accurate. */ - public unsharp(halfWidth: number, fraction: number): Image; + unsharp(halfWidth: number, fraction: number): Image; /** * Rotates the image around its center by the specified angle in degrees. */ - public rotate(angle: number): Image; + rotate(angle: number): Image; /** * Scales an image proportionally by scale (1.0 = 100%). */ - public scale(scale: number): Image; + scale(scale: number): Image; /** * Scales an image by scaleX and scaleY (1.0 = 100%). */ - public scale(scaleX: number, scaleY: number): Image; + scale(scaleX: number, scaleY: number): Image; /** * Crops an image from this image by the specified rectangle and returns the resulting image. */ - public crop(box: Box): Image; - public crop(x: number, y: number, width: number, height: number): Image; + crop(box: Box): Image; + crop(x: number, y: number, width: number, height: number): Image; /** * Creates a mask by testing if pixels (RGB, HSV, ...) are between lower and upper. Formally speaking: * lower1 ≀ pixel1 ≀ upper1 * ∧ lower2 ≀ pixel2 ≀ upper2 * ∧ lower3 ≀ pixel3 ≀ upper3 */ - public inRange(lower1: number, lower2: number, lower3: number, upper1: number, upper2: number, upper3: number): Image; + inRange(lower1: number, lower2: number, lower3: number, upper1: number, upper2: number, upper3: number): Image; /** * Only available for grayscale images. Returns the histogram in an array of length 256, where each entry represents the fraction (0.0 to 1.0) of that color in the image. * The mask parameter is optional and must be a monochrome image of same width and height; only pixels where mask is 0 will be counted. */ - public histogram(mask?: Image): Image; + histogram(mask?: Image): Image; /** * Computes the horizontal or vertical projection of an 1bpp or 8bpp image. */ - public projection(mode: 'horizontal' | 'vertical'): number[]; + projection(mode: 'horizontal' | 'vertical'): number[]; /** * Sets the specified value to each pixel set in the mask. */ - public setMasked(mask: Image, value: number): Image; + setMasked(mask: Image, value: number): Image; /** * Available for grayscale and color images. Channelwise maps each pixel of image using mapping, which must be an array of length 256 with integer values between 0 and 255. * !!! !!! Note: this function actually changes the image! * The mask parameter is optional and must be a monochrome image of same width and height; only pixels where mask is 0 will be modified. */ - public applyCurve(mapping: number[], mask?: Image): this; + applyCurve(mapping: number[], mask?: Image): this; /** - * Applies a rank (0.0 ... 1.0) filter of the specified width and height (think of it as radius) to this image and returns the result. If you set rank to 0.5 you'll get a Median Filter. Note that this type of filter works best with odd sizes like 3 or 5. + * Applies a rank (0.0 ... 1.0) filter of the specified width + * and height (think of it as radius) to this image + * and returns the result. + * If you set rank to 0.5 you'll get a Median Filter. + * Note that this type of filter works best with odd sizes like 3 or 5. */ - public rankFilter(width: number, height: number, rank: number): Image; + rankFilter(width: number, height: number, rank: number): Image; /** - * Color image quantization using an octree based algorithm. colors must be between 2 and 256. Note that support for the resulting palette image is highly experimental at this point; only toGray() and toBuffer('png') are guaranteed to work. + * Color image quantization using an octree based algorithm. + * colors must be between 2 and 256. + * Note that support for the resulting palette image is highly experimental at this point; + * only toGray() and toBuffer('png') are guaranteed to work. */ - public octreeColorQuant(colors: number): Image; + octreeColorQuant(colors: number): Image; /** - * Color image quantization using median cut algorithm. colors must be between 2 and 256. Note that support for the resulting palette image is highly experimental at this point; only toGray() and toBuffer('png') are guaranteed to work. + * Color image quantization using median cut algorithm. + * colors must be between 2 and 256. + * Note that support for the resulting palette image is highly experimental at this point; + * only toGray() and toBuffer('png') are guaranteed to work. */ - public medianCutQuant(colors: number): Image; + medianCutQuant(colors: number): Image; /** * Converts a grayscale image to monochrome using a global threshold. value must be between 0 and 255. */ - public threshold(value: number): Image; + threshold(value: number): Image; /** * Converts an image to grayscale using default settings. Can be used to convert monochrome images back to grayscale. */ - public toGray(): Image; + toGray(): Image; /** * Converts an RGB image to grayscale using the specified widths for each channel. */ - public toGray(redWeight: number, greenWeight: number, blueWeight: number): Image; + toGray(redWeight: number, greenWeight: number, blueWeight: number): Image; /** - * Converts an RGB image to grayscale by selecting either the 'min' or 'max' channel. This can act as a simple color filter: 'max' maps colored pixels towards white, while 'min' maps colored pixels towards black. + * Converts an RGB image to grayscale by selecting either the 'min' or 'max' channel. + * This can act as a simple color filter: 'max' maps colored pixels towards white, + * while 'min' maps colored pixels towards black. */ - public toGray(selector: 'min' | 'max'): Image; + toGray(selector: 'min' | 'max'): Image; /** * Converts a grayscale image to a color image. */ - public toColor(): Image; + toColor(): Image; /** * Converts from RGB to HSV color space. HSV has the following ranges: * Hue: [0 .. 239] * Saturation: [0 .. 255] * Value: [0 .. 255] */ - public toHSV(): Image; + toHSV(): Image; /** * Converts from HSV to RGB color space. */ - public toRGB(): Image; + toRGB(): Image; /** * Applies an Erode Filter and returns the result. */ - public erode(width: number, height: number): Image; + erode(width: number, height: number): Image; /** * Applies a Dilate Filter and returns the result. */ - public dilate(width: number, height: number): Image; + dilate(width: number, height: number): Image; /** * Applies an Open Filter and returns the result. */ - public open(width: number, height: number): Image; + open(width: number, height: number): Image; /** * Applies a Close Filter and returns the result. */ - public close(width: number, height: number): Image; + close(width: number, height: number): Image; /** * Applies morphological thinning of type (fg or bg) with the specified connectivitiy (4 or 8) and maxIterations (0 to iterate until complete). */ - public thin(type: 'fg' | 'bg', connectivity: number, maxIterations: number): Image; + thin(type: 'fg' | 'bg', connectivity: number, maxIterations: number): Image; /** * Scales an 8bpp image for maximum dynamic range. scale must be either log or linear. */ - public maxDynamicRange(scale: 'log' | 'linear'): Image; + maxDynamicRange(scale: 'log' | 'linear'): Image; /** - * Applies Otsu's Method for computing the threshold of a grayscale image. It computes a threshold for each tile of the specified size and performs the threshold operation, resulting in a binary image for each tile. These are stitched into the final result. - * The smooth size controls the a convolution kernel applied to threshold array (use 0 for no smoothing). The score factor controls the fraction of the max. Otsu score (typically 0.1; use 0.0 for standard Otsu). + * Applies Otsu's Method for computing the threshold of a grayscale image. + * It computes a threshold for each tile of the specified size and performs the threshold operation, + * resulting in a binary image for each tile. These are stitched into the final result. + * The smooth size controls the a convolution kernel applied to threshold array (use 0 for no smoothing). + * The score factor controls the fraction of the max. Otsu score (typically 0.1; use 0.0 for standard Otsu). */ - public otsuAdaptiveThreshold(tileWidth: number, tileHeight: number, smoothWidth: number, smoothHeight: number, scoreFactor: number): Image; + otsuAdaptiveThreshold(tileWidth: number, tileHeight: number, smoothWidth: number, smoothHeight: number, scoreFactor: number): Image; /** * Detects Line Segments with the specified accuracy (3 is a good start). The number of found line segments can be limited using maxLineSegments (0 is unlimited). */ - public lineSegments(accuracy: number, maxLineSegments: number, useWeightedMeanShift: boolean): Segment[]; + lineSegments(accuracy: number, maxLineSegments: number, useWeightedMeanShift: boolean): Segment[]; /** * Only available for monochrome images. Tries to find the skew of this image. The resulting angle is in degree. The confidence is between 0.0 and 1.0. */ - public findSkew(): Skew; + findSkew(): Skew; /** * Only available for monochrome images. Tries to extract connected components (think of flood fill). The connectivity can be specified as 4 or 8 directions. */ - public connectedComponents(connectivity: 4 | 8): Component[]; + connectedComponents(connectivity: 4 | 8): Component[]; /** * The Distance Function works on 1bpp images. It labels each pixel with the largest distance between this and any other pixel in its connected component. The connectivity is either 4 or 8. */ - public distanceFunction(connectivity: 4 | 8): Image; + distanceFunction(connectivity: 4 | 8): Image; /** * !!! Note: this function actually changes the image! * Fills a specified rectangle with white. */ - public clearBox(box: Box): this; - public clearBox(x: number, y: number, width: number, height: number): this; + clearBox(box: Box): this; + clearBox(x: number, y: number, width: number, height: number): this; /** * !!! Note: this function actually changes the image! * Draws a filled rectangle to this image with the specified value. Works for 8bpp and 1bpp images. */ - public fillBox(box: Box, value: number): this; - public fillBox(x: number, y: number, width: number, height: number, value: number): this; + fillBox(box: Box, value: number): this; + fillBox(x: number, y: number, width: number, height: number, value: number): this; /** * !!! Note: this function actually changes the image! * Draws a filled rectangle to this image in the specified color with an optional blending parameter (0.0: transparent; 1.0: no transparency). */ - public fillBox(box: Box, r: number, g: number, b: number, fraction?: number): this; - public fillBox(x: number, y: number, width: number, height: number, r: number, g: number, b: number, fraction?: number): this; + fillBox(box: Box, r: number, g: number, b: number, fraction?: number): this; + fillBox(x: number, y: number, width: number, height: number, r: number, g: number, b: number, fraction?: number): this; /** * !!! Note: this function actually changes the image! * Draws a rectangle to this image with the specified border. The possible pixel manipulating operations are set, clear and flip. */ - public drawBox(box: Box, borderWidth: number, operation: 'set' | 'clear' | 'flip'): this; - public drawBox(x: number, y: number, width: number, height: number, borderWidth: number, operation: 'set' | 'clear' | 'flip'): this; + drawBox(box: Box, borderWidth: number, operation: 'set' | 'clear' | 'flip'): this; + drawBox(x: number, y: number, width: number, height: number, borderWidth: number, operation: 'set' | 'clear' | 'flip'): this; /** * !!! Note: this function actually changes the image! * Draws a rectangle to this image with the specified border in the specified color with an optional blending parameter (0.0: transparent; 1.0: no transparency). */ - public drawBox(box: Box, borderWidth: number, red: number, green: number, blue: number, frac?: number): this; - public drawBox(x: number, y: number, width: number, height: number, borderWidth: number, red: number, green: number, blue: number, frac?: number): this; + drawBox(box: Box, borderWidth: number, red: number, green: number, blue: number, frac?: number): this; + drawBox(x: number, y: number, width: number, height: number, borderWidth: number, red: number, green: number, blue: number, frac?: number): this; /** * !!! Note: this function actually changes the image! * Draws a line between p1 and p2 to this image with the specified line width. The possible pixel manipulating operations are set, clear and flip. */ - public drawLine(p1: Point, p2: Point, width: number, operation: 'set' | 'clear' | 'flip'): this; + drawLine(p1: Point, p2: Point, width: number, operation: 'set' | 'clear' | 'flip'): this; /** * !!! Note: this function actually changes the image! * Draws a line between p1 and p2 to this image with the specified line width in the specified color with an optional blending parameter (0.0: transparent; 1.0: no transparency). */ - public drawLine(p1: Point, p2: Point, width: number, red: number, green: number, blue: number, frac?: number): this; + drawLine(p1: Point, p2: Point, width: number, red: number, green: number, blue: number, frac?: number): this; /** * !!! Note: this function actually changes the image! * Draws an image to this image with the specified destination box. */ - public drawImage(image: Image, box: Box): this; - public drawImage(image: Image, x: number, y: number, width: number, height: number): this; + drawImage(image: Image, box: Box): this; + drawImage(image: Image, x: number, y: number, width: number, height: number): this; /** * Converts the Image in the specified format to a buffer. - * Specifying raw returns the raw image data as buffer. For color images, the result contains three bytes per pixel in the order R, G, B; for grayscale and monochrome images, it contains one byte per pixel. + * Specifying raw returns the raw image data as buffer. + * For color images, the result contains three bytes per pixel in the order R, G, B; + * for grayscale and monochrome images, it contains one byte per pixel. * Specifying png returns a PNG encoded image as buffer. * Specifying jpg returns a JPG encoded image as buffer. */ - public toBuffer(format?: 'raw' | 'png' | 'jpg'): Buffer; + toBuffer(format?: 'raw' | 'png' | 'jpg'): Buffer; } export interface Rect { - // todo + x: number; + y: number; + width: number; + height: number; } export interface Region { box: Box; - text: string, + text: string; confidence: number; } @@ -303,7 +329,7 @@ export interface Textline { export type Word = Region; export interface Choice { - text: string, + text: string; confidence: number; } @@ -314,7 +340,9 @@ export interface Symbol extends Region { export type Text = Choice; /** - * A Tesseract object represents an optical character recognition engine, that reads text using Tesseract from an image. Tesseract supports many langauges and fonts (see Tesseract/Downloads). New language files have to be installed in node-dv/tessdata. + * A Tesseract object represents an optical character recognition engine, that reads text using Tesseract from an image. + * Tesseract supports many langauges and fonts (see Tesseract/Downloads). + * New language files have to be installed in node-dv/tessdata. */ export class Tesseract { /** @@ -325,7 +353,7 @@ export class Tesseract { /** * Creates a Tesseract engine with the specified language. */ - constructor(datapath: string, lang: string); + constructor(lang: string, image: Image); /** * Creates a Tesseract engine with the specified language and image. */ @@ -334,54 +362,57 @@ export class Tesseract { /** * Accessor for the input image. */ - public image: Image; + image: Image; /** * Accessor for the rectangle that specifies a "visible" area on the image. */ - public rectangle: Rect; + rectangle: Rect; /** - * Accessor for the page segmentation mode. Valid values are: osd_only, auto_osd, auto_only, auto, single_column, single_block_vert_text, single_block, single_line, single_word, circle_word, single_char, sparse_text, sparse_text_osd. + * Accessor for the page segmentation mode. */ - public pageSegMode: 'osd_only' | 'auto_osd' | 'auto_only' | 'auto' | 'single_column' | 'single_block_vert_text' | 'single_block' | 'single_line' | 'single_word' | 'circle_word' | 'single_char' | 'sparse_text' | 'sparse_text_osd' + pageSegMode: 'osd_only' | 'auto_osd' | 'auto_only' | 'auto' + | 'single_column' | 'single_block_vert_text' | 'single_block' + | 'single_line' | 'single_word' | 'circle_word' | 'single_char' + | 'sparse_text' | 'sparse_text_osd'; [key: string]: unknown; /** * Clears the tesseract image and its last results. */ - public clear(): void; + clear(): void; /** * Clears all adaptive classifiers (use this when results vary during scanning). */ - public clearAdaptiveClassifier(): void; + clearAdaptiveClassifier(): void; /** * Returns the binarized image Tesseract uses for its recognition. */ - public thresholdImage(): Image; + thresholdImage(): Image; /** * Returns an array of objects, You can omit text information by setting recognize = false, which is considerably faster. */ - public findRegions(recognize: boolean): Region[]; + findRegions(recognize: boolean): Region[]; /** * Returns an array of objects, You can omit text information by setting recognize = false, which is considerably faster. */ - public findParagraphs(recognize: boolean): Paragaph[]; + findParagraphs(recognize: boolean): Paragaph[]; /** * Returns an array of objects, You can omit text information by setting recognize = false, which is considerably faster. */ - public findTextLines(recognize: boolean): Textline[]; + findTextLines(recognize: boolean): Textline[]; /** * Returns an array of objects, You can omit text information by setting recognize = false, which is considerably faster. */ - public findWords(recognize: boolean): Word[]; + findWords(recognize: boolean): Word[]; /** * Returns an array of objects, You can omit text information by setting recognize = false, which is considerably faster. */ - public findSymbols(recognize: boolean): Symbol[]; + findSymbols(recognize: boolean): symbol[]; /** * Returns text in the specified format. Valid formats are: plain, unlv. */ - public findText(format: 'plain' | 'unlv', withConfidence?: boolean): string; - public findText(format: 'hocr' | 'box', pageNumber: number): string; + findText(format: 'plain' | 'unlv', withConfidence?: boolean): string; + findText(format: 'hocr' | 'box', pageNumber: number): string; } export interface Barcodeformat { @@ -414,33 +445,33 @@ export class ZXing { /** * Accessor for the input image this barcode reader operates on. */ - public image: Image; + image: Image; /** * List of barcodes the reader tries to find. It's specified as an object and missing properties account as false */ - public formats: Barcodeformat; + formats: Barcodeformat; /** * If try harder is enabled, the barcode reader spends more time trying to find a barcode (optimize for accuracy, not speed). */ - public tryHarder: boolean; + tryHarder: boolean; /** * Returns the first barcode found as an object with the following format: */ - public findCode(): BarCode; + findCode(): BarCode; /** * enotes the barcodes type. */ - public readonly type: 'None' | 'QR_CODE' | 'DATA_MATRIX' | 'PDF_417' | 'UPC_E' | 'UPC_A' | 'EAN_8' | 'EAN_13' | 'CODE_128' | 'CODE_39' | 'ITF' | 'AZTEC'; + readonly type: 'None' | 'QR_CODE' | 'DATA_MATRIX' | 'PDF_417' | 'UPC_E' | 'UPC_A' | 'EAN_8' | 'EAN_13' | 'CODE_128' | 'CODE_39' | 'ITF' | 'AZTEC'; /** * denotes the stringified data read from the barcode. */ - public readonly data: string; + readonly data: string; /** * denotes the decoded binary data of the barcode before conversion into another character encoding. */ - public readonly buffer: Buffer; + readonly buffer: Buffer; /** * denotes the points in pixels which were used by the barcode reader to detect the barcode. */ - public readonly points: Point[]; + readonly points: Point[]; } diff --git a/types/dv/tslint.json b/types/dv/tslint.json index 3db14f85ea..8765f2428f 100644 --- a/types/dv/tslint.json +++ b/types/dv/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + "unified-signatures": false + } +} \ No newline at end of file From 5887c8669381c6c8d8ead32c72d23d147a1b8a10 Mon Sep 17 00:00:00 2001 From: "Adam A. Zerella" Date: Tue, 5 Mar 2019 14:19:18 +1100 Subject: [PATCH 355/924] Updated function default export to function --- types/mumath/clamp.d.ts | 2 +- types/mumath/closest.d.ts | 2 +- types/mumath/index.d.ts | 68 +++++++----------------------------- types/mumath/isMultiple.d.ts | 2 +- types/mumath/len.d.ts | 2 +- types/mumath/lerp.d.ts | 2 +- types/mumath/mod.d.ts | 2 +- types/mumath/mumath-tests.ts | 24 ++++++------- types/mumath/order.d.ts | 2 +- types/mumath/precision.d.ts | 2 +- types/mumath/round.d.ts | 2 +- types/mumath/scale.d.ts | 2 +- types/mumath/within.d.ts | 2 +- 13 files changed, 35 insertions(+), 79 deletions(-) diff --git a/types/mumath/clamp.d.ts b/types/mumath/clamp.d.ts index fe08302e37..9d674a9620 100644 --- a/types/mumath/clamp.d.ts +++ b/types/mumath/clamp.d.ts @@ -3,4 +3,4 @@ */ declare function clamp(value: number, left: number, right: number): number; -export default clamp; +export = clamp; diff --git a/types/mumath/closest.d.ts b/types/mumath/closest.d.ts index f2db4ea1ec..762bcb6548 100644 --- a/types/mumath/closest.d.ts +++ b/types/mumath/closest.d.ts @@ -3,4 +3,4 @@ */ declare function closest(value: number, list: number[]): number; -export default closest; +export = closest; diff --git a/types/mumath/index.d.ts b/types/mumath/index.d.ts index 3dcfccf565..ee0f0ff6c6 100644 --- a/types/mumath/index.d.ts +++ b/types/mumath/index.d.ts @@ -3,60 +3,16 @@ // Definitions by: Adam Zerella // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/** - * Detects proper clamp min/max. - */ -export function clamp(value: number, left: number, right: number): number; +import clamp = require('./clamp'); +import closest = require('./closest'); +import isMultiple = require('./isMultiple'); +import len = require('./len'); +import lerp = require('./lerp'); +import mod = require('./mod'); +import order = require('./order'); +import precision = require('./precision'); +import round = require('./round'); +import scale = require('./scale'); +import within = require('./within'); -/** - * Get closest value out of a set. - */ -export function closest(value: number, list: number[]): number; - -/** - * Check if one number is multiple of other - * Same as a % b === 0, but with precision check. - */ -export function isMultiple(a: number, b: number, eps?: number): boolean; - -/** - * Return quadratic length of a vector. - */ -export function len(a: number, b: number): number; - -/** - * Return value interpolated between x and y. - */ -export function lerp(x: number, y: number, ratio: number): number; - -/** - * An enhanced mod-loop, like fmod — loops value within a frame. - */ -export function mod(value: number, max: number, min?: number): number; - -/** - * Get order of magnitude for a number. - */ -export function order(value: number): number; - -/** - * Get precision from float: - */ -export function precision(value: number): number; - -/** - * Rounds value to optional step. - */ -export function round(value: number, step?: number): number; - -/** - * Get first scale out of a list of basic scales, aligned to the power. E. g. - * step(.37, [1, 2, 5]) → .5 step(456, [1, 2]) → 1000 - * Similar to closest, but takes all possible powers of scales. - */ -export function scale(value: number, list: number[]): number; - -/** - * Whether element is between left & right, including. - */ -export function within(value: number, left: number, right: number): number; +export { clamp, closest, isMultiple, len, lerp, mod, order, precision, round, scale, within }; diff --git a/types/mumath/isMultiple.d.ts b/types/mumath/isMultiple.d.ts index 255d0ece72..31c7a09b08 100644 --- a/types/mumath/isMultiple.d.ts +++ b/types/mumath/isMultiple.d.ts @@ -4,4 +4,4 @@ */ declare function isMultiple(a: number, b: number, eps?: number): boolean; -export default isMultiple; +export = isMultiple; diff --git a/types/mumath/len.d.ts b/types/mumath/len.d.ts index 2392cff32f..b2fae8a8e5 100644 --- a/types/mumath/len.d.ts +++ b/types/mumath/len.d.ts @@ -3,4 +3,4 @@ */ declare function len(a: number, b: number): number; -export default len; +export = len; diff --git a/types/mumath/lerp.d.ts b/types/mumath/lerp.d.ts index 3ab8639c0c..5e09370be2 100644 --- a/types/mumath/lerp.d.ts +++ b/types/mumath/lerp.d.ts @@ -3,4 +3,4 @@ */ declare function lerp(x: number, y: number, ratio: number): number; -export default lerp; +export = lerp; diff --git a/types/mumath/mod.d.ts b/types/mumath/mod.d.ts index 6517271e45..ac1784fe06 100644 --- a/types/mumath/mod.d.ts +++ b/types/mumath/mod.d.ts @@ -3,4 +3,4 @@ */ declare function mod(value: number, max: number, min?: number): number; -export default mod; +export = mod; diff --git a/types/mumath/mumath-tests.ts b/types/mumath/mumath-tests.ts index 5a8fd6476f..a5b339b2fe 100644 --- a/types/mumath/mumath-tests.ts +++ b/types/mumath/mumath-tests.ts @@ -1,16 +1,16 @@ -import * as mumath from "mumath"; +import mumath = require("mumath"); -import mumathClamp from "mumath/clamp"; -import mumathClosest from "mumath/closest"; -import mumathIsMultiple from "mumath/isMultiple"; -import mumathLen from "mumath/len"; -import mumathLerp from "mumath/lerp"; -import mumathMod from "mumath/mod"; -import mumathOrder from "mumath/order"; -import mumathPrecision from "mumath/precision"; -import mumathRound from "mumath/round"; -import mumathScale from "mumath/scale"; -import mumathWithin from "mumath/within"; +import mumathClamp = require("mumath/clamp"); +import mumathClosest = require("mumath/closest"); +import mumathIsMultiple = require("mumath/isMultiple"); +import mumathLen = require("mumath/len"); +import mumathLerp = require("mumath/lerp"); +import mumathMod = require("mumath/mod"); +import mumathOrder = require("mumath/order"); +import mumathPrecision = require("mumath/precision"); +import mumathRound = require("mumath/round"); +import mumathScale = require("mumath/scale"); +import mumathWithin = require("mumath/within"); mumath.clamp(1, 2, 3); mumathClamp(1, 2, 3); diff --git a/types/mumath/order.d.ts b/types/mumath/order.d.ts index 6da624f1d3..8ce4c396fa 100644 --- a/types/mumath/order.d.ts +++ b/types/mumath/order.d.ts @@ -3,4 +3,4 @@ */ declare function order(value: number): number; -export default order; +export = order; diff --git a/types/mumath/precision.d.ts b/types/mumath/precision.d.ts index ec94b3a4ed..1b1a7290cc 100644 --- a/types/mumath/precision.d.ts +++ b/types/mumath/precision.d.ts @@ -3,4 +3,4 @@ */ declare function precision(value: number): number; -export default precision; +export = precision; diff --git a/types/mumath/round.d.ts b/types/mumath/round.d.ts index 09549f14f1..8966dc6068 100644 --- a/types/mumath/round.d.ts +++ b/types/mumath/round.d.ts @@ -3,4 +3,4 @@ */ declare function round(value: number, step?: number): number; -export default round; +export = round; diff --git a/types/mumath/scale.d.ts b/types/mumath/scale.d.ts index 2d5487ea10..2cb97bcb4f 100644 --- a/types/mumath/scale.d.ts +++ b/types/mumath/scale.d.ts @@ -5,4 +5,4 @@ */ declare function scale(value: number, list: number[]): number; -export default scale; +export = scale; diff --git a/types/mumath/within.d.ts b/types/mumath/within.d.ts index 47558c73d0..f1d7e56cbd 100644 --- a/types/mumath/within.d.ts +++ b/types/mumath/within.d.ts @@ -3,4 +3,4 @@ */ declare function within(value: number, left: number, right: number): number; -export default within; +export = within; From ef3a842cf3e62f9a97e886c250a81a89022b0c64 Mon Sep 17 00:00:00 2001 From: qiang Date: Tue, 5 Mar 2019 11:49:55 +0800 Subject: [PATCH 356/924] change tslint rules for types/html5plus --- types/html5plus/html5plus-tests.ts | 4 +- types/html5plus/index.d.ts | 366 ++++++++++++++--------------- types/html5plus/tslint.json | 76 +----- 3 files changed, 185 insertions(+), 261 deletions(-) diff --git a/types/html5plus/html5plus-tests.ts b/types/html5plus/html5plus-tests.ts index 56dd640498..371e463473 100644 --- a/types/html5plus/html5plus-tests.ts +++ b/types/html5plus/html5plus-tests.ts @@ -1,2 +1,2 @@ -const webview = plus.webview.currentWebview() -const style = webview.getStyle() \ No newline at end of file +const webview = plus.webview.currentWebview(); +const style = webview.getStyle(); diff --git a/types/html5plus/index.d.ts b/types/html5plus/index.d.ts index 841a64f6d4..808d31a9e5 100644 --- a/types/html5plus/index.d.ts +++ b/types/html5plus/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for html5plus 1.0.0 +// Type definitions for non-npm package html5plus 1.0 // Project: https://www.html5plus.org/doc/ // Definitions by: Dcloud // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -291,7 +291,7 @@ interface PlusAccelerometer { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/accelerometer.html](http://www.html5plus.org/doc/zh_cn/accelerometer.html) */ - getCurrentAcceleration(successCB?: (result: PlusAccelerometerAcceleration) => void, errorCB?: (result: any) => void): void; + getCurrentAcceleration(successCB?: () => void, errorCB?: () => void): void; /** * ç›‘ćŹèźŸć€‡ćŠ é€ŸćșŠć˜ćŒ–äżĄæŻ * 抠速ćșŠæ˜ŻèźŸć€‡ćœšćœ“ć‰æ–čć‘äžŠæ‰€ćšç›žćŻčèżćŠšć˜ćŒ–ïŒˆćąžă€ć‡é‡ïŒ‰çš„èżćŠšäŒ æ„Ÿć™šă€‚ćŠ é€ŸćșŠäżĄæŻćŒ…æ‹Źx、y、z侉äžȘæ–čć‘çš„äżĄæŻă€‚ @@ -300,7 +300,7 @@ interface PlusAccelerometer { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/accelerometer.html](http://www.html5plus.org/doc/zh_cn/accelerometer.html) */ - watchAcceleration(successCB?: (result: PlusAccelerometerAcceleration) => void, errorCB?: (result: any) => void, options?: PlusAccelerometerAccelerometerOption): number; + watchAcceleration(successCB?: () => void, errorCB?: () => void, options?: PlusAccelerometerAccelerometerOption): number; /** * ć…łé—­ç›‘ćŹèźŸć€‡ćŠ é€ŸćșŠäżĄæŻ * ć…łé—­ç›‘ćŹèźŸć€‡ćŠ é€ŸćșŠäżĄæŻïŒŒćș”ç”šć…łé—­è°ƒç”šwatchAccelerationæ–čæł•çš„ćŒ€ćŻçš„ç›‘ćŹæ“äœœă€‚ @@ -558,7 +558,7 @@ interface PlusAudioAudioRecorder { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) */ - record(option?: PlusAudioRecordOptions, successCB?: (result: string) => void, errorCB?: (result: any) => void): void; + record(option?: PlusAudioRecordOptions, successCB?: () => void, errorCB?: () => void): void; /** * ç»“æŸćœ•éŸłæ“äœœ * ç»“æŸćœ•éŸłæ“äœœïŒŒé€šçŸ„èźŸć€‡ćźŒæˆćœ•éŸłæ“äœœă€‚ćœ•éŸłćźŒæˆćŽć°†è°ƒç”šrecordæ–čæł•äž­äŒ ć…„çš„successCBć›žè°ƒèż”ć›žćœ•éŸłæ–‡ä»¶ă€‚ @@ -580,7 +580,7 @@ interface PlusAudioAudioPlayer { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) */ - play(successCB?: Function, errorCB?: (result: any) => void): void; + play(successCB?: () => void, errorCB?: () => void): void; /** * æš‚ćœæ’­æ”ŸéŸłéą‘ * éœ€ć…ˆè°ƒç”šcreatePlayeræ–čæł•ćˆ›ć»șéŸłéą‘æ’­æ”ŸćŻčè±ĄïŒŒćč¶ćŒ€ć§‹æ’­æ”Ÿă€‚éŸłéą‘æ’­æ”ŸćŻčè±Ąćœšæ’­æ”ŸçŠ¶æ€æ‰èƒœæš‚ćœïŒŒćœšć…¶ćźƒçŠ¶æ€è°ƒç”šæ­€æ–čæł•æ— ä»»äœ•äœœç”šă€‚ @@ -716,14 +716,14 @@ interface PlusBluetooth { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) */ - closeBluetoothAdapter(success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + closeBluetoothAdapter(success?: () => void, fail?: () => void, complete?: () => void): void; /** * èŽ·ć–æœŹæœșè“ç‰™é€‚é…ć™šçŠ¶æ€ * èŽ·ć–æˆćŠŸćŽè§Šć‘optionsć‚æ•°äž­çš„successć›žè°ƒïŒŒć€±èŽ„è§Šć‘optionsć‚æ•°äž­çš„failć›žè°ƒă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) */ - getBluetoothAdapterState(success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + getBluetoothAdapterState(success?: () => void, fail?: () => void, complete?: () => void): void; /** * èŽ·ć–ć·ČæœçŽąćˆ°çš„è“ç‰™èźŸć€‡ * ćŒ…æ‹Źć·Čç»ć’ŒæœŹæœș怄äșŽèżžæŽ„çŠ¶æ€çš„èźŸć€‡ă€‚ @@ -731,35 +731,35 @@ interface PlusBluetooth { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) */ - getBluetoothDevices(success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + getBluetoothDevices(success?: () => void, fail?: () => void, complete?: () => void): void; /** * æ čæźuuidèŽ·ć–ć€„äșŽć·ČèżžæŽ„çš„èźŸć€‡ * èŽ·ć–æˆćŠŸćŽè§Šć‘optionsć‚æ•°äž­çš„successć›žè°ƒïŒŒć€±èŽ„è§Šć‘optionsć‚æ•°äž­çš„failć›žè°ƒă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) */ - getConnectedBluetoothDevices(services?: any [], success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + getConnectedBluetoothDevices(services?: any [], success?: () => void, fail?: () => void, complete?: () => void): void; /** * ç›‘ćŹè“ç‰™é€‚é…ć™šçŠ¶æ€ć˜ćŒ–äș‹ä»¶ * è“ç‰™é€‚é…ć™šçŠ¶æ€ć‘ç”Ÿć˜ćŒ–æ—¶è§Šć‘ć›žè°ƒă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) */ - onBluetoothAdapterStateChange(changeCB?: (result: any) => void): void; + onBluetoothAdapterStateChange(changeCB?: () => void): void; /** * ç›‘ćŹæœçŽąćˆ°æ–°èźŸć€‡çš„äș‹ä»¶ * æœçŽąćˆ°æ–°èźŸć€‡æ—¶è§Šć‘ć›žè°ƒă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) */ - onBluetoothDeviceFound(callback?: (result: any) => void): void; + onBluetoothDeviceFound(callback?: () => void): void; /** * ćˆć§‹ćŒ–è“ç‰™æšĄć— * ćˆć§‹ćŒ–æˆćŠŸćŽè§Šć‘optionsć‚æ•°äž­çš„successć›žè°ƒïŒŒć€±èŽ„è§Šć‘optionsć‚æ•°äž­çš„failć›žè°ƒă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) */ - openBluetoothAdapter(success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + openBluetoothAdapter(success?: () => void, fail?: () => void, complete?: () => void): void; /** * ćŒ€ć§‹æœçŽąé™„èż‘çš„è“ç‰™èźŸć€‡ * æ­€æ“äœœæŻ”èŸƒè€—èŽčçł»ç»Ÿè”„æșïŒŒèŻ·ćœšæœçŽąćč¶èżžæŽ„ćˆ°èźŸć€‡ćŽè°ƒç”šstopBluetoothDevicesDiscoveryæ–čæł•ćœæ­ąæœçŽąă€‚ @@ -767,7 +767,7 @@ interface PlusBluetooth { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) */ - startBluetoothDevicesDiscovery(services?: any [], allowDuplicatesKey?: boolean, interval?: number, success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + startBluetoothDevicesDiscovery(services?: any [], allowDuplicatesKey?: boolean, interval?: number, success?: () => void, fail?: () => void, complete?: () => void): void; /** * ćœæ­ąæœćŻ»é™„èż‘çš„è“ç‰™ć€–ć›ŽèźŸć€‡ * è‹„ć·Čç»æ‰Ÿćˆ°éœ€èŠçš„è“ç‰™èźŸć€‡ćč¶äžéœ€èŠç»§ç»­æœçŽąæ—¶ïŒŒćș”èŻ„è°ƒç”šèŻ„æŽ„ćŁćœæ­ąè“ç‰™æœçŽąă€‚ @@ -775,32 +775,32 @@ interface PlusBluetooth { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) */ - stopBluetoothDevicesDiscovery(success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + stopBluetoothDevicesDiscovery(success?: () => void, fail?: () => void, complete?: () => void): void; /** * æ–­ćŒ€äžŽäœŽćŠŸè€—è“ç‰™èźŸć€‡çš„èżžæŽ„ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) */ - closeBLEConnection(deviceId?: string, success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + closeBLEConnection(deviceId?: string, success?: () => void, fail?: () => void, complete?: () => void): void; /** * èżžæŽ„äœŽćŠŸè€—è“ç‰™èźŸć€‡ * è‹„äč‹ć‰ć·Čæœ‰æœçŽąèż‡æŸäžȘè“ç‰™èźŸć€‡ïŒŒćč¶æˆćŠŸć»șç«‹èżžæŽ„ïŒŒćŻç›ŽæŽ„äŒ ć…„äč‹ć‰æœçŽąèŽ·ć–çš„deviceIdć°èŻ•èżžæŽ„èŻ„èźŸć€‡ïŒŒæ— éœ€èż›èĄŒæœçŽąæ“äœœă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) */ - createBLEConnection(deviceId?: string, timeout?: number, success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + createBLEConnection(deviceId?: string, timeout?: number, success?: () => void, fail?: () => void, complete?: () => void): void; /** * èŽ·ć–è“ç‰™èźŸć€‡æŒ‡ćźšæœćŠĄäž­æ‰€æœ‰ç‰čćŸć€Œ(characteristic) * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) */ - getBLEDeviceCharacteristics(deviceId?: string, serviceId?: string, success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + getBLEDeviceCharacteristics(deviceId?: string, serviceId?: string, success?: () => void, fail?: () => void, complete?: () => void): void; /** * èŽ·ć–è“ç‰™èźŸć€‡çš„æ‰€æœ‰æœćŠĄ(service) * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) */ - getBLEDeviceServices(deviceId?: string, success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + getBLEDeviceServices(deviceId?: string, success?: () => void, fail?: () => void, complete?: () => void): void; /** * ćŻç”šäœŽćŠŸè€—è“ç‰™èźŸć€‡ç‰čćŸć€Œć˜ćŒ–æ—¶çš„notifyćŠŸèƒœïŒŒèźąé˜…ç‰čćŸć€Œ * è“ç‰™èźŸć€‡æœćŠĄçš„ç‰čćŸć€Œćż…éĄ»æ”ŻæŒnotify或indicateæ‰ćŻä»„æˆćŠŸè°ƒç”šă€‚ @@ -808,20 +808,20 @@ interface PlusBluetooth { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) */ - notifyBLECharacteristicValueChange(deviceId?: string, serviceId?: string, characteristicId?: string, state?: boolean, success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + notifyBLECharacteristicValueChange(deviceId?: string, serviceId?: string, characteristicId?: string, state?: boolean, success?: () => void, fail?: () => void, complete?: () => void): void; /** * ç›‘ćŹäœŽćŠŸè€—è“ç‰™èźŸć€‡çš„ç‰čćŸć€Œć˜ćŒ–äș‹ä»¶ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) */ - onBLECharacteristicValueChange(callback?: (result: any) => void): void; + onBLECharacteristicValueChange(callback?: () => void): void; /** * ç›‘ćŹäœŽćŠŸè€—è“ç‰™èźŸć€‡èżžæŽ„çŠ¶æ€ć˜ćŒ–äș‹ä»¶ * ćŒ…æ‹ŹćŒ€ć‘è€…äž»ćŠšèżžæŽ„æˆ–æ–­ćŒ€èżžæŽ„ïŒŒèźŸć€‡äžąć€±ïŒŒèżžæŽ„ćŒ‚ćžžæ–­ćŒ€ç­‰ă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) */ - onBLEConnectionStateChange(callback?: (result: any) => void): void; + onBLEConnectionStateChange(callback?: () => void): void; /** * èŻ»ć–äœŽćŠŸè€—è“ç‰™èźŸć€‡æŒ‡ćźšç‰čćŸć€Œçš„äșŒèż›ćˆ¶æ•°æźć€Œ * æŒ‡ćźšçš„ç‰čćŸć€Œéœ€æ”ŻæŒreadæ“äœœæ‰ćŻä»„æˆćŠŸè°ƒç”šă€‚ @@ -829,7 +829,7 @@ interface PlusBluetooth { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) */ - readBLECharacteristicValue(deviceId?: string, serviceId?: string, characteristicId?: string, success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + readBLECharacteristicValue(deviceId?: string, serviceId?: string, characteristicId?: string, success?: () => void, fail?: () => void, complete?: () => void): void; /** * ć‘äœŽćŠŸè€—è“ç‰™èźŸć€‡æŒ‡ćźšç‰čćŸć€Œć†™ć…„äșŒèż›ćˆ¶æ•°æź * æŒ‡ćźšçš„ç‰čćŸć€Œéœ€æ”ŻæŒwriteæ“äœœæ‰ćŻä»„æˆćŠŸè°ƒç”šă€‚ @@ -837,7 +837,7 @@ interface PlusBluetooth { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) */ - writeBLECharacteristicValue(deviceId?: string, serviceId?: string, characteristicId?: string, value?: ArrayBuffer, success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + writeBLECharacteristicValue(deviceId?: string, serviceId?: string, characteristicId?: string, value?: ArrayBuffer, success?: () => void, fail?: () => void, complete?: () => void): void; } /** @@ -1042,7 +1042,7 @@ interface PlusCameraCamera { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) */ - captureImage(successCB?: (result: string) => void, errorCB?: (result: any) => void, options?: PlusCameraCameraOptions): void; + captureImage(successCB?: () => void, errorCB?: () => void, options?: PlusCameraCameraOptions): void; /** * è°ƒç”šæ‘„ćƒć€Žèż›èĄŒæ‘„ćƒæ“äœœ * æ‘„ćƒć€Žè”„æșäžșç‹Źć è”„æșïŒŒćŠ‚æžœć…¶ćźƒçš‹ćșæˆ–饔靱ć·Čç»ć ç”šæ‘„ćƒć€ŽïŒŒć†æŹĄæ“äœœćˆ™ć€±èŽ„ă€‚ @@ -1051,7 +1051,7 @@ interface PlusCameraCamera { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) */ - startVideoCapture(successCB?: (result: string) => void, errorCB?: (result: any) => void, option?: PlusCameraCameraOptions): void; + startVideoCapture(successCB?: () => void, errorCB?: () => void, option?: PlusCameraCameraOptions): void; /** * ç»“æŸæ‘„ćƒæ“äœœ * ćŒ€ć§‹è°ƒç”šæ‘„ćƒć€Žèż›èĄŒæ‘„ćƒæ“äœœćŽïŒŒćŻćœšćŽć°ç»“æŸæ‘„ćƒæ“äœœïŒŒäžŽç”šæˆ·ćœšç•Œéąç»“æŸæ“äœœæ•ˆæžœäž€è‡Žă€‚ @@ -1248,7 +1248,7 @@ interface PlusContacts { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) */ - getAddressBook(type?: number, successCB?: (result: PlusContactsAddressBook) => void, errorCB?: (result: any) => void): void; + getAddressBook(type?: number, successCB?: () => void, errorCB?: () => void): void; } /** @@ -1271,7 +1271,7 @@ interface PlusContactsAddressBook { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) */ - find(contactFields?: String[], successCB?: (result: PlusContactsContact) => void, errorCB?: (result: any) => void, findOptions?: PlusContactsContactFindOption): void; + find(contactFields?: string [], successCB?: () => void, errorCB?: () => void, findOptions?: PlusContactsContactFindOption): void; } /** @@ -1390,14 +1390,14 @@ interface PlusContactsContact { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) */ - remove(successCB?: Function, errorCB?: (result: any) => void): void; + remove(successCB?: () => void, errorCB?: () => void): void; /** * äżć­˜è”çł»äșș * ć°†è”çł»äșșæ•°æźäżć­˜ćˆ°é€šèźŻćœ•äž­ïŒŒæ“äœœæˆćŠŸć°†é€šèż‡successCBć›žè°ƒć‡œæ•°èż”ć›žäżć­˜ç»“æžœïŒŒæ“äœœć€±èŽ„ć°†é€šèż‡é€šèż‡errorCBć›žè°ƒć‡œæ•°èż”ć›žé”™èŻŻäżĄæŻă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) */ - save(successCB?: Function, errorCB?: (result: any) => void): void; + save(successCB?: () => void, errorCB?: () => void): void; } /** @@ -1960,14 +1960,14 @@ interface PlusDownloader { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) */ - createDownload(url?: string, options?: PlusDownloaderDownloadOptions, completedCB?: (result0: PlusDownloaderDownload, result1: number) => void): PlusDownloaderDownload; + createDownload(url?: string, options?: PlusDownloaderDownloadOptions, completedCB?: () => void): PlusDownloaderDownload; /** * æžšäžŸäž‹èœœä»»ćŠĄ * æžšäžŸæŒ‡ćźšçŠ¶æ€çš„äž‹èœœä»»ćŠĄćˆ—èĄšïŒŒé€šèż‡enumCBć›žè°ƒć‡œæ•°èż”ć›žç»“æžœă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) */ - enumerate(enumCB?: (result: any []) => void, state?: PlusDownloaderDownloadState): void; + enumerate(enumCB?: () => void, state?: PlusDownloaderDownloadState): void; /** * æž…é™€äž‹èœœä»»ćŠĄ * æž…é™€æŒ‡ćźšçŠ¶æ€çš„äž‹èœœä»»ćŠĄă€‚ @@ -2055,7 +2055,7 @@ interface PlusDownloaderDownload { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) */ - addEventListener(type?: string, listener?: (result0: PlusDownloaderDownload, result1: number) => void, capture?: boolean): void; + addEventListener(type?: string, listener?: () => void, capture?: boolean): void; /** * èŽ·ć–äž‹èœœèŻ·æ±‚HTTP操ćș”ć€ŽéƒšäżĄæŻ * HTTP操ćș”ć€Žéƒšć…šéƒšć†…ćźč䜜äžșæœȘè§Łæžçš„ć­—çŹŠäžČèż”ć›žïŒŒćŠ‚æžœæČĄæœ‰æŽ„æ”¶ćˆ°èż™äžȘHTTP操ćș”ć€Žæ•°æźæˆ–è€…äž‹èœœèŻ·æ±‚æœȘćźŒæˆćˆ™äžșç©ș歗笩äžČ。 @@ -2241,7 +2241,7 @@ interface PlusFingerprint { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) */ - authenticate(successCB?: Function, errorCB?: (result: PlusFingerprintFingerprintError) => void, options?: PlusFingerprintAuthenticateOptions): void; + authenticate(successCB?: () => void, errorCB?: () => void, options?: PlusFingerprintAuthenticateOptions): void; /** * ć–æ¶ˆæŒ‡çșčèŻ†ćˆ«èź€èŻ * ć–æ¶ˆćœ“ć‰æ­Łćœšć€„ç†çš„æŒ‡çșčèŻ†ćˆ«èź€èŻæ“äœœă€‚ @@ -2377,7 +2377,7 @@ interface PlusGallery { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) */ - pick(succesCB?: (result: string) => void, errorCB?: (result: any) => void, options?: PlusGalleryGalleryOptions): void; + pick(succesCB?: () => void, errorCB?: () => void, options?: PlusGalleryGalleryOptions): void; /** * äżć­˜æ–‡ä»¶ćˆ°çł»ç»Ÿç›žć†Œäž­ * äżć­˜æ–‡ä»¶ćˆ°çł»ç»Ÿç›žć†Œäž­ă€‚ @@ -2386,7 +2386,7 @@ interface PlusGallery { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) */ - save(path ?: string, succesCB?: (result: PlusGalleryGallerySaveEvent) => void, errorCB?: (result: any) => void): void; + save(path ?: string, succesCB?: () => void, errorCB?: () => void): void; } /** @@ -2441,7 +2441,7 @@ interface PlusGalleryGalleryOptions { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) */ - onmaxed?: Function; + onmaxed?: () => void; /** * ç›žć†Œé€‰æ‹©ç•ŒéąćŒčć‡ș指ç€șćŒș㟟 * ćŻčäșŽć€§ć±ćč•èźŸć€‡ćŠ‚iPadïŒŒç›žć†Œé€‰æ‹©ç•ŒéąäžșćŒčć‡șçȘ—ćŁïŒŒæ­€æ—¶ćŻé€šèż‡æ­€ć‚æ•°èźŸçœźćŒčć‡șçȘ—ćŁäœçœźă€‚ @@ -2586,7 +2586,7 @@ interface PlusGeolocation { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) */ - getCurrentPosition(successCB?: (result: PlusGeolocationPosition) => void, errorCB?: (result: PlusGeolocationGeolocationError) => void, options?: PlusGeolocationPositionOptions): void; + getCurrentPosition(successCB?: () => void, errorCB?: () => void, options?: PlusGeolocationPositionOptions): void; /** * ç›‘ćŹèźŸć€‡äœçœźć˜ćŒ–äżĄæŻ * äœçœźäżĄæŻć°†é€šèż‡æ‰‹æœșGPSèźŸć€‡æˆ–ć…¶ćźƒäżĄæŻćŠ‚IPćœ°ć€ă€ç§»ćŠšçœ‘ç»œäżĄć·èŽ·ć–ă€‚ @@ -2595,7 +2595,7 @@ interface PlusGeolocation { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) */ - watchPosition(successCB?: (result: PlusGeolocationPosition) => void, errorCB?: (result: PlusGeolocationGeolocationError) => void, option?: PlusGeolocationPositionOptions): number; + watchPosition(successCB?: () => void, errorCB?: () => void, option?: PlusGeolocationPositionOptions): number; /** * ć…łé—­ç›‘ćŹèźŸć€‡äœçœźäżĄæŻ * @@ -2913,35 +2913,35 @@ interface PlusIbeacon { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) */ - startBeaconDiscovery(uuids?: any [], ignoretoothAvailable?: boolean, success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + startBeaconDiscovery(uuids?: any [], ignoretoothAvailable?: boolean, success?: () => void, fail?: () => void, complete?: () => void): void; /** * ćœæ­ąæœçŽąé™„èż‘çš„iBeaconèźŸć€‡ * ć–æ¶ˆæˆćŠŸćŽè§Šć‘successCBć›žè°ƒïŒŒć€±èŽ„è§Šć‘errorCBć›žè°ƒă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) */ - stopBeaconDiscovery(success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + stopBeaconDiscovery(success?: () => void, fail?: () => void, complete?: () => void): void; /** * èŽ·ć–ć·ČæœçŽąćˆ°çš„iBeaconèźŸć€‡ * èŽ·ć–æˆćŠŸćŽè§Šć‘successCBć›žè°ƒïŒŒć€±èŽ„è§Šć‘errorCBć›žè°ƒă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) */ - getBeacons(success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + getBeacons(success?: () => void, fail?: () => void, complete?: () => void): void; /** * 监搬iBeaconèźŸć€‡æ›Žæ–° * iBeaconèźŸć€‡æ›Žæ–°ćŽè§Šć‘updateCBć›žè°ƒă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) */ - onBeaconUpdate(updateCB?: (result: any) => void): void; + onBeaconUpdate(updateCB?: () => void): void; /** * 监搬iBeaconæœćŠĄçŠ¶æ€ć˜ćŒ– * iBeaconæœćŠĄçŠ¶æ€ć˜ćŒ–æ—¶è§Šć‘changeCBć›žè°ƒă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) */ - onBeaconServiceChange(changeCB?: (result: any) => void): void; + onBeaconServiceChange(changeCB?: () => void): void; } /** @@ -3129,7 +3129,7 @@ interface PlusIo { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - requestFileSystem(type?: number, succesCB?: (result: PlusIoFileSystem) => void, errorCB?: (result: any) => void): void; + requestFileSystem(type?: number, succesCB?: () => void, errorCB?: () => void): void; /** * é€šèż‡URLć‚æ•°èŽ·ć–ç›źćœ•ćŻčè±Ąæˆ–æ–‡ä»¶ćŻčè±Ą * ćż«é€ŸèŽ·ć–æŒ‡ćźšçš„ç›źćœ•æˆ–æ–‡ä»¶æ“äœœćŻčè±ĄïŒŒćŠ‚é€šèż‡URLć€Œâ€œ_www/test.htmlâ€ćŻç›ŽæŽ„èŽ·ć–æ–‡ä»¶æ“äœœćŻčè±Ąă€‚ @@ -3138,7 +3138,7 @@ interface PlusIo { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - resolveLocalFileSystemURL(url ?: string, succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; + resolveLocalFileSystemURL(url ?: string, succesCB?: () => void, errorCB?: () => void): void; /** * ć°†æœŹćœ°URLè·ŻćŸ„èœŹæąæˆćčłć°ç»ćŻčè·ŻćŸ„ * 绝ćŻčè·ŻćŸ„çŹŠćˆć„ćčłć°æ–‡ä»¶è·ŻćŸ„æ ŒćŒïŒŒé€šćžžç”šäșŽNative.JSè°ƒç”šçł»ç»ŸćŽŸç”Ÿæ–‡ä»¶æ“äœœAPIäčŸćŻä»„ćœšć‰éąæ·»ćŠ â€œfile://”搎朹htmléĄ”éąäž­ç›ŽæŽ„äœżç”šă€‚ @@ -3199,7 +3199,7 @@ interface PlusIoDirectoryEntry { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - getMetadata(succesCB?: (result: PlusIoMetadata) => void, errorCB?: (result: any) => void, recursive?: boolean): void; + getMetadata(succesCB?: () => void, errorCB?: () => void, recursive?: boolean): void; /** * ç§»ćŠšç›źćœ• * ä»„äž‹æƒ…ć†”ç§»ćŠšç›źćœ•ć°†äŒšćŻŒè‡Žć€±èŽ„ïŒš @@ -3211,7 +3211,7 @@ interface PlusIoDirectoryEntry { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - moveTo(parent?: PlusIoDirectoryEntry, newName?: string, succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; + moveTo(parent?: PlusIoDirectoryEntry, newName?: string, succesCB?: () => void, errorCB?: () => void): void; /** * æ‹·èŽç›źćœ• * ä»„äž‹æƒ…ć†”æ‹·èŽç›źćœ•ć°†äŒšćŻŒè‡Žć€±èŽ„ïŒš @@ -3223,7 +3223,7 @@ interface PlusIoDirectoryEntry { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - copyTo(parent?: PlusIoDirectoryEntry, newName?: string, succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; + copyTo(parent?: PlusIoDirectoryEntry, newName?: string, succesCB?: () => void, errorCB?: () => void): void; /** * èŽ·ć–ç›źćœ•è·ŻćŸ„èœŹæąäžșURL朰杀 * @@ -3251,14 +3251,14 @@ interface PlusIoDirectoryEntry { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - remove(succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; + remove(succesCB?: () => void, errorCB?: () => void): void; /** * èŽ·ć–ç›źćœ•æ‰€ć±žçš„çˆ¶ç›źćœ• * èŽ·ć–çˆ¶ç›źćœ•æˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - getParent(succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; + getParent(succesCB?: () => void, errorCB?: () => void): void; /** * 戛ć»șç›źćœ•èŻ»ć–ćŻčè±Ą * 戛ć»ș侀äžȘç›źćœ•èŻ»ć–ćŻčè±ĄïŒŒç”šæˆ·èŻ»ć–ç›źäž‹çš„æ–‡ä»¶ćŠć­ç›źćœ•ă€‚ @@ -3273,7 +3273,7 @@ interface PlusIoDirectoryEntry { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - getDirectory(path?: string, flag?: PlusIoFlags, succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; + getDirectory(path?: string, flag?: PlusIoFlags, succesCB?: () => void, errorCB?: () => void): void; /** * 戛ć»șæˆ–æ‰“ćŒ€æ–‡ä»¶ * 戛ć»șæˆ–æ‰“ćŒ€ćœ“ć‰ç›źćœ•äž‹æŒ‡ćźšçš„æ–‡ä»¶ă€‚ @@ -3281,7 +3281,7 @@ interface PlusIoDirectoryEntry { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - getFile(path?: string, flag?: PlusIoFlags, succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; + getFile(path?: string, flag?: PlusIoFlags, succesCB?: () => void, errorCB?: () => void): void; /** * é€’ćœ’ćˆ é™€ç›źćœ• * ćˆ é™€ç›źćœ•ć°†äŒšćˆ é™€ć…¶äž‹çš„æ‰€æœ‰æ–‡ä»¶ćŠć­ç›źćœ• @@ -3290,7 +3290,7 @@ interface PlusIoDirectoryEntry { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - removeRecursively(succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; + removeRecursively(succesCB?: () => void, errorCB?: () => void): void; } /** @@ -3306,7 +3306,7 @@ interface PlusIoDirectoryReader { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - readEntries(succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; + readEntries(succesCB?: () => void, errorCB?: () => void): void; } /** @@ -3398,7 +3398,7 @@ interface PlusIoFileEntry { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - getMetadata(succesCB?: (result: PlusIoMetadata) => void, errorCB?: (result: any) => void): void; + getMetadata(succesCB?: () => void, errorCB?: () => void): void; /** * ç§»ćŠšæ–‡ä»¶ * ä»„äž‹æƒ…ć†”ç§»ćŠšç›źćœ•ć°†äŒšćŻŒè‡Žć€±èŽ„ïŒš @@ -3408,7 +3408,7 @@ interface PlusIoFileEntry { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - moveTo(parent?: PlusIoDirectoryEntry, newName?: string, succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; + moveTo(parent?: PlusIoDirectoryEntry, newName?: string, succesCB?: () => void, errorCB?: () => void): void; /** * 拷莝文件 * ä»„äž‹æƒ…ć†”æ‹·èŽæ–‡ä»¶ć°†äŒšćŻŒè‡Žć€±èŽ„ïŒš @@ -3418,7 +3418,7 @@ interface PlusIoFileEntry { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - copyTo(parent?: PlusIoDirectoryEntry, newName?: string, succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; + copyTo(parent?: PlusIoDirectoryEntry, newName?: string, succesCB?: () => void, errorCB?: () => void): void; /** * èŽ·ć–æ–‡ä»¶è·ŻćŸ„èœŹæąäžșURL朰杀 * @@ -3444,28 +3444,28 @@ interface PlusIoFileEntry { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - remove(succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; + remove(succesCB?: () => void, errorCB?: () => void): void; /** * èŽ·ć–æ–‡ä»¶æ‰€ć±žçš„çˆ¶ç›źćœ• * èŽ·ć–çˆ¶ç›źćœ•æˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - getParent(succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; + getParent(succesCB?: () => void, errorCB?: () => void): void; /** * èŽ·ć–æ–‡ä»¶ć…łè”çš„ć†™æ–‡ä»¶æ“äœœćŻčè±ĄFileWriter * èŽ·ć–ć†™æ–‡ä»¶æ“äœœćŻčè±ĄæˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - createWriter(succesCB?: (result: PlusIoFileWriter) => void, errorCB?: (result: any) => void): void; + createWriter(succesCB?: () => void, errorCB?: () => void): void; /** * èŽ·ć–æ–‡ä»¶æ•°æźćŻčè±Ą * èŽ·ć–æ–‡ä»¶æ•°æźćŻčè±ĄæˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - file(succesCB?: (result: PlusIoFile) => void, errorCB?: (result: any) => void): void; + file(succesCB?: () => void, errorCB?: () => void): void; } /** @@ -3518,39 +3518,39 @@ interface PlusIoFileReader { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - onloadstart?: (result: PlusIoFileEvent) => void; + onloadstart?: () => void; /** * èŻ»ć–æ–‡ä»¶èż‡çš‹äž­çš„ć›žè°ƒć‡œæ•° * 甹äșŽèŽ·ć–æ–‡ä»¶èŻ»ć–èż›ćșŠă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - onprogress?: (result: PlusIoFileEvent) => void; + onprogress?: () => void; /** * èŻ»ć–æ–‡ä»¶æˆćŠŸćźŒæˆçš„ć›žè°ƒć‡œæ•° * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - onload?: (result: PlusIoFileEvent) => void; + onload?: () => void; /** * ć–æ¶ˆèŻ»ć–æ–‡ä»¶æ—¶çš„ć›žè°ƒć‡œæ•° * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - onabort?: (result: PlusIoFileEvent) => void; + onabort?: () => void; /** * æ–‡ä»¶èŻ»ć–æ“äœœć€±èŽ„æ—¶è°ƒç”šçš„ć›žè°ƒć‡œæ•° * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - onerror?: (result: PlusIoFileEvent) => void; + onerror?: () => void; /** * æ–‡ä»¶èŻ»ć–æ“äœœćźŒæˆæ—¶çš„ć›žè°ƒć‡œæ•° * äžçźĄæˆćŠŸæˆ–ć€±èŽ„éƒœäŒšè§Šć‘ă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - onloadend?: (result: PlusIoFileEvent) => void; + onloadend?: () => void; /** * ç»ˆæ­ąæ–‡ä»¶èŻ»ć–æ“äœœ * èŻ»ć–æ–‡ä»¶æ“äœœćŒ€ć§‹ćŽïŒŒćŻé€šèż‡æ­€æ–čæł•ć–æ¶ˆèŻ»ć–æ–‡ä»¶ă€‚ @@ -3632,39 +3632,39 @@ interface PlusIoFileWriter { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - onwritestart?: (result: PlusIoFileEvent) => void; + onwritestart?: () => void; /** * ć†™ć…„æ–‡ä»¶èż‡çš‹äž­çš„ć›žè°ƒć‡œæ•° * 甹äșŽèŽ·ć–æ–‡ä»¶èŻ»ć–èż›ćșŠă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - onprogress?: (result: PlusIoFileEvent) => void; + onprogress?: () => void; /** * ć†™ć…„æ–‡ä»¶æˆćŠŸćźŒæˆçš„ć›žè°ƒć‡œæ•° * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - onwrite?: (result: PlusIoFileEvent) => void; + onwrite?: () => void; /** * ć–æ¶ˆć†™ć…„æ–‡ä»¶æ—¶çš„ć›žè°ƒć‡œæ•° * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - onabort?: (result: PlusIoFileEvent) => void; + onabort?: () => void; /** * æ–‡ä»¶ć†™ć…„æ“äœœć€±èŽ„æ—¶è°ƒç”šçš„ć›žè°ƒć‡œæ•° * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - onerror?: (result: PlusIoFileEvent) => void; + onerror?: () => void; /** * æ–‡ä»¶ć†™ć…„æ“äœœćźŒæˆæ—¶çš„ć›žè°ƒć‡œæ•° * äžçźĄæˆćŠŸæˆ–ć€±èŽ„éƒœäŒšè§Šć‘ă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - onwriteend?: (result: PlusIoFileEvent) => void; + onwriteend?: () => void; /** * ç»ˆæ­ąæ–‡ä»¶ć†™ć…„æ“äœœ * ć†™ć…„æ–‡ä»¶æ•°æźæ“äœœćŒ€ć§‹ćŽïŒŒćŻé€šèż‡æ­€æ–čæł•ć–æ¶ˆć†™ć…„æ–‡ä»¶æ•°æźæ“äœœă€‚ @@ -3870,9 +3870,7 @@ interface PlusIoRelativeURL { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ -interface PlusIoLocalURL { -} - +type PlusIoLocalURL = any; /** * çœ‘ç»œè·ŻćŸ„URL * 揯朹htmléĄ”éąäž­ä»„çœ‘ç»œè”„æșæšĄćŒèźżé—źæœŹćœ°è”„æșïŒŒä»„“http://â€ćŒ€ć€ŽïŒŒćŽéąè·Ÿéšç›žćŻčè·ŻćŸ„ă€‚ @@ -3880,8 +3878,7 @@ interface PlusIoLocalURL { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ -interface PlusIoRemoteURL { -} +type PlusIoRemoteURL = any; /** * Native.js for iOSć°èŁ…äž€æĄé€šèż‡JSèŻ­æł•ç›ŽæŽ„è°ƒç”šNative Objective-CæŽ„ćŁé€šé“ïŒŒé€šèż‡plus.iosćŻè°ƒç”šć‡ äčŽæ‰€æœ‰çš„çł»ç»ŸAPI。 @@ -3954,8 +3951,7 @@ interface PlusIos { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ios.html](http://www.html5plus.org/doc/zh_cn/ios.html) */ -interface PlusIosClassObject { -} +type PlusIosClassObject = any; /** * Objective-CćźžäŸ‹ćŻčè±Ą @@ -4006,7 +4002,7 @@ interface PlusKey { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) */ - addEventListener(event?: PlusKeyKeyType, listener?: (result: PlusKeyKeyEvent) => void, capture?: boolean): void; + addEventListener(event?: PlusKeyKeyType, listener?: () => void, capture?: boolean): void; /** * éšè—èœŻé”źç›˜ * 隐藏ć·Č经星ç€șçš„èœŻé”źç›˜ïŒŒćŠ‚æžœèœŻé”źç›˜æČĄæœ‰æ˜Ÿç€șćˆ™äžćšä»»äœ•æ“äœœă€‚ @@ -4035,7 +4031,7 @@ interface PlusKey { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) */ - removeEventListener(event?: PlusKeyKeyType, listener?: (result: PlusKeyKeyEvent) => void): void; + removeEventListener(event?: PlusKeyKeyType, listener?: () => void): void; } /** @@ -4180,7 +4176,7 @@ interface PlusMessaging { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) */ - sendMessage(msg?: PlusMessagingMessage, successCB?: Function, errorCB?: (result: any) => void): void; + sendMessage(msg?: PlusMessagingMessage, successCB?: () => void, errorCB?: () => void): void; } /** @@ -4536,7 +4532,7 @@ interface PlusNativeObjBitmap { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) */ - load(path?: string, successCallback?: Function, errorCallback?: (result: any) => void): void; + load(path?: string, successCallback?: () => void, errorCallback?: () => void): void; /** * ćŠ èœœBase64çŒ–ç æ ŒćŒć›Ÿç‰‡ćˆ°BitmapćŻčè±Ą * 从Base64çŒ–ç æ ŒćŒć›Ÿç‰‡æ•°æźäž­ćŠ èœœć›Ÿç‰‡ïŒŒæ­€æ“äœœć°†èŠ†ç›–äč‹ć‰çš„ć›Ÿç‰‡ć†…ćźč @@ -4544,7 +4540,7 @@ interface PlusNativeObjBitmap { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) */ - loadBase64Data(data?: string, successCallback?: Function, errorCallback?: (result: any) => void): void; + loadBase64Data(data?: string, successCallback?: () => void, errorCallback?: () => void): void; /** * ć›žæ”¶Bitmapć›Ÿç‰‡ć†…ć­˜ * 释攟Bitmapć›Ÿç‰‡ć ç”šçš„ć†…ć­˜è”„æșïŒŒäœ†äžé”€æŻć›Ÿç‰‡ćŻčè±ĄïŒŒäŸç„¶ćŻä»„ç»§ç»­äœżç”šć›Ÿç‰‡ćŻčè±Ąă€‚ @@ -4559,7 +4555,7 @@ interface PlusNativeObjBitmap { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) */ - save(path?: string, options?: PlusNativeObjBitmapSaveOptions, successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; + save(path?: string, options?: PlusNativeObjBitmapSaveOptions, successCallback?: () => void, errorCallback?: () => void): void; /** * èŽ·ć–ć›Ÿç‰‡çš„Base64çŒ–ç æ•°æź * èŻ»ć–ć›Ÿç‰‡çš„æ•°æźć†…ćźčćč¶èœŹæąäžșBase64çŒ–ç æ ŒćŒć­—çŹŠäžČ。 @@ -4831,21 +4827,21 @@ interface PlusNativeObjInputStyles { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) */ - onComplete?: (result: any) => void; + onComplete?: () => void; /** * èŸ“ć…„æĄ†èŽ·ć–ç„Šç‚čäș‹ä»¶ * ćœ“çŒ–èŸ‘æĄ†èŽ·ć–ç„Šç‚čæ—¶è§Šć‘。 * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) */ - onFocus?: (result: any) => void; + onFocus?: () => void; /** * èŸ“ć…„æĄ†ć€±ćŽ»ç„Šç‚čäș‹ä»¶ * ćœ“çŒ–èŸ‘æĄ†ć€±ćŽ»ç„Šç‚čæ—¶è§Šć‘。 * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) */ - onBlur?: (result: any) => void; + onBlur?: () => void; } /** @@ -4984,7 +4980,7 @@ interface PlusNativeObjRichTextStyles { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) */ - onClick?: (result: any) => void; + onClick?: () => void; } /** @@ -5216,7 +5212,7 @@ interface PlusNativeObjView { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) */ - startAnimation(options?: PlusNativeObjAnimationOptions, view?: PlusNativeObjAnimationViewStyles, otherview?: PlusNativeObjAnimationViewStyles, callback?: Function): void; + startAnimation(options?: PlusNativeObjAnimationOptions, view?: PlusNativeObjAnimationViewStyles, otherview?: PlusNativeObjAnimationViewStyles, callback?: () => void): void; /** * 静态æ–čæł•ïŒŒć…łé—­ćŽŸç”ŸćŠšç”»çȘ—揣 * é€šèż‡plus.nativeObj.View.startAnimationæ–čæł•ćŒ€ć§‹ćŽŸç”ŸćŠšç”»ćŽïŒŒäžäŒšè‡ȘćŠšć…łé—­ćŽŸç”ŸćŠšç”»çȘ—揣ćŻčè±ĄïŒŒéœ€èŠè°ƒç”šæ­€æ–čæł•ć…łé—­ćŽŸç”ŸćŠšç”»ă€‚ @@ -5241,14 +5237,14 @@ interface PlusNativeObjView { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) */ - addEventListener(event?: PlusNativeObjViewEvents, listener?: (result: any) => void, capture?: boolean): void; + addEventListener(event?: PlusNativeObjViewEvents, listener?: () => void, capture?: boolean): void; /** * ViewæŽ§ä»¶ć†…ćźč抚画 * ćŠšç”»ćŽćŻèƒœäŒšćŻŒè‡ŽView控件星ç€ș憅ćźčæ”čć˜ïŒŒćŻé€šèż‡è°ƒç”šrestoreæ–čæł•æąć€ă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) */ - animate(options?: PlusNativeObjViewAnimationOptions, callback?: Function): void; + animate(options?: PlusNativeObjViewAnimationOptions, callback?: () => void): void; /** * 慳闭View控件 * 释攟View控件蔄æșïŒŒViewćŻčè±ĄäžćŻć†æ“äœœïŒŒćŠ‚æžœView控件ć·Č经星ç€ș戙è‡ȘćŠšéšè—ă€‚ @@ -5787,7 +5783,7 @@ interface PlusNativeUI { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) */ - actionSheet(actionsheetStyle?: PlusNativeUIActionSheetStyles, actionsheetCallback?: (result: any) => void): PlusNativeUINativeUIObj; + actionSheet(actionsheetStyle?: PlusNativeUIActionSheetStyles, actionsheetCallback?: () => void): PlusNativeUINativeUIObj; /** * ćŒčć‡șçł»ç»Ÿæç€șćŻčèŻæĄ† * 戛ć»șćč¶æ˜Ÿç€șçł»ç»Ÿæ ·ćŒæç€șćŻčèŻæĄ†ïŒŒćŻèźŸçœźæç€șćŻčèŻæĄ†çš„æ ‡éą˜ă€ć†…ćźčă€æŒ‰é’źæ–‡ć­—ç­‰ă€‚ @@ -5795,7 +5791,7 @@ interface PlusNativeUI { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) */ - alert(message?: string, alertCB?: (result: any) => void, title?: string, buttonCapture?: string): void; + alert(message?: string, alertCB?: () => void, title?: string, buttonCapture?: string): void; /** * ćŒčć‡șçł»ç»ŸçĄźèź€ćŻčèŻæĄ† * 戛ć»șćč¶æ˜Ÿç€șçł»ç»Ÿæ ·ćŒçĄźèź€ćŻčèŻæĄ†ïŒŒćŻèźŸçœźçĄźèź€ćŻčèŻæĄ†çš„æ ‡éą˜ă€ć†…ćźčă€æŒ‰é’źæ•°ç›źćŠć…¶æ–‡ć­—ă€‚ @@ -5803,7 +5799,7 @@ interface PlusNativeUI { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) */ - confirm(message?: string, confirmCB?: (result: any) => void, options?: PlusNativeUIConfirmOptions, buttons?: any []): void; + confirm(message?: string, confirmCB?: () => void, options?: PlusNativeUIConfirmOptions, buttons?: any []): void; /** * ć…łé—­çł»ç»Ÿç­‰ćŸ…ćŻčèŻæĄ† * 慳闭ć·Č经星ç€șçš„æ‰€æœ‰çł»ç»Ÿæ ·ćŒç­‰ćŸ…ćŻčèŻæĄ†ïŒŒè§Šć‘WaitingćŻčè±Ąçš„oncloseäș‹ä»¶ă€‚ @@ -5839,7 +5835,7 @@ interface PlusNativeUI { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) */ - pickDate(successCB?: (result: any) => void, errorCB?: (result: any) => void, options?: PlusNativeUIPickDateOption): void; + pickDate(successCB?: () => void, errorCB?: () => void, options?: PlusNativeUIPickDateOption): void; /** * ćŒčć‡șçł»ç»Ÿæ—¶é—Žé€‰æ‹©ćŻčèŻæĄ† * 戛ć»șćč¶ćŒčć‡șçł»ç»Ÿæ ·ćŒæ—¶é—Žé€‰æ‹©ćŻčèŻæĄ†ïŒŒćŻèż›èĄŒæ—¶é—Žçš„é€‰æ‹©ă€‚ @@ -5847,7 +5843,7 @@ interface PlusNativeUI { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) */ - pickTime(successCB?: (result: any) => void, errorCB?: (result: any) => void, options?: PlusNativeUIPickTimeOption): void; + pickTime(successCB?: () => void, errorCB?: () => void, options?: PlusNativeUIPickTimeOption): void; /** * ćŒčć‡șçł»ç»ŸèŸ“ć…„ćŻčèŻæĄ† * 戛ć»șćč¶æ˜Ÿç€șçł»ç»Ÿæ ·ćŒèŸ“ć…„ćŻčèŻæĄ†ïŒŒćŻèźŸçœźèŸ“ć…„ćŻčèŻæĄ†çš„æ ‡éą˜ă€ć†…ćźčă€æç€șèŸ“ć…„äżĄæŻă€æŒ‰é’źæ•°ç›źćŠć…¶æ–‡ć­—ă€‚ @@ -5855,7 +5851,7 @@ interface PlusNativeUI { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) */ - prompt(message?: string, promptCB?: (result: any) => void, title?: string, tip?: string, buttons?: any []): void; + prompt(message?: string, promptCB?: () => void, title?: string, tip?: string, buttons?: any []): void; /** * 星ç€șè‡ȘćŠšæ¶ˆć€±çš„æç€șæ¶ˆæŻ * 戛ć»șćč¶æ˜Ÿç€șçł»ç»Ÿæ ·ćŒæç€șæ¶ˆæŻïŒŒćŒčć‡ș的提ç€șæ¶ˆæŻäžșéžé˜»ćĄžæšĄćŒïŒŒæ˜Ÿç€șæŒ‡ćźšæ—¶é—ŽćŽè‡ȘćŠšæ¶ˆć€±ă€‚ @@ -6122,7 +6118,7 @@ interface PlusNativeUIWaitingObj { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) */ - onclose?: Function; + onclose?: () => void; /** * èźŸçœźç­‰ćŸ…ćŻčèŻæĄ†äžŠæ˜Ÿç€șçš„æ–‡ć­—ć†…ćźč * @@ -6453,13 +6449,13 @@ interface PlusNavigator { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) */ - createShortcut(options?: PlusNavigatorShortcutOptions, successCallback?: (result: any) => void): void; + createShortcut(options?: PlusNavigatorShortcutOptions, successCallback?: () => void): void; /** * æŸ„èŻąæ˜ŻćŠć­˜ćœšćș”ç”šćż«æ·æ–čćŒ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) */ - hasShortcut(options?: PlusNavigatorShortcutOptions, successCallback?: (result: any) => void): void; + hasShortcut(options?: PlusNavigatorShortcutOptions, successCallback?: () => void): void; /** * ćˆ€æ–­ćœ“ć‰ćș”ç”šæ˜ŻćŠćˆ‡æąćˆ°ćŽć° * ćœšć€šćș”ç”šèżèĄŒçŽŻćąƒïŒˆćŠ‚æ”ćș”ç”šïŒ‰äž­ïŒŒćŻćŠšäž€äžȘ新ćș”甚时äč‹ć‰èżèĄŒçš„ćș”ç”šć°†äŒšè‡ȘćŠšćˆ‡æąćˆ°ćŽć°èżèĄŒïŒŒæ­€æ—¶plus.navigator.isBackground()èż”ć›žçŠ¶æ€ćȘäžștrue。 @@ -6767,14 +6763,14 @@ interface PlusOrientation { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/orientation.html](http://www.html5plus.org/doc/zh_cn/orientation.html) */ - getCurrentOrientation(successCB?: (result: string) => void, errorCB?: (result: any) => void): void; + getCurrentOrientation(successCB?: () => void, errorCB?: () => void): void; /** * ç›‘ćŹèźŸć€‡æ–čć‘äżĄæŻçš„ć˜ćŒ– * æ–čć‘äżĄæŻæ˜ŻèźŸć€‡ç›žćŻčäșŽæ°Žćčłćˆć§‹æ–čć‘ćˆ†ćˆ«ä»„z、x、y蜎äžșèœŽćżƒæ—‹èœŹçš„è§’ćșŠïŒŒćŻčćș”ć€Œäžșalpha、beta、gamma侉äžȘæ–čć‘çš„äżĄæŻă€‚watchOrientationæŻéš”ć›șćźšæ—¶é—Žć°±èŽ·ć–äž€æŹĄèźŸć€‡çš„æ–čć‘äżĄæŻïŒŒé€šèż‡successCBć›žè°ƒć‡œæ•°èż”ć›žă€‚ćŻé€šèż‡option的frequencyć‚æ•°èźŸćźšèŽ·ć–èźŸć€‡æ–čć‘äżĄæŻçš„æ—¶é—Žé—Žéš”ă€‚æ–čć‘äżĄæŻèŽ·ć–ć€±èŽ„ćˆ™è°ƒç”šć›žè°ƒć‡œæ•°errorCB。 * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/orientation.html](http://www.html5plus.org/doc/zh_cn/orientation.html) */ - watchOrientation(successCB?: (result: string) => void, errorCB?: (result: any) => void, option?: PlusOrientationOrientationOption): number; + watchOrientation(successCB?: () => void, errorCB?: () => void, option?: PlusOrientationOrientationOption): number; /** * ć…łé—­ç›‘ćŹèźŸć€‡æ–čć‘äżĄæŻ * @@ -6860,14 +6856,14 @@ interface PlusProximity { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/proximity.html](http://www.html5plus.org/doc/zh_cn/proximity.html) */ - getCurrentProximity(successCB?: (result: number) => void, errorCB?: (result: any) => void): void; + getCurrentProximity(successCB?: () => void, errorCB?: () => void): void; /** * ç›‘ćŹèźŸć€‡æŽ„èż‘è·çŠ»çš„ć˜ćŒ– * watchProximityć°†ç›‘ćŹèźŸć€‡çš„æŽ„èż‘è·çŠ»äżĄæŻć˜ćŒ–äș‹ä»¶ïŒŒćœ“æŽ„èż‘è·çŠ»ć‘ç”Ÿć˜ćŒ–æ—¶é€šèż‡changeCBć›žè°ƒć‡œæ•°èż”ć›žè·çŠ»ć€Œă€‚ç›‘ćŹè·çŠ»ć˜ćŒ–äș‹ä»¶ć€±èŽ„ćˆ™é€šèż‡errorCBć›žè°ƒć‡œæ•°èż”ć›žé”™èŻŻäżĄæŻă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/proximity.html](http://www.html5plus.org/doc/zh_cn/proximity.html) */ - watchProximity(changeCB?: (result: number) => void, errorCB?: (result: any) => void): number; + watchProximity(changeCB?: () => void, errorCB?: () => void): number; /** * ć…łé—­ç›‘ćŹèźŸć€‡æŽ„èż‘è·çŠ»ć˜ćŒ– * @@ -7048,7 +7044,7 @@ interface PlusRuntime { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) */ - getProperty(appid?: string, getPropertyCB?: (result: PlusRuntimeWidgetInfo) => void): void; + getProperty(appid?: string, getPropertyCB?: () => void): void; /** * ćź‰èŁ…ćș”甚 * æ”ŻæŒä»„äž‹ç±»ćž‹ćź‰èŁ…ćŒ…ïŒš @@ -7059,7 +7055,7 @@ interface PlusRuntime { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) */ - install(filePath?: string, options?: PlusRuntimeWidgetOptions, installSuccessCB?: (result: PlusRuntimeWidgetInfo) => void, installErrorCB?: (result: any) => void): void; + install(filePath?: string, options?: PlusRuntimeWidgetOptions, installSuccessCB?: () => void, installErrorCB?: () => void): void; /** * 退ć‡șćźąæˆ·ç«Żçš‹ćș * @@ -7083,7 +7079,7 @@ interface PlusRuntime { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) */ - openURL(url?: string, errorCB?: (result: any) => void, identity?: string): void; + openURL(url?: string, errorCB?: () => void, identity?: string): void; /** * äœżç”šć†…çœźWebviewçȘ—ćŁæ‰“ćŒ€URL * @@ -7095,7 +7091,7 @@ interface PlusRuntime { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) */ - openFile(filepath?: string, options?: PlusRuntimeOpenFileOptions, errorCB?: (result: any) => void): void; + openFile(filepath?: string, options?: PlusRuntimeOpenFileOptions, errorCB?: () => void): void; /** * ć€„ç†ç›ŽèŸŸéĄ”éąé“ŸæŽ„ć‚æ•° * é€šèż‡URL SchemećŻćŠšæ—¶ïŒŒćŻä»„ćœš?ćŽéąæ·»ćŠ __direct_pageć‚æ•°è‡Ș漚äč‰ç›ŽèŸŸéĄ”éąćœ°ć€ïŒŒ @@ -7111,7 +7107,7 @@ interface PlusRuntime { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) */ - launchApplication(appInf?: PlusRuntimeApplicationInf, errorCB?: (result: any) => void): void; + launchApplication(appInf?: PlusRuntimeApplicationInf, errorCB?: () => void): void; /** * ćˆ€æ–­çŹŹäž‰æ–č繋ćșæ˜ŻćŠć·Č歘朹 * ćŠ‚æžœçŹŹäž‰æ–č繋ćșć·Čćź‰èŁ…ćˆ™èż”ć›žtrueæœȘćź‰èŁ…ćˆ™èż”ć›žfalse。 @@ -7274,7 +7270,7 @@ interface PlusRuntimeWidgetInfo { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) */ - features?: String[]; + features?: string []; } /** @@ -7399,7 +7395,7 @@ interface PlusStream { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) */ - open(options?: PlusStreamStreamOptions, successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; + open(options?: PlusStreamStreamOptions, successCallback?: () => void, errorCallback?: () => void): void; /** * 攁ćș”ç”šæż€æŽ»ç»ŸèźĄ * 提äș€ç»ŸèźĄæ•°æźćˆ°æ”ćș”ç”šæœćŠĄć™šïŒŒèĄšæ˜ŽäžšćŠĄçł»ç»Ÿæż€æŽ»æˆćŠŸă€‚ @@ -7444,13 +7440,13 @@ interface PlusStream { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) */ - freetrafficRequest(options?: PlusStreamFreetrafficOptions, successCallback?: Function, errorCallback?: (result: any) => void): void; + freetrafficRequest(options?: PlusStreamFreetrafficOptions, successCallback?: () => void, errorCallback?: () => void): void; /** * ć…æ”é‡ç»‘ćźšæ‰‹æœșć· * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) */ - freetrafficBind(options?: PlusStreamFreetrafficOptions, successCallback?: Function, errorCallback?: (result: any) => void): void; + freetrafficBind(options?: PlusStreamFreetrafficOptions, successCallback?: () => void, errorCallback?: () => void): void; /** * è§Łé™€ć…æ”é‡ç»‘ćźš * è§Łé™€ćœ“ć‰èźŸć€‡ç»‘ćźšçš„æ‰‹æœșć·ïŒŒćŠ‚æžœèźŸć€‡æœȘç»‘ćźšćˆ™äžæ‰§èĄŒæ“äœœă€‚ @@ -7463,7 +7459,7 @@ interface PlusStream { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) */ - freetrafficInfo(successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; + freetrafficInfo(successCallback?: (result: any) => void, errorCallback?: () => void): void; /** * ć…æ”é‡æ˜ŻćŠç”Ÿæ•ˆ * @@ -7770,14 +7766,14 @@ interface PlusUploader { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) */ - createUpload(url?: string, options?: PlusUploaderUploadOptions, completedCB?: (result0: PlusUploaderUpload, result1: number) => void): PlusUploaderUpload; + createUpload(url?: string, options?: PlusUploaderUploadOptions, completedCB?: () => void): PlusUploaderUpload; /** * æžšäžŸäžŠäŒ ä»»ćŠĄ * æžšäžŸæŒ‡ćźšçŠ¶æ€çš„äžŠäŒ ä»»ćŠĄćˆ—èĄšïŒŒé€šèż‡enumCBć›žè°ƒć‡œæ•°èż”ć›žç»“æžœă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) */ - enumerate(enumCB?: (result: PlusUploader []) => void, state?: PlusUploaderUploadState): void; + enumerate(enumCB?: () => void, state?: PlusUploaderUploadState): void; /** * æž…é™€äžŠäŒ ä»»ćŠĄ * æž…é™€æŒ‡ćźšçŠ¶æ€çš„äžŠäŒ ä»»ćŠĄă€‚ @@ -7906,7 +7902,7 @@ interface PlusUploaderUpload { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) */ - addEventListener(type?: string, listener?: (result0: PlusUploaderUpload, result1: number) => void, capture?: boolean): void; + addEventListener(type?: string, listener?: () => void, capture?: boolean): void; /** * èŽ·ć–äžŠäŒ èŻ·æ±‚HTTP操ćș”ć€ŽéƒšäżĄæŻ * HTTP操ćș”ć€Žéƒšć…šéƒšć†…ćźč䜜äžșæœȘè§Łæžçš„ć­—çŹŠäžČèż”ć›žïŒŒćŠ‚æžœæČĄæœ‰æŽ„æ”¶ćˆ°èż™äžȘHTTP操ćș”ć€Žæ•°æźæˆ–è€…äžŠäŒ èŻ·æ±‚æœȘćźŒæˆćˆ™äžșç©ș歗笩äžČ。 @@ -8125,7 +8121,7 @@ interface PlusVideoVideoPlayer { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) */ - addEventListener(event?: PlusVideoVideoPlayerEvents, listener?: (result: any) => void, capture?: boolean): void; + addEventListener(event?: PlusVideoVideoPlayerEvents, listener?: () => void, capture?: boolean): void; /** * èźŸçœźè§†éą‘æ’­æ”ŸæŽ§ä»¶ć‚æ•° * 甹äșŽćŠšæ€æ›Žæ–°è§†éą‘æ’­æ”ŸæŽ§ä»¶çš„é…çœźć‚æ•°ă€‚ @@ -8492,7 +8488,7 @@ interface PlusVideoLivePusher { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) */ - addEventListener(event?: PlusVideoLivePusherEvents, listener?: (result: any) => void, capture?: boolean): void; + addEventListener(event?: PlusVideoLivePusherEvents, listener?: () => void, capture?: boolean): void; /** * èźŸçœźç›Žæ’­æŽšæ”æŽ§ä»¶ć‚æ•° * 甹äșŽćŠšæ€æ›Žæ–°ç›Žæ’­æŽšæ”æŽ§ä»¶çš„é…çœźć‚æ•°ă€‚ @@ -8523,7 +8519,7 @@ interface PlusVideoLivePusher { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) */ - start(successCB?: Function, errorCB?: Function): void; + start(successCB?: () => void, errorCB?: () => void): void; /** * ćœæ­ąæŽšæ” * ćŠ‚æžœæœȘ怄äșŽæŽšæ”çŠ¶æ€ïŒŒćˆ™æ“äœœæ— æ•ˆă€‚ @@ -8556,7 +8552,7 @@ interface PlusVideoLivePusher { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) */ - snapshot(successCB?: Function, errorCB?: Function): void; + snapshot(successCB?: () => void, errorCB?: () => void): void; /** * ć…łé—­ç›Žæ’­æŽšæ”æŽ§ä»¶ * ć…łé—­æ“äœœć°†é‡Šæ”ŸæŽ§ä»¶æ‰€æœ‰è”„æșïŒŒäžć†ćŻç”šă€‚ @@ -9043,7 +9039,7 @@ interface PlusWebview { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) */ - open(url?: string, id?: string, styles?: PlusWebviewWebviewStyles, aniShow?: string, duration?: number, showedCB?: Function): PlusWebviewWebviewObject; + open(url?: string, id?: string, styles?: PlusWebviewWebviewStyles, aniShow?: string, duration?: number, showedCB?: () => void): PlusWebviewWebviewObject; /** * éą„èœœçœ‘ç»œéĄ”éą * éą„èœœçœ‘ç»œéĄ”éąäŒšć‘æœćŠĄć™šć‘è”·http/httpsèŻ·æ±‚èŽ·ć–htmléĄ”éąć†…ćźč @@ -9068,7 +9064,7 @@ interface PlusWebview { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) */ - show(id_wvobj?: string, aniShow?: string, duration?: number, showedCB?: Function, extras?: PlusWebviewWebviewExtraOptions): PlusWebviewWebviewObject; + show(id_wvobj?: string, aniShow?: string, duration?: number, showedCB?: () => void, extras?: PlusWebviewWebviewExtraOptions): PlusWebviewWebviewObject; /** * WebviewçȘ—ćŁç»„ćˆćŠšç”» * ćŒæ­„ç»„ćˆäž€äžȘWebviewçȘ—ćŁćŠšç”»ïŒŒćŠšç”»ćꌿˆćŽçȘ—ćŁçš„äœçœźäŒšć‘ç”Ÿć˜ćŒ–ïŒŒäž€æŹĄéœ€èŠćœšćŠšç”»ć±žæ€§ć‚æ•°äž­èźŸçœźćŠšç”»è”·ć§‹äœçœźă€ç»“æŸäœçœźç­‰ă€‚ @@ -9076,7 +9072,7 @@ interface PlusWebview { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) */ - startAnimation(options?: PlusWebviewWebviewAnimationOptions, otherOptions?: PlusWebviewWebviewAnimationOptions, callback?: (result: any) => void): void; + startAnimation(options?: PlusWebviewWebviewAnimationOptions, otherOptions?: PlusWebviewWebviewAnimationOptions, callback?: () => void): void; /** * èŽ·ć–Webviewé»˜èź€æ˜ŻćŠćŒ€ćŻçĄŹä»¶ćŠ é€Ÿ * 由äșŽäžćŒèźŸć€‡ćŻčçĄŹä»¶ćŠ é€Ÿçš„æ”ŻæŒæƒ…ć†”ć­˜ćœšć·źćŒ‚ïŒŒćŒ€ćŻçĄŹä»¶ćŠ é€ŸèƒœćŠ é€ŸHTMLéĄ”éąçš„æžČ染䜆äčŸäŒšæ¶ˆè€—æ›Žć€šçš„çł»ç»Ÿè”„æșïŒŒä»Žè€ŒćŻŒè‡Žćœšéƒšćˆ†èźŸć€‡äžŠćŻèƒœć‡ș现é—Șć±ă€ć‘è™šă€ćˆ†ć—æžČæŸ“ç­‰é—źéą˜ïŒŒ ć› æ­€5+ Runtime䌚æ čæźèźŸć€‡ćźžé™…æ”ŻæŒæƒ…ć†”è‡ȘćŠšé€‰æ‹©æ˜ŻćŠćŒ€ćŻçĄŹä»¶ćŠ é€Ÿă€‚ @@ -9302,7 +9298,7 @@ interface PlusWebviewWebviewObject { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) */ - addEventListener(event?: PlusWebviewWebviewEvent, listener?: (result: any) => void, capture?: boolean): void; + addEventListener(event?: PlusWebviewWebviewEvent, listener?: () => void, capture?: boolean): void; /** * 朹WebviewçȘ—ćŁäž­æ·»ćŠ ć­çȘ—揣 * 氆揩侀äžȘWebviewçȘ—ćŁäœœäžș歐çȘ—ćŁæ·»ćŠ ćˆ°ćœ“ć‰WebviewçȘ—ćŁäž­ïŒŒæ·»ćŠ ćŽć…¶æ‰€æœ‰æƒćœ’çˆ¶WebviewçȘ—ćŁïŒŒćœ“çˆ¶çȘ—ćŁć…łé—­æ—¶ć­çȘ—揣è‡Ș抹慳闭。 @@ -9325,7 +9321,7 @@ interface PlusWebviewWebviewObject { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) */ - animate(options?: PlusWebviewWebviewContentAnimationOptions, callback?: Function): void; + animate(options?: PlusWebviewWebviewContentAnimationOptions, callback?: () => void): void; /** * ćŽé€€ćˆ°äžŠæŹĄćŠ èœœçš„éĄ”éą * WebviewçȘ—ćŁćŽ†ćČèź°ćœ•æ“äœœïŒŒćŽé€€ćˆ°çȘ—ćŁäžŠæŹĄćŠ èœœçš„HTMLéĄ”éąă€‚ @@ -9348,14 +9344,14 @@ interface PlusWebviewWebviewObject { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) */ - canBack(queryCallback?: (result: any) => void): void; + canBack(queryCallback?: () => void): void; /** * æŸ„èŻąWebviewçȘ—ćŁæ˜ŻćŠćŻć‰èż› * WebviewçȘ—ćŁćŽ†ćČèź°ćœ•æŸ„èŻąæ“äœœïŒŒèŽ·ć–Webviewæ˜ŻćŠćŻć‰èż›ćˆ°ćŽ†ćČćŠ èœœçš„éĄ”éąïŒŒç»“æžœé€šèż‡queryCallbackć›žè°ƒæ–čæł•èż”ć›žă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) */ - canForward(queryCallback?: (result: any) => void): void; + canForward(queryCallback?: () => void): void; /** * æŁ€æ”‹WebviewçȘ—ćŁæ˜ŻćŠæžČæŸ“ćźŒæˆ * æŁ€æ”‹æ–čćŒäžșćˆ€æ–­çš„WebviewçȘ—ćŁć†…ćźčæ˜ŻćŠäžșç™œć±ïŒŒćŠ‚æžœéžç™œć±ćˆ™èź€äžșæžČæŸ“ćźŒæˆïŒŒćŠćˆ™èź€äžșæžČ染æœȘćźŒæˆă€‚ @@ -9363,7 +9359,7 @@ interface PlusWebviewWebviewObject { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) */ - checkRenderedContent(options?: PlusWebviewWebviewRenderedEventOptions, successCallback?: Function, errorCallback?: (result: any) => void): void; + checkRenderedContent(options?: PlusWebviewWebviewRenderedEventOptions, successCallback?: () => void, errorCallback?: () => void): void; /** * èŽ·ć–WebviewçȘ—ćŁçš„æ‰€æœ‰ć­WebviewçȘ—揣 * èŽ·ć–æ·»ćŠ ćˆ°WebviewçȘ—ćŁäž­çš„æ‰€æœ‰ć­WebviewçȘ—ćŁïŒŒćŠ‚æžœæČĄæœ‰ć­WebviewçȘ—ćŁćˆ™èż”ć›žç©șæ•°ç»„ă€‚ @@ -9392,14 +9388,14 @@ interface PlusWebviewWebviewObject { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) */ - drag(options?: PlusWebviewWebviewDragOptions, otherView?: PlusWebviewWebviewDragOtherViewOptions, callback?: (result: PlusWebviewWebviewDragEvent) => void): void; + drag(options?: PlusWebviewWebviewDragOptions, otherView?: PlusWebviewWebviewDragOtherViewOptions, callback?: () => void): void; /** * æˆȘć±ç»˜ćˆ¶ * 氆WebviewçȘ—ćŁçš„ćŻè§†ćŒș㟟æˆȘć±ćč¶ç»˜ćˆ¶ćˆ°Bitmapć›Ÿç‰‡ćŻčè±Ąäž­ă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) */ - draw(bitmap?: PlusNativeObjBitmap, successCallback?: Function, errorCallback?: (result: any) => void, options?: PlusWebviewWebviewDrawOptions): void; + draw(bitmap?: PlusNativeObjBitmap, successCallback?: () => void, errorCallback?: () => void, options?: PlusWebviewWebviewDrawOptions): void; /** * 结束WebviewçȘ—ćŁçš„äž‹æ‹‰ćˆ·æ–° * ć…łé—­äž‹æ‹‰ćˆ·æ–°æ•ˆæžœïŒŒæąć€ćˆ°ćŒ€ć§‹äž‹æ‹‰ćˆ·æ–°äč‹ć‰çš„æ•ˆæžœă€‚ @@ -9518,7 +9514,7 @@ interface PlusWebviewWebviewObject { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) */ - listenResourceLoading(options?: PlusWebviewWebviewListenResourceOptions, callback?: (result: any) => void): void; + listenResourceLoading(options?: PlusWebviewWebviewListenResourceOptions, callback?: () => void): void; /** * ćŠ èœœæ–°HTMLæ•°æź * è§Šć‘WebviewçȘ—ćŁćŠ èœœHTMLéĄ”éąæ•°æźïŒŒćŠ‚æžœHTMLæ•°æźæ— æ•ˆć°†ćŻŒè‡ŽéĄ”éąćŠ èœœć€±èŽ„ă€‚ @@ -9571,7 +9567,7 @@ interface PlusWebviewWebviewObject { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) */ - overrideUrlLoading(options?: PlusWebviewWebviewOverrideUrlOptions, callback?: (result: any) => void): void; + overrideUrlLoading(options?: PlusWebviewWebviewOverrideUrlOptions, callback?: () => void): void; /** * èŽ·ć–ćœ“ć‰WebviewçȘ—ćŁçš„çˆ¶çȘ—揣 * WebviewçȘ—ćŁäœœäžș歐çȘ—ćŁæ·»ćŠ ïŒˆWebview.appendïŒ‰ćˆ°ć…¶ćźƒWebviewçȘ—ćŁäž­æ—¶æœ‰æ•ˆïŒŒèż™æ—¶ć…¶ćźƒWebviewçȘ—揣äžș父çȘ—ćŁă€‚ @@ -9616,7 +9612,7 @@ interface PlusWebviewWebviewObject { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) */ - removeEventListener(event?: PlusWebviewWebviewEvent, listener?: (result: any) => void): void; + removeEventListener(event?: PlusWebviewWebviewEvent, listener?: () => void): void; /** * 从父çȘ—ćŁäž­ç§»é™€ * ä»Žæ‰€ć±žçš„çˆ¶WebviewçȘ—ćŁç§»é™€ïŒŒćŠ‚æžœæČĄæœ‰çˆ¶çȘ—ćŁïŒŒćˆ™æ— ä»»äœ•äœœç”šă€‚ @@ -9698,7 +9694,7 @@ interface PlusWebviewWebviewObject { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) */ - setPullToRefresh(style?: PlusWebviewWebviewPullToRefreshStyles, refreshCB?: Function): void; + setPullToRefresh(style?: PlusWebviewWebviewPullToRefreshStyles, refreshCB?: () => void): void; /** * èźŸçœźWebviewçȘ—揣renderedäș‹ä»¶ć‚æ•° * ćŻèźŸçœźéĄ”éąæžČæŸ“ćźŒæˆçš„ćˆ€æ–­æ ‡ć‡†ïŒŒćŠ‚ćˆ€æ–­éĄ”éąéĄ¶éƒšćŒș柟、侭问ćŒșćŸŸă€æˆ–ćș•郚ćŒș柟。 @@ -9741,7 +9737,7 @@ interface PlusWebviewWebviewObject { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) */ - show(aniShow?: PlusWebviewAnimationTypeShow, duration?: number, showedCB?: Function, extras?: PlusWebviewWebviewExtraOptions): void; + show(aniShow?: PlusWebviewAnimationTypeShow, duration?: number, showedCB?: () => void, extras?: PlusWebviewWebviewExtraOptions): void; /** * ćœšæŒ‡ćźšWebviewçȘ—ćŁćŽæ˜Ÿç€ș * ćœ“è°ƒç”šplus.webview.createæ–čæł•ćˆ›ć»șWebviewçȘ—ćŁćŽïŒŒćŻè°ƒç”šć…¶showBehindæ–čæł•星ç€șćœšæŒ‡ćźšWebviewçȘ—揣äč‹ćŽă€‚ @@ -11795,21 +11791,21 @@ interface PlusNetXMLHttpRequest { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) */ - onreadystatechange?: Function; + onreadystatechange?: () => void; /** * çœ‘ç»œèŻ·æ±‚ćŒ€ć§‹äș‹ä»¶ * é€šćžžćœšè°ƒç”šsendæ–čæł•ćŒ€ć§‹ć‘è”·HTTPèŻ·æ±‚æ—¶è§Šć‘ă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) */ - onloadstart?: (result: PlusNetProgressEvent) => void; + onloadstart?: () => void; /** * çœ‘ç»œèŻ·æ±‚äŒ èŸ“æ•°æźäș‹ä»¶ * 通澾朹HTTPèŻ·æ±‚é“ŸæŽ„ć·Č经ć»șç«‹ïŒŒćŒ€ć§‹äŒ èŸ“æ•°æźæ—¶è§Šć‘ïŒŒćœšæ•°æźäŒ èŸ“çš„èż‡çš‹äž­ćŻèƒœć€šæŹĄè§Šć‘ïŒŒæ­€äș‹ä»¶äžŽonreadystatechangeäș‹ä»¶è§Šć‘状态3ç±»äŒŒă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) */ - onprogress?: (result: PlusNetProgressEvent) => void; + onprogress?: () => void; /** * çœ‘ç»œèŻ·æ±‚ć–æ¶ˆäș‹ä»¶ * é€šćžžćœšè°ƒç”šabortæ–čæł•ć–æ¶ˆHTTPèŻ·æ±‚æ—¶è§Šć‘ă€‚ @@ -11817,7 +11813,7 @@ interface PlusNetXMLHttpRequest { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) */ - onabort?: (result: PlusNetProgressEvent) => void; + onabort?: () => void; /** * çœ‘ç»œèŻ·æ±‚é”™èŻŻäș‹ä»¶ * 通澾朹HTTPèŻ·æ±‚ć‘ç”Ÿé”™èŻŻæ—¶è§Šć‘ïŒŒćŠ‚æ— æł•èżžæŽ„ćˆ°æœćŠĄć™šç­‰ć„ç§é”™èŻŻéƒœè§Šć‘æ­€äș‹ä»¶ă€‚ @@ -11825,7 +11821,7 @@ interface PlusNetXMLHttpRequest { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) */ - onerror?: (result: PlusNetProgressEvent) => void; + onerror?: () => void; /** * çœ‘ç»œèŻ·æ±‚æˆćŠŸäș‹ä»¶ * 通澾朹HTTPèŻ·æ±‚æˆćŠŸćźŒæˆæ—¶è§Šć‘ïŒŒćŠ‚æžœHTTPèŻ·æ±‚ć‘ç”Ÿé”™èŻŻćˆ™äžè§Šć‘æ­€äș‹ä»¶ă€‚ @@ -11833,7 +11829,7 @@ interface PlusNetXMLHttpRequest { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) */ - onload?: (result: PlusNetProgressEvent) => void; + onload?: () => void; /** * çœ‘ç»œèŻ·æ±‚è¶…æ—¶äș‹ä»¶ * 通澾朹HTTPèŻ·æ±‚è¶…æ—¶æ—¶è§Šć‘ïŒŒæ­€æ—¶äžäŒšè§Šć‘onerroräș‹ä»¶ă€‚ @@ -11841,7 +11837,7 @@ interface PlusNetXMLHttpRequest { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) */ - ontimeout?: (result: PlusNetProgressEvent) => void; + ontimeout?: () => void; /** * çœ‘ç»œèŻ·æ±‚ç»“æŸäș‹ä»¶ * 通澾朹HTTPèŻ·æ±‚ç»“æŸæ—¶è§Šć‘ïŒŒäžçźĄæ˜ŻHTTPèŻ·æ±‚ć€±èŽ„ă€æˆćŠŸă€æˆ–è¶…æ—¶äč‹ćŽéƒœäŒšè§Šć‘æ­€äș‹ä»¶ă€‚ @@ -11849,7 +11845,7 @@ interface PlusNetXMLHttpRequest { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) */ - onloadend?: (result: PlusNetProgressEvent) => void; + onloadend?: () => void; /** * ć–æ¶ˆćœ“ć‰ć“ćș”ïŒŒć…łé—­èżžæŽ„ćč¶äž”结束任䜕æœȘć†łçš„çœ‘ç»œæŽ»ćŠš * æ­€æ–čæł•把XMLHttpRequestćŻčè±Ąé‡çœźäžșreadyStateäžș0的状态ćč¶äž”ć–æ¶ˆæ‰€æœ‰æœȘć†łçš„çœ‘ç»œæŽ»ćŠšă€‚ @@ -11987,20 +11983,20 @@ interface PlusZip { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) */ - compress(src?: string, zipfile?: string, successCB?: Function, errorCB?: (result: any) => void): void; + compress(src?: string, zipfile?: string, successCB?: () => void, errorCB?: () => void): void; /** * è§ŁćŽ‹çŒ©Zip文件 * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) */ - decompress(zipfile?: string, target?: string, successCB?: Function, errorCB?: (result: any) => void): void; + decompress(zipfile?: string, target?: string, successCB?: () => void, errorCB?: () => void): void; /** * ć›Ÿç‰‡ćŽ‹çŒ©èœŹæą * 揯甹äșŽć›Ÿç‰‡çš„èŽšé‡ćŽ‹çŒ©ă€ć€§ć°çŒ©æ”Ÿă€æ–čć‘æ—‹èœŹă€ćŒșćŸŸèŁć‰Șă€æ ŒćŒèœŹæąç­‰ă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) */ - compressImage(options?: PlusZipCompressImageOptions, successCB?: (result: any) => void, errorCB?: (result: any) => void): void; + compressImage(options?: PlusZipCompressImageOptions, successCB?: () => void, errorCB?: () => void): void; } /** @@ -12294,7 +12290,7 @@ interface PlusBarcode { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) */ - scan(path?: string, successCB?: (result0: number, result1: string, result2: string) => void, errorCB?: (result: any) => void, filters?: any []): void; + scan(path?: string, successCB?: () => void, errorCB?: () => void, filters?: any []): void; /** * 戛ć»șBarcodećŻčè±Ą * 调甚歀æ–čæł•ćˆ›ć»ș搎ćč¶äžäŒšæ˜Ÿç€ș需芁调甚WebviewçȘ—ćŁçš„appendæ–čæł•ć°†ć…¶æ·»ćŠ ćˆ°WebviewçȘ—ćŁćŽæ‰èƒœæ˜Ÿç€ș。 @@ -12325,14 +12321,14 @@ interface PlusBarcodeBarcode { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) */ - onmarked?: (result0: number, result1: string, result2: string) => void; + onmarked?: () => void; /** * æĄç èŻ†ćˆ«é”™èŻŻäș‹ä»¶ * ææŽ§ä»¶èŻ†ćˆ«èż‡çš‹äž­ć‘ç”Ÿé”™èŻŻæ—¶è§Šć‘çš„ć€±èŽ„äș‹ä»¶ïŒŒćč¶èż”ć›žé”™èŻŻäżĄæŻă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) */ - onerror?: (result: any) => void; + onerror?: () => void; /** * ćŒ€ć§‹æĄç èŻ†ćˆ« * ćŒ€ć§‹è°ƒç”šçł»ç»Ÿæ‘„ćƒć€ŽèŽ·ć–ć›Ÿç‰‡æ•°æźèż›èĄŒæ‰«ç èŻ†ćˆ«ïŒŒćœ“èŻ†ćˆ«ć‡șæĄç æ•°æźæ—¶é€šèż‡onmarkedć›žè°ƒć‡œæ•°èż”ć›žă€‚ @@ -12663,14 +12659,14 @@ interface PlusMapsMap { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) */ - onclick?: (result: PlusMapsPoint) => void; + onclick?: () => void; /** * ćœ°ć›ŸçŠ¶æ€æ”č揘äș‹ä»¶ * ç”šæˆ·æ‹–ćŠšă€çŒ©æ”Ÿćœ°ć›Ÿç­‰æ“äœœćźŒæˆćŽè§Šć‘ă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) */ - onstatuschanged?: (result: any) => void; + onstatuschanged?: () => void; /** * 静态æ–čæł•ïŒŒèźĄçź—éąç§Ż * èźĄçź—æŒ‡ćźšćœ°ç†ćŒșćŸŸçš„éąç§ŻïŒŒć•äœäžșćčłæ–č米。 @@ -12678,14 +12674,14 @@ interface PlusMapsMap { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) */ - calculateArea(bounds?: PlusMapsBounds, successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; + calculateArea(bounds?: PlusMapsBounds, successCallback?: () => void, errorCallback?: () => void): void; /** * 静态æ–čæł•ïŒŒèźĄçź—è·çŠ» * èźĄçź—ä»ŽpointStartćæ ‡ç‚č戰pointEndćæ ‡çš„ćźžé™…ç›Žçșżè·çŠ»ïŒŒć•äœäžșç±łïŒˆmïŒ‰ă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) */ - calculateDistance(pointStart?: PlusMapsPoint, pointEnd?: PlusMapsPoint, successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; + calculateDistance(pointStart?: PlusMapsPoint, pointEnd?: PlusMapsPoint, successCallback?: () => void, errorCallback?: () => void): void; /** * 静态æ–čæł•ïŒŒćæ ‡èœŹæą * 氆第侉æ–čćæ ‡çł»ćæ ‡èœŹæąæˆćœ“ć‰ćœ°ć›Ÿçš„ćæ ‡çł»ćæ ‡ă€‚ @@ -12693,7 +12689,7 @@ interface PlusMapsMap { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) */ - convertCoordinates(point?: PlusMapsPoint, options?: PlusMapsCoordinateConvertOptions, successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; + convertCoordinates(point?: PlusMapsPoint, options?: PlusMapsCoordinateConvertOptions, successCallback?: () => void, errorCallback?: () => void): void; /** * 静态æ–čæł•ïŒŒćœ°ç†çŒ–ç  * ć°†ćœ°ç†äœçœźäżĄæŻèœŹæąäžșćæ ‡ç‚č。 @@ -12701,7 +12697,7 @@ interface PlusMapsMap { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) */ - geocode(address?: string, options?: PlusMapsGeocodeOptions, successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; + geocode(address?: string, options?: PlusMapsGeocodeOptions, successCallback?: () => void, errorCallback?: () => void): void; /** * 静态æ–čæł•ïŒŒćć‘ćœ°ç†çŒ–ç  * ć°†ćæ ‡ç‚čèœŹæąäžșćœ°ç†äœçœźäżĄæŻă€‚ @@ -12709,7 +12705,7 @@ interface PlusMapsMap { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) */ - reverseGeocode(point?: PlusMapsPoint, options?: PlusMapsGeocodeOptions, successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; + reverseGeocode(point?: PlusMapsPoint, options?: PlusMapsGeocodeOptions, successCallback?: () => void, errorCallback?: () => void): void; /** * ć‘ćœ°ć›Ÿäž­æ·»ćŠ èŠ†ç›–ç‰© * æ­€æ–čæł•甚äșŽć‘ćœ°ć›Ÿäž­æ·»ćŠ èŠ†ç›–ç‰©ă€‚ @@ -12765,7 +12761,7 @@ interface PlusMapsMap { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) */ - getCurrentCenter(callback?: (result0: number, result1: PlusMapsPoint) => void): boolean; + getCurrentCenter(callback?: () => void): boolean; /** * èŽ·ć–ćœ°ć›Ÿçš„æ˜Ÿç€ș类枋 * @@ -12779,7 +12775,7 @@ interface PlusMapsMap { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) */ - getUserLocation(callback?: (result0: number, result1: PlusMapsPoint) => void): boolean; + getUserLocation(callback?: () => void): boolean; /** * èŽ·ć–ćœ°ć›Ÿçš„çŒ©æ”Ÿçș§ćˆ« * æ­€æ–čæł•甚äșŽèźŸçœźćœ°ć›Ÿçš„猩攟çș§ćˆ«ïŒŒç”šäșŽćˆ‡æąćœ“ć‰æ˜Ÿç€șćœ°ć›ŸçŒ©æ”Ÿçș§ćˆ«ă€‚ @@ -13204,14 +13200,14 @@ interface PlusMapsMarker { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) */ - onclick?: (result: PlusMapsOverlay) => void; + onclick?: () => void; /** * 甚户拖拜标ç‚čäș‹ä»¶ * ćŻè°ƒç”šæ ‡ç‚čćŻčè±Ąçš„markObj.setDraggable(true)æ–čæł•èźŸçœźæ ‡ç‚čć…èźžæ‹–æ‹œïŒŒćœ“ç”šæˆ·æ‹–æ‹œæ ‡ç‚čćŻčè±Ąæ—¶è§Šć‘æ­€äș‹ä»¶ă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) */ - onDrag?: (result: any) => void; + onDrag?: () => void; /** * 芆盖物星ç€șćˆ°æœ€äžŠć±‚ * 澾甹äșŽèŠ†ç›–ç‰©ç›žäș’芆盖时调敎芆盖物的星ç€șéĄșćșă€‚ @@ -13313,7 +13309,7 @@ interface PlusMapsBubble { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) */ - onclick?: (result: PlusMapsOverlay) => void; + onclick?: () => void; /** * èźŸçœźæ°”æłĄäžŠæ˜Ÿç€șçš„ć›Ÿæ ‡ * è‹„äžșèźŸçœźćˆ™æ— é»˜èź€ć›Ÿæ ‡ïŒŒć·Čæ·»ćŠ çš„æ˜Ÿç€șçš„æ°”æłĄćœšèźŸçœźæ–°ć€ŒćŽć°†ćœšćœ°ć›ŸäžŠç«‹ćłæ›Žæ–°ć†…ćźč。 @@ -13627,13 +13623,13 @@ interface PlusMapsSearch { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) */ - onPoiSearchComplete?: (result0: number, result1: PlusMapsSearchPoiResult) => void; + onPoiSearchComplete?: () => void; /** * çșżè·ŻæŁ€çŽąćźŒæˆäș‹ä»¶ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) */ - onRouteSearchComplete?: (result0: number, result1: PlusMapsSearchRouteResult) => void; + onRouteSearchComplete?: () => void; /** * èźŸçœźæŁ€çŽąèż”ć›žç»“æžœæŻéĄ”çš„äżĄæŻæ•°ç›ź * ćœ°ć›ŸæŁ€çŽąç»“æžœæ˜ŻæŒ‰éĄ”èż”ć›žçš„ïŒŒé»˜èź€æŁ€çŽąæŻéĄ”èż”ć›ž10æĄäżĄæŻă€‚ @@ -14013,7 +14009,7 @@ interface PlusOauth { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) */ - getServices(successCB?: (result: PlusOauth []) => void, errorCB?: (result: any) => void): void; + getServices(successCB?: () => void, errorCB?: () => void): void; } /** @@ -14076,7 +14072,7 @@ interface PlusOauthAuthService { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) */ - authorize(successCallback?: (result: any) => void, errorCallback?: (result: any) => void, options?: PlusOauthAuthOptions): void; + authorize(successCallback?: () => void, errorCallback?: () => void, options?: PlusOauthAuthOptions): void; /** * èŻ·æ±‚ç™»ćœ•æŽˆæƒèź€èŻæ“äœœ * ćŻčæŒ‡ćźšçš„ç™»ćœ•æŽˆæƒèź€èŻæœćŠĄèż›èĄŒç™»ćœ•èź€èŻæ“äœœïŒŒćœšç™»ćœ•ć‰ćŻé€šèż‡ćŻčè±Ąçš„authResultć±žæ€§ćˆ€æ–­æ˜ŻćŠć·Čç»ç™»ćœ•èź€èŻèż‡ïŒŒé€šćžžćȘ需芁ćŻčæČĄæœ‰èż›èĄŒèż‡ç™»ćœ•èź€èŻçš„æœćŠĄèż›èĄŒç™»ćœ•èź€èŻæ“äœœă€‚ @@ -14084,7 +14080,7 @@ interface PlusOauthAuthService { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) */ - login(successCallback?: (result: any) => void, errorCallback?: (result: any) => void, options?: PlusOauthAuthOptions): void; + login(successCallback?: () => void, errorCallback?: () => void, options?: PlusOauthAuthOptions): void; /** * æłšé”€ç™»ćœ•æŽˆæƒèź€èŻ * ćŻčæŒ‡ćźšçš„ç™»ćœ•æŽˆæƒèź€èŻæœćŠĄæłšé”€ç™»ćœ•èź€èŻæ“äœœïŒŒæłšé”€æŽˆæƒèź€èŻćŽïŒŒć†æŹĄæ“äœœæ—¶éœ€é‡æ–°èż›èĄŒç™»ćœ•èź€èŻæ“äœœă€‚ @@ -14092,7 +14088,7 @@ interface PlusOauthAuthService { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) */ - logout(successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; + logout(successCallback?: () => void, errorCallback?: () => void): void; /** * èŽ·ć–ç™»ćœ•æŽˆæƒç”šæˆ·äżĄæŻ * èŽ·ć–ç™»ćœ•æŽˆæƒèź€èŻçš„ç”šæˆ·äżĄæŻïŒŒćœšèŽ·ć–ć‰ćŻé€šèż‡ćŻčè±Ąçš„userInfoć±žæ€§ćˆ€æ–­æ˜ŻćŠć·Čç»èŽ·ć–èż‡ïŒŒé€šćžžćȘ需芁ćŻčæČĄæœ‰èŽ·ć–èż‡ç”šæˆ·äżĄæŻçš„æœćŠĄèż›èĄŒæ“äœœă€‚ @@ -14100,14 +14096,14 @@ interface PlusOauthAuthService { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) */ - getUserInfo(successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; + getUserInfo(successCallback?: () => void, errorCallback?: () => void): void; /** * æ·»ćŠ ç”šæˆ·æ‰‹æœșć·äżĄæŻ * æ‰“ćŒ€ç™»ćœ•æŽˆæƒæœćŠĄçš„æ·»ćŠ ç”šæˆ·æ‰‹æœșć·ç•Œéąèż›èĄŒæ“äœœïŒŒæ·»ćŠ ç”šæˆ·æ‰‹æœșć·æ“äœœæˆćŠŸćŽé€šèż‡successCallbackć›žè°ƒć‡œæ•°é€šçŸ„ïŒŒćŠćˆ™é€šèż‡errorCallbackć›žè°ƒć‡œæ•°é€šçŸ„ă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) */ - addPhoneNumber(successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; + addPhoneNumber(successCallback?: () => void, errorCallback?: () => void): void; } /** @@ -14345,7 +14341,7 @@ interface PlusPayment { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) */ - getChannels(successCB?: (result: PlusPayment []) => void, errorCB?: (result: any) => void): void; + getChannels(successCB?: () => void, errorCB?: () => void): void; /** * èŻ·æ±‚æ”Żä»˜æ“äœœ * è°ƒç”šæŒ‡ćźšçš„æ”Żä»˜é€šé“èż›èĄŒæ”Żä»˜æ“äœœïŒŒć…¶äž­statementćŒ…ć«æ”Żä»˜æ“äœœçš„ç›žć…łäżĄæŻïŒŒæ”Żä»˜æšĄć—ć°†ćŒčć‡șæ”Żä»˜ç•ŒéąäŸ›ç”šæˆ·èż›èĄŒæ”Żä»˜äżĄæŻçš„èŸ“ć…„çĄźèź€æ“äœœă€‚ @@ -14353,7 +14349,7 @@ interface PlusPayment { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) */ - request(channel?: PlusPaymentPaymentChannel, statement?: string, successCB?: (result: PlusPaymentPaymentResult) => void, errorCB?: (result: any) => void): void; + request(channel?: PlusPaymentPaymentChannel, statement?: string, successCB?: () => void, errorCB?: () => void): void; } /** @@ -14405,14 +14401,14 @@ interface PlusPaymentPaymentChannel { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) */ - requestOrder(ids?: any [], successCB?: (result: PlusPayment []) => void, errorCB?: (result: any) => void): void; + requestOrder(ids?: any [], successCB?: () => void, errorCB?: () => void): void; /** * 搑IAPæœćŠĄć™šèŻ·æ±‚ć·Č经莭äč°çš„éžæ¶ˆè€—æ€§ć•†ć“ć’Œèźąé˜…ć•†ć“ * æłšæ„ïŒšäžèƒœèŽ·ć–ć·Č莭äč°çš„æ¶ˆè€—æ€§ć•†ć“ă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) */ - restoreComplateRequest(options?: any, successCB?: (result: PlusPayment []) => void): void; + restoreComplateRequest(options?: any, successCB?: () => void): void; } /** @@ -14618,7 +14614,7 @@ interface PlusPush { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) */ - addEventListener(type?: string, listener?: (result: string) => void, capture?: boolean): void; + addEventListener(type?: string, listener?: () => void, capture?: boolean): void; /** * æž…ç©șæ‰€æœ‰æŽšé€æ¶ˆæŻ * æž…ç©șçł»ç»Ÿæ¶ˆæŻäž­ćżƒæ‰€æœ‰çš„æŽšé€æ¶ˆæŻă€‚ @@ -14864,7 +14860,7 @@ interface PlusShare { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) */ - getServices(successCB?: (result: PlusShare []) => void, errorCB?: (result: any) => void): void; + getServices(successCB?: () => void, errorCB?: () => void): void; /** * äœżç”šçł»ç»Ÿç»„ä»¶ć‘é€ćˆ†äș« * è°ƒç”šçł»ç»Ÿćˆ†äș«ç»„ä»¶ćˆ†äș«æ¶ˆæŻïŒŒé€šèż‡msgć‚æ•°èźŸçœźćˆ†äș«ć†…ćźč。 @@ -14872,7 +14868,7 @@ interface PlusShare { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) */ - sendWithSystem(msg?: PlusShareShareMessage, successCB?: Function, errorCB?: (result: any) => void): void; + sendWithSystem(msg?: PlusShareShareMessage, successCB?: () => void, errorCB?: () => void): void; } /** @@ -14936,14 +14932,14 @@ interface PlusShareAuthorize { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) */ - onauthenticated?: Function; + onauthenticated?: () => void; /** * 戆äș«æŽˆæƒèź€èŻć€±èŽ„äș‹ä»¶ * ç”šæˆ·ćœšćˆ†äș«æŽˆæƒæŽ§ä»¶äžŠèŸ“ć…„æ“äœœæŽˆæƒèź€èŻé”™èŻŻæ—¶è§Šć‘ïŒŒäș‹ä»¶æ–čæł•æ ŒćŒć‚è€ƒShareErrorCallbackć›žè°ƒć‡œæ•°ă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) */ - onerror?: (result: any) => void; + onerror?: () => void; /** * ćŠ èœœćˆ†äș«æŽˆæƒéĄ”靱 * 戛ć»ș戆äș«æŽˆæƒéĄ”éąćŽïŒŒéœ€èŠè°ƒç”šæ­€æ–čæł•æŒ‡ćźšćˆ†äș«æœćŠĄæ ‡èŻ†æ„ćŠ èœœæŽˆæƒéĄ”éąæ•°æźïŒŒæ­€æ ‡èŻ†ćŻäœżç”šShareServicećŻčè±Ąçš„idć±žæ€§ă€‚ @@ -15035,7 +15031,7 @@ interface PlusShareShareService { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) */ - authorize(successCallback?: (result: PlusShareShareService) => void, errorCallback?: (result: any) => void, options?: PlusShareAuthOptions): void; + authorize(successCallback?: () => void, errorCallback?: () => void, options?: PlusShareAuthOptions): void; /** * ć–æ¶ˆæŽˆæƒèź€èŻ * ćŻčæŒ‡ćźšçš„ćˆ†äș«æœćŠĄć–æ¶ˆæŽˆæƒèź€èŻæ“äœœïŒŒć–æ¶ˆæŽˆæƒèź€èŻćŽïŒŒć†æŹĄćˆ†äș«æ—¶éœ€é‡æ–°èż›èĄŒæŽˆæƒæ“äœœă€‚ @@ -15050,7 +15046,7 @@ interface PlusShareShareService { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) */ - send(msg?: PlusShareShareMessage, successCB?: Function, errorCB?: (result: any) => void): void; + send(msg?: PlusShareShareMessage, successCB?: () => void, errorCB?: () => void): void; /** * è°ƒç”šćŸźäżĄć°çš‹ćș * æłšæ„ïŒšéœ€ćœšćŸźäżĄćŒ€æ”Ÿćčłć°ć°†ćș”ç”šć…łè”ć°çš‹ćșæ‰èƒœæ­Łćžžè°ƒç”šă€‚ @@ -15279,7 +15275,7 @@ interface PlusSpeech { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) */ - startRecognize(options?: PlusSpeechSpeechRecognizeOptions, successCB?: (result: string) => void, errorCB?: (result: any) => void): void; + startRecognize(options?: PlusSpeechSpeechRecognizeOptions, successCB?: () => void, errorCB?: (result: any) => void): void; /** * ćœæ­ąèŻ­éŸłèŻ†ćˆ« * ćœ“èŻ­éŸłèŻ†ćˆ«ćźŒæˆæ—¶æˆ–ç”šæˆ·ć–æ¶ˆèŻ­éŸłèŻ†ćˆ«æ—¶è°ƒç”šïŒŒè°ƒç”šæ­€æ–čæł•ć°†ćŻŒè‡ŽerrorCallbackć›žè°ƒć‡œæ•°çš„è°ƒç”šă€‚ @@ -15294,7 +15290,7 @@ interface PlusSpeech { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) */ - addEventListener(event?: PlusSpeechSpeechRecoginzeEvents, listener?: (result: any) => void, capture?: boolean): void; + addEventListener(event?: PlusSpeechSpeechRecoginzeEvents, listener?: () => void, capture?: boolean): void; } /** diff --git a/types/html5plus/tslint.json b/types/html5plus/tslint.json index a41bf5d19a..661e47a018 100644 --- a/types/html5plus/tslint.json +++ b/types/html5plus/tslint.json @@ -1,79 +1,7 @@ { "extends": "dtslint/dt.json", "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false + "no-trailing-whitespace": false } -} +} \ No newline at end of file From e1f303170cd112a6818474233ad3d80aaffcca80 Mon Sep 17 00:00:00 2001 From: qiang Date: Tue, 5 Mar 2019 11:57:47 +0800 Subject: [PATCH 357/924] change types for html5plus --- types/html5plus/index.d.ts | 326 ++++++++++++++++++------------------- 1 file changed, 163 insertions(+), 163 deletions(-) diff --git a/types/html5plus/index.d.ts b/types/html5plus/index.d.ts index 808d31a9e5..2993f829b6 100644 --- a/types/html5plus/index.d.ts +++ b/types/html5plus/index.d.ts @@ -291,7 +291,7 @@ interface PlusAccelerometer { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/accelerometer.html](http://www.html5plus.org/doc/zh_cn/accelerometer.html) */ - getCurrentAcceleration(successCB?: () => void, errorCB?: () => void): void; + getCurrentAcceleration(successCB?: (result: PlusAccelerometerAcceleration) => void, errorCB?: (result: any) => void): void; /** * ç›‘ćŹèźŸć€‡ćŠ é€ŸćșŠć˜ćŒ–äżĄæŻ * 抠速ćșŠæ˜ŻèźŸć€‡ćœšćœ“ć‰æ–čć‘äžŠæ‰€ćšç›žćŻčèżćŠšć˜ćŒ–ïŒˆćąžă€ć‡é‡ïŒ‰çš„èżćŠšäŒ æ„Ÿć™šă€‚ćŠ é€ŸćșŠäżĄæŻćŒ…æ‹Źx、y、z侉äžȘæ–čć‘çš„äżĄæŻă€‚ @@ -300,7 +300,7 @@ interface PlusAccelerometer { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/accelerometer.html](http://www.html5plus.org/doc/zh_cn/accelerometer.html) */ - watchAcceleration(successCB?: () => void, errorCB?: () => void, options?: PlusAccelerometerAccelerometerOption): number; + watchAcceleration(successCB?: (result: PlusAccelerometerAcceleration) => void, errorCB?: (result: any) => void, options?: PlusAccelerometerAccelerometerOption): number; /** * ć…łé—­ç›‘ćŹèźŸć€‡ćŠ é€ŸćșŠäżĄæŻ * ć…łé—­ç›‘ćŹèźŸć€‡ćŠ é€ŸćșŠäżĄæŻïŒŒćș”ç”šć…łé—­è°ƒç”šwatchAccelerationæ–čæł•çš„ćŒ€ćŻçš„ç›‘ćŹæ“äœœă€‚ @@ -558,7 +558,7 @@ interface PlusAudioAudioRecorder { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) */ - record(option?: PlusAudioRecordOptions, successCB?: () => void, errorCB?: () => void): void; + record(option?: PlusAudioRecordOptions, successCB?: (result: string) => void, errorCB?: (result: any) => void): void; /** * ç»“æŸćœ•éŸłæ“äœœ * ç»“æŸćœ•éŸłæ“äœœïŒŒé€šçŸ„èźŸć€‡ćźŒæˆćœ•éŸłæ“äœœă€‚ćœ•éŸłćźŒæˆćŽć°†è°ƒç”šrecordæ–čæł•äž­äŒ ć…„çš„successCBć›žè°ƒèż”ć›žćœ•éŸłæ–‡ä»¶ă€‚ @@ -580,7 +580,7 @@ interface PlusAudioAudioPlayer { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) */ - play(successCB?: () => void, errorCB?: () => void): void; + play(successCB?: () => void, errorCB?: (result: any) => void): void; /** * æš‚ćœæ’­æ”ŸéŸłéą‘ * éœ€ć…ˆè°ƒç”šcreatePlayeræ–čæł•ćˆ›ć»șéŸłéą‘æ’­æ”ŸćŻčè±ĄïŒŒćč¶ćŒ€ć§‹æ’­æ”Ÿă€‚éŸłéą‘æ’­æ”ŸćŻčè±Ąćœšæ’­æ”ŸçŠ¶æ€æ‰èƒœæš‚ćœïŒŒćœšć…¶ćźƒçŠ¶æ€è°ƒç”šæ­€æ–čæł•æ— ä»»äœ•äœœç”šă€‚ @@ -716,14 +716,14 @@ interface PlusBluetooth { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) */ - closeBluetoothAdapter(success?: () => void, fail?: () => void, complete?: () => void): void; + closeBluetoothAdapter(success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; /** * èŽ·ć–æœŹæœșè“ç‰™é€‚é…ć™šçŠ¶æ€ * èŽ·ć–æˆćŠŸćŽè§Šć‘optionsć‚æ•°äž­çš„successć›žè°ƒïŒŒć€±èŽ„è§Šć‘optionsć‚æ•°äž­çš„failć›žè°ƒă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) */ - getBluetoothAdapterState(success?: () => void, fail?: () => void, complete?: () => void): void; + getBluetoothAdapterState(success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; /** * èŽ·ć–ć·ČæœçŽąćˆ°çš„è“ç‰™èźŸć€‡ * ćŒ…æ‹Źć·Čç»ć’ŒæœŹæœș怄äșŽèżžæŽ„çŠ¶æ€çš„èźŸć€‡ă€‚ @@ -731,35 +731,35 @@ interface PlusBluetooth { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) */ - getBluetoothDevices(success?: () => void, fail?: () => void, complete?: () => void): void; + getBluetoothDevices(success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; /** * æ čæźuuidèŽ·ć–ć€„äșŽć·ČèżžæŽ„çš„èźŸć€‡ * èŽ·ć–æˆćŠŸćŽè§Šć‘optionsć‚æ•°äž­çš„successć›žè°ƒïŒŒć€±èŽ„è§Šć‘optionsć‚æ•°äž­çš„failć›žè°ƒă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) */ - getConnectedBluetoothDevices(services?: any [], success?: () => void, fail?: () => void, complete?: () => void): void; + getConnectedBluetoothDevices(services?: any [], success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; /** * ç›‘ćŹè“ç‰™é€‚é…ć™šçŠ¶æ€ć˜ćŒ–äș‹ä»¶ * è“ç‰™é€‚é…ć™šçŠ¶æ€ć‘ç”Ÿć˜ćŒ–æ—¶è§Šć‘ć›žè°ƒă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) */ - onBluetoothAdapterStateChange(changeCB?: () => void): void; + onBluetoothAdapterStateChange(changeCB?: (result: any) => void): void; /** * ç›‘ćŹæœçŽąćˆ°æ–°èźŸć€‡çš„äș‹ä»¶ * æœçŽąćˆ°æ–°èźŸć€‡æ—¶è§Šć‘ć›žè°ƒă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) */ - onBluetoothDeviceFound(callback?: () => void): void; + onBluetoothDeviceFound(callback?: (result: any) => void): void; /** * ćˆć§‹ćŒ–è“ç‰™æšĄć— * ćˆć§‹ćŒ–æˆćŠŸćŽè§Šć‘optionsć‚æ•°äž­çš„successć›žè°ƒïŒŒć€±èŽ„è§Šć‘optionsć‚æ•°äž­çš„failć›žè°ƒă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) */ - openBluetoothAdapter(success?: () => void, fail?: () => void, complete?: () => void): void; + openBluetoothAdapter(success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; /** * ćŒ€ć§‹æœçŽąé™„èż‘çš„è“ç‰™èźŸć€‡ * æ­€æ“äœœæŻ”èŸƒè€—èŽčçł»ç»Ÿè”„æșïŒŒèŻ·ćœšæœçŽąćč¶èżžæŽ„ćˆ°èźŸć€‡ćŽè°ƒç”šstopBluetoothDevicesDiscoveryæ–čæł•ćœæ­ąæœçŽąă€‚ @@ -767,7 +767,7 @@ interface PlusBluetooth { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) */ - startBluetoothDevicesDiscovery(services?: any [], allowDuplicatesKey?: boolean, interval?: number, success?: () => void, fail?: () => void, complete?: () => void): void; + startBluetoothDevicesDiscovery(services?: any [], allowDuplicatesKey?: boolean, interval?: number, success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; /** * ćœæ­ąæœćŻ»é™„èż‘çš„è“ç‰™ć€–ć›ŽèźŸć€‡ * è‹„ć·Čç»æ‰Ÿćˆ°éœ€èŠçš„è“ç‰™èźŸć€‡ćč¶äžéœ€èŠç»§ç»­æœçŽąæ—¶ïŒŒćș”èŻ„è°ƒç”šèŻ„æŽ„ćŁćœæ­ąè“ç‰™æœçŽąă€‚ @@ -775,32 +775,32 @@ interface PlusBluetooth { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) */ - stopBluetoothDevicesDiscovery(success?: () => void, fail?: () => void, complete?: () => void): void; + stopBluetoothDevicesDiscovery(success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; /** * æ–­ćŒ€äžŽäœŽćŠŸè€—è“ç‰™èźŸć€‡çš„èżžæŽ„ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) */ - closeBLEConnection(deviceId?: string, success?: () => void, fail?: () => void, complete?: () => void): void; + closeBLEConnection(deviceId?: string, success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; /** * èżžæŽ„äœŽćŠŸè€—è“ç‰™èźŸć€‡ * è‹„äč‹ć‰ć·Čæœ‰æœçŽąèż‡æŸäžȘè“ç‰™èźŸć€‡ïŒŒćč¶æˆćŠŸć»șç«‹èżžæŽ„ïŒŒćŻç›ŽæŽ„äŒ ć…„äč‹ć‰æœçŽąèŽ·ć–çš„deviceIdć°èŻ•èżžæŽ„èŻ„èźŸć€‡ïŒŒæ— éœ€èż›èĄŒæœçŽąæ“äœœă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) */ - createBLEConnection(deviceId?: string, timeout?: number, success?: () => void, fail?: () => void, complete?: () => void): void; + createBLEConnection(deviceId?: string, timeout?: number, success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; /** * èŽ·ć–è“ç‰™èźŸć€‡æŒ‡ćźšæœćŠĄäž­æ‰€æœ‰ç‰čćŸć€Œ(characteristic) * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) */ - getBLEDeviceCharacteristics(deviceId?: string, serviceId?: string, success?: () => void, fail?: () => void, complete?: () => void): void; + getBLEDeviceCharacteristics(deviceId?: string, serviceId?: string, success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; /** * èŽ·ć–è“ç‰™èźŸć€‡çš„æ‰€æœ‰æœćŠĄ(service) * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) */ - getBLEDeviceServices(deviceId?: string, success?: () => void, fail?: () => void, complete?: () => void): void; + getBLEDeviceServices(deviceId?: string, success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; /** * ćŻç”šäœŽćŠŸè€—è“ç‰™èźŸć€‡ç‰čćŸć€Œć˜ćŒ–æ—¶çš„notifyćŠŸèƒœïŒŒèźąé˜…ç‰čćŸć€Œ * è“ç‰™èźŸć€‡æœćŠĄçš„ç‰čćŸć€Œćż…éĄ»æ”ŻæŒnotify或indicateæ‰ćŻä»„æˆćŠŸè°ƒç”šă€‚ @@ -808,20 +808,20 @@ interface PlusBluetooth { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) */ - notifyBLECharacteristicValueChange(deviceId?: string, serviceId?: string, characteristicId?: string, state?: boolean, success?: () => void, fail?: () => void, complete?: () => void): void; + notifyBLECharacteristicValueChange(deviceId?: string, serviceId?: string, characteristicId?: string, state?: boolean, success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; /** * ç›‘ćŹäœŽćŠŸè€—è“ç‰™èźŸć€‡çš„ç‰čćŸć€Œć˜ćŒ–äș‹ä»¶ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) */ - onBLECharacteristicValueChange(callback?: () => void): void; + onBLECharacteristicValueChange(callback?: (result: any) => void): void; /** * ç›‘ćŹäœŽćŠŸè€—è“ç‰™èźŸć€‡èżžæŽ„çŠ¶æ€ć˜ćŒ–äș‹ä»¶ * ćŒ…æ‹ŹćŒ€ć‘è€…äž»ćŠšèżžæŽ„æˆ–æ–­ćŒ€èżžæŽ„ïŒŒèźŸć€‡äžąć€±ïŒŒèżžæŽ„ćŒ‚ćžžæ–­ćŒ€ç­‰ă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) */ - onBLEConnectionStateChange(callback?: () => void): void; + onBLEConnectionStateChange(callback?: (result: any) => void): void; /** * èŻ»ć–äœŽćŠŸè€—è“ç‰™èźŸć€‡æŒ‡ćźšç‰čćŸć€Œçš„äșŒèż›ćˆ¶æ•°æźć€Œ * æŒ‡ćźšçš„ç‰čćŸć€Œéœ€æ”ŻæŒreadæ“äœœæ‰ćŻä»„æˆćŠŸè°ƒç”šă€‚ @@ -829,7 +829,7 @@ interface PlusBluetooth { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) */ - readBLECharacteristicValue(deviceId?: string, serviceId?: string, characteristicId?: string, success?: () => void, fail?: () => void, complete?: () => void): void; + readBLECharacteristicValue(deviceId?: string, serviceId?: string, characteristicId?: string, success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; /** * ć‘äœŽćŠŸè€—è“ç‰™èźŸć€‡æŒ‡ćźšç‰čćŸć€Œć†™ć…„äșŒèż›ćˆ¶æ•°æź * æŒ‡ćźšçš„ç‰čćŸć€Œéœ€æ”ŻæŒwriteæ“äœœæ‰ćŻä»„æˆćŠŸè°ƒç”šă€‚ @@ -837,7 +837,7 @@ interface PlusBluetooth { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) */ - writeBLECharacteristicValue(deviceId?: string, serviceId?: string, characteristicId?: string, value?: ArrayBuffer, success?: () => void, fail?: () => void, complete?: () => void): void; + writeBLECharacteristicValue(deviceId?: string, serviceId?: string, characteristicId?: string, value?: ArrayBuffer, success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; } /** @@ -1042,7 +1042,7 @@ interface PlusCameraCamera { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) */ - captureImage(successCB?: () => void, errorCB?: () => void, options?: PlusCameraCameraOptions): void; + captureImage(successCB?: (result: string) => void, errorCB?: (result: any) => void, options?: PlusCameraCameraOptions): void; /** * è°ƒç”šæ‘„ćƒć€Žèż›èĄŒæ‘„ćƒæ“äœœ * æ‘„ćƒć€Žè”„æșäžșç‹Źć è”„æșïŒŒćŠ‚æžœć…¶ćźƒçš‹ćșæˆ–饔靱ć·Čç»ć ç”šæ‘„ćƒć€ŽïŒŒć†æŹĄæ“äœœćˆ™ć€±èŽ„ă€‚ @@ -1051,7 +1051,7 @@ interface PlusCameraCamera { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) */ - startVideoCapture(successCB?: () => void, errorCB?: () => void, option?: PlusCameraCameraOptions): void; + startVideoCapture(successCB?: (result: string) => void, errorCB?: (result: any) => void, option?: PlusCameraCameraOptions): void; /** * ç»“æŸæ‘„ćƒæ“äœœ * ćŒ€ć§‹è°ƒç”šæ‘„ćƒć€Žèż›èĄŒæ‘„ćƒæ“äœœćŽïŒŒćŻćœšćŽć°ç»“æŸæ‘„ćƒæ“äœœïŒŒäžŽç”šæˆ·ćœšç•Œéąç»“æŸæ“äœœæ•ˆæžœäž€è‡Žă€‚ @@ -1248,7 +1248,7 @@ interface PlusContacts { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) */ - getAddressBook(type?: number, successCB?: () => void, errorCB?: () => void): void; + getAddressBook(type?: number, successCB?: (result: PlusContactsAddressBook) => void, errorCB?: (result: any) => void): void; } /** @@ -1271,7 +1271,7 @@ interface PlusContactsAddressBook { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) */ - find(contactFields?: string [], successCB?: () => void, errorCB?: () => void, findOptions?: PlusContactsContactFindOption): void; + find(contactFields?: string [], successCB?: (result: PlusContactsContact) => void, errorCB?: (result: any) => void, findOptions?: PlusContactsContactFindOption): void; } /** @@ -1390,14 +1390,14 @@ interface PlusContactsContact { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) */ - remove(successCB?: () => void, errorCB?: () => void): void; + remove(successCB?: () => void, errorCB?: (result: any) => void): void; /** * äżć­˜è”çł»äșș * ć°†è”çł»äșșæ•°æźäżć­˜ćˆ°é€šèźŻćœ•äž­ïŒŒæ“äœœæˆćŠŸć°†é€šèż‡successCBć›žè°ƒć‡œæ•°èż”ć›žäżć­˜ç»“æžœïŒŒæ“äœœć€±èŽ„ć°†é€šèż‡é€šèż‡errorCBć›žè°ƒć‡œæ•°èż”ć›žé”™èŻŻäżĄæŻă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) */ - save(successCB?: () => void, errorCB?: () => void): void; + save(successCB?: () => void, errorCB?: (result: any) => void): void; } /** @@ -1960,14 +1960,14 @@ interface PlusDownloader { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) */ - createDownload(url?: string, options?: PlusDownloaderDownloadOptions, completedCB?: () => void): PlusDownloaderDownload; + createDownload(url?: string, options?: PlusDownloaderDownloadOptions, completedCB?: (result0: PlusDownloaderDownload, result1: number) => void): PlusDownloaderDownload; /** * æžšäžŸäž‹èœœä»»ćŠĄ * æžšäžŸæŒ‡ćźšçŠ¶æ€çš„äž‹èœœä»»ćŠĄćˆ—èĄšïŒŒé€šèż‡enumCBć›žè°ƒć‡œæ•°èż”ć›žç»“æžœă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) */ - enumerate(enumCB?: () => void, state?: PlusDownloaderDownloadState): void; + enumerate(enumCB?: (result: any []) => void, state?: PlusDownloaderDownloadState): void; /** * æž…é™€äž‹èœœä»»ćŠĄ * æž…é™€æŒ‡ćźšçŠ¶æ€çš„äž‹èœœä»»ćŠĄă€‚ @@ -2055,7 +2055,7 @@ interface PlusDownloaderDownload { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) */ - addEventListener(type?: string, listener?: () => void, capture?: boolean): void; + addEventListener(type?: string, listener?: (result0: PlusDownloaderDownload, result1: number) => void, capture?: boolean): void; /** * èŽ·ć–äž‹èœœèŻ·æ±‚HTTP操ćș”ć€ŽéƒšäżĄæŻ * HTTP操ćș”ć€Žéƒšć…šéƒšć†…ćźč䜜äžșæœȘè§Łæžçš„ć­—çŹŠäžČèż”ć›žïŒŒćŠ‚æžœæČĄæœ‰æŽ„æ”¶ćˆ°èż™äžȘHTTP操ćș”ć€Žæ•°æźæˆ–è€…äž‹èœœèŻ·æ±‚æœȘćźŒæˆćˆ™äžșç©ș歗笩äžČ。 @@ -2241,7 +2241,7 @@ interface PlusFingerprint { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) */ - authenticate(successCB?: () => void, errorCB?: () => void, options?: PlusFingerprintAuthenticateOptions): void; + authenticate(successCB?: () => void, errorCB?: (result: PlusFingerprintFingerprintError) => void, options?: PlusFingerprintAuthenticateOptions): void; /** * ć–æ¶ˆæŒ‡çșčèŻ†ćˆ«èź€èŻ * ć–æ¶ˆćœ“ć‰æ­Łćœšć€„ç†çš„æŒ‡çșčèŻ†ćˆ«èź€èŻæ“äœœă€‚ @@ -2377,7 +2377,7 @@ interface PlusGallery { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) */ - pick(succesCB?: () => void, errorCB?: () => void, options?: PlusGalleryGalleryOptions): void; + pick(succesCB?: (result: string) => void, errorCB?: (result: any) => void, options?: PlusGalleryGalleryOptions): void; /** * äżć­˜æ–‡ä»¶ćˆ°çł»ç»Ÿç›žć†Œäž­ * äżć­˜æ–‡ä»¶ćˆ°çł»ç»Ÿç›žć†Œäž­ă€‚ @@ -2386,7 +2386,7 @@ interface PlusGallery { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) */ - save(path ?: string, succesCB?: () => void, errorCB?: () => void): void; + save(path ?: string, succesCB?: (result: PlusGalleryGallerySaveEvent) => void, errorCB?: (result: any) => void): void; } /** @@ -2586,7 +2586,7 @@ interface PlusGeolocation { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) */ - getCurrentPosition(successCB?: () => void, errorCB?: () => void, options?: PlusGeolocationPositionOptions): void; + getCurrentPosition(successCB?: (result: PlusGeolocationPosition) => void, errorCB?: (result: PlusGeolocationGeolocationError) => void, options?: PlusGeolocationPositionOptions): void; /** * ç›‘ćŹèźŸć€‡äœçœźć˜ćŒ–äżĄæŻ * äœçœźäżĄæŻć°†é€šèż‡æ‰‹æœșGPSèźŸć€‡æˆ–ć…¶ćźƒäżĄæŻćŠ‚IPćœ°ć€ă€ç§»ćŠšçœ‘ç»œäżĄć·èŽ·ć–ă€‚ @@ -2595,7 +2595,7 @@ interface PlusGeolocation { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) */ - watchPosition(successCB?: () => void, errorCB?: () => void, option?: PlusGeolocationPositionOptions): number; + watchPosition(successCB?: (result: PlusGeolocationPosition) => void, errorCB?: (result: PlusGeolocationGeolocationError) => void, option?: PlusGeolocationPositionOptions): number; /** * ć…łé—­ç›‘ćŹèźŸć€‡äœçœźäżĄæŻ * @@ -2913,35 +2913,35 @@ interface PlusIbeacon { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) */ - startBeaconDiscovery(uuids?: any [], ignoretoothAvailable?: boolean, success?: () => void, fail?: () => void, complete?: () => void): void; + startBeaconDiscovery(uuids?: any [], ignoretoothAvailable?: boolean, success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; /** * ćœæ­ąæœçŽąé™„èż‘çš„iBeaconèźŸć€‡ * ć–æ¶ˆæˆćŠŸćŽè§Šć‘successCBć›žè°ƒïŒŒć€±èŽ„è§Šć‘errorCBć›žè°ƒă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) */ - stopBeaconDiscovery(success?: () => void, fail?: () => void, complete?: () => void): void; + stopBeaconDiscovery(success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; /** * èŽ·ć–ć·ČæœçŽąćˆ°çš„iBeaconèźŸć€‡ * èŽ·ć–æˆćŠŸćŽè§Šć‘successCBć›žè°ƒïŒŒć€±èŽ„è§Šć‘errorCBć›žè°ƒă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) */ - getBeacons(success?: () => void, fail?: () => void, complete?: () => void): void; + getBeacons(success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; /** * 监搬iBeaconèźŸć€‡æ›Žæ–° * iBeaconèźŸć€‡æ›Žæ–°ćŽè§Šć‘updateCBć›žè°ƒă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) */ - onBeaconUpdate(updateCB?: () => void): void; + onBeaconUpdate(updateCB?: (result: any) => void): void; /** * 监搬iBeaconæœćŠĄçŠ¶æ€ć˜ćŒ– * iBeaconæœćŠĄçŠ¶æ€ć˜ćŒ–æ—¶è§Šć‘changeCBć›žè°ƒă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) */ - onBeaconServiceChange(changeCB?: () => void): void; + onBeaconServiceChange(changeCB?: (result: any) => void): void; } /** @@ -3129,7 +3129,7 @@ interface PlusIo { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - requestFileSystem(type?: number, succesCB?: () => void, errorCB?: () => void): void; + requestFileSystem(type?: number, succesCB?: (result: PlusIoFileSystem) => void, errorCB?: (result: any) => void): void; /** * é€šèż‡URLć‚æ•°èŽ·ć–ç›źćœ•ćŻčè±Ąæˆ–æ–‡ä»¶ćŻčè±Ą * ćż«é€ŸèŽ·ć–æŒ‡ćźšçš„ç›źćœ•æˆ–æ–‡ä»¶æ“äœœćŻčè±ĄïŒŒćŠ‚é€šèż‡URLć€Œâ€œ_www/test.htmlâ€ćŻç›ŽæŽ„èŽ·ć–æ–‡ä»¶æ“äœœćŻčè±Ąă€‚ @@ -3138,7 +3138,7 @@ interface PlusIo { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - resolveLocalFileSystemURL(url ?: string, succesCB?: () => void, errorCB?: () => void): void; + resolveLocalFileSystemURL(url ?: string, succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; /** * ć°†æœŹćœ°URLè·ŻćŸ„èœŹæąæˆćčłć°ç»ćŻčè·ŻćŸ„ * 绝ćŻčè·ŻćŸ„çŹŠćˆć„ćčłć°æ–‡ä»¶è·ŻćŸ„æ ŒćŒïŒŒé€šćžžç”šäșŽNative.JSè°ƒç”šçł»ç»ŸćŽŸç”Ÿæ–‡ä»¶æ“äœœAPIäčŸćŻä»„ćœšć‰éąæ·»ćŠ â€œfile://”搎朹htmléĄ”éąäž­ç›ŽæŽ„äœżç”šă€‚ @@ -3199,7 +3199,7 @@ interface PlusIoDirectoryEntry { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - getMetadata(succesCB?: () => void, errorCB?: () => void, recursive?: boolean): void; + getMetadata(succesCB?: (result: PlusIoMetadata) => void, errorCB?: (result: any) => void, recursive?: boolean): void; /** * ç§»ćŠšç›źćœ• * ä»„äž‹æƒ…ć†”ç§»ćŠšç›źćœ•ć°†äŒšćŻŒè‡Žć€±èŽ„ïŒš @@ -3211,7 +3211,7 @@ interface PlusIoDirectoryEntry { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - moveTo(parent?: PlusIoDirectoryEntry, newName?: string, succesCB?: () => void, errorCB?: () => void): void; + moveTo(parent?: PlusIoDirectoryEntry, newName?: string, succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; /** * æ‹·èŽç›źćœ• * ä»„äž‹æƒ…ć†”æ‹·èŽç›źćœ•ć°†äŒšćŻŒè‡Žć€±èŽ„ïŒš @@ -3223,7 +3223,7 @@ interface PlusIoDirectoryEntry { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - copyTo(parent?: PlusIoDirectoryEntry, newName?: string, succesCB?: () => void, errorCB?: () => void): void; + copyTo(parent?: PlusIoDirectoryEntry, newName?: string, succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; /** * èŽ·ć–ç›źćœ•è·ŻćŸ„èœŹæąäžșURL朰杀 * @@ -3251,14 +3251,14 @@ interface PlusIoDirectoryEntry { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - remove(succesCB?: () => void, errorCB?: () => void): void; + remove(succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; /** * èŽ·ć–ç›źćœ•æ‰€ć±žçš„çˆ¶ç›źćœ• * èŽ·ć–çˆ¶ç›źćœ•æˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - getParent(succesCB?: () => void, errorCB?: () => void): void; + getParent(succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; /** * 戛ć»șç›źćœ•èŻ»ć–ćŻčè±Ą * 戛ć»ș侀äžȘç›źćœ•èŻ»ć–ćŻčè±ĄïŒŒç”šæˆ·èŻ»ć–ç›źäž‹çš„æ–‡ä»¶ćŠć­ç›źćœ•ă€‚ @@ -3273,7 +3273,7 @@ interface PlusIoDirectoryEntry { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - getDirectory(path?: string, flag?: PlusIoFlags, succesCB?: () => void, errorCB?: () => void): void; + getDirectory(path?: string, flag?: PlusIoFlags, succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; /** * 戛ć»șæˆ–æ‰“ćŒ€æ–‡ä»¶ * 戛ć»șæˆ–æ‰“ćŒ€ćœ“ć‰ç›źćœ•äž‹æŒ‡ćźšçš„æ–‡ä»¶ă€‚ @@ -3281,7 +3281,7 @@ interface PlusIoDirectoryEntry { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - getFile(path?: string, flag?: PlusIoFlags, succesCB?: () => void, errorCB?: () => void): void; + getFile(path?: string, flag?: PlusIoFlags, succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; /** * é€’ćœ’ćˆ é™€ç›źćœ• * ćˆ é™€ç›źćœ•ć°†äŒšćˆ é™€ć…¶äž‹çš„æ‰€æœ‰æ–‡ä»¶ćŠć­ç›źćœ• @@ -3290,7 +3290,7 @@ interface PlusIoDirectoryEntry { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - removeRecursively(succesCB?: () => void, errorCB?: () => void): void; + removeRecursively(succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; } /** @@ -3306,7 +3306,7 @@ interface PlusIoDirectoryReader { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - readEntries(succesCB?: () => void, errorCB?: () => void): void; + readEntries(succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; } /** @@ -3398,7 +3398,7 @@ interface PlusIoFileEntry { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - getMetadata(succesCB?: () => void, errorCB?: () => void): void; + getMetadata(succesCB?: (result: PlusIoMetadata) => void, errorCB?: (result: any) => void): void; /** * ç§»ćŠšæ–‡ä»¶ * ä»„äž‹æƒ…ć†”ç§»ćŠšç›źćœ•ć°†äŒšćŻŒè‡Žć€±èŽ„ïŒš @@ -3408,7 +3408,7 @@ interface PlusIoFileEntry { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - moveTo(parent?: PlusIoDirectoryEntry, newName?: string, succesCB?: () => void, errorCB?: () => void): void; + moveTo(parent?: PlusIoDirectoryEntry, newName?: string, succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; /** * 拷莝文件 * ä»„äž‹æƒ…ć†”æ‹·èŽæ–‡ä»¶ć°†äŒšćŻŒè‡Žć€±èŽ„ïŒš @@ -3418,7 +3418,7 @@ interface PlusIoFileEntry { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - copyTo(parent?: PlusIoDirectoryEntry, newName?: string, succesCB?: () => void, errorCB?: () => void): void; + copyTo(parent?: PlusIoDirectoryEntry, newName?: string, succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; /** * èŽ·ć–æ–‡ä»¶è·ŻćŸ„èœŹæąäžșURL朰杀 * @@ -3444,28 +3444,28 @@ interface PlusIoFileEntry { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - remove(succesCB?: () => void, errorCB?: () => void): void; + remove(succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; /** * èŽ·ć–æ–‡ä»¶æ‰€ć±žçš„çˆ¶ç›źćœ• * èŽ·ć–çˆ¶ç›źćœ•æˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - getParent(succesCB?: () => void, errorCB?: () => void): void; + getParent(succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; /** * èŽ·ć–æ–‡ä»¶ć…łè”çš„ć†™æ–‡ä»¶æ“äœœćŻčè±ĄFileWriter * èŽ·ć–ć†™æ–‡ä»¶æ“äœœćŻčè±ĄæˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - createWriter(succesCB?: () => void, errorCB?: () => void): void; + createWriter(succesCB?: (result: PlusIoFileWriter) => void, errorCB?: (result: any) => void): void; /** * èŽ·ć–æ–‡ä»¶æ•°æźćŻčè±Ą * èŽ·ć–æ–‡ä»¶æ•°æźćŻčè±ĄæˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - file(succesCB?: () => void, errorCB?: () => void): void; + file(succesCB?: (result: PlusIoFile) => void, errorCB?: (result: any) => void): void; } /** @@ -3518,39 +3518,39 @@ interface PlusIoFileReader { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - onloadstart?: () => void; + onloadstart?: (result: PlusIoFileEvent) => void; /** * èŻ»ć–æ–‡ä»¶èż‡çš‹äž­çš„ć›žè°ƒć‡œæ•° * 甹äșŽèŽ·ć–æ–‡ä»¶èŻ»ć–èż›ćșŠă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - onprogress?: () => void; + onprogress?: (result: PlusIoFileEvent) => void; /** * èŻ»ć–æ–‡ä»¶æˆćŠŸćźŒæˆçš„ć›žè°ƒć‡œæ•° * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - onload?: () => void; + onload?: (result: PlusIoFileEvent) => void; /** * ć–æ¶ˆèŻ»ć–æ–‡ä»¶æ—¶çš„ć›žè°ƒć‡œæ•° * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - onabort?: () => void; + onabort?: (result: PlusIoFileEvent) => void; /** * æ–‡ä»¶èŻ»ć–æ“äœœć€±èŽ„æ—¶è°ƒç”šçš„ć›žè°ƒć‡œæ•° * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - onerror?: () => void; + onerror?: (result: PlusIoFileEvent) => void; /** * æ–‡ä»¶èŻ»ć–æ“äœœćźŒæˆæ—¶çš„ć›žè°ƒć‡œæ•° * äžçźĄæˆćŠŸæˆ–ć€±èŽ„éƒœäŒšè§Šć‘ă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - onloadend?: () => void; + onloadend?: (result: PlusIoFileEvent) => void; /** * ç»ˆæ­ąæ–‡ä»¶èŻ»ć–æ“äœœ * èŻ»ć–æ–‡ä»¶æ“äœœćŒ€ć§‹ćŽïŒŒćŻé€šèż‡æ­€æ–čæł•ć–æ¶ˆèŻ»ć–æ–‡ä»¶ă€‚ @@ -3632,39 +3632,39 @@ interface PlusIoFileWriter { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - onwritestart?: () => void; + onwritestart?: (result: PlusIoFileEvent) => void; /** * ć†™ć…„æ–‡ä»¶èż‡çš‹äž­çš„ć›žè°ƒć‡œæ•° * 甹äșŽèŽ·ć–æ–‡ä»¶èŻ»ć–èż›ćșŠă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - onprogress?: () => void; + onprogress?: (result: PlusIoFileEvent) => void; /** * ć†™ć…„æ–‡ä»¶æˆćŠŸćźŒæˆçš„ć›žè°ƒć‡œæ•° * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - onwrite?: () => void; + onwrite?: (result: PlusIoFileEvent) => void; /** * ć–æ¶ˆć†™ć…„æ–‡ä»¶æ—¶çš„ć›žè°ƒć‡œæ•° * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - onabort?: () => void; + onabort?: (result: PlusIoFileEvent) => void; /** * æ–‡ä»¶ć†™ć…„æ“äœœć€±èŽ„æ—¶è°ƒç”šçš„ć›žè°ƒć‡œæ•° * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - onerror?: () => void; + onerror?: (result: PlusIoFileEvent) => void; /** * æ–‡ä»¶ć†™ć…„æ“äœœćźŒæˆæ—¶çš„ć›žè°ƒć‡œæ•° * äžçźĄæˆćŠŸæˆ–ć€±èŽ„éƒœäŒšè§Šć‘ă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) */ - onwriteend?: () => void; + onwriteend?: (result: PlusIoFileEvent) => void; /** * ç»ˆæ­ąæ–‡ä»¶ć†™ć…„æ“äœœ * ć†™ć…„æ–‡ä»¶æ•°æźæ“äœœćŒ€ć§‹ćŽïŒŒćŻé€šèż‡æ­€æ–čæł•ć–æ¶ˆć†™ć…„æ–‡ä»¶æ•°æźæ“äœœă€‚ @@ -4002,7 +4002,7 @@ interface PlusKey { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) */ - addEventListener(event?: PlusKeyKeyType, listener?: () => void, capture?: boolean): void; + addEventListener(event?: PlusKeyKeyType, listener?: (result: PlusKeyKeyEvent) => void, capture?: boolean): void; /** * éšè—èœŻé”źç›˜ * 隐藏ć·Č经星ç€șçš„èœŻé”źç›˜ïŒŒćŠ‚æžœèœŻé”źç›˜æČĄæœ‰æ˜Ÿç€șćˆ™äžćšä»»äœ•æ“äœœă€‚ @@ -4031,7 +4031,7 @@ interface PlusKey { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) */ - removeEventListener(event?: PlusKeyKeyType, listener?: () => void): void; + removeEventListener(event?: PlusKeyKeyType, listener?: (result: PlusKeyKeyEvent) => void): void; } /** @@ -4176,7 +4176,7 @@ interface PlusMessaging { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) */ - sendMessage(msg?: PlusMessagingMessage, successCB?: () => void, errorCB?: () => void): void; + sendMessage(msg?: PlusMessagingMessage, successCB?: () => void, errorCB?: (result: any) => void): void; } /** @@ -4532,7 +4532,7 @@ interface PlusNativeObjBitmap { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) */ - load(path?: string, successCallback?: () => void, errorCallback?: () => void): void; + load(path?: string, successCallback?: () => void, errorCallback?: (result: any) => void): void; /** * ćŠ èœœBase64çŒ–ç æ ŒćŒć›Ÿç‰‡ćˆ°BitmapćŻčè±Ą * 从Base64çŒ–ç æ ŒćŒć›Ÿç‰‡æ•°æźäž­ćŠ èœœć›Ÿç‰‡ïŒŒæ­€æ“äœœć°†èŠ†ç›–äč‹ć‰çš„ć›Ÿç‰‡ć†…ćźč @@ -4540,7 +4540,7 @@ interface PlusNativeObjBitmap { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) */ - loadBase64Data(data?: string, successCallback?: () => void, errorCallback?: () => void): void; + loadBase64Data(data?: string, successCallback?: () => void, errorCallback?: (result: any) => void): void; /** * ć›žæ”¶Bitmapć›Ÿç‰‡ć†…ć­˜ * 释攟Bitmapć›Ÿç‰‡ć ç”šçš„ć†…ć­˜è”„æșïŒŒäœ†äžé”€æŻć›Ÿç‰‡ćŻčè±ĄïŒŒäŸç„¶ćŻä»„ç»§ç»­äœżç”šć›Ÿç‰‡ćŻčè±Ąă€‚ @@ -4555,7 +4555,7 @@ interface PlusNativeObjBitmap { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) */ - save(path?: string, options?: PlusNativeObjBitmapSaveOptions, successCallback?: () => void, errorCallback?: () => void): void; + save(path?: string, options?: PlusNativeObjBitmapSaveOptions, successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; /** * èŽ·ć–ć›Ÿç‰‡çš„Base64çŒ–ç æ•°æź * èŻ»ć–ć›Ÿç‰‡çš„æ•°æźć†…ćźčćč¶èœŹæąäžșBase64çŒ–ç æ ŒćŒć­—çŹŠäžČ。 @@ -4827,21 +4827,21 @@ interface PlusNativeObjInputStyles { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) */ - onComplete?: () => void; + onComplete?: (result: any) => void; /** * èŸ“ć…„æĄ†èŽ·ć–ç„Šç‚čäș‹ä»¶ * ćœ“çŒ–èŸ‘æĄ†èŽ·ć–ç„Šç‚čæ—¶è§Šć‘。 * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) */ - onFocus?: () => void; + onFocus?: (result: any) => void; /** * èŸ“ć…„æĄ†ć€±ćŽ»ç„Šç‚čäș‹ä»¶ * ćœ“çŒ–èŸ‘æĄ†ć€±ćŽ»ç„Šç‚čæ—¶è§Šć‘。 * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) */ - onBlur?: () => void; + onBlur?: (result: any) => void; } /** @@ -4980,7 +4980,7 @@ interface PlusNativeObjRichTextStyles { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) */ - onClick?: () => void; + onClick?: (result: any) => void; } /** @@ -5237,7 +5237,7 @@ interface PlusNativeObjView { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) */ - addEventListener(event?: PlusNativeObjViewEvents, listener?: () => void, capture?: boolean): void; + addEventListener(event?: PlusNativeObjViewEvents, listener?: (result: any) => void, capture?: boolean): void; /** * ViewæŽ§ä»¶ć†…ćźč抚画 * ćŠšç”»ćŽćŻèƒœäŒšćŻŒè‡ŽView控件星ç€ș憅ćźčæ”čć˜ïŒŒćŻé€šèż‡è°ƒç”šrestoreæ–čæł•æąć€ă€‚ @@ -5783,7 +5783,7 @@ interface PlusNativeUI { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) */ - actionSheet(actionsheetStyle?: PlusNativeUIActionSheetStyles, actionsheetCallback?: () => void): PlusNativeUINativeUIObj; + actionSheet(actionsheetStyle?: PlusNativeUIActionSheetStyles, actionsheetCallback?: (result: any) => void): PlusNativeUINativeUIObj; /** * ćŒčć‡șçł»ç»Ÿæç€șćŻčèŻæĄ† * 戛ć»șćč¶æ˜Ÿç€șçł»ç»Ÿæ ·ćŒæç€șćŻčèŻæĄ†ïŒŒćŻèźŸçœźæç€șćŻčèŻæĄ†çš„æ ‡éą˜ă€ć†…ćźčă€æŒ‰é’źæ–‡ć­—ç­‰ă€‚ @@ -5791,7 +5791,7 @@ interface PlusNativeUI { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) */ - alert(message?: string, alertCB?: () => void, title?: string, buttonCapture?: string): void; + alert(message?: string, alertCB?: (result: any) => void, title?: string, buttonCapture?: string): void; /** * ćŒčć‡șçł»ç»ŸçĄźèź€ćŻčèŻæĄ† * 戛ć»șćč¶æ˜Ÿç€șçł»ç»Ÿæ ·ćŒçĄźèź€ćŻčèŻæĄ†ïŒŒćŻèźŸçœźçĄźèź€ćŻčèŻæĄ†çš„æ ‡éą˜ă€ć†…ćźčă€æŒ‰é’źæ•°ç›źćŠć…¶æ–‡ć­—ă€‚ @@ -5799,7 +5799,7 @@ interface PlusNativeUI { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) */ - confirm(message?: string, confirmCB?: () => void, options?: PlusNativeUIConfirmOptions, buttons?: any []): void; + confirm(message?: string, confirmCB?: (result: any) => void, options?: PlusNativeUIConfirmOptions, buttons?: any []): void; /** * ć…łé—­çł»ç»Ÿç­‰ćŸ…ćŻčèŻæĄ† * 慳闭ć·Č经星ç€șçš„æ‰€æœ‰çł»ç»Ÿæ ·ćŒç­‰ćŸ…ćŻčèŻæĄ†ïŒŒè§Šć‘WaitingćŻčè±Ąçš„oncloseäș‹ä»¶ă€‚ @@ -5835,7 +5835,7 @@ interface PlusNativeUI { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) */ - pickDate(successCB?: () => void, errorCB?: () => void, options?: PlusNativeUIPickDateOption): void; + pickDate(successCB?: (result: any) => void, errorCB?: (result: any) => void, options?: PlusNativeUIPickDateOption): void; /** * ćŒčć‡șçł»ç»Ÿæ—¶é—Žé€‰æ‹©ćŻčèŻæĄ† * 戛ć»șćč¶ćŒčć‡șçł»ç»Ÿæ ·ćŒæ—¶é—Žé€‰æ‹©ćŻčèŻæĄ†ïŒŒćŻèż›èĄŒæ—¶é—Žçš„é€‰æ‹©ă€‚ @@ -5843,7 +5843,7 @@ interface PlusNativeUI { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) */ - pickTime(successCB?: () => void, errorCB?: () => void, options?: PlusNativeUIPickTimeOption): void; + pickTime(successCB?: (result: any) => void, errorCB?: (result: any) => void, options?: PlusNativeUIPickTimeOption): void; /** * ćŒčć‡șçł»ç»ŸèŸ“ć…„ćŻčèŻæĄ† * 戛ć»șćč¶æ˜Ÿç€șçł»ç»Ÿæ ·ćŒèŸ“ć…„ćŻčèŻæĄ†ïŒŒćŻèźŸçœźèŸ“ć…„ćŻčèŻæĄ†çš„æ ‡éą˜ă€ć†…ćźčă€æç€șèŸ“ć…„äżĄæŻă€æŒ‰é’źæ•°ç›źćŠć…¶æ–‡ć­—ă€‚ @@ -5851,7 +5851,7 @@ interface PlusNativeUI { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) */ - prompt(message?: string, promptCB?: () => void, title?: string, tip?: string, buttons?: any []): void; + prompt(message?: string, promptCB?: (result: any) => void, title?: string, tip?: string, buttons?: any []): void; /** * 星ç€șè‡ȘćŠšæ¶ˆć€±çš„æç€șæ¶ˆæŻ * 戛ć»șćč¶æ˜Ÿç€șçł»ç»Ÿæ ·ćŒæç€șæ¶ˆæŻïŒŒćŒčć‡ș的提ç€șæ¶ˆæŻäžșéžé˜»ćĄžæšĄćŒïŒŒæ˜Ÿç€șæŒ‡ćźšæ—¶é—ŽćŽè‡ȘćŠšæ¶ˆć€±ă€‚ @@ -6449,13 +6449,13 @@ interface PlusNavigator { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) */ - createShortcut(options?: PlusNavigatorShortcutOptions, successCallback?: () => void): void; + createShortcut(options?: PlusNavigatorShortcutOptions, successCallback?: (result: any) => void): void; /** * æŸ„èŻąæ˜ŻćŠć­˜ćœšćș”ç”šćż«æ·æ–čćŒ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) */ - hasShortcut(options?: PlusNavigatorShortcutOptions, successCallback?: () => void): void; + hasShortcut(options?: PlusNavigatorShortcutOptions, successCallback?: (result: any) => void): void; /** * ćˆ€æ–­ćœ“ć‰ćș”ç”šæ˜ŻćŠćˆ‡æąćˆ°ćŽć° * ćœšć€šćș”ç”šèżèĄŒçŽŻćąƒïŒˆćŠ‚æ”ćș”ç”šïŒ‰äž­ïŒŒćŻćŠšäž€äžȘ新ćș”甚时äč‹ć‰èżèĄŒçš„ćș”ç”šć°†äŒšè‡ȘćŠšćˆ‡æąćˆ°ćŽć°èżèĄŒïŒŒæ­€æ—¶plus.navigator.isBackground()èż”ć›žçŠ¶æ€ćȘäžștrue。 @@ -6763,14 +6763,14 @@ interface PlusOrientation { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/orientation.html](http://www.html5plus.org/doc/zh_cn/orientation.html) */ - getCurrentOrientation(successCB?: () => void, errorCB?: () => void): void; + getCurrentOrientation(successCB?: (result: string) => void, errorCB?: (result: any) => void): void; /** * ç›‘ćŹèźŸć€‡æ–čć‘äżĄæŻçš„ć˜ćŒ– * æ–čć‘äżĄæŻæ˜ŻèźŸć€‡ç›žćŻčäșŽæ°Žćčłćˆć§‹æ–čć‘ćˆ†ćˆ«ä»„z、x、y蜎äžșèœŽćżƒæ—‹èœŹçš„è§’ćșŠïŒŒćŻčćș”ć€Œäžșalpha、beta、gamma侉äžȘæ–čć‘çš„äżĄæŻă€‚watchOrientationæŻéš”ć›șćźšæ—¶é—Žć°±èŽ·ć–äž€æŹĄèźŸć€‡çš„æ–čć‘äżĄæŻïŒŒé€šèż‡successCBć›žè°ƒć‡œæ•°èż”ć›žă€‚ćŻé€šèż‡option的frequencyć‚æ•°èźŸćźšèŽ·ć–èźŸć€‡æ–čć‘äżĄæŻçš„æ—¶é—Žé—Žéš”ă€‚æ–čć‘äżĄæŻèŽ·ć–ć€±èŽ„ćˆ™è°ƒç”šć›žè°ƒć‡œæ•°errorCB。 * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/orientation.html](http://www.html5plus.org/doc/zh_cn/orientation.html) */ - watchOrientation(successCB?: () => void, errorCB?: () => void, option?: PlusOrientationOrientationOption): number; + watchOrientation(successCB?: (result: string) => void, errorCB?: (result: any) => void, option?: PlusOrientationOrientationOption): number; /** * ć…łé—­ç›‘ćŹèźŸć€‡æ–čć‘äżĄæŻ * @@ -6856,14 +6856,14 @@ interface PlusProximity { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/proximity.html](http://www.html5plus.org/doc/zh_cn/proximity.html) */ - getCurrentProximity(successCB?: () => void, errorCB?: () => void): void; + getCurrentProximity(successCB?: (result: number) => void, errorCB?: (result: any) => void): void; /** * ç›‘ćŹèźŸć€‡æŽ„èż‘è·çŠ»çš„ć˜ćŒ– * watchProximityć°†ç›‘ćŹèźŸć€‡çš„æŽ„èż‘è·çŠ»äżĄæŻć˜ćŒ–äș‹ä»¶ïŒŒćœ“æŽ„èż‘è·çŠ»ć‘ç”Ÿć˜ćŒ–æ—¶é€šèż‡changeCBć›žè°ƒć‡œæ•°èż”ć›žè·çŠ»ć€Œă€‚ç›‘ćŹè·çŠ»ć˜ćŒ–äș‹ä»¶ć€±èŽ„ćˆ™é€šèż‡errorCBć›žè°ƒć‡œæ•°èż”ć›žé”™èŻŻäżĄæŻă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/proximity.html](http://www.html5plus.org/doc/zh_cn/proximity.html) */ - watchProximity(changeCB?: () => void, errorCB?: () => void): number; + watchProximity(changeCB?: (result: number) => void, errorCB?: (result: any) => void): number; /** * ć…łé—­ç›‘ćŹèźŸć€‡æŽ„èż‘è·çŠ»ć˜ćŒ– * @@ -7044,7 +7044,7 @@ interface PlusRuntime { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) */ - getProperty(appid?: string, getPropertyCB?: () => void): void; + getProperty(appid?: string, getPropertyCB?: (result: PlusRuntimeWidgetInfo) => void): void; /** * ćź‰èŁ…ćș”甚 * æ”ŻæŒä»„äž‹ç±»ćž‹ćź‰èŁ…ćŒ…ïŒš @@ -7055,7 +7055,7 @@ interface PlusRuntime { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) */ - install(filePath?: string, options?: PlusRuntimeWidgetOptions, installSuccessCB?: () => void, installErrorCB?: () => void): void; + install(filePath?: string, options?: PlusRuntimeWidgetOptions, installSuccessCB?: (result: PlusRuntimeWidgetInfo) => void, installErrorCB?: (result: any) => void): void; /** * 退ć‡șćźąæˆ·ç«Żçš‹ćș * @@ -7079,7 +7079,7 @@ interface PlusRuntime { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) */ - openURL(url?: string, errorCB?: () => void, identity?: string): void; + openURL(url?: string, errorCB?: (result: any) => void, identity?: string): void; /** * äœżç”šć†…çœźWebviewçȘ—ćŁæ‰“ćŒ€URL * @@ -7091,7 +7091,7 @@ interface PlusRuntime { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) */ - openFile(filepath?: string, options?: PlusRuntimeOpenFileOptions, errorCB?: () => void): void; + openFile(filepath?: string, options?: PlusRuntimeOpenFileOptions, errorCB?: (result: any) => void): void; /** * ć€„ç†ç›ŽèŸŸéĄ”éąé“ŸæŽ„ć‚æ•° * é€šèż‡URL SchemećŻćŠšæ—¶ïŒŒćŻä»„ćœš?ćŽéąæ·»ćŠ __direct_pageć‚æ•°è‡Ș漚äč‰ç›ŽèŸŸéĄ”éąćœ°ć€ïŒŒ @@ -7107,7 +7107,7 @@ interface PlusRuntime { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) */ - launchApplication(appInf?: PlusRuntimeApplicationInf, errorCB?: () => void): void; + launchApplication(appInf?: PlusRuntimeApplicationInf, errorCB?: (result: any) => void): void; /** * ćˆ€æ–­çŹŹäž‰æ–č繋ćșæ˜ŻćŠć·Č歘朹 * ćŠ‚æžœçŹŹäž‰æ–č繋ćșć·Čćź‰èŁ…ćˆ™èż”ć›žtrueæœȘćź‰èŁ…ćˆ™èż”ć›žfalse。 @@ -7395,7 +7395,7 @@ interface PlusStream { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) */ - open(options?: PlusStreamStreamOptions, successCallback?: () => void, errorCallback?: () => void): void; + open(options?: PlusStreamStreamOptions, successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; /** * 攁ćș”ç”šæż€æŽ»ç»ŸèźĄ * 提äș€ç»ŸèźĄæ•°æźćˆ°æ”ćș”ç”šæœćŠĄć™šïŒŒèĄšæ˜ŽäžšćŠĄçł»ç»Ÿæż€æŽ»æˆćŠŸă€‚ @@ -7440,13 +7440,13 @@ interface PlusStream { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) */ - freetrafficRequest(options?: PlusStreamFreetrafficOptions, successCallback?: () => void, errorCallback?: () => void): void; + freetrafficRequest(options?: PlusStreamFreetrafficOptions, successCallback?: () => void, errorCallback?: (result: any) => void): void; /** * ć…æ”é‡ç»‘ćźšæ‰‹æœșć· * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) */ - freetrafficBind(options?: PlusStreamFreetrafficOptions, successCallback?: () => void, errorCallback?: () => void): void; + freetrafficBind(options?: PlusStreamFreetrafficOptions, successCallback?: () => void, errorCallback?: (result: any) => void): void; /** * è§Łé™€ć…æ”é‡ç»‘ćźš * è§Łé™€ćœ“ć‰èźŸć€‡ç»‘ćźšçš„æ‰‹æœșć·ïŒŒćŠ‚æžœèźŸć€‡æœȘç»‘ćźšćˆ™äžæ‰§èĄŒæ“äœœă€‚ @@ -7459,7 +7459,7 @@ interface PlusStream { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) */ - freetrafficInfo(successCallback?: (result: any) => void, errorCallback?: () => void): void; + freetrafficInfo(successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; /** * ć…æ”é‡æ˜ŻćŠç”Ÿæ•ˆ * @@ -7766,14 +7766,14 @@ interface PlusUploader { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) */ - createUpload(url?: string, options?: PlusUploaderUploadOptions, completedCB?: () => void): PlusUploaderUpload; + createUpload(url?: string, options?: PlusUploaderUploadOptions, completedCB?: (result0: PlusUploaderUpload, result1: number) => void): PlusUploaderUpload; /** * æžšäžŸäžŠäŒ ä»»ćŠĄ * æžšäžŸæŒ‡ćźšçŠ¶æ€çš„äžŠäŒ ä»»ćŠĄćˆ—èĄšïŒŒé€šèż‡enumCBć›žè°ƒć‡œæ•°èż”ć›žç»“æžœă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) */ - enumerate(enumCB?: () => void, state?: PlusUploaderUploadState): void; + enumerate(enumCB?: (result: PlusUploader []) => void, state?: PlusUploaderUploadState): void; /** * æž…é™€äžŠäŒ ä»»ćŠĄ * æž…é™€æŒ‡ćźšçŠ¶æ€çš„äžŠäŒ ä»»ćŠĄă€‚ @@ -7902,7 +7902,7 @@ interface PlusUploaderUpload { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) */ - addEventListener(type?: string, listener?: () => void, capture?: boolean): void; + addEventListener(type?: string, listener?: (result0: PlusUploaderUpload, result1: number) => void, capture?: boolean): void; /** * èŽ·ć–äžŠäŒ èŻ·æ±‚HTTP操ćș”ć€ŽéƒšäżĄæŻ * HTTP操ćș”ć€Žéƒšć…šéƒšć†…ćźč䜜äžșæœȘè§Łæžçš„ć­—çŹŠäžČèż”ć›žïŒŒćŠ‚æžœæČĄæœ‰æŽ„æ”¶ćˆ°èż™äžȘHTTP操ćș”ć€Žæ•°æźæˆ–è€…äžŠäŒ èŻ·æ±‚æœȘćźŒæˆćˆ™äžșç©ș歗笩äžČ。 @@ -8121,7 +8121,7 @@ interface PlusVideoVideoPlayer { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) */ - addEventListener(event?: PlusVideoVideoPlayerEvents, listener?: () => void, capture?: boolean): void; + addEventListener(event?: PlusVideoVideoPlayerEvents, listener?: (result: any) => void, capture?: boolean): void; /** * èźŸçœźè§†éą‘æ’­æ”ŸæŽ§ä»¶ć‚æ•° * 甹äșŽćŠšæ€æ›Žæ–°è§†éą‘æ’­æ”ŸæŽ§ä»¶çš„é…çœźć‚æ•°ă€‚ @@ -8488,7 +8488,7 @@ interface PlusVideoLivePusher { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) */ - addEventListener(event?: PlusVideoLivePusherEvents, listener?: () => void, capture?: boolean): void; + addEventListener(event?: PlusVideoLivePusherEvents, listener?: (result: any) => void, capture?: boolean): void; /** * èźŸçœźç›Žæ’­æŽšæ”æŽ§ä»¶ć‚æ•° * 甹äșŽćŠšæ€æ›Žæ–°ç›Žæ’­æŽšæ”æŽ§ä»¶çš„é…çœźć‚æ•°ă€‚ @@ -9072,7 +9072,7 @@ interface PlusWebview { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) */ - startAnimation(options?: PlusWebviewWebviewAnimationOptions, otherOptions?: PlusWebviewWebviewAnimationOptions, callback?: () => void): void; + startAnimation(options?: PlusWebviewWebviewAnimationOptions, otherOptions?: PlusWebviewWebviewAnimationOptions, callback?: (result: any) => void): void; /** * èŽ·ć–Webviewé»˜èź€æ˜ŻćŠćŒ€ćŻçĄŹä»¶ćŠ é€Ÿ * 由äșŽäžćŒèźŸć€‡ćŻčçĄŹä»¶ćŠ é€Ÿçš„æ”ŻæŒæƒ…ć†”ć­˜ćœšć·źćŒ‚ïŒŒćŒ€ćŻçĄŹä»¶ćŠ é€ŸèƒœćŠ é€ŸHTMLéĄ”éąçš„æžČ染䜆äčŸäŒšæ¶ˆè€—æ›Žć€šçš„çł»ç»Ÿè”„æșïŒŒä»Žè€ŒćŻŒè‡Žćœšéƒšćˆ†èźŸć€‡äžŠćŻèƒœć‡ș现é—Șć±ă€ć‘è™šă€ćˆ†ć—æžČæŸ“ç­‰é—źéą˜ïŒŒ ć› æ­€5+ Runtime䌚æ čæźèźŸć€‡ćźžé™…æ”ŻæŒæƒ…ć†”è‡ȘćŠšé€‰æ‹©æ˜ŻćŠćŒ€ćŻçĄŹä»¶ćŠ é€Ÿă€‚ @@ -9298,7 +9298,7 @@ interface PlusWebviewWebviewObject { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) */ - addEventListener(event?: PlusWebviewWebviewEvent, listener?: () => void, capture?: boolean): void; + addEventListener(event?: PlusWebviewWebviewEvent, listener?: (result: any) => void, capture?: boolean): void; /** * 朹WebviewçȘ—ćŁäž­æ·»ćŠ ć­çȘ—揣 * 氆揩侀äžȘWebviewçȘ—ćŁäœœäžș歐çȘ—ćŁæ·»ćŠ ćˆ°ćœ“ć‰WebviewçȘ—ćŁäž­ïŒŒæ·»ćŠ ćŽć…¶æ‰€æœ‰æƒćœ’çˆ¶WebviewçȘ—ćŁïŒŒćœ“çˆ¶çȘ—ćŁć…łé—­æ—¶ć­çȘ—揣è‡Ș抹慳闭。 @@ -9344,14 +9344,14 @@ interface PlusWebviewWebviewObject { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) */ - canBack(queryCallback?: () => void): void; + canBack(queryCallback?: (result: any) => void): void; /** * æŸ„èŻąWebviewçȘ—ćŁæ˜ŻćŠćŻć‰èż› * WebviewçȘ—ćŁćŽ†ćČèź°ćœ•æŸ„èŻąæ“äœœïŒŒèŽ·ć–Webviewæ˜ŻćŠćŻć‰èż›ćˆ°ćŽ†ćČćŠ èœœçš„éĄ”éąïŒŒç»“æžœé€šèż‡queryCallbackć›žè°ƒæ–čæł•èż”ć›žă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) */ - canForward(queryCallback?: () => void): void; + canForward(queryCallback?: (result: any) => void): void; /** * æŁ€æ”‹WebviewçȘ—ćŁæ˜ŻćŠæžČæŸ“ćźŒæˆ * æŁ€æ”‹æ–čćŒäžșćˆ€æ–­çš„WebviewçȘ—ćŁć†…ćźčæ˜ŻćŠäžșç™œć±ïŒŒćŠ‚æžœéžç™œć±ćˆ™èź€äžșæžČæŸ“ćźŒæˆïŒŒćŠćˆ™èź€äžșæžČ染æœȘćźŒæˆă€‚ @@ -9359,7 +9359,7 @@ interface PlusWebviewWebviewObject { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) */ - checkRenderedContent(options?: PlusWebviewWebviewRenderedEventOptions, successCallback?: () => void, errorCallback?: () => void): void; + checkRenderedContent(options?: PlusWebviewWebviewRenderedEventOptions, successCallback?: () => void, errorCallback?: (result: any) => void): void; /** * èŽ·ć–WebviewçȘ—ćŁçš„æ‰€æœ‰ć­WebviewçȘ—揣 * èŽ·ć–æ·»ćŠ ćˆ°WebviewçȘ—ćŁäž­çš„æ‰€æœ‰ć­WebviewçȘ—ćŁïŒŒćŠ‚æžœæČĄæœ‰ć­WebviewçȘ—ćŁćˆ™èż”ć›žç©șæ•°ç»„ă€‚ @@ -9388,14 +9388,14 @@ interface PlusWebviewWebviewObject { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) */ - drag(options?: PlusWebviewWebviewDragOptions, otherView?: PlusWebviewWebviewDragOtherViewOptions, callback?: () => void): void; + drag(options?: PlusWebviewWebviewDragOptions, otherView?: PlusWebviewWebviewDragOtherViewOptions, callback?: (result: PlusWebviewWebviewDragEvent) => void): void; /** * æˆȘć±ç»˜ćˆ¶ * 氆WebviewçȘ—ćŁçš„ćŻè§†ćŒș㟟æˆȘć±ćč¶ç»˜ćˆ¶ćˆ°Bitmapć›Ÿç‰‡ćŻčè±Ąäž­ă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) */ - draw(bitmap?: PlusNativeObjBitmap, successCallback?: () => void, errorCallback?: () => void, options?: PlusWebviewWebviewDrawOptions): void; + draw(bitmap?: PlusNativeObjBitmap, successCallback?: () => void, errorCallback?: (result: any) => void, options?: PlusWebviewWebviewDrawOptions): void; /** * 结束WebviewçȘ—ćŁçš„äž‹æ‹‰ćˆ·æ–° * ć…łé—­äž‹æ‹‰ćˆ·æ–°æ•ˆæžœïŒŒæąć€ćˆ°ćŒ€ć§‹äž‹æ‹‰ćˆ·æ–°äč‹ć‰çš„æ•ˆæžœă€‚ @@ -9514,7 +9514,7 @@ interface PlusWebviewWebviewObject { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) */ - listenResourceLoading(options?: PlusWebviewWebviewListenResourceOptions, callback?: () => void): void; + listenResourceLoading(options?: PlusWebviewWebviewListenResourceOptions, callback?: (result: any) => void): void; /** * ćŠ èœœæ–°HTMLæ•°æź * è§Šć‘WebviewçȘ—ćŁćŠ èœœHTMLéĄ”éąæ•°æźïŒŒćŠ‚æžœHTMLæ•°æźæ— æ•ˆć°†ćŻŒè‡ŽéĄ”éąćŠ èœœć€±èŽ„ă€‚ @@ -9567,7 +9567,7 @@ interface PlusWebviewWebviewObject { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) */ - overrideUrlLoading(options?: PlusWebviewWebviewOverrideUrlOptions, callback?: () => void): void; + overrideUrlLoading(options?: PlusWebviewWebviewOverrideUrlOptions, callback?: (result: any) => void): void; /** * èŽ·ć–ćœ“ć‰WebviewçȘ—ćŁçš„çˆ¶çȘ—揣 * WebviewçȘ—ćŁäœœäžș歐çȘ—ćŁæ·»ćŠ ïŒˆWebview.appendïŒ‰ćˆ°ć…¶ćźƒWebviewçȘ—ćŁäž­æ—¶æœ‰æ•ˆïŒŒèż™æ—¶ć…¶ćźƒWebviewçȘ—揣äžș父çȘ—ćŁă€‚ @@ -9612,7 +9612,7 @@ interface PlusWebviewWebviewObject { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) */ - removeEventListener(event?: PlusWebviewWebviewEvent, listener?: () => void): void; + removeEventListener(event?: PlusWebviewWebviewEvent, listener?: (result: any) => void): void; /** * 从父çȘ—ćŁäž­ç§»é™€ * ä»Žæ‰€ć±žçš„çˆ¶WebviewçȘ—ćŁç§»é™€ïŒŒćŠ‚æžœæČĄæœ‰çˆ¶çȘ—ćŁïŒŒćˆ™æ— ä»»äœ•äœœç”šă€‚ @@ -11798,14 +11798,14 @@ interface PlusNetXMLHttpRequest { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) */ - onloadstart?: () => void; + onloadstart?: (result: PlusNetProgressEvent) => void; /** * çœ‘ç»œèŻ·æ±‚äŒ èŸ“æ•°æźäș‹ä»¶ * 通澾朹HTTPèŻ·æ±‚é“ŸæŽ„ć·Č经ć»șç«‹ïŒŒćŒ€ć§‹äŒ èŸ“æ•°æźæ—¶è§Šć‘ïŒŒćœšæ•°æźäŒ èŸ“çš„èż‡çš‹äž­ćŻèƒœć€šæŹĄè§Šć‘ïŒŒæ­€äș‹ä»¶äžŽonreadystatechangeäș‹ä»¶è§Šć‘状态3ç±»äŒŒă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) */ - onprogress?: () => void; + onprogress?: (result: PlusNetProgressEvent) => void; /** * çœ‘ç»œèŻ·æ±‚ć–æ¶ˆäș‹ä»¶ * é€šćžžćœšè°ƒç”šabortæ–čæł•ć–æ¶ˆHTTPèŻ·æ±‚æ—¶è§Šć‘ă€‚ @@ -11813,7 +11813,7 @@ interface PlusNetXMLHttpRequest { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) */ - onabort?: () => void; + onabort?: (result: PlusNetProgressEvent) => void; /** * çœ‘ç»œèŻ·æ±‚é”™èŻŻäș‹ä»¶ * 通澾朹HTTPèŻ·æ±‚ć‘ç”Ÿé”™èŻŻæ—¶è§Šć‘ïŒŒćŠ‚æ— æł•èżžæŽ„ćˆ°æœćŠĄć™šç­‰ć„ç§é”™èŻŻéƒœè§Šć‘æ­€äș‹ä»¶ă€‚ @@ -11821,7 +11821,7 @@ interface PlusNetXMLHttpRequest { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) */ - onerror?: () => void; + onerror?: (result: PlusNetProgressEvent) => void; /** * çœ‘ç»œèŻ·æ±‚æˆćŠŸäș‹ä»¶ * 通澾朹HTTPèŻ·æ±‚æˆćŠŸćźŒæˆæ—¶è§Šć‘ïŒŒćŠ‚æžœHTTPèŻ·æ±‚ć‘ç”Ÿé”™èŻŻćˆ™äžè§Šć‘æ­€äș‹ä»¶ă€‚ @@ -11829,7 +11829,7 @@ interface PlusNetXMLHttpRequest { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) */ - onload?: () => void; + onload?: (result: PlusNetProgressEvent) => void; /** * çœ‘ç»œèŻ·æ±‚è¶…æ—¶äș‹ä»¶ * 通澾朹HTTPèŻ·æ±‚è¶…æ—¶æ—¶è§Šć‘ïŒŒæ­€æ—¶äžäŒšè§Šć‘onerroräș‹ä»¶ă€‚ @@ -11837,7 +11837,7 @@ interface PlusNetXMLHttpRequest { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) */ - ontimeout?: () => void; + ontimeout?: (result: PlusNetProgressEvent) => void; /** * çœ‘ç»œèŻ·æ±‚ç»“æŸäș‹ä»¶ * 通澾朹HTTPèŻ·æ±‚ç»“æŸæ—¶è§Šć‘ïŒŒäžçźĄæ˜ŻHTTPèŻ·æ±‚ć€±èŽ„ă€æˆćŠŸă€æˆ–è¶…æ—¶äč‹ćŽéƒœäŒšè§Šć‘æ­€äș‹ä»¶ă€‚ @@ -11845,7 +11845,7 @@ interface PlusNetXMLHttpRequest { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) */ - onloadend?: () => void; + onloadend?: (result: PlusNetProgressEvent) => void; /** * ć–æ¶ˆćœ“ć‰ć“ćș”ïŒŒć…łé—­èżžæŽ„ćč¶äž”结束任䜕æœȘć†łçš„çœ‘ç»œæŽ»ćŠš * æ­€æ–čæł•把XMLHttpRequestćŻčè±Ąé‡çœźäžșreadyStateäžș0的状态ćč¶äž”ć–æ¶ˆæ‰€æœ‰æœȘć†łçš„çœ‘ç»œæŽ»ćŠšă€‚ @@ -11983,20 +11983,20 @@ interface PlusZip { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) */ - compress(src?: string, zipfile?: string, successCB?: () => void, errorCB?: () => void): void; + compress(src?: string, zipfile?: string, successCB?: () => void, errorCB?: (result: any) => void): void; /** * è§ŁćŽ‹çŒ©Zip文件 * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) */ - decompress(zipfile?: string, target?: string, successCB?: () => void, errorCB?: () => void): void; + decompress(zipfile?: string, target?: string, successCB?: () => void, errorCB?: (result: any) => void): void; /** * ć›Ÿç‰‡ćŽ‹çŒ©èœŹæą * 揯甹äșŽć›Ÿç‰‡çš„èŽšé‡ćŽ‹çŒ©ă€ć€§ć°çŒ©æ”Ÿă€æ–čć‘æ—‹èœŹă€ćŒșćŸŸèŁć‰Șă€æ ŒćŒèœŹæąç­‰ă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) */ - compressImage(options?: PlusZipCompressImageOptions, successCB?: () => void, errorCB?: () => void): void; + compressImage(options?: PlusZipCompressImageOptions, successCB?: (result: any) => void, errorCB?: (result: any) => void): void; } /** @@ -12290,7 +12290,7 @@ interface PlusBarcode { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) */ - scan(path?: string, successCB?: () => void, errorCB?: () => void, filters?: any []): void; + scan(path?: string, successCB?: (result0: number, result1: string, result2: string) => void, errorCB?: (result: any) => void, filters?: any []): void; /** * 戛ć»șBarcodećŻčè±Ą * 调甚歀æ–čæł•ćˆ›ć»ș搎ćč¶äžäŒšæ˜Ÿç€ș需芁调甚WebviewçȘ—ćŁçš„appendæ–čæł•ć°†ć…¶æ·»ćŠ ćˆ°WebviewçȘ—ćŁćŽæ‰èƒœæ˜Ÿç€ș。 @@ -12321,14 +12321,14 @@ interface PlusBarcodeBarcode { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) */ - onmarked?: () => void; + onmarked?: (result0: number, result1: string, result2: string) => void; /** * æĄç èŻ†ćˆ«é”™èŻŻäș‹ä»¶ * ææŽ§ä»¶èŻ†ćˆ«èż‡çš‹äž­ć‘ç”Ÿé”™èŻŻæ—¶è§Šć‘çš„ć€±èŽ„äș‹ä»¶ïŒŒćč¶èż”ć›žé”™èŻŻäżĄæŻă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) */ - onerror?: () => void; + onerror?: (result: any) => void; /** * ćŒ€ć§‹æĄç èŻ†ćˆ« * ćŒ€ć§‹è°ƒç”šçł»ç»Ÿæ‘„ćƒć€ŽèŽ·ć–ć›Ÿç‰‡æ•°æźèż›èĄŒæ‰«ç èŻ†ćˆ«ïŒŒćœ“èŻ†ćˆ«ć‡șæĄç æ•°æźæ—¶é€šèż‡onmarkedć›žè°ƒć‡œæ•°èż”ć›žă€‚ @@ -12659,14 +12659,14 @@ interface PlusMapsMap { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) */ - onclick?: () => void; + onclick?: (result: PlusMapsPoint) => void; /** * ćœ°ć›ŸçŠ¶æ€æ”č揘äș‹ä»¶ * ç”šæˆ·æ‹–ćŠšă€çŒ©æ”Ÿćœ°ć›Ÿç­‰æ“äœœćźŒæˆćŽè§Šć‘ă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) */ - onstatuschanged?: () => void; + onstatuschanged?: (result: any) => void; /** * 静态æ–čæł•ïŒŒèźĄçź—éąç§Ż * èźĄçź—æŒ‡ćźšćœ°ç†ćŒșćŸŸçš„éąç§ŻïŒŒć•äœäžșćčłæ–č米。 @@ -12674,14 +12674,14 @@ interface PlusMapsMap { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) */ - calculateArea(bounds?: PlusMapsBounds, successCallback?: () => void, errorCallback?: () => void): void; + calculateArea(bounds?: PlusMapsBounds, successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; /** * 静态æ–čæł•ïŒŒèźĄçź—è·çŠ» * èźĄçź—ä»ŽpointStartćæ ‡ç‚č戰pointEndćæ ‡çš„ćźžé™…ç›Žçșżè·çŠ»ïŒŒć•äœäžșç±łïŒˆmïŒ‰ă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) */ - calculateDistance(pointStart?: PlusMapsPoint, pointEnd?: PlusMapsPoint, successCallback?: () => void, errorCallback?: () => void): void; + calculateDistance(pointStart?: PlusMapsPoint, pointEnd?: PlusMapsPoint, successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; /** * 静态æ–čæł•ïŒŒćæ ‡èœŹæą * 氆第侉æ–čćæ ‡çł»ćæ ‡èœŹæąæˆćœ“ć‰ćœ°ć›Ÿçš„ćæ ‡çł»ćæ ‡ă€‚ @@ -12689,7 +12689,7 @@ interface PlusMapsMap { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) */ - convertCoordinates(point?: PlusMapsPoint, options?: PlusMapsCoordinateConvertOptions, successCallback?: () => void, errorCallback?: () => void): void; + convertCoordinates(point?: PlusMapsPoint, options?: PlusMapsCoordinateConvertOptions, successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; /** * 静态æ–čæł•ïŒŒćœ°ç†çŒ–ç  * ć°†ćœ°ç†äœçœźäżĄæŻèœŹæąäžșćæ ‡ç‚č。 @@ -12697,7 +12697,7 @@ interface PlusMapsMap { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) */ - geocode(address?: string, options?: PlusMapsGeocodeOptions, successCallback?: () => void, errorCallback?: () => void): void; + geocode(address?: string, options?: PlusMapsGeocodeOptions, successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; /** * 静态æ–čæł•ïŒŒćć‘ćœ°ç†çŒ–ç  * ć°†ćæ ‡ç‚čèœŹæąäžșćœ°ç†äœçœźäżĄæŻă€‚ @@ -12705,7 +12705,7 @@ interface PlusMapsMap { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) */ - reverseGeocode(point?: PlusMapsPoint, options?: PlusMapsGeocodeOptions, successCallback?: () => void, errorCallback?: () => void): void; + reverseGeocode(point?: PlusMapsPoint, options?: PlusMapsGeocodeOptions, successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; /** * ć‘ćœ°ć›Ÿäž­æ·»ćŠ èŠ†ç›–ç‰© * æ­€æ–čæł•甚äșŽć‘ćœ°ć›Ÿäž­æ·»ćŠ èŠ†ç›–ç‰©ă€‚ @@ -12761,7 +12761,7 @@ interface PlusMapsMap { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) */ - getCurrentCenter(callback?: () => void): boolean; + getCurrentCenter(callback?: (result0: number, result1: PlusMapsPoint) => void): boolean; /** * èŽ·ć–ćœ°ć›Ÿçš„æ˜Ÿç€ș类枋 * @@ -12775,7 +12775,7 @@ interface PlusMapsMap { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) */ - getUserLocation(callback?: () => void): boolean; + getUserLocation(callback?: (result0: number, result1: PlusMapsPoint) => void): boolean; /** * èŽ·ć–ćœ°ć›Ÿçš„çŒ©æ”Ÿçș§ćˆ« * æ­€æ–čæł•甚äșŽèźŸçœźćœ°ć›Ÿçš„猩攟çș§ćˆ«ïŒŒç”šäșŽćˆ‡æąćœ“ć‰æ˜Ÿç€șćœ°ć›ŸçŒ©æ”Ÿçș§ćˆ«ă€‚ @@ -13200,14 +13200,14 @@ interface PlusMapsMarker { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) */ - onclick?: () => void; + onclick?: (result: PlusMapsOverlay) => void; /** * 甚户拖拜标ç‚čäș‹ä»¶ * ćŻè°ƒç”šæ ‡ç‚čćŻčè±Ąçš„markObj.setDraggable(true)æ–čæł•èźŸçœźæ ‡ç‚čć…èźžæ‹–æ‹œïŒŒćœ“ç”šæˆ·æ‹–æ‹œæ ‡ç‚čćŻčè±Ąæ—¶è§Šć‘æ­€äș‹ä»¶ă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) */ - onDrag?: () => void; + onDrag?: (result: any) => void; /** * 芆盖物星ç€șćˆ°æœ€äžŠć±‚ * 澾甹äșŽèŠ†ç›–ç‰©ç›žäș’芆盖时调敎芆盖物的星ç€șéĄșćșă€‚ @@ -13309,7 +13309,7 @@ interface PlusMapsBubble { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) */ - onclick?: () => void; + onclick?: (result: PlusMapsOverlay) => void; /** * èźŸçœźæ°”æłĄäžŠæ˜Ÿç€șçš„ć›Ÿæ ‡ * è‹„äžșèźŸçœźćˆ™æ— é»˜èź€ć›Ÿæ ‡ïŒŒć·Čæ·»ćŠ çš„æ˜Ÿç€șçš„æ°”æłĄćœšèźŸçœźæ–°ć€ŒćŽć°†ćœšćœ°ć›ŸäžŠç«‹ćłæ›Žæ–°ć†…ćźč。 @@ -13623,13 +13623,13 @@ interface PlusMapsSearch { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) */ - onPoiSearchComplete?: () => void; + onPoiSearchComplete?: (result0: number, result1: PlusMapsSearchPoiResult) => void; /** * çșżè·ŻæŁ€çŽąćźŒæˆäș‹ä»¶ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) */ - onRouteSearchComplete?: () => void; + onRouteSearchComplete?: (result0: number, result1: PlusMapsSearchRouteResult) => void; /** * èźŸçœźæŁ€çŽąèż”ć›žç»“æžœæŻéĄ”çš„äżĄæŻæ•°ç›ź * ćœ°ć›ŸæŁ€çŽąç»“æžœæ˜ŻæŒ‰éĄ”èż”ć›žçš„ïŒŒé»˜èź€æŁ€çŽąæŻéĄ”èż”ć›ž10æĄäżĄæŻă€‚ @@ -14009,7 +14009,7 @@ interface PlusOauth { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) */ - getServices(successCB?: () => void, errorCB?: () => void): void; + getServices(successCB?: (result: PlusOauth []) => void, errorCB?: (result: any) => void): void; } /** @@ -14072,7 +14072,7 @@ interface PlusOauthAuthService { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) */ - authorize(successCallback?: () => void, errorCallback?: () => void, options?: PlusOauthAuthOptions): void; + authorize(successCallback?: (result: any) => void, errorCallback?: (result: any) => void, options?: PlusOauthAuthOptions): void; /** * èŻ·æ±‚ç™»ćœ•æŽˆæƒèź€èŻæ“äœœ * ćŻčæŒ‡ćźšçš„ç™»ćœ•æŽˆæƒèź€èŻæœćŠĄèż›èĄŒç™»ćœ•èź€èŻæ“äœœïŒŒćœšç™»ćœ•ć‰ćŻé€šèż‡ćŻčè±Ąçš„authResultć±žæ€§ćˆ€æ–­æ˜ŻćŠć·Čç»ç™»ćœ•èź€èŻèż‡ïŒŒé€šćžžćȘ需芁ćŻčæČĄæœ‰èż›èĄŒèż‡ç™»ćœ•èź€èŻçš„æœćŠĄèż›èĄŒç™»ćœ•èź€èŻæ“äœœă€‚ @@ -14080,7 +14080,7 @@ interface PlusOauthAuthService { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) */ - login(successCallback?: () => void, errorCallback?: () => void, options?: PlusOauthAuthOptions): void; + login(successCallback?: (result: any) => void, errorCallback?: (result: any) => void, options?: PlusOauthAuthOptions): void; /** * æłšé”€ç™»ćœ•æŽˆæƒèź€èŻ * ćŻčæŒ‡ćźšçš„ç™»ćœ•æŽˆæƒèź€èŻæœćŠĄæłšé”€ç™»ćœ•èź€èŻæ“äœœïŒŒæłšé”€æŽˆæƒèź€èŻćŽïŒŒć†æŹĄæ“äœœæ—¶éœ€é‡æ–°èż›èĄŒç™»ćœ•èź€èŻæ“äœœă€‚ @@ -14088,7 +14088,7 @@ interface PlusOauthAuthService { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) */ - logout(successCallback?: () => void, errorCallback?: () => void): void; + logout(successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; /** * èŽ·ć–ç™»ćœ•æŽˆæƒç”šæˆ·äżĄæŻ * èŽ·ć–ç™»ćœ•æŽˆæƒèź€èŻçš„ç”šæˆ·äżĄæŻïŒŒćœšèŽ·ć–ć‰ćŻé€šèż‡ćŻčè±Ąçš„userInfoć±žæ€§ćˆ€æ–­æ˜ŻćŠć·Čç»èŽ·ć–èż‡ïŒŒé€šćžžćȘ需芁ćŻčæČĄæœ‰èŽ·ć–èż‡ç”šæˆ·äżĄæŻçš„æœćŠĄèż›èĄŒæ“äœœă€‚ @@ -14096,14 +14096,14 @@ interface PlusOauthAuthService { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) */ - getUserInfo(successCallback?: () => void, errorCallback?: () => void): void; + getUserInfo(successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; /** * æ·»ćŠ ç”šæˆ·æ‰‹æœșć·äżĄæŻ * æ‰“ćŒ€ç™»ćœ•æŽˆæƒæœćŠĄçš„æ·»ćŠ ç”šæˆ·æ‰‹æœșć·ç•Œéąèż›èĄŒæ“äœœïŒŒæ·»ćŠ ç”šæˆ·æ‰‹æœșć·æ“äœœæˆćŠŸćŽé€šèż‡successCallbackć›žè°ƒć‡œæ•°é€šçŸ„ïŒŒćŠćˆ™é€šèż‡errorCallbackć›žè°ƒć‡œæ•°é€šçŸ„ă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) */ - addPhoneNumber(successCallback?: () => void, errorCallback?: () => void): void; + addPhoneNumber(successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; } /** @@ -14341,7 +14341,7 @@ interface PlusPayment { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) */ - getChannels(successCB?: () => void, errorCB?: () => void): void; + getChannels(successCB?: (result: PlusPayment []) => void, errorCB?: (result: any) => void): void; /** * èŻ·æ±‚æ”Żä»˜æ“äœœ * è°ƒç”šæŒ‡ćźšçš„æ”Żä»˜é€šé“èż›èĄŒæ”Żä»˜æ“äœœïŒŒć…¶äž­statementćŒ…ć«æ”Żä»˜æ“äœœçš„ç›žć…łäżĄæŻïŒŒæ”Żä»˜æšĄć—ć°†ćŒčć‡șæ”Żä»˜ç•ŒéąäŸ›ç”šæˆ·èż›èĄŒæ”Żä»˜äżĄæŻçš„èŸ“ć…„çĄźèź€æ“äœœă€‚ @@ -14349,7 +14349,7 @@ interface PlusPayment { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) */ - request(channel?: PlusPaymentPaymentChannel, statement?: string, successCB?: () => void, errorCB?: () => void): void; + request(channel?: PlusPaymentPaymentChannel, statement?: string, successCB?: (result: PlusPaymentPaymentResult) => void, errorCB?: (result: any) => void): void; } /** @@ -14401,14 +14401,14 @@ interface PlusPaymentPaymentChannel { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) */ - requestOrder(ids?: any [], successCB?: () => void, errorCB?: () => void): void; + requestOrder(ids?: any [], successCB?: (result: PlusPayment []) => void, errorCB?: (result: any) => void): void; /** * 搑IAPæœćŠĄć™šèŻ·æ±‚ć·Č经莭äč°çš„éžæ¶ˆè€—æ€§ć•†ć“ć’Œèźąé˜…ć•†ć“ * æłšæ„ïŒšäžèƒœèŽ·ć–ć·Č莭äč°çš„æ¶ˆè€—æ€§ć•†ć“ă€‚ * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) */ - restoreComplateRequest(options?: any, successCB?: () => void): void; + restoreComplateRequest(options?: any, successCB?: (result: PlusPayment []) => void): void; } /** @@ -14614,7 +14614,7 @@ interface PlusPush { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) */ - addEventListener(type?: string, listener?: () => void, capture?: boolean): void; + addEventListener(type?: string, listener?: (result: string) => void, capture?: boolean): void; /** * æž…ç©șæ‰€æœ‰æŽšé€æ¶ˆæŻ * æž…ç©șçł»ç»Ÿæ¶ˆæŻäž­ćżƒæ‰€æœ‰çš„æŽšé€æ¶ˆæŻă€‚ @@ -14860,7 +14860,7 @@ interface PlusShare { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) */ - getServices(successCB?: () => void, errorCB?: () => void): void; + getServices(successCB?: (result: PlusShare []) => void, errorCB?: (result: any) => void): void; /** * äœżç”šçł»ç»Ÿç»„ä»¶ć‘é€ćˆ†äș« * è°ƒç”šçł»ç»Ÿćˆ†äș«ç»„ä»¶ćˆ†äș«æ¶ˆæŻïŒŒé€šèż‡msgć‚æ•°èźŸçœźćˆ†äș«ć†…ćźč。 @@ -14868,7 +14868,7 @@ interface PlusShare { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) */ - sendWithSystem(msg?: PlusShareShareMessage, successCB?: () => void, errorCB?: () => void): void; + sendWithSystem(msg?: PlusShareShareMessage, successCB?: () => void, errorCB?: (result: any) => void): void; } /** @@ -14939,7 +14939,7 @@ interface PlusShareAuthorize { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) */ - onerror?: () => void; + onerror?: (result: any) => void; /** * ćŠ èœœćˆ†äș«æŽˆæƒéĄ”靱 * 戛ć»ș戆äș«æŽˆæƒéĄ”éąćŽïŒŒéœ€èŠè°ƒç”šæ­€æ–čæł•æŒ‡ćźšćˆ†äș«æœćŠĄæ ‡èŻ†æ„ćŠ èœœæŽˆæƒéĄ”éąæ•°æźïŒŒæ­€æ ‡èŻ†ćŻäœżç”šShareServicećŻčè±Ąçš„idć±žæ€§ă€‚ @@ -15031,7 +15031,7 @@ interface PlusShareShareService { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) */ - authorize(successCallback?: () => void, errorCallback?: () => void, options?: PlusShareAuthOptions): void; + authorize(successCallback?: (result: PlusShareShareService) => void, errorCallback?: (result: any) => void, options?: PlusShareAuthOptions): void; /** * ć–æ¶ˆæŽˆæƒèź€èŻ * ćŻčæŒ‡ćźšçš„ćˆ†äș«æœćŠĄć–æ¶ˆæŽˆæƒèź€èŻæ“äœœïŒŒć–æ¶ˆæŽˆæƒèź€èŻćŽïŒŒć†æŹĄćˆ†äș«æ—¶éœ€é‡æ–°èż›èĄŒæŽˆæƒæ“äœœă€‚ @@ -15046,7 +15046,7 @@ interface PlusShareShareService { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) */ - send(msg?: PlusShareShareMessage, successCB?: () => void, errorCB?: () => void): void; + send(msg?: PlusShareShareMessage, successCB?: () => void, errorCB?: (result: any) => void): void; /** * è°ƒç”šćŸźäżĄć°çš‹ćș * æłšæ„ïŒšéœ€ćœšćŸźäżĄćŒ€æ”Ÿćčłć°ć°†ćș”ç”šć…łè”ć°çš‹ćșæ‰èƒœæ­Łćžžè°ƒç”šă€‚ @@ -15275,7 +15275,7 @@ interface PlusSpeech { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) */ - startRecognize(options?: PlusSpeechSpeechRecognizeOptions, successCB?: () => void, errorCB?: (result: any) => void): void; + startRecognize(options?: PlusSpeechSpeechRecognizeOptions, successCB?: (result: string) => void, errorCB?: (result: any) => void): void; /** * ćœæ­ąèŻ­éŸłèŻ†ćˆ« * ćœ“èŻ­éŸłèŻ†ćˆ«ćźŒæˆæ—¶æˆ–ç”šæˆ·ć–æ¶ˆèŻ­éŸłèŻ†ćˆ«æ—¶è°ƒç”šïŒŒè°ƒç”šæ­€æ–čæł•ć°†ćŻŒè‡ŽerrorCallbackć›žè°ƒć‡œæ•°çš„è°ƒç”šă€‚ @@ -15290,7 +15290,7 @@ interface PlusSpeech { * * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) */ - addEventListener(event?: PlusSpeechSpeechRecoginzeEvents, listener?: () => void, capture?: boolean): void; + addEventListener(event?: PlusSpeechSpeechRecoginzeEvents, listener?: (result: any) => void, capture?: boolean): void; } /** From b0c0de0a559025254302cafaaf7032a258cb77c2 Mon Sep 17 00:00:00 2001 From: tkow Date: Tue, 5 Mar 2019 13:00:57 +0900 Subject: [PATCH 358/924] remove deprecated methods --- types/react-navigation/index.d.ts | 23 ------------------- .../react-navigation-tests.tsx | 15 ------------ 2 files changed, 38 deletions(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index f2b0b968fb..9b2aee84e2 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -872,10 +872,6 @@ export interface StackNavigatorConfig } // Return createNavigationContainer -export function StackNavigator( - routeConfigMap: NavigationRouteConfigMap, - stackConfig?: StackNavigatorConfig -): NavigationContainer; export function createStackNavigator( routeConfigMap: NavigationRouteConfigMap, @@ -892,11 +888,6 @@ export interface SwitchNavigatorConfig { // Return createNavigationContainer export type _SwitchNavigatorConfig = NavigationSwitchRouterConfig; -export function SwitchNavigator( - routeConfigMap: NavigationRouteConfigMap, - switchConfig?: SwitchNavigatorConfig -): NavigationContainer; - export function createSwitchNavigator( routeConfigMap: NavigationRouteConfigMap, switchConfig?: SwitchNavigatorConfig @@ -962,11 +953,6 @@ export interface DrawerNavigatorConfig drawerLockMode?: DrawerLockMode; } -export function DrawerNavigator( - routeConfigMap: NavigationRouteConfigMap, - drawerConfig?: DrawerNavigatorConfig -): NavigationContainer; - export function createDrawerNavigator( routeConfigMap: NavigationRouteConfigMap, drawerConfig?: DrawerNavigatorConfig @@ -1021,15 +1007,6 @@ export interface BottomTabNavigatorConfig } // From navigators/TabNavigator.js -export function TabNavigator( - routeConfigMap: NavigationRouteConfigMap, - drawConfig?: TabNavigatorConfig -): NavigationContainer; - -export function createTabNavigator( - routeConfigMap: NavigationRouteConfigMap, - drawConfig?: TabNavigatorConfig -): NavigationContainer; export function createBottomTabNavigator( routeConfigMap: NavigationRouteConfigMap, diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index 777a8fa9f3..cf933d43ba 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -36,7 +36,6 @@ import { createSwitchNavigator, SwitchNavigatorConfig, TabBarTop, - createTabNavigator, TabNavigatorConfig, Transitioner, HeaderBackButton, @@ -245,20 +244,6 @@ const tabNavigatorConfigWithNavigationOptions: TabNavigatorConfig = { }, }; -const BasicTabNavigator = createTabNavigator( - routeConfigMap, - tabNavigatorConfig, -); - -function renderBasicTabNavigator(): JSX.Element { - return ( - { }} - style={[viewStyle, undefined]} // Test that we are using StyleProp - /> - ); -} - /** * Stack navigator. */ From 78260dbf4c74d308b5e189cd8adcc4a587040502 Mon Sep 17 00:00:00 2001 From: Aaron Beall Date: Mon, 4 Mar 2019 23:01:41 -0500 Subject: [PATCH 359/924] Added pendo-io-agent definitions --- pendo-io-agent/index.d.ts | 166 +++++++++++++++++++ pendo-io-agent/pendo-io-agent-tests.ts | 78 +++++++++ pendo-io-agent/tsconfig.json | 23 +++ pendo-io-agent/tslint.json | 1 + types/pendo-io-agent/index.d.ts | 63 +++++++ types/pendo-io-agent/pendo-io-agent-tests.ts | 0 types/pendo-io-agent/tsconfig.json | 22 +++ types/pendo-io-agent/tslint.json | 1 + 8 files changed, 354 insertions(+) create mode 100644 pendo-io-agent/index.d.ts create mode 100644 pendo-io-agent/pendo-io-agent-tests.ts create mode 100644 pendo-io-agent/tsconfig.json create mode 100644 pendo-io-agent/tslint.json create mode 100644 types/pendo-io-agent/index.d.ts create mode 100644 types/pendo-io-agent/pendo-io-agent-tests.ts create mode 100644 types/pendo-io-agent/tsconfig.json create mode 100644 types/pendo-io-agent/tslint.json diff --git a/pendo-io-agent/index.d.ts b/pendo-io-agent/index.d.ts new file mode 100644 index 0000000000..6429f3b95b --- /dev/null +++ b/pendo-io-agent/index.d.ts @@ -0,0 +1,166 @@ +// Type definitions for Pendo.io Agent 2.16 +// Project: https://www.pendo.io/ +// Definitions by: Aaron Beall +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace pendo { + interface Identity { + visitor: Visitor; + account?: Account; + } + + type Metadata = Record; + + interface Visitor extends Metadata { + id: string; + } + + interface Account extends Metadata { + id?: string; + } + + interface InitOptions extends Identity { + apiKey?: string; + excludeAllText?: boolean; + excludeTitle?: boolean; + disablePersistence?: boolean; + guides?: { + delay?: boolean; + disable?: boolean; + timeout?: number; + tooltip?: { + arrowSize?: number; + } + }; + events?: EventCallbacks; + } + + interface EventCallbacks { + ready?(): void; + guidesLoaded?(): void; + guidesFailed?(): void; + } + + interface Pendo { + // Initialization and Identification + initialize(options: InitOptions): void; + identify(visitorId: string, accountId?: string): void; + identify(identity: Identity): void; + isReady(): boolean; + flushNow(): Promise; + updateOptions(visitorMetadata: Metadata): void; + getVersion(): string; + getVisitorId(): string; + getAccountId(): string; + getCurrentUrl(): string; + + // Guides and Guide Center + findGuideByName(name: string): Guide | void; + findGuideById(id: string): Guide | void; + showGuideByName(name: string): void; + showGuideById(id: string): void; + toggleLauncher(): void; + removeLauncher(): void; + + // Troubleshooting + loadGuides(): void; + startGuides(): void; + stopGuides(): void; + + // Debugging + enableDebugging(): void; + disableDebugging(): void; + isDebuggingEnabled(coerce?: false): "Yes" | "No"; + isDebuggingEnabled(coerce: true): boolean; + debugging: Debugging; + + // Events + events: Events; + track(trackType: string, metadata?: Metadata): void; + + // Guide Events + onGuideAdvanced(step?: GuideStep): void; + onGuideAdvanced(steps: { steps: number }): void; + onGuidePrevious(step?: GuideStep): void; + onGuideDismissed(step?: GuideStep): void; + onGuideDismissed(until: { until: "reload" }): void; + + // Other + validateInstall(): void; + dom(input: any): HTMLElement; // TODO + } + + interface Debugging { + getEventCache(): any[]; // TODO + getAllGuides(): Guide[]; + getAutoGuides(): { auto: Guide[]; override: Guide[] }; + getBadgeGuides(): Guide[]; + getLauncherGuides(): Guide[]; + } + + type Events = { + [K in keyof EventCallbacks]-?: (callback: EventCallbacks[K]) => Events; + }; + + interface Guide { + createdByUser: User; + createdAt: number; + lastUpdatedByUser: User; + lastUpdatedAt: number; + kind: string; + rootVersionId: string; + stableVersionId: string; + id: string; + name: string; + state: "published" | "staged" | "draft" | "disabled"; + launchMethod: "api" | "automatic" | "badge" | "dom" | "launcher"; + isMultiStep: boolean; + steps: GuideStep[]; + attributes: { + type: string; + device: { desktop: boolean; mobile: boolean; type: "desktop" | "mobile" }; + badge: any; + priority: number; + launcher: { keywords: string[] }; + }; + audience: any[]; // TODO + audienceUiHint: { filters: any[] }; // TODO + resetAt: number; + publishedAt: number; + } + + interface User { + id: string; + username: string; + first: string; + last: string; + role: number; + userType: string; + } + + interface GuideStep { + id: string; + guideId: string; + type: string; + elementPathRule: string; + contentType: string; + contentUrl?: string; + contentUrlCss?: string; + contentUrlJs?: string; + rank: number; + advanceMethod: "button" | "programatic" /* sic */ | "element"; + thumbnailUrls?: string; + attributes: { + height: number; + width: number; + autoHeight: boolean; + position: string; + css: string; + variables: any; + }; + lastUpdatedAt: number; + resetAt: number; + } +} + +declare const pendo: pendo.Pendo; diff --git a/pendo-io-agent/pendo-io-agent-tests.ts b/pendo-io-agent/pendo-io-agent-tests.ts new file mode 100644 index 0000000000..575b039686 --- /dev/null +++ b/pendo-io-agent/pendo-io-agent-tests.ts @@ -0,0 +1,78 @@ +// Examples from: https://developers.pendo.io/docs/?bash#agent-api + +pendo.initialize({ + visitor: { + id: "PUT_VISITOR_ID_HERE", + name: "Neo", + email: "neo@thematrix.io", + role: "godlike" + }, + account: { + id: "PUT_ACCOUNT_ID_HERE", + name: "CorpSchmorp" + } +}); + +pendo.identify( + "PUT_VISITOR_ID_HERE", + "PUT_ACCOUNT_ID_HERE" +); + +pendo.identify({ + visitor: { + id: "PUT_VISITOR_ID_HERE", + name: "Neo", + email: "neo@thematrix.io", + role: "godlike" + }, + account: { + id: "PUT_ACCOUNT_ID_HERE", + name: "CorpSchmorp" + } +}); + +pendo.debugging.getEventCache(); + +pendo.events + .ready(function () { + // Do something once `pendo.isReady()` would return `true` + }) + .guidesLoaded(function () { + // Do something when Guides load + }) + .guidesFailed(function () { + // Do something when Guides fail to load + }); + +pendo.initialize({ + apiKey: 'YOUR_API_KEY', + visitor: { id: "" }, + account: { id: "" }, + events: { + ready: function () { + // Do something when pendo is initialized + } + } +}); + +pendo.track("User Registered", { + userId: "user.id", + plan: "user.plan", + accountType: "Facebook" +}); + +try { + throw new Error(); +} +catch (error) { + pendo.track("JIRA-12345--error-tripped", { + message: error.message, + stack: error.stack + }); +} + +pendo.dom("").closest('._pendo-guide-next_') + +pendo.onGuideAdvanced(); +pendo.onGuideAdvanced({ steps: 2 }); +pendo.onGuideDismissed(); diff --git a/pendo-io-agent/tsconfig.json b/pendo-io-agent/tsconfig.json new file mode 100644 index 0000000000..4ee19675e0 --- /dev/null +++ b/pendo-io-agent/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "pendo-io-agent-tests.ts" + ] +} diff --git a/pendo-io-agent/tslint.json b/pendo-io-agent/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/pendo-io-agent/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/pendo-io-agent/index.d.ts b/types/pendo-io-agent/index.d.ts new file mode 100644 index 0000000000..edd35a96fd --- /dev/null +++ b/types/pendo-io-agent/index.d.ts @@ -0,0 +1,63 @@ +// Type definitions for pendo-io-agent x.x +// Project: https://github.com/baz/foo (Does not have to be to GitHub, but prefer linking to a source code repository rather than to a project website.) +// Definitions by: My Self +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/*~ If this library is callable (e.g. can be invoked as myLib(3)), + *~ include those call signatures here. + *~ Otherwise, delete this section. + */ +declare function myLib(a: string): string; +declare function myLib(a: number): number; + +/*~ If you want the name of this library to be a valid type name, + *~ you can do so here. + *~ + *~ For example, this allows us to write 'var x: myLib'; + *~ Be sure this actually makes sense! If it doesn't, just + *~ delete this declaration and add types inside the namespace below. + */ +interface myLib { + name: string; + length: number; + extras?: string[]; +} + +/*~ If your library has properties exposed on a global variable, + *~ place them here. + *~ You should also place types (interfaces and type alias) here. + */ +declare namespace myLib { + //~ We can write 'myLib.timeout = 50;' + let timeout: number; + + //~ We can access 'myLib.version', but not change it + const version: string; + + //~ There's some class we can create via 'let c = new myLib.Cat(42)' + //~ Or reference e.g. 'function f(c: myLib.Cat) { ... } + class Cat { + constructor(n: number); + + //~ We can read 'c.age' from a 'Cat' instance + readonly age: number; + + //~ We can invoke 'c.purr()' from a 'Cat' instance + purr(): void; + } + + //~ We can declare a variable as + //~ 'var s: myLib.CatSettings = { weight: 5, name: "Maru" };' + interface CatSettings { + weight: number; + name: string; + tailLength?: number; + } + + //~ We can write 'const v: myLib.VetID = 42;' + //~ or 'const v: myLib.VetID = "bob";' + type VetID = string | number; + + //~ We can invoke 'myLib.checkCat(c)' or 'myLib.checkCat(c, v);' + function checkCat(c: Cat, s?: VetID); +} diff --git a/types/pendo-io-agent/pendo-io-agent-tests.ts b/types/pendo-io-agent/pendo-io-agent-tests.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/types/pendo-io-agent/tsconfig.json b/types/pendo-io-agent/tsconfig.json new file mode 100644 index 0000000000..35695dd90c --- /dev/null +++ b/types/pendo-io-agent/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", + "pendo-io-agent-tests.ts" + ] +} diff --git a/types/pendo-io-agent/tslint.json b/types/pendo-io-agent/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/pendo-io-agent/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From c018882991198c685b6c38741242bab5435839dc Mon Sep 17 00:00:00 2001 From: tkow Date: Tue, 5 Mar 2019 13:02:16 +0900 Subject: [PATCH 360/924] add createMaterialTopTabNavigator test --- types/react-navigation/react-navigation-tests.tsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index cf933d43ba..2f7c65f9cd 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -36,6 +36,7 @@ import { createSwitchNavigator, SwitchNavigatorConfig, TabBarTop, + createMaterialTopTabNavigator, TabNavigatorConfig, Transitioner, HeaderBackButton, @@ -244,6 +245,20 @@ const tabNavigatorConfigWithNavigationOptions: TabNavigatorConfig = { }, }; +const BasicTabNavigator = createMaterialTopTabNavigator( + routeConfigMap, + tabNavigatorConfig, +); + +function renderBasicTabNavigator(): JSX.Element { + return ( + { }} + style={[viewStyle, undefined]} // Test that we are using StyleProp + /> + ); +} + /** * Stack navigator. */ From 3f04dbeed99039d96b22dedd04bb456765b466a4 Mon Sep 17 00:00:00 2001 From: Aaron Beall Date: Mon, 4 Mar 2019 23:07:34 -0500 Subject: [PATCH 361/924] Moved dir to /types --- pendo-io-agent/index.d.ts | 166 --------------- pendo-io-agent/pendo-io-agent-tests.ts | 78 ------- pendo-io-agent/tsconfig.json | 23 -- pendo-io-agent/tslint.json | 1 - types/pendo-io-agent/index.d.ts | 211 ++++++++++++++----- types/pendo-io-agent/pendo-io-agent-tests.ts | 78 +++++++ types/pendo-io-agent/tsconfig.json | 5 +- 7 files changed, 238 insertions(+), 324 deletions(-) delete mode 100644 pendo-io-agent/index.d.ts delete mode 100644 pendo-io-agent/pendo-io-agent-tests.ts delete mode 100644 pendo-io-agent/tsconfig.json delete mode 100644 pendo-io-agent/tslint.json diff --git a/pendo-io-agent/index.d.ts b/pendo-io-agent/index.d.ts deleted file mode 100644 index 6429f3b95b..0000000000 --- a/pendo-io-agent/index.d.ts +++ /dev/null @@ -1,166 +0,0 @@ -// Type definitions for Pendo.io Agent 2.16 -// Project: https://www.pendo.io/ -// Definitions by: Aaron Beall -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace pendo { - interface Identity { - visitor: Visitor; - account?: Account; - } - - type Metadata = Record; - - interface Visitor extends Metadata { - id: string; - } - - interface Account extends Metadata { - id?: string; - } - - interface InitOptions extends Identity { - apiKey?: string; - excludeAllText?: boolean; - excludeTitle?: boolean; - disablePersistence?: boolean; - guides?: { - delay?: boolean; - disable?: boolean; - timeout?: number; - tooltip?: { - arrowSize?: number; - } - }; - events?: EventCallbacks; - } - - interface EventCallbacks { - ready?(): void; - guidesLoaded?(): void; - guidesFailed?(): void; - } - - interface Pendo { - // Initialization and Identification - initialize(options: InitOptions): void; - identify(visitorId: string, accountId?: string): void; - identify(identity: Identity): void; - isReady(): boolean; - flushNow(): Promise; - updateOptions(visitorMetadata: Metadata): void; - getVersion(): string; - getVisitorId(): string; - getAccountId(): string; - getCurrentUrl(): string; - - // Guides and Guide Center - findGuideByName(name: string): Guide | void; - findGuideById(id: string): Guide | void; - showGuideByName(name: string): void; - showGuideById(id: string): void; - toggleLauncher(): void; - removeLauncher(): void; - - // Troubleshooting - loadGuides(): void; - startGuides(): void; - stopGuides(): void; - - // Debugging - enableDebugging(): void; - disableDebugging(): void; - isDebuggingEnabled(coerce?: false): "Yes" | "No"; - isDebuggingEnabled(coerce: true): boolean; - debugging: Debugging; - - // Events - events: Events; - track(trackType: string, metadata?: Metadata): void; - - // Guide Events - onGuideAdvanced(step?: GuideStep): void; - onGuideAdvanced(steps: { steps: number }): void; - onGuidePrevious(step?: GuideStep): void; - onGuideDismissed(step?: GuideStep): void; - onGuideDismissed(until: { until: "reload" }): void; - - // Other - validateInstall(): void; - dom(input: any): HTMLElement; // TODO - } - - interface Debugging { - getEventCache(): any[]; // TODO - getAllGuides(): Guide[]; - getAutoGuides(): { auto: Guide[]; override: Guide[] }; - getBadgeGuides(): Guide[]; - getLauncherGuides(): Guide[]; - } - - type Events = { - [K in keyof EventCallbacks]-?: (callback: EventCallbacks[K]) => Events; - }; - - interface Guide { - createdByUser: User; - createdAt: number; - lastUpdatedByUser: User; - lastUpdatedAt: number; - kind: string; - rootVersionId: string; - stableVersionId: string; - id: string; - name: string; - state: "published" | "staged" | "draft" | "disabled"; - launchMethod: "api" | "automatic" | "badge" | "dom" | "launcher"; - isMultiStep: boolean; - steps: GuideStep[]; - attributes: { - type: string; - device: { desktop: boolean; mobile: boolean; type: "desktop" | "mobile" }; - badge: any; - priority: number; - launcher: { keywords: string[] }; - }; - audience: any[]; // TODO - audienceUiHint: { filters: any[] }; // TODO - resetAt: number; - publishedAt: number; - } - - interface User { - id: string; - username: string; - first: string; - last: string; - role: number; - userType: string; - } - - interface GuideStep { - id: string; - guideId: string; - type: string; - elementPathRule: string; - contentType: string; - contentUrl?: string; - contentUrlCss?: string; - contentUrlJs?: string; - rank: number; - advanceMethod: "button" | "programatic" /* sic */ | "element"; - thumbnailUrls?: string; - attributes: { - height: number; - width: number; - autoHeight: boolean; - position: string; - css: string; - variables: any; - }; - lastUpdatedAt: number; - resetAt: number; - } -} - -declare const pendo: pendo.Pendo; diff --git a/pendo-io-agent/pendo-io-agent-tests.ts b/pendo-io-agent/pendo-io-agent-tests.ts deleted file mode 100644 index 575b039686..0000000000 --- a/pendo-io-agent/pendo-io-agent-tests.ts +++ /dev/null @@ -1,78 +0,0 @@ -// Examples from: https://developers.pendo.io/docs/?bash#agent-api - -pendo.initialize({ - visitor: { - id: "PUT_VISITOR_ID_HERE", - name: "Neo", - email: "neo@thematrix.io", - role: "godlike" - }, - account: { - id: "PUT_ACCOUNT_ID_HERE", - name: "CorpSchmorp" - } -}); - -pendo.identify( - "PUT_VISITOR_ID_HERE", - "PUT_ACCOUNT_ID_HERE" -); - -pendo.identify({ - visitor: { - id: "PUT_VISITOR_ID_HERE", - name: "Neo", - email: "neo@thematrix.io", - role: "godlike" - }, - account: { - id: "PUT_ACCOUNT_ID_HERE", - name: "CorpSchmorp" - } -}); - -pendo.debugging.getEventCache(); - -pendo.events - .ready(function () { - // Do something once `pendo.isReady()` would return `true` - }) - .guidesLoaded(function () { - // Do something when Guides load - }) - .guidesFailed(function () { - // Do something when Guides fail to load - }); - -pendo.initialize({ - apiKey: 'YOUR_API_KEY', - visitor: { id: "" }, - account: { id: "" }, - events: { - ready: function () { - // Do something when pendo is initialized - } - } -}); - -pendo.track("User Registered", { - userId: "user.id", - plan: "user.plan", - accountType: "Facebook" -}); - -try { - throw new Error(); -} -catch (error) { - pendo.track("JIRA-12345--error-tripped", { - message: error.message, - stack: error.stack - }); -} - -pendo.dom("").closest('._pendo-guide-next_') - -pendo.onGuideAdvanced(); -pendo.onGuideAdvanced({ steps: 2 }); -pendo.onGuideDismissed(); diff --git a/pendo-io-agent/tsconfig.json b/pendo-io-agent/tsconfig.json deleted file mode 100644 index 4ee19675e0..0000000000 --- a/pendo-io-agent/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "pendo-io-agent-tests.ts" - ] -} diff --git a/pendo-io-agent/tslint.json b/pendo-io-agent/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/pendo-io-agent/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" } diff --git a/types/pendo-io-agent/index.d.ts b/types/pendo-io-agent/index.d.ts index edd35a96fd..6429f3b95b 100644 --- a/types/pendo-io-agent/index.d.ts +++ b/types/pendo-io-agent/index.d.ts @@ -1,63 +1,166 @@ -// Type definitions for pendo-io-agent x.x -// Project: https://github.com/baz/foo (Does not have to be to GitHub, but prefer linking to a source code repository rather than to a project website.) -// Definitions by: My Self +// Type definitions for Pendo.io Agent 2.16 +// Project: https://www.pendo.io/ +// Definitions by: Aaron Beall // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/*~ If this library is callable (e.g. can be invoked as myLib(3)), - *~ include those call signatures here. - *~ Otherwise, delete this section. - */ -declare function myLib(a: string): string; -declare function myLib(a: number): number; - -/*~ If you want the name of this library to be a valid type name, - *~ you can do so here. - *~ - *~ For example, this allows us to write 'var x: myLib'; - *~ Be sure this actually makes sense! If it doesn't, just - *~ delete this declaration and add types inside the namespace below. - */ -interface myLib { - name: string; - length: number; - extras?: string[]; -} - -/*~ If your library has properties exposed on a global variable, - *~ place them here. - *~ You should also place types (interfaces and type alias) here. - */ -declare namespace myLib { - //~ We can write 'myLib.timeout = 50;' - let timeout: number; - - //~ We can access 'myLib.version', but not change it - const version: string; - - //~ There's some class we can create via 'let c = new myLib.Cat(42)' - //~ Or reference e.g. 'function f(c: myLib.Cat) { ... } - class Cat { - constructor(n: number); - - //~ We can read 'c.age' from a 'Cat' instance - readonly age: number; - - //~ We can invoke 'c.purr()' from a 'Cat' instance - purr(): void; +declare namespace pendo { + interface Identity { + visitor: Visitor; + account?: Account; } - //~ We can declare a variable as - //~ 'var s: myLib.CatSettings = { weight: 5, name: "Maru" };' - interface CatSettings { - weight: number; + type Metadata = Record; + + interface Visitor extends Metadata { + id: string; + } + + interface Account extends Metadata { + id?: string; + } + + interface InitOptions extends Identity { + apiKey?: string; + excludeAllText?: boolean; + excludeTitle?: boolean; + disablePersistence?: boolean; + guides?: { + delay?: boolean; + disable?: boolean; + timeout?: number; + tooltip?: { + arrowSize?: number; + } + }; + events?: EventCallbacks; + } + + interface EventCallbacks { + ready?(): void; + guidesLoaded?(): void; + guidesFailed?(): void; + } + + interface Pendo { + // Initialization and Identification + initialize(options: InitOptions): void; + identify(visitorId: string, accountId?: string): void; + identify(identity: Identity): void; + isReady(): boolean; + flushNow(): Promise; + updateOptions(visitorMetadata: Metadata): void; + getVersion(): string; + getVisitorId(): string; + getAccountId(): string; + getCurrentUrl(): string; + + // Guides and Guide Center + findGuideByName(name: string): Guide | void; + findGuideById(id: string): Guide | void; + showGuideByName(name: string): void; + showGuideById(id: string): void; + toggleLauncher(): void; + removeLauncher(): void; + + // Troubleshooting + loadGuides(): void; + startGuides(): void; + stopGuides(): void; + + // Debugging + enableDebugging(): void; + disableDebugging(): void; + isDebuggingEnabled(coerce?: false): "Yes" | "No"; + isDebuggingEnabled(coerce: true): boolean; + debugging: Debugging; + + // Events + events: Events; + track(trackType: string, metadata?: Metadata): void; + + // Guide Events + onGuideAdvanced(step?: GuideStep): void; + onGuideAdvanced(steps: { steps: number }): void; + onGuidePrevious(step?: GuideStep): void; + onGuideDismissed(step?: GuideStep): void; + onGuideDismissed(until: { until: "reload" }): void; + + // Other + validateInstall(): void; + dom(input: any): HTMLElement; // TODO + } + + interface Debugging { + getEventCache(): any[]; // TODO + getAllGuides(): Guide[]; + getAutoGuides(): { auto: Guide[]; override: Guide[] }; + getBadgeGuides(): Guide[]; + getLauncherGuides(): Guide[]; + } + + type Events = { + [K in keyof EventCallbacks]-?: (callback: EventCallbacks[K]) => Events; + }; + + interface Guide { + createdByUser: User; + createdAt: number; + lastUpdatedByUser: User; + lastUpdatedAt: number; + kind: string; + rootVersionId: string; + stableVersionId: string; + id: string; name: string; - tailLength?: number; + state: "published" | "staged" | "draft" | "disabled"; + launchMethod: "api" | "automatic" | "badge" | "dom" | "launcher"; + isMultiStep: boolean; + steps: GuideStep[]; + attributes: { + type: string; + device: { desktop: boolean; mobile: boolean; type: "desktop" | "mobile" }; + badge: any; + priority: number; + launcher: { keywords: string[] }; + }; + audience: any[]; // TODO + audienceUiHint: { filters: any[] }; // TODO + resetAt: number; + publishedAt: number; } - //~ We can write 'const v: myLib.VetID = 42;' - //~ or 'const v: myLib.VetID = "bob";' - type VetID = string | number; + interface User { + id: string; + username: string; + first: string; + last: string; + role: number; + userType: string; + } - //~ We can invoke 'myLib.checkCat(c)' or 'myLib.checkCat(c, v);' - function checkCat(c: Cat, s?: VetID); + interface GuideStep { + id: string; + guideId: string; + type: string; + elementPathRule: string; + contentType: string; + contentUrl?: string; + contentUrlCss?: string; + contentUrlJs?: string; + rank: number; + advanceMethod: "button" | "programatic" /* sic */ | "element"; + thumbnailUrls?: string; + attributes: { + height: number; + width: number; + autoHeight: boolean; + position: string; + css: string; + variables: any; + }; + lastUpdatedAt: number; + resetAt: number; + } } + +declare const pendo: pendo.Pendo; diff --git a/types/pendo-io-agent/pendo-io-agent-tests.ts b/types/pendo-io-agent/pendo-io-agent-tests.ts index e69de29bb2..575b039686 100644 --- a/types/pendo-io-agent/pendo-io-agent-tests.ts +++ b/types/pendo-io-agent/pendo-io-agent-tests.ts @@ -0,0 +1,78 @@ +// Examples from: https://developers.pendo.io/docs/?bash#agent-api + +pendo.initialize({ + visitor: { + id: "PUT_VISITOR_ID_HERE", + name: "Neo", + email: "neo@thematrix.io", + role: "godlike" + }, + account: { + id: "PUT_ACCOUNT_ID_HERE", + name: "CorpSchmorp" + } +}); + +pendo.identify( + "PUT_VISITOR_ID_HERE", + "PUT_ACCOUNT_ID_HERE" +); + +pendo.identify({ + visitor: { + id: "PUT_VISITOR_ID_HERE", + name: "Neo", + email: "neo@thematrix.io", + role: "godlike" + }, + account: { + id: "PUT_ACCOUNT_ID_HERE", + name: "CorpSchmorp" + } +}); + +pendo.debugging.getEventCache(); + +pendo.events + .ready(function () { + // Do something once `pendo.isReady()` would return `true` + }) + .guidesLoaded(function () { + // Do something when Guides load + }) + .guidesFailed(function () { + // Do something when Guides fail to load + }); + +pendo.initialize({ + apiKey: 'YOUR_API_KEY', + visitor: { id: "" }, + account: { id: "" }, + events: { + ready: function () { + // Do something when pendo is initialized + } + } +}); + +pendo.track("User Registered", { + userId: "user.id", + plan: "user.plan", + accountType: "Facebook" +}); + +try { + throw new Error(); +} +catch (error) { + pendo.track("JIRA-12345--error-tripped", { + message: error.message, + stack: error.stack + }); +} + +pendo.dom("").closest('._pendo-guide-next_') + +pendo.onGuideAdvanced(); +pendo.onGuideAdvanced({ steps: 2 }); +pendo.onGuideDismissed(); diff --git a/types/pendo-io-agent/tsconfig.json b/types/pendo-io-agent/tsconfig.json index 35695dd90c..4ee19675e0 100644 --- a/types/pendo-io-agent/tsconfig.json +++ b/types/pendo-io-agent/tsconfig.json @@ -1,12 +1,13 @@ { "compilerOptions": { - "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" From ef25a112620ddf8e21f902efa98432ef8f6325ed Mon Sep 17 00:00:00 2001 From: Aaron Beall Date: Mon, 4 Mar 2019 23:31:51 -0500 Subject: [PATCH 362/924] Renamed to pendo-io-browser per tslint, other lint fixes --- .../{pendo-io-agent => pendo-io-browser}/index.d.ts | 3 ++- .../pendo-io-browser-tests.ts} | 13 ++++++------- .../tsconfig.json | 3 ++- .../tslint.json | 0 4 files changed, 10 insertions(+), 9 deletions(-) rename types/{pendo-io-agent => pendo-io-browser}/index.d.ts (98%) rename types/{pendo-io-agent/pendo-io-agent-tests.ts => pendo-io-browser/pendo-io-browser-tests.ts} (88%) rename types/{pendo-io-agent => pendo-io-browser}/tsconfig.json (87%) rename types/{pendo-io-agent => pendo-io-browser}/tslint.json (100%) diff --git a/types/pendo-io-agent/index.d.ts b/types/pendo-io-browser/index.d.ts similarity index 98% rename from types/pendo-io-agent/index.d.ts rename to types/pendo-io-browser/index.d.ts index 6429f3b95b..dfc04e25d4 100644 --- a/types/pendo-io-agent/index.d.ts +++ b/types/pendo-io-browser/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for Pendo.io Agent 2.16 +// Type definitions for non-npm package Pendo.io Agent 2.16 // Project: https://www.pendo.io/ // Definitions by: Aaron Beall // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 declare namespace pendo { interface Identity { diff --git a/types/pendo-io-agent/pendo-io-agent-tests.ts b/types/pendo-io-browser/pendo-io-browser-tests.ts similarity index 88% rename from types/pendo-io-agent/pendo-io-agent-tests.ts rename to types/pendo-io-browser/pendo-io-browser-tests.ts index 575b039686..16db208cda 100644 --- a/types/pendo-io-agent/pendo-io-agent-tests.ts +++ b/types/pendo-io-browser/pendo-io-browser-tests.ts @@ -34,13 +34,13 @@ pendo.identify({ pendo.debugging.getEventCache(); pendo.events - .ready(function () { + .ready(() => { // Do something once `pendo.isReady()` would return `true` }) - .guidesLoaded(function () { + .guidesLoaded(() => { // Do something when Guides load }) - .guidesFailed(function () { + .guidesFailed(() => { // Do something when Guides fail to load }); @@ -49,7 +49,7 @@ pendo.initialize({ visitor: { id: "" }, account: { id: "" }, events: { - ready: function () { + ready() { // Do something when pendo is initialized } } @@ -63,15 +63,14 @@ pendo.track("User Registered", { try { throw new Error(); -} -catch (error) { +} catch (error) { pendo.track("JIRA-12345--error-tripped", { message: error.message, stack: error.stack }); } -pendo.dom("").closest('._pendo-guide-next_') +pendo.dom("").closest('._pendo-guide-next_'); pendo.onGuideAdvanced(); pendo.onGuideAdvanced({ steps: 2 }); diff --git a/types/pendo-io-agent/tsconfig.json b/types/pendo-io-browser/tsconfig.json similarity index 87% rename from types/pendo-io-agent/tsconfig.json rename to types/pendo-io-browser/tsconfig.json index 4ee19675e0..e5b8fc4c3f 100644 --- a/types/pendo-io-agent/tsconfig.json +++ b/types/pendo-io-browser/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "module": "commonjs", "lib": [ "es6", "dom" @@ -18,6 +19,6 @@ }, "files": [ "index.d.ts", - "pendo-io-agent-tests.ts" + "pendo-io-browser-tests.ts" ] } diff --git a/types/pendo-io-agent/tslint.json b/types/pendo-io-browser/tslint.json similarity index 100% rename from types/pendo-io-agent/tslint.json rename to types/pendo-io-browser/tslint.json From 674528b01e60cd6a8a503b6a1953cd245236937b Mon Sep 17 00:00:00 2001 From: "Adam A. Zerella" Date: Tue, 5 Mar 2019 15:29:24 +1100 Subject: [PATCH 363/924] Added type defs for sntp --- types/sntp/index.d.ts | 41 ++++++++++++++++++++++++++++++++++++++++ types/sntp/sntp-tests.ts | 18 ++++++++++++++++++ types/sntp/tsconfig.json | 25 ++++++++++++++++++++++++ types/sntp/tslint.json | 3 +++ 4 files changed, 87 insertions(+) create mode 100644 types/sntp/index.d.ts create mode 100644 types/sntp/sntp-tests.ts create mode 100644 types/sntp/tsconfig.json create mode 100644 types/sntp/tslint.json diff --git a/types/sntp/index.d.ts b/types/sntp/index.d.ts new file mode 100644 index 0000000000..9f94651df8 --- /dev/null +++ b/types/sntp/index.d.ts @@ -0,0 +1,41 @@ +// Type definitions for sntp 3.0 +// Project: https://github.com/hueniverse/sntp +// Definitions by: Adam Zerella +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export interface Options { + host?: string; + port?: number; + resolveReference?: boolean; + timeout?: number; +} + +export interface TimeOptions { + isValid: boolean; + leapIndicator: string; + version: number; + mode: string; + stratum: string; + pollInterval: number; + precision: number; + rootDelay: number; + rootDispersion: number; + referenceId: string; + referenceTimestamp: number; + originateTimestamp: number; + receiveTimestamp: number; + transmitTimestamp: number; + d: number; + t: number; + receivedLocally: number; +} + +export function start(options?: Options): Promise; + +export function stop(): void; + +export function offset(): Promise; + +export function time(options?: Options): Promise; + +export function now(): number; diff --git a/types/sntp/sntp-tests.ts b/types/sntp/sntp-tests.ts new file mode 100644 index 0000000000..1e6f80d35b --- /dev/null +++ b/types/sntp/sntp-tests.ts @@ -0,0 +1,18 @@ +import Sntp = require('sntp'); + +const options = { + host: 'abc', + port: 123, +}; + +Sntp.now(); + +Sntp.start(options); +Sntp.start(); + +Sntp.stop(); + +Sntp.time(options); +Sntp.time(); + +Sntp.offset(); diff --git a/types/sntp/tsconfig.json b/types/sntp/tsconfig.json new file mode 100644 index 0000000000..4bf279440e --- /dev/null +++ b/types/sntp/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [ + + ], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "sntp-tests.ts" + ] +} diff --git a/types/sntp/tslint.json b/types/sntp/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/sntp/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file From 92060063d559254444c9bdcae6a0ceffdda0a692 Mon Sep 17 00:00:00 2001 From: locknono Date: Tue, 5 Mar 2019 11:44:19 +0800 Subject: [PATCH 364/924] add types for d3-cloud --- types/d3-cloud/d3-cloud-tests.ts | 3 +++ types/d3-cloud/index.d.ts | 22 ++++++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/types/d3-cloud/d3-cloud-tests.ts b/types/d3-cloud/d3-cloud-tests.ts index e3bffed4cb..19a140959f 100644 --- a/types/d3-cloud/d3-cloud-tests.ts +++ b/types/d3-cloud/d3-cloud-tests.ts @@ -27,8 +27,11 @@ d3.layout.cloud().size([300, 300]) .font("Impact") .fontSize(function(d:ICompTextSize) { return d.size; }) .on("end", draw) + .random() + .canvas() .start(); + function draw(words:ICompTextSize[]) { d3.select("body").append("svg") .attr("width", 300) diff --git a/types/d3-cloud/index.d.ts b/types/d3-cloud/index.d.ts index fdf2dbc719..b0a3b8a78c 100644 --- a/types/d3-cloud/index.d.ts +++ b/types/d3-cloud/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for d3JS cloud layout plugin by Jason Davies v1.2.2 +// Type definitions for d3JS cloud layout plugin by Jason Davies v1.2.5 // Project: https://github.com/jasondavies/d3-cloud -// Definitions by: hans windhoff +// Definitions by: hans windhoff , locknono // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped import * as d3 from 'd3'; @@ -71,6 +71,24 @@ declare module 'd3' { padding(padding: number): Cloud; padding(padding: (datum: T, index: number) => number): Cloud; + /** + * If specified, sets the internal random number generator,used for selecting the initial position of each word, + * and the clockwise/counterclockwise direction of the spiral for each word. + * + * @param randomFunction should return a number in the range [0, 1).The default is Math.random. + */ + random(): Cloud; + random(randomFunction: () => number): Cloud; + + /** + * If specified, sets the canvas generator function, which is used internally to draw text. + * When using Node.js, you will almost definitely override the default, e.g. using the canvas module. + * @param canvasGenerator should return a HTMLCanvasElement.The default is: ()=>{document.createElement("canvas");} + * + */ + canvas():Cloud; + canvas(canvasGenerator: () => HTMLCanvasElement): Cloud; + on(type: "word", listener: (word: T) => void): Cloud; on(type: "end", listener: (tags: T[], bounds: { x: number; y: number }[]) => void): Cloud; on(type: string, listener: (...args: any[]) => void): Cloud; From d6bdcea216db4fb7c546bb72e51cee1b1753ae92 Mon Sep 17 00:00:00 2001 From: "Adam A. Zerella" Date: Tue, 5 Mar 2019 17:15:20 +1100 Subject: [PATCH 365/924] Added type defs for gl-vec2 --- types/gl-vec2/add.d.ts | 6 ++ types/gl-vec2/clone.d.ts | 6 ++ types/gl-vec2/copy.d.ts | 6 ++ types/gl-vec2/create.d.ts | 6 ++ types/gl-vec2/cross.d.ts | 6 ++ types/gl-vec2/dist.d.ts | 6 ++ types/gl-vec2/div.d.ts | 6 ++ types/gl-vec2/dot.d.ts | 6 ++ types/gl-vec2/equals.d.ts | 6 ++ types/gl-vec2/exactEquals.d.ts | 6 ++ types/gl-vec2/floor.d.ts | 6 ++ types/gl-vec2/forEach.d.ts | 6 ++ types/gl-vec2/fromValues.d.ts | 6 ++ types/gl-vec2/gl-vec2-tests.ts | 134 ++++++++++++++++++++++++++++++ types/gl-vec2/index.d.ts | 75 +++++++++++++++++ types/gl-vec2/inverse.d.ts | 6 ++ types/gl-vec2/len.d.ts | 6 ++ types/gl-vec2/lerp.d.ts | 6 ++ types/gl-vec2/limit.d.ts | 6 ++ types/gl-vec2/max.d.ts | 6 ++ types/gl-vec2/min.d.ts | 6 ++ types/gl-vec2/mul.d.ts | 6 ++ types/gl-vec2/negate.d.ts | 6 ++ types/gl-vec2/normalize.d.ts | 6 ++ types/gl-vec2/random.d.ts | 6 ++ types/gl-vec2/scale.d.ts | 6 ++ types/gl-vec2/scaleAndAdd.d.ts | 6 ++ types/gl-vec2/set.d.ts | 6 ++ types/gl-vec2/sqrDist.d.ts | 6 ++ types/gl-vec2/sqrLen.d.ts | 6 ++ types/gl-vec2/sub.d.ts | 6 ++ types/gl-vec2/transformMat2.d.ts | 6 ++ types/gl-vec2/transformMat2d.d.ts | 6 ++ types/gl-vec2/transformMat3.d.ts | 6 ++ types/gl-vec2/transformMat4.d.ts | 6 ++ types/gl-vec2/tsconfig.json | 58 +++++++++++++ types/gl-vec2/tslint.json | 3 + 37 files changed, 468 insertions(+) create mode 100644 types/gl-vec2/add.d.ts create mode 100644 types/gl-vec2/clone.d.ts create mode 100644 types/gl-vec2/copy.d.ts create mode 100644 types/gl-vec2/create.d.ts create mode 100644 types/gl-vec2/cross.d.ts create mode 100644 types/gl-vec2/dist.d.ts create mode 100644 types/gl-vec2/div.d.ts create mode 100644 types/gl-vec2/dot.d.ts create mode 100644 types/gl-vec2/equals.d.ts create mode 100644 types/gl-vec2/exactEquals.d.ts create mode 100644 types/gl-vec2/floor.d.ts create mode 100644 types/gl-vec2/forEach.d.ts create mode 100644 types/gl-vec2/fromValues.d.ts create mode 100644 types/gl-vec2/gl-vec2-tests.ts create mode 100644 types/gl-vec2/index.d.ts create mode 100644 types/gl-vec2/inverse.d.ts create mode 100644 types/gl-vec2/len.d.ts create mode 100644 types/gl-vec2/lerp.d.ts create mode 100644 types/gl-vec2/limit.d.ts create mode 100644 types/gl-vec2/max.d.ts create mode 100644 types/gl-vec2/min.d.ts create mode 100644 types/gl-vec2/mul.d.ts create mode 100644 types/gl-vec2/negate.d.ts create mode 100644 types/gl-vec2/normalize.d.ts create mode 100644 types/gl-vec2/random.d.ts create mode 100644 types/gl-vec2/scale.d.ts create mode 100644 types/gl-vec2/scaleAndAdd.d.ts create mode 100644 types/gl-vec2/set.d.ts create mode 100644 types/gl-vec2/sqrDist.d.ts create mode 100644 types/gl-vec2/sqrLen.d.ts create mode 100644 types/gl-vec2/sub.d.ts create mode 100644 types/gl-vec2/transformMat2.d.ts create mode 100644 types/gl-vec2/transformMat2d.d.ts create mode 100644 types/gl-vec2/transformMat3.d.ts create mode 100644 types/gl-vec2/transformMat4.d.ts create mode 100644 types/gl-vec2/tsconfig.json create mode 100644 types/gl-vec2/tslint.json diff --git a/types/gl-vec2/add.d.ts b/types/gl-vec2/add.d.ts new file mode 100644 index 0000000000..f19025387f --- /dev/null +++ b/types/gl-vec2/add.d.ts @@ -0,0 +1,6 @@ +/** + * Adds two vec2's + */ +declare function add(out: number[], a: number[], b: number[]): number[]; + +export = add; diff --git a/types/gl-vec2/clone.d.ts b/types/gl-vec2/clone.d.ts new file mode 100644 index 0000000000..53f4fd9aea --- /dev/null +++ b/types/gl-vec2/clone.d.ts @@ -0,0 +1,6 @@ +/** + * Creates a new vec2 initialized with values from an existing vector + */ +declare function clone(a: number[]): number[]; + +export = clone; diff --git a/types/gl-vec2/copy.d.ts b/types/gl-vec2/copy.d.ts new file mode 100644 index 0000000000..8236100308 --- /dev/null +++ b/types/gl-vec2/copy.d.ts @@ -0,0 +1,6 @@ +/** + * Copy the values from one vec2 to another. + */ +declare function copy(out: number[], a: number[]): number[]; + +export = copy; diff --git a/types/gl-vec2/create.d.ts b/types/gl-vec2/create.d.ts new file mode 100644 index 0000000000..26b76eee80 --- /dev/null +++ b/types/gl-vec2/create.d.ts @@ -0,0 +1,6 @@ +/** + * Creates a new, empty vec2. + */ +declare function create(): number[]; + +export = create; diff --git a/types/gl-vec2/cross.d.ts b/types/gl-vec2/cross.d.ts new file mode 100644 index 0000000000..6ce6cab5f4 --- /dev/null +++ b/types/gl-vec2/cross.d.ts @@ -0,0 +1,6 @@ +/** + * Computes the cross product of two vec2's Note that the cross product must by definition produce a 3D vector. + */ +declare function cross(out: number[], a: number[], b: number[]): number[]; + +export = cross; diff --git a/types/gl-vec2/dist.d.ts b/types/gl-vec2/dist.d.ts new file mode 100644 index 0000000000..d83a49e3fb --- /dev/null +++ b/types/gl-vec2/dist.d.ts @@ -0,0 +1,6 @@ +/** + * Calculates the euclidian distance between two vec2's. Aliased as dist. + */ +declare function dist(a: number[], b: number[]): number; + +export = dist; diff --git a/types/gl-vec2/div.d.ts b/types/gl-vec2/div.d.ts new file mode 100644 index 0000000000..7999d6f3e9 --- /dev/null +++ b/types/gl-vec2/div.d.ts @@ -0,0 +1,6 @@ +/** + * Divides two vec2's. Aliased as div. + */ +declare function div(out: number[], a: number[], b: number[]): number[]; + +export = div; diff --git a/types/gl-vec2/dot.d.ts b/types/gl-vec2/dot.d.ts new file mode 100644 index 0000000000..60a7c484dc --- /dev/null +++ b/types/gl-vec2/dot.d.ts @@ -0,0 +1,6 @@ +/** + * Calculates the dot product of two vec2's. + */ +declare function dot(a: number[], b: number[]): number; + +export = dot; diff --git a/types/gl-vec2/equals.d.ts b/types/gl-vec2/equals.d.ts new file mode 100644 index 0000000000..3892372e7e --- /dev/null +++ b/types/gl-vec2/equals.d.ts @@ -0,0 +1,6 @@ +/** + * Returns whether or not the vectors have approximately the same elements in the same position. + */ +declare function equals(a: number[], b: number[]): boolean; + +export = equals; diff --git a/types/gl-vec2/exactEquals.d.ts b/types/gl-vec2/exactEquals.d.ts new file mode 100644 index 0000000000..ce8772b5fc --- /dev/null +++ b/types/gl-vec2/exactEquals.d.ts @@ -0,0 +1,6 @@ +/** + * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===). + */ +declare function exactEquals(a: number[], b: number[]): boolean; + +export = exactEquals; diff --git a/types/gl-vec2/floor.d.ts b/types/gl-vec2/floor.d.ts new file mode 100644 index 0000000000..7909d20a23 --- /dev/null +++ b/types/gl-vec2/floor.d.ts @@ -0,0 +1,6 @@ +/** + * Math.floor the components of a vec2. + */ +declare function floor(out: number[], a: number[]): number[]; + +export = floor; diff --git a/types/gl-vec2/forEach.d.ts b/types/gl-vec2/forEach.d.ts new file mode 100644 index 0000000000..7da060f549 --- /dev/null +++ b/types/gl-vec2/forEach.d.ts @@ -0,0 +1,6 @@ +/** + * Perform some operation over an array of vec2s. + */ +declare function forEach(a: number[], stride: number, offset: number, count: number, fn: (a: number[], b: number[], arg: object) => number[], arg: object): number[]; + +export = forEach; diff --git a/types/gl-vec2/fromValues.d.ts b/types/gl-vec2/fromValues.d.ts new file mode 100644 index 0000000000..7a3f7928e9 --- /dev/null +++ b/types/gl-vec2/fromValues.d.ts @@ -0,0 +1,6 @@ +/** + * Creates a new vec2 initialized with the given values. + */ +declare function fromValues(x: number, y: number): number[]; + +export = fromValues; diff --git a/types/gl-vec2/gl-vec2-tests.ts b/types/gl-vec2/gl-vec2-tests.ts new file mode 100644 index 0000000000..6db61462ac --- /dev/null +++ b/types/gl-vec2/gl-vec2-tests.ts @@ -0,0 +1,134 @@ +import GlVec2 = require("gl-vec2"); + +import GlVec2Add = require("gl-vec2/add"); +import GlVec2Clone = require("gl-vec2/clone"); +import GlVec2Copy = require("gl-vec2/copy"); +import GlVec2Create = require("gl-vec2/create"); +import GlVec2Cross = require("gl-vec2/cross"); +import GlVec2Dist = require("gl-vec2/dist"); +import GlVec2Div = require("gl-vec2/div"); +import GlVec2Dot = require("gl-vec2/dot"); +import GlVec2Equals = require("gl-vec2/equals"); +import GlVec2exactEquals = require("gl-vec2/exactEquals"); +import GlVec2forEach = require("gl-vec2/forEach"); +import GlVec2fromValues = require("gl-vec2/fromValues"); +import GlVec2Floor = require("gl-vec2/floor"); +import GlVec2Inverse = require("gl-vec2/inverse"); +import GlVec2Len = require("gl-vec2/len"); +import GlVec2Lerp = require("gl-vec2/lerp"); +import GlVec2Limit = require("gl-vec2/limit"); +import GlVec2Max = require("gl-vec2/max"); +import GlVec2Min = require("gl-vec2/min"); +import GlVec2Mul = require("gl-vec2/mul"); +import GlVec2Negate = require("gl-vec2/negate"); +import GlVec2Normalize = require("gl-vec2/normalize"); +import GlVec2Random = require("gl-vec2/random"); +import GlVec2Scale = require("gl-vec2/scale"); +import GlVec2ScaleAndAdd = require("gl-vec2/scaleAndAdd"); +import GlVec2Set = require("gl-vec2/set"); +import GlVec2SqrDist = require("gl-vec2/sqrDist"); +import GlVec2SqrLen = require("gl-vec2/sqrLen"); +import GlVec2Sub = require("gl-vec2/sub"); +import GlVec2TransformMat2 = require("gl-vec2/transformMat2"); +import GlVec2TransformMat2d = require("gl-vec2/transformMat2d"); +import GlVec2TransformMat3 = require("gl-vec2/transformMat3"); +import GlVec2TransformMat4 = require("gl-vec2/transformMat4"); + +GlVec2.add([1, 2, 3], [1, 2, 3], [1, 2, 3]); +GlVec2Add([1, 2, 3], [1, 2, 3], [1, 2, 3]); + +GlVec2.clone([1, 2, 3]); +GlVec2Clone([1, 2, 3]); + +GlVec2.copy([1, 2, 3], [1, 2, 3]); +GlVec2Copy([1, 2, 3], [1, 2, 3]); + +GlVec2.create(); +GlVec2Create(); + +GlVec2.cross([1, 2], [1, 2], [1, 2]); +GlVec2Cross([1, 2], [1, 2], [1, 2]); + +GlVec2.dist([1, 2, 3], [1, 2, 3]); +GlVec2Dist([1, 2, 3], [1, 2, 3]); + +GlVec2.div([1, 2, 3], [1, 2, 3], [1, 2, 3]); +GlVec2Div([1, 2, 3], [1, 2, 3], [1, 2, 3]); + +GlVec2.dot([1, 2, 3], [1, 2, 3]); +GlVec2Dot([1, 2, 3], [1, 2, 3]); + +GlVec2.forEach([1, 2, 3], 5, 6, 1, () => [3], {}); +GlVec2forEach([1, 2, 3], 5, 6, 1, () => [3], {}); + +GlVec2.fromValues(1, 2); +GlVec2fromValues(1, 2); + +GlVec2.floor([1, 2], [1, 2]); +GlVec2Floor([1, 2], [1, 2]); + +GlVec2.equals([1, 2, 3], [1, 2, 3]); +GlVec2Equals([1, 2, 3], [1, 2, 3]); + +GlVec2.exactEquals([1, 2, 3], [1, 2, 3]); +GlVec2exactEquals([1, 2, 3], [1, 2, 3]); + +GlVec2.inverse([1, 2, 3], [1, 2, 3]); +GlVec2Inverse([1, 2, 3], [1, 2, 3]); + +GlVec2.len([1, 2, 3]); +GlVec2Len([1, 2, 3]); + +GlVec2.lerp([1, 2, 3], [1, 2, 3], [1, 2, 3], 6); +GlVec2Lerp([1, 2, 3], [1, 2, 3], [1, 2, 3], 6); + +GlVec2.limit([1, 2], [1, 2], 5); +GlVec2Limit([1, 2], [1, 2], 5); + +GlVec2.max([1, 2, 3], [1, 2, 3], [1, 2, 3]); +GlVec2Max([1, 2, 3], [1, 2, 3], [1, 2, 3]); + +GlVec2.min([1, 2, 3], [1, 2, 3], [1, 2, 3]); +GlVec2Min([1, 2, 3], [1, 2, 3], [1, 2, 3]); + +GlVec2.mul([1, 2, 3], [1, 2, 3], [1, 2, 3]); +GlVec2Mul([1, 2, 3], [1, 2, 3], [1, 2, 3]); + +GlVec2.negate([1, 2, 3], [1, 2, 3]); +GlVec2Negate([1, 2, 3], [1, 2, 3]); + +GlVec2.normalize([1, 2, 3], [1, 2, 3]); +GlVec2Normalize([1, 2, 3], [1, 2, 3]); + +GlVec2.random([1, 2, 3], 6); +GlVec2Random([1, 2, 3], 6); + +GlVec2.scale([1, 2, 3], [1, 2, 3], 6); +GlVec2Scale([1, 2, 3], [1, 2, 3], 6); + +GlVec2.scaleAndAdd([1, 2, 3], [1, 2, 3], [1, 2, 3], 6); +GlVec2ScaleAndAdd([1, 2, 3], [1, 2, 3], [1, 2, 3], 6); + +GlVec2.set([1, 2], 1, 2); +GlVec2Set([1, 2], 1, 2); + +GlVec2.sqrDist([1, 2, 3], [1, 2, 3]); +GlVec2SqrDist([1, 2, 3], [1, 2, 3]); + +GlVec2.sqrLen([1, 2, 3]); +GlVec2SqrLen([1, 2, 3]); + +GlVec2.sub([1, 2, 3], [1, 2, 3], [1, 2, 3]); +GlVec2Sub([1, 2, 3], [1, 2, 3], [1, 2, 3]); + +GlVec2.transformMat2([1, 2, 3], [1, 2, 3], [1, 2, 3]); +GlVec2TransformMat2([1, 2, 3], [1, 2, 3], [1, 2, 3]); + +GlVec2.transformMat2([1, 2, 3], [1, 2, 3], [1, 2, 3]); +GlVec2TransformMat2d([1, 2, 3], [1, 2, 3], [1, 2, 3]); + +GlVec2.transformMat3([1, 2, 3], [1, 2, 3], [1, 2, 3]); +GlVec2TransformMat3([1, 2, 3], [1, 2, 3], [1, 2, 3]); + +GlVec2.transformMat4([1, 2, 3], [1, 2, 3], [1, 2, 3]); +GlVec2TransformMat4([1, 2, 3], [1, 2, 3], [1, 2, 3]); diff --git a/types/gl-vec2/index.d.ts b/types/gl-vec2/index.d.ts new file mode 100644 index 0000000000..65eb6ae91a --- /dev/null +++ b/types/gl-vec2/index.d.ts @@ -0,0 +1,75 @@ +// Type definitions for gl-vec2 1.3 +// Project: https://github.com/stackgl/gl-vec2 +// Definitions by: Adam Zerella +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.3 + +import add = require('./add'); +import clone = require('./clone'); +import copy = require('./copy'); +import create = require('./create'); +import cross = require('./cross'); +import dist = require('./dist'); +import div = require('./div'); +import dot = require('./dot'); +import equals = require('./equals'); +import exactEquals = require('./exactEquals'); +import floor = require('./floor'); +import forEach = require('./forEach'); +import fromValues = require('./fromValues'); +import inverse = require('./inverse'); +import len = require('./len'); +import lerp = require('./lerp'); +import limit = require('./limit'); +import max = require('./max'); +import min = require('./min'); +import mul = require('./mul'); +import negate = require('./negate'); +import normalize = require('./normalize'); +import random = require('./random'); +import scale = require('./scale'); +import scaleAndAdd = require('./scaleAndAdd'); +import set = require('./set'); +import sqrDist = require('./sqrDist'); +import sqrLen = require('./sqrLen'); +import sub = require('./sub'); +import transformMat2 = require('./transformMat2'); +import transformMat2d = require('./transformMat2d'); +import transformMat3 = require('./transformMat3'); +import transformMat4 = require('./transformMat4'); + +export { + add, + clone, + copy, + create, + cross, + dist, + div, + dot, + equals, + exactEquals, + floor, + forEach, + fromValues, + inverse, + len, + lerp, + limit, + max, + min, + mul, + negate, + normalize, + random, + scale, + scaleAndAdd, + set, + sqrDist, + sqrLen, + sub, + transformMat2, + transformMat2d, + transformMat3, + transformMat4 +}; diff --git a/types/gl-vec2/inverse.d.ts b/types/gl-vec2/inverse.d.ts new file mode 100644 index 0000000000..af3840b2a0 --- /dev/null +++ b/types/gl-vec2/inverse.d.ts @@ -0,0 +1,6 @@ +/** + * Returns the inverse of the components of a vec2. + */ +declare function inverse(out: number[], a: number[]): number[]; + +export = inverse; diff --git a/types/gl-vec2/len.d.ts b/types/gl-vec2/len.d.ts new file mode 100644 index 0000000000..cfb66abfae --- /dev/null +++ b/types/gl-vec2/len.d.ts @@ -0,0 +1,6 @@ +/** + * Calculates the length of a vec2. Aliased as len. + */ +declare function len(a: number[]): number; + +export = len; diff --git a/types/gl-vec2/lerp.d.ts b/types/gl-vec2/lerp.d.ts new file mode 100644 index 0000000000..d0c4ed4cda --- /dev/null +++ b/types/gl-vec2/lerp.d.ts @@ -0,0 +1,6 @@ +/** + * Performs a linear interpolation between two vec2's + */ +declare function lerp(out: number[], a: number[], b: number[], t: number): number[]; + +export = lerp; diff --git a/types/gl-vec2/limit.d.ts b/types/gl-vec2/limit.d.ts new file mode 100644 index 0000000000..abf7af287a --- /dev/null +++ b/types/gl-vec2/limit.d.ts @@ -0,0 +1,6 @@ +/** + * Limit the magnitude of this vector to the value used for the max parameter. + */ +declare function limit(out: number[], a: number[], max: number): number[]; + +export = limit; diff --git a/types/gl-vec2/max.d.ts b/types/gl-vec2/max.d.ts new file mode 100644 index 0000000000..38a64a2c34 --- /dev/null +++ b/types/gl-vec2/max.d.ts @@ -0,0 +1,6 @@ +/** + * Returns the maximum of two vec2's. + */ +declare function max(out: number[], a: number[], b: number[]): number[]; + +export = max; diff --git a/types/gl-vec2/min.d.ts b/types/gl-vec2/min.d.ts new file mode 100644 index 0000000000..19727a0e4e --- /dev/null +++ b/types/gl-vec2/min.d.ts @@ -0,0 +1,6 @@ +/** + * Returns the minimum of two vec2's. + */ +declare function min(out: number[], a: number[], b: number[]): number[]; + +export = min; diff --git a/types/gl-vec2/mul.d.ts b/types/gl-vec2/mul.d.ts new file mode 100644 index 0000000000..0322ca0e9d --- /dev/null +++ b/types/gl-vec2/mul.d.ts @@ -0,0 +1,6 @@ +/** + * Multiplies two vec2's. Aliased as mul. + */ +declare function mul(out: number[], a: number[], b: number[]): number[]; + +export = mul; diff --git a/types/gl-vec2/negate.d.ts b/types/gl-vec2/negate.d.ts new file mode 100644 index 0000000000..6edb8f50f6 --- /dev/null +++ b/types/gl-vec2/negate.d.ts @@ -0,0 +1,6 @@ +/** + * Negates the components of a vec2. + */ +declare function negate(out: number[], a: number[]): number[]; + +export = negate; diff --git a/types/gl-vec2/normalize.d.ts b/types/gl-vec2/normalize.d.ts new file mode 100644 index 0000000000..139a1c708e --- /dev/null +++ b/types/gl-vec2/normalize.d.ts @@ -0,0 +1,6 @@ +/** + * Normalize a number + */ +declare function normalize(out: number[], a: number[]): number[]; + +export = normalize; diff --git a/types/gl-vec2/random.d.ts b/types/gl-vec2/random.d.ts new file mode 100644 index 0000000000..0fa076543a --- /dev/null +++ b/types/gl-vec2/random.d.ts @@ -0,0 +1,6 @@ +/** + * Generates a random vector with the given scale. + */ +declare function random(out: number[], scale: number): number[]; + +export = random; diff --git a/types/gl-vec2/scale.d.ts b/types/gl-vec2/scale.d.ts new file mode 100644 index 0000000000..1348ff78c0 --- /dev/null +++ b/types/gl-vec2/scale.d.ts @@ -0,0 +1,6 @@ +/** + * Scales a vec2 by a scalar number. + */ +declare function scale(out: number[], a: number[], b: number): number[]; + +export = scale; diff --git a/types/gl-vec2/scaleAndAdd.d.ts b/types/gl-vec2/scaleAndAdd.d.ts new file mode 100644 index 0000000000..2a3e9b8a2d --- /dev/null +++ b/types/gl-vec2/scaleAndAdd.d.ts @@ -0,0 +1,6 @@ +/** + * Adds two vec2's after scaling the second operand by a scalar value. + */ +declare function scaleAndAdd(out: number[], a: number[], b: number[], scale: number): number[]; + +export = scaleAndAdd; diff --git a/types/gl-vec2/set.d.ts b/types/gl-vec2/set.d.ts new file mode 100644 index 0000000000..33ed71f0f3 --- /dev/null +++ b/types/gl-vec2/set.d.ts @@ -0,0 +1,6 @@ +/** + * Set the components of a vec2 to the given values. + */ +declare function set(out: number[], x: number, y: number): number[]; + +export = set; diff --git a/types/gl-vec2/sqrDist.d.ts b/types/gl-vec2/sqrDist.d.ts new file mode 100644 index 0000000000..d510d253e0 --- /dev/null +++ b/types/gl-vec2/sqrDist.d.ts @@ -0,0 +1,6 @@ +/** + * Calculates the squared euclidian distance between two vec2's. Aliased as sqrDist. + */ +declare function sqrDist(a: number[], b: number[]): number[]; + +export = sqrDist; diff --git a/types/gl-vec2/sqrLen.d.ts b/types/gl-vec2/sqrLen.d.ts new file mode 100644 index 0000000000..3237540072 --- /dev/null +++ b/types/gl-vec2/sqrLen.d.ts @@ -0,0 +1,6 @@ +/** + * Calculates the squared length of a vec2. Aliased as sqrLen. + */ +declare function sqrLen(a: number[]): number[]; + +export = sqrLen; diff --git a/types/gl-vec2/sub.d.ts b/types/gl-vec2/sub.d.ts new file mode 100644 index 0000000000..7b5976404d --- /dev/null +++ b/types/gl-vec2/sub.d.ts @@ -0,0 +1,6 @@ +/** + * Subtracts vector b from vector a. Aliased as sub. + */ +declare function sub(out: number[], a: number[], b: number[]): number[]; + +export = sub; diff --git a/types/gl-vec2/transformMat2.d.ts b/types/gl-vec2/transformMat2.d.ts new file mode 100644 index 0000000000..9ee67f7629 --- /dev/null +++ b/types/gl-vec2/transformMat2.d.ts @@ -0,0 +1,6 @@ +/** + * Transforms the vec2 with a mat2. + */ +declare function transformMat2(out: number[], a: number[], m: number[]): number[]; + +export = transformMat2; diff --git a/types/gl-vec2/transformMat2d.d.ts b/types/gl-vec2/transformMat2d.d.ts new file mode 100644 index 0000000000..978078f1da --- /dev/null +++ b/types/gl-vec2/transformMat2d.d.ts @@ -0,0 +1,6 @@ +/** + * Transforms the vec with a mat2d. + */ +declare function transformMat2d(out: number[], a: number[], m: number[]): number[]; + +export = transformMat2d; diff --git a/types/gl-vec2/transformMat3.d.ts b/types/gl-vec2/transformMat3.d.ts new file mode 100644 index 0000000000..682ded3966 --- /dev/null +++ b/types/gl-vec2/transformMat3.d.ts @@ -0,0 +1,6 @@ +/** + * Transforms the vec2 with a mat3 3rd vector component is implicitly '1' + */ +declare function transformMat3(out: number[], a: number[], m: number[]): number[]; + +export = transformMat3; diff --git a/types/gl-vec2/transformMat4.d.ts b/types/gl-vec2/transformMat4.d.ts new file mode 100644 index 0000000000..f7f96e6d41 --- /dev/null +++ b/types/gl-vec2/transformMat4.d.ts @@ -0,0 +1,6 @@ +/** + * Transforms the vec2 with a mat4 3rd vector component is implicitly '0' 4th vector component is implicitly '1' + */ +declare function transformMat4(out: number[], a: number[], m: number[]): number[]; + +export = transformMat4; diff --git a/types/gl-vec2/tsconfig.json b/types/gl-vec2/tsconfig.json new file mode 100644 index 0000000000..c1f24a1dad --- /dev/null +++ b/types/gl-vec2/tsconfig.json @@ -0,0 +1,58 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [ + + ], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "add.d.ts", + "clone.d.ts", + "copy.d.ts", + "create.d.ts", + "cross.d.ts", + "dist.d.ts", + "div.d.ts", + "dot.d.ts", + "equals.d.ts", + "exactEquals.d.ts", + "forEach.d.ts", + "fromValues.d.ts", + "floor.d.ts", + "inverse.d.ts", + "len.d.ts", + "lerp.d.ts", + "limit.d.ts", + "max.d.ts", + "min.d.ts", + "mul.d.ts", + "negate.d.ts", + "normalize.d.ts", + "random.d.ts", + "scale.d.ts", + "scaleAndAdd.d.ts", + "set.d.ts", + "sqrDist.d.ts", + "sqrLen.d.ts", + "sub.d.ts", + "transformMat2.d.ts", + "transformMat2d.d.ts", + "transformMat3.d.ts", + "transformMat4.d.ts", + "gl-vec2-tests.ts" + ] +} diff --git a/types/gl-vec2/tslint.json b/types/gl-vec2/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/gl-vec2/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file From af5b21291deebf95400956f1c9451dc5c40ba800 Mon Sep 17 00:00:00 2001 From: Florian Keller Date: Thu, 28 Feb 2019 16:55:33 +0100 Subject: [PATCH 366/924] Add types for open-graph --- types/open-graph/index.d.ts | 74 ++++++++++++++++++++++++++++ types/open-graph/open-graph-tests.ts | 18 +++++++ types/open-graph/tsconfig.json | 23 +++++++++ types/open-graph/tslint.json | 1 + 4 files changed, 116 insertions(+) create mode 100644 types/open-graph/index.d.ts create mode 100644 types/open-graph/open-graph-tests.ts create mode 100644 types/open-graph/tsconfig.json create mode 100644 types/open-graph/tslint.json diff --git a/types/open-graph/index.d.ts b/types/open-graph/index.d.ts new file mode 100644 index 0000000000..14a3fe3ce6 --- /dev/null +++ b/types/open-graph/index.d.ts @@ -0,0 +1,74 @@ +// Type definitions for open-graph 0.2 +// Project: https://github.com/samholmes/node-open-graph +// Definitions by: Florian Keller +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/// + +declare namespace og { + interface Metadata { + [key: string]: string | string[] | undefined; + /** An alternate url to use if the webpage requires HTTPS. */ + secure_url?: string | string[]; + /** A MIME type for this image. */ + type?: string | string[]; + } + + interface ImageVideoMetadata extends Metadata { + /** A description of what is in the image (not a caption). If the page specifies an `og:image` it should specify `og:image:alt`. */ + alt?: string | string[]; + /** The number of pixels high. */ + height?: string | string[]; + /** The */ + url?: string | string[]; + /** The number of pixels wide. */ + width?: string | string[]; + } + + interface Data { + [key: string]: string | string[] | ImageVideoMetadata | Metadata | undefined; + /** A URL to an audio file to accompany this object. */ + audio?: string | string[] | Metadata; + /** A one to two sentence description of your object. */ + description?: string | string[]; + /** + * The word that appears before this object's title in a sentence. An enum of (a, an, the, "", auto). + * If auto is chosen, the consumer of your data should chose between "a" or "an". Default is "" (blank). + */ + determiner?: string | string[]; + /** An image URL which should represent your object within the graph. */ + image?: string | string[] | ImageVideoMetadata; + /** The locale these tags are marked up in. Of the format `language_TERRITORY`. Default is `en_US`. */ + locale?: + | string | string[] + | { + /** An array of other locales this page is available in. */ + alternate?: string | string[]; + }; + /** If your object is part of a larger web site, the name which should be displayed for the overall site. e.g., "IMDb". */ + site_name?: string | string[]; + /** The title of your object as it should appear within the graph, e.g., "The Rock". */ + title: string | string[]; + /** The type of your object, e.g., "video.movie". Depending on the type you specify, other properties may also be required. */ + type?: string | string[]; + /** The canonical URL of your object that will be used as its permanent ID in the graph, e.g., "http://www.imdb.com/title/tt0117500/". */ + url?: string | string[]; + /** A URL to a video file that complements this object. */ + video?: string | string[] | ImageVideoMetadata; + } + + type DataCallback = (err: Error | null, data: Data | undefined) => void; + type RequestCallback = (err: Error | null, data: string | undefined) => void; + + interface Options { + strict?: boolean; + } + + function parse(websiteContent: string, options?: Options): Data; + function getHTML(url: string | Cheerio, callback: RequestCallback): void; +} + +declare function og(url: string, callback: og.DataCallback, options?: og.Options): void; + +export = og; diff --git a/types/open-graph/open-graph-tests.ts b/types/open-graph/open-graph-tests.ts new file mode 100644 index 0000000000..4e3db10438 --- /dev/null +++ b/types/open-graph/open-graph-tests.ts @@ -0,0 +1,18 @@ +import og = require('open-graph'); + +const url = 'http://github.com/samholmes/node-open-graph/raw/master/test.html'; + +og(url, (err, meta) => { + if (meta) { + meta.custom; + meta.description; // $ExpectType string | string[] | undefined + } +}); + +og.parse('content', { + strict: true, +}); + +og.getHTML('http://github.com/samholmes/node-open-graph/raw/master/test.html', (err, data) => { + data; // $ExpectType string | undefined +}); diff --git a/types/open-graph/tsconfig.json b/types/open-graph/tsconfig.json new file mode 100644 index 0000000000..72fa10a12d --- /dev/null +++ b/types/open-graph/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "open-graph-tests.ts" + ] +} diff --git a/types/open-graph/tslint.json b/types/open-graph/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/open-graph/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From b2e95f16384b941696ef8b8c36b5c208786a0d72 Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Tue, 5 Mar 2019 10:59:46 +0100 Subject: [PATCH 367/924] Update Select.d.ts --- types/react-select/lib/Select.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/react-select/lib/Select.d.ts b/types/react-select/lib/Select.d.ts index 11853f6be9..fd85909702 100644 --- a/types/react-select/lib/Select.d.ts +++ b/types/react-select/lib/Select.d.ts @@ -50,7 +50,9 @@ export interface FormatOptionLabelMeta { selectValue: ValueType; } -export interface Props { +type SelectComponentsProps = { [key in string]: any }; + +export interface Props extends SelectComponentsProps { /* Aria label (for assistive tech) */ 'aria-label'?: string; /* HTML ID of an element that should be used as the label (for assistive tech) */ From 15e163aef6e358fcf8d522cc5419ab686e6db8ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?v=C3=A9gtelens=C3=A9g?= Date: Tue, 5 Mar 2019 13:17:02 +0200 Subject: [PATCH 368/924] Added missing prop for the multi select component --- types/react-widgets/lib/Multiselect.d.ts | 61 ++++-- types/react-widgets/react-widgets-tests.tsx | 196 ++++++++++---------- 2 files changed, 139 insertions(+), 118 deletions(-) diff --git a/types/react-widgets/lib/Multiselect.d.ts b/types/react-widgets/lib/Multiselect.d.ts index 56a2753d3e..afafdfcb12 100644 --- a/types/react-widgets/lib/Multiselect.d.ts +++ b/types/react-widgets/lib/Multiselect.d.ts @@ -1,12 +1,14 @@ -import * as React from 'react'; -import { ReactWidgetsCommonDropdownProps, AutoFocus } from './CommonProps'; +import * as React from "react"; +import { ReactWidgetsCommonDropdownProps, AutoFocus } from "./CommonProps"; -interface MultiselectProps extends ReactWidgetsCommonDropdownProps, AutoFocus { +interface MultiselectProps + extends ReactWidgetsCommonDropdownProps, + AutoFocus { /** * Enables the list option creation UI. onFilter will only the UI when actively filtering for a list item. * @default 'onFilter' */ - allowCreate?: boolean | 'onFilter'; + allowCreate?: boolean | "onFilter"; /** * The current values of the Multiselect. The value should can null, or an array of * valueField values, or an array of objects (such as a few items in the data array) @@ -20,20 +22,26 @@ interface MultiselectProps extends ReactWidgetsCommonDropdownProps void; + onChange?: ( + dataItems: any[], + metadata: { + dataItem: any; + action: "insert" | "remove"; + originalEvent?: any; + lastValue?: any[]; + searchTerm?: string; + } + ) => void; /** * This handler fires when an item has been selected from the list. It fires before the * onChange handler, and fires regardless of whether the value has actually changed */ - onSelect?: (value: any, metadata: { - originalEvent: any; - }) => void; + onSelect?: ( + value: any, + metadata: { + originalEvent: any; + } + ) => void; /** * This handler fires when the user chooses to create a new tag, not in the data list. It is * up to the widget parent to implement creation logic, a common implementation is shown @@ -100,11 +108,14 @@ interface MultiselectProps extends ReactWidgetsCommonDropdownProps void; + onSearch?: ( + searchTerm: string, + metadata: { + action: "clear" | "input"; + lastSearchTerm?: string; + originalEvent?: any; + } + ) => void; /** * Whether or not the Multiselect is open. When unset (undefined) the Multiselect will * handle the opening and closing internally. The defaultOpen prop can be used to set an @@ -124,7 +135,12 @@ interface MultiselectProps extends ReactWidgetsCommonDropdownProps boolean); + filter?: + | false + | "startsWith" + | "endsWith" + | "contains" + | ((dataItem: any, searchTerm: string) => boolean); /** * Use in conjunction with the filter prop. Filter the list without regard for case. This * only applies to non function values for filter. @@ -167,6 +183,11 @@ interface MultiselectProps extends ReactWidgetsCommonDropdownProps{props.value}; @@ -18,105 +26,97 @@ function listComponent(props: { value: string }) { class Test extends React.Component> { render() { return ( -
- - - - - - - +
+ + + + + + + +
+
+ + + + + + + +
+
+ + + + + +
+
+ + + + + + + +
+
+ + + } + /> + + + + + + + +
+
+ } + /> +
-
- - - - - - - -
-
- - - - - -
-
- - - - - - - -
-
- - - - } - /> - - - - - - -
-
- } /> -
-
); } } From 55bfcc3dd9681a8fdb07ee44e900198c39270518 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20Holhjem?= Date: Tue, 5 Mar 2019 12:57:58 +0100 Subject: [PATCH 369/924] More missing props and some corrections From doc: https://github.com/ericgio/react-bootstrap-typeahead/blob/master/docs/Props.md --- types/react-bootstrap-typeahead/index.d.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/types/react-bootstrap-typeahead/index.d.ts b/types/react-bootstrap-typeahead/index.d.ts index 18311bccb5..f916a4c293 100644 --- a/types/react-bootstrap-typeahead/index.d.ts +++ b/types/react-bootstrap-typeahead/index.d.ts @@ -5,6 +5,7 @@ // Paito Anderson // Andreas Richter // Dale Fenton +// HĂ„kon Holhjem // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.9 @@ -126,7 +127,7 @@ export interface TypeaheadProps { but not the list of original options unless handled as such by Typeahead's parent. The newly added item will always be returned as an object even if the other options are simply strings, so be sure your onChange callback can handle this. */ - allowNew?: boolean | ((results: T[], props: TypeaheadProps) => boolean); + allowNew?: boolean | ((results: T[], props: AllTypeaheadOwnAndInjectedProps) => boolean); /* Autofocus the input when the component initially mounts. */ autoFocus?: boolean; @@ -172,6 +173,9 @@ export interface TypeaheadProps { Does not work with allowNew. */ highlightOnlyResult?: boolean; + /* An html id attribute, required for assistive technologies such as screen readers. */ + id?: string | number; + /* Whether the filter should ignore accents and other diacritical marks. */ ignoreDiacritics?: boolean; @@ -198,7 +202,7 @@ export interface TypeaheadProps { so as not to render too many DOM nodes in the case of large data sets. */ maxResults?: number; - /* Id applied to the top-level menu element. Required for accessibility. */ + /* DEPRECATED. Id applied to the top-level menu element. Required for accessibility. */ menuId?: string; /* Number of input characters that must be entered before showing results. */ @@ -253,6 +257,10 @@ export interface TypeaheadProps { /* Placeholder text for the input. */ placeholder?: string; + /* Whether to use fixed positioning for the menu, which is useful when rendering inside a + container with overflow: hidden;. Uses absolute positioning by default. */ + positionFixed?: boolean; + /* Callback for custom menu rendering. */ renderMenu?: (results: Array>, menuProps: any) => React.ReactNode; From ab5ce28a5c986c59398d2d5c4b4295492b604a3a Mon Sep 17 00:00:00 2001 From: Rob Valentine Date: Tue, 5 Mar 2019 14:29:23 +0200 Subject: [PATCH 370/924] Added MouseTransition as per module spec --- types/react-dnd-multi-backend/index.d.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/types/react-dnd-multi-backend/index.d.ts b/types/react-dnd-multi-backend/index.d.ts index 36c161beb0..ea18d98b1a 100644 --- a/types/react-dnd-multi-backend/index.d.ts +++ b/types/react-dnd-multi-backend/index.d.ts @@ -97,7 +97,10 @@ export interface PreviewProps { * This is frequently used with the Touch backend to provide a preview on mobile devices. */ export class Preview extends PureComponent {} - +/** + * Pre-existing/default react-dnd-multi-backend transition available to use. + */ + export const MouseTransition: Transition; /** * Pre-existing/default react-dnd-touch-backend transition available to use. * This transition has the setting for "enableMouseEvents" turned on. From 95ae13766fa48b9cd17ee73b90ad6f9811f91705 Mon Sep 17 00:00:00 2001 From: Rob Valentine Date: Tue, 5 Mar 2019 14:35:13 +0200 Subject: [PATCH 371/924] Contrib --- types/react-dnd-multi-backend/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/react-dnd-multi-backend/index.d.ts b/types/react-dnd-multi-backend/index.d.ts index ea18d98b1a..9797be6e28 100644 --- a/types/react-dnd-multi-backend/index.d.ts +++ b/types/react-dnd-multi-backend/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/LouisBrunner/react-dnd-multi-backend, https://louisbrunner.github.io/dnd-multi-backend/packages/react-dnd-multi-backend // Definitions by: Janeene Beeforth // Adam Haglund +// Rob Valentine // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 From e2969b1b13a910c6e4b1d000feec26b92fbef166 Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Tue, 5 Mar 2019 13:42:13 +0100 Subject: [PATCH 372/924] Update Select.d.ts --- types/react-select/lib/Select.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-select/lib/Select.d.ts b/types/react-select/lib/Select.d.ts index fd85909702..57fef3bb9c 100644 --- a/types/react-select/lib/Select.d.ts +++ b/types/react-select/lib/Select.d.ts @@ -50,7 +50,7 @@ export interface FormatOptionLabelMeta { selectValue: ValueType; } -type SelectComponentsProps = { [key in string]: any }; +export type SelectComponentsProps = { [key in string]: any }; export interface Props extends SelectComponentsProps { /* Aria label (for assistive tech) */ From 11fd8b42509e956ba6b7c4f41a25176723ac3bff Mon Sep 17 00:00:00 2001 From: Marc Knaup Date: Tue, 5 Mar 2019 14:17:00 +0100 Subject: [PATCH 373/924] [facebook-js-sdk] Fixed type of LoginOptions.auth_type --- types/facebook-js-sdk/facebook-js-sdk-tests.ts | 4 ++++ types/facebook-js-sdk/index.d.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/types/facebook-js-sdk/facebook-js-sdk-tests.ts b/types/facebook-js-sdk/facebook-js-sdk-tests.ts index db8b13686e..8bcd07cbed 100644 --- a/types/facebook-js-sdk/facebook-js-sdk-tests.ts +++ b/types/facebook-js-sdk/facebook-js-sdk-tests.ts @@ -48,6 +48,10 @@ FB.logout(function(response: fb.StatusResponse) { console.log(response.authResponse.accessToken); }); +FB.login({ auth_type: 'reauthenticate' }); +FB.login({ auth_type: 'reauthorize' }); +FB.login({ auth_type: 'rerequest' }); + FB.logout(); /** diff --git a/types/facebook-js-sdk/index.d.ts b/types/facebook-js-sdk/index.d.ts index c4f3b78c31..18da6b5ae9 100644 --- a/types/facebook-js-sdk/index.d.ts +++ b/types/facebook-js-sdk/index.d.ts @@ -150,7 +150,7 @@ declare namespace facebook { } interface LoginOptions { - auth_type?: 'rerequest'; + auth_type?: 'reauthenticate' | 'reauthorize' | 'rerequest'; scope?: string; return_scopes?: boolean; enable_profile_selector?: boolean; From ea8883df25191abe36aa8c6bf1fa0e1d3c144cd4 Mon Sep 17 00:00:00 2001 From: Jamie Sykes Date: Tue, 5 Mar 2019 14:08:00 +0000 Subject: [PATCH 374/924] Makes some changes but macros are not valid. --- types/collectionsjs/collectionsjs-tests.ts | 5 ++++- types/collectionsjs/index.d.ts | 15 ++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/types/collectionsjs/collectionsjs-tests.ts b/types/collectionsjs/collectionsjs-tests.ts index 1c3b8a5813..bc71c9e544 100644 --- a/types/collectionsjs/collectionsjs-tests.ts +++ b/types/collectionsjs/collectionsjs-tests.ts @@ -52,7 +52,10 @@ collection.sortBy('name'); // $ExpectType Collection<{ name: string; age: number collection.stringify(); // $ExpectType string collection.sum('age'); // $ExpectType any collection.take(2); // $ExpectType Collection<{ name: string; age: number; }> -collection.macro('addToMembers', (collection, n) => collection.map((collectionItem: any) => collectionItem + n)); // $ExpectType any + +// Collection.macro('addToMembers', (collection, n) => collection.map((collectionItem: any) => collectionItem + n)); +// const collection2 = new Collection([1,2,3,4]).addToMembers(3); + collection.unique(stark => stark.age); // $ExpectType Collection<{ name: string; age: number; }> collection.values(); // $ExpectType Collection<{ name: string; age: number; }> collection.where('age', 14); // $ExpectType Collection<{ name: string; age: number; }> diff --git a/types/collectionsjs/index.d.ts b/types/collectionsjs/index.d.ts index 40c616fcdb..364877050d 100644 --- a/types/collectionsjs/index.d.ts +++ b/types/collectionsjs/index.d.ts @@ -16,7 +16,7 @@ export default class Collection { count(): number; each(callback: (item: T) => void): Collection; filter(callback: (item: T) => boolean): Collection; - find(item: any): number; + find(item: T): number; first(callback?: ((item: T) => boolean)|null): T; flatten(deep?: boolean): Collection; get(index: number): T; @@ -24,23 +24,24 @@ export default class Collection { join(separator?: string): string; keys(): Collection; last(callback?: ((item: T) => boolean)|null): T; - map(callback: (item: T) => any): Collection; + map(callback: (item: T) => R): Collection; pluck(property: string): Collection; push(item: T): Collection; - reduce(callback: (previous: T, current: T) => any, initial: any): any; + reduce(callback: (previous: R, current: T) => R, initial: R): R; reject(callback: (item: T) => boolean): Collection; - remove(item: any): boolean; + remove(item: T): boolean; reverse(): Collection; skip(count: number): Collection; slice(start: number, end?: number): Collection; sort(compare?: () => boolean): Collection; sortBy(property: string, order?: string): Collection; stringify(): string; - sum(property?: string|null): any; + sum(property: T extends object ? keyof T : never): number take(count: number): Collection; - macro(name: string, callback: (...args: any) => any): any; + static macro(name: string, callback: (coll: Collection, ...args: unknown[]) => unknown): void; unique(callback?: string|null|((item: T) => any)): Collection; values(): Collection; - where(callback: ((item: T) => boolean)|string, value?: any): Collection; + where(key: K, value: T[K]): Collection + where(callback: (item: T) => boolean): Collection zip(array: T[]|Collection): Collection; } From 36e980b5fd44b20788c266c3c9f9d1792f00b934 Mon Sep 17 00:00:00 2001 From: Hitomi Hatsukaze Date: Tue, 5 Mar 2019 23:38:57 +0900 Subject: [PATCH 375/924] Add TextRenderer to marked types --- types/marked/index.d.ts | 12 ++++++++++++ types/marked/marked-tests.ts | 3 +++ 2 files changed, 15 insertions(+) diff --git a/types/marked/index.d.ts b/types/marked/index.d.ts index 78a45b052c..818620bb5e 100644 --- a/types/marked/index.d.ts +++ b/types/marked/index.d.ts @@ -4,6 +4,7 @@ // BendingBender // CrossR // Mike Wickett +// Hitomi Hatsukaze // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export as namespace marked; @@ -102,6 +103,17 @@ declare namespace marked { text(text: string): string; } + class TextRenderer { + strong(text: string): string; + em(text: string): string; + codespan(text: string): string; + del(text: string): string; + text(text: string): string; + link(href: string, title: string, text: string): string; + image(href: string, title: string, text: string): string; + br(): string; + } + class Lexer { rules: Rules; tokens: TokensList; diff --git a/types/marked/marked-tests.ts b/types/marked/marked-tests.ts index 0edc376e43..0abfb48efb 100644 --- a/types/marked/marked-tests.ts +++ b/types/marked/marked-tests.ts @@ -48,3 +48,6 @@ const slugger = new marked.Slugger(); renderer.heading = (text, level, raw, slugger) => { return text + level.toString() + slugger.slug(raw); }; + +const textRenderer = new marked.TextRenderer(); +console.log(textRenderer.strong(text)); From 974649dd4df36342daadf4ca9d6c8c78938112b1 Mon Sep 17 00:00:00 2001 From: Eugene Kolnick Date: Tue, 5 Mar 2019 10:19:18 -0500 Subject: [PATCH 376/924] Added optional custom strategy option: `userEmailURL` See issue: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/33619 --- types/passport-github2/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/passport-github2/index.d.ts b/types/passport-github2/index.d.ts index 0048cfd901..a938e8c36b 100644 --- a/types/passport-github2/index.d.ts +++ b/types/passport-github2/index.d.ts @@ -29,6 +29,7 @@ export interface StrategyOption extends passport.AuthenticateOptions { scopeSeparator?: string; customHeaders?: OutgoingHttpHeaders; userProfileURL?: string; + userEmailURL?: string; } export type OAuth2StrategyOptionsWithoutRequiredURLs = Pick< @@ -50,6 +51,7 @@ export interface _StrategyOptionsBase extends OAuth2StrategyOptionsWithoutRequir scopeSeparator?: string; customHeaders?: OutgoingHttpHeaders; userProfileURL?: string; + userEmailURL?: string; } export interface StrategyOptions extends _StrategyOptionsBase { From 16d1c380cba458122ba900a4fb7245f0efbe4f4a Mon Sep 17 00:00:00 2001 From: Joe O'Hallaron Date: Tue, 5 Mar 2019 09:35:08 -0700 Subject: [PATCH 377/924] Event listener callbacks can have variable parameters --- types/cesium/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/cesium/index.d.ts b/types/cesium/index.d.ts index 398d05ad33..c1be0e4f16 100644 --- a/types/cesium/index.d.ts +++ b/types/cesium/index.d.ts @@ -706,8 +706,8 @@ declare namespace Cesium { class Event { numberOfListeners: number; - addEventListener(listener: () => void, scope?: any): Event.RemoveCallback; - removeEventListener(listener: () => void, scope?: any): boolean; + addEventListener(listener: (...args: any[]) => void, scope?: any): Event.RemoveCallback; + removeEventListener(listener: (...args: any[]) => void, scope?: any): boolean; raiseEvent(...args: any[]): void; } From 76e6187c4cbec5522430b0f39985f290e47fefc4 Mon Sep 17 00:00:00 2001 From: Daniel Hritzkiv Date: Tue, 5 Mar 2019 11:46:54 -0500 Subject: [PATCH 378/924] [three.js] Remove unresolvable authors @SereznoKot, @s093294, and @elk941 are usernames that longer exist on Github. --- types/three/index.d.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/types/three/index.d.ts b/types/three/index.d.ts index f929ef2383..880f27f0ac 100644 --- a/types/three/index.d.ts +++ b/types/three/index.d.ts @@ -3,21 +3,18 @@ // Definitions by: Kon , // Satoru Kimura , // Florent Poujol , -// SereznoKot , // HouChunlei , // Ivo , // David Asmuth , // Brandon Roberge, // Qinsi ZHU , // Toshiya Nakakura , -// Poul Kjeldager SĂžrensen , // Stefan Profanter , // Edmund Fokschaner , // Roelof Jooste , // Daniel Hritzkiv , // Apurva Ojas , // Tiger Oakes , -// Ethan Kay , // Methuselah96 // Dilip Ramirez // Julian Strecker From 8fc1bc0bbe2b3b1aae765e0c648f0d8643e57b3d Mon Sep 17 00:00:00 2001 From: Daniel Hritzkiv Date: Tue, 5 Mar 2019 11:48:39 -0500 Subject: [PATCH 379/924] [three.js] Remove @dhritzkiv (myself) from definition authors --- types/three/index.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/types/three/index.d.ts b/types/three/index.d.ts index f929ef2383..1491cd8073 100644 --- a/types/three/index.d.ts +++ b/types/three/index.d.ts @@ -14,7 +14,6 @@ // Stefan Profanter , // Edmund Fokschaner , // Roelof Jooste , -// Daniel Hritzkiv , // Apurva Ojas , // Tiger Oakes , // Ethan Kay , From a07c515fbd4732a465c01dd617cb99724b71daec Mon Sep 17 00:00:00 2001 From: Ostad Date: Tue, 5 Mar 2019 13:04:15 -0500 Subject: [PATCH 380/924] - add typedef for sendmail package --- types/sendmail/index.d.ts | 70 ++++++++++++++++++++++++++++++++ types/sendmail/sendmail-tests.ts | 24 +++++++++++ types/sendmail/tsconfig.json | 22 ++++++++++ types/sendmail/tslint.json | 1 + 4 files changed, 117 insertions(+) create mode 100644 types/sendmail/index.d.ts create mode 100644 types/sendmail/sendmail-tests.ts create mode 100644 types/sendmail/tsconfig.json create mode 100644 types/sendmail/tslint.json diff --git a/types/sendmail/index.d.ts b/types/sendmail/index.d.ts new file mode 100644 index 0000000000..191c0514fb --- /dev/null +++ b/types/sendmail/index.d.ts @@ -0,0 +1,70 @@ +// Type definitions for sendmail 1.4 +// Project: https://github.com/guileen/node-sendmail +// Definitions by: My Self +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/*~ If this module is a UMD module that exposes a global variable 'myLib' when + *~ loaded outside a module loader environment, declare that global here. + *~ Otherwise, delete this declaration. + */ +declare namespace sendMailConstructor { + export interface IOptions { + logger?: { + debug?: () => void; + info?: () => void; + warn?: () => void; + error?: () => void; + }; + silent?: boolean; + /** Default: False */ + dkim?: + | boolean + | { + privateKey: string; + keySelector: string; + }; + /** Default: False */ + devPort?: number | boolean; + /** Default: localhost */ + devHost?: string; + /** Default: 25 */ + smtpPort?: number; + /** Default: -1 - extra smtp host after resolveMX */ + smtpHost?: string | number; + } + + export interface IMailInput { + from: string; + to: string; + cc?: string; + bcc?: string; + replyTo?: string; + returnTo?: string; + subject: string; + type?: string; + charset?: string; + encoding?: string; + id?: string; + headers?: object; + content?: string; + html?: string; + attachments?: { + type: string; + filename: string; + content: any; + }[]; + } +} + +type CallbackFn = (err: Error, domain: string) => void; + +type SendMailFn = ( + mail: sendMailConstructor.IMailInput, + callback: CallbackFn +) => void; + +declare function sendMailConstructor( + options: sendMailConstructor.IOptions +): SendMailFn; + +export = sendMailConstructor; diff --git a/types/sendmail/sendmail-tests.ts b/types/sendmail/sendmail-tests.ts new file mode 100644 index 0000000000..f57c3b00d9 --- /dev/null +++ b/types/sendmail/sendmail-tests.ts @@ -0,0 +1,24 @@ +import sendmail = require("sendmail"); + +const emailSender = sendmail({ + silent: false +}); + +const sendEmail = (options: sendmail.IMailInput): Promise => + new Promise((resolve, reject) => { + emailSender(options, (err, reply) => { + // if error happened or returned code is now started with 2** + if (err || !reply.startsWith("2")) { + reject(err); + } else { + resolve(true); + } + }); + }); + +sendEmail({ + from: "Test Mail ", + to: "test@mydomain.com", + subject: "First Test", + html: "This is a Test message!" +}); diff --git a/types/sendmail/tsconfig.json b/types/sendmail/tsconfig.json new file mode 100644 index 0000000000..c4cf4b7613 --- /dev/null +++ b/types/sendmail/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", + "sendmail-tests.ts" + ] +} diff --git a/types/sendmail/tslint.json b/types/sendmail/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/sendmail/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 919218e6e65422e832a9551ebf39b9f67e3769bf Mon Sep 17 00:00:00 2001 From: saranshkataria Date: Tue, 5 Mar 2019 10:20:22 -0800 Subject: [PATCH 381/924] added referrerpolicy to anchor tag in react types --- types/react/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index a2dd9ee144..29123092e6 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -21,6 +21,7 @@ // Jessica Franco // Paul Sherman // Sunil Pai +// Saransh Kataria // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -1777,6 +1778,7 @@ declare namespace React { rel?: string; target?: string; type?: string; + referrerPolicy?: string; } // tslint:disable-next-line:no-empty-interface From 55151c0d425b718ad8a929f2bb981e6d9864289d Mon Sep 17 00:00:00 2001 From: Ostad Date: Tue, 5 Mar 2019 13:25:20 -0500 Subject: [PATCH 382/924] -fix linting problems --- types/sendmail/index.d.ts | 15 ++++++++------- types/sendmail/sendmail-tests.ts | 2 +- types/sendmail/tsconfig.json | 14 ++++---------- 3 files changed, 13 insertions(+), 18 deletions(-) diff --git a/types/sendmail/index.d.ts b/types/sendmail/index.d.ts index 191c0514fb..a70fc9930f 100644 --- a/types/sendmail/index.d.ts +++ b/types/sendmail/index.d.ts @@ -2,13 +2,14 @@ // Project: https://github.com/guileen/node-sendmail // Definitions by: My Self // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /*~ If this module is a UMD module that exposes a global variable 'myLib' when *~ loaded outside a module loader environment, declare that global here. *~ Otherwise, delete this declaration. */ declare namespace sendMailConstructor { - export interface IOptions { + interface Options { logger?: { debug?: () => void; info?: () => void; @@ -33,7 +34,7 @@ declare namespace sendMailConstructor { smtpHost?: string | number; } - export interface IMailInput { + interface MailInput { from: string; to: string; cc?: string; @@ -45,26 +46,26 @@ declare namespace sendMailConstructor { charset?: string; encoding?: string; id?: string; - headers?: object; + headers?: any; content?: string; html?: string; - attachments?: { + attachments?: Array<{ type: string; filename: string; content: any; - }[]; + }>; } } type CallbackFn = (err: Error, domain: string) => void; type SendMailFn = ( - mail: sendMailConstructor.IMailInput, + mail: sendMailConstructor.MailInput, callback: CallbackFn ) => void; declare function sendMailConstructor( - options: sendMailConstructor.IOptions + options: sendMailConstructor.Options ): SendMailFn; export = sendMailConstructor; diff --git a/types/sendmail/sendmail-tests.ts b/types/sendmail/sendmail-tests.ts index f57c3b00d9..5b0f50979b 100644 --- a/types/sendmail/sendmail-tests.ts +++ b/types/sendmail/sendmail-tests.ts @@ -4,7 +4,7 @@ const emailSender = sendmail({ silent: false }); -const sendEmail = (options: sendmail.IMailInput): Promise => +const sendEmail = (options: sendmail.MailInput): Promise => new Promise((resolve, reject) => { emailSender(options, (err, reply) => { // if error happened or returned code is now started with 2** diff --git a/types/sendmail/tsconfig.json b/types/sendmail/tsconfig.json index c4cf4b7613..248bfdbfdf 100644 --- a/types/sendmail/tsconfig.json +++ b/types/sendmail/tsconfig.json @@ -1,22 +1,16 @@ { "compilerOptions": { "module": "commonjs", - "lib": [ - "es6" - ], + "lib": ["es6"], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", - "typeRoots": [ - "../" - ], + "typeRoots": ["../"], "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, - "files": [ - "index.d.ts", - "sendmail-tests.ts" - ] + "files": ["index.d.ts", "sendmail-tests.ts"] } From db16d65e4c903c410be28bdb7374b6178d15d090 Mon Sep 17 00:00:00 2001 From: helloworld111gh Date: Tue, 5 Mar 2019 10:28:46 -0800 Subject: [PATCH 383/924] fix missing animation frame on FakeMethod --- types/lolex/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/lolex/index.d.ts b/types/lolex/index.d.ts index 052c9c45dc..1a33a60c7d 100644 --- a/types/lolex/index.d.ts +++ b/types/lolex/index.d.ts @@ -9,7 +9,7 @@ /** * Names of clock methods that may be faked by install. */ -type FakeMethod = "setTimeout" | "clearTimeout" | "setImmediate" | "clearImmediate" | "setInterval" | "clearInterval" | "Date" | "nextTick" | "hrtime" | "requestIdleCallback" | "cancelIdleCallback"; +type FakeMethod = "setTimeout" | "clearTimeout" | "setImmediate" | "clearImmediate" | "setInterval" | "clearInterval" | "Date" | "nextTick" | "hrtime" | "requestAnimationFrame" | "cancelAnimationFrame" | "requestIdleCallback" | "cancelIdleCallback"; /** * Global methods avaliable to every clock and also as standalone methods (inside `timers` global object). From d8f10f57fdaf6b1b21f2828e1f92b43d1e3ab261 Mon Sep 17 00:00:00 2001 From: Ostad Date: Tue, 5 Mar 2019 14:26:09 -0500 Subject: [PATCH 384/924] - change Constructor to Factory --- types/sendmail/index.d.ts | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/types/sendmail/index.d.ts b/types/sendmail/index.d.ts index a70fc9930f..ec748e0118 100644 --- a/types/sendmail/index.d.ts +++ b/types/sendmail/index.d.ts @@ -1,14 +1,10 @@ // Type definitions for sendmail 1.4 // Project: https://github.com/guileen/node-sendmail -// Definitions by: My Self +// Definitions by: Saeid Ostad // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 -/*~ If this module is a UMD module that exposes a global variable 'myLib' when - *~ loaded outside a module loader environment, declare that global here. - *~ Otherwise, delete this declaration. - */ -declare namespace sendMailConstructor { +declare namespace sendMailFactory { interface Options { logger?: { debug?: () => void; @@ -60,12 +56,10 @@ declare namespace sendMailConstructor { type CallbackFn = (err: Error, domain: string) => void; type SendMailFn = ( - mail: sendMailConstructor.MailInput, + mail: sendMailFactory.MailInput, callback: CallbackFn ) => void; -declare function sendMailConstructor( - options: sendMailConstructor.Options -): SendMailFn; +declare function sendMailFactory(options: sendMailFactory.Options): SendMailFn; -export = sendMailConstructor; +export = sendMailFactory; From 61e8cba63cf392513219a5f1c5445c26f5c2a122 Mon Sep 17 00:00:00 2001 From: pirix-gh Date: Tue, 5 Mar 2019 21:27:10 +0200 Subject: [PATCH 385/924] curry types --- types/ramda/index.d.ts | 121 +++++++------------------------------ types/ramda/ramda-tests.ts | 11 +++- types/ramda/tools.d.ts | 114 ++++++++++++++++++++++++++++++++++ types/ramda/tsconfig.json | 1 + 4 files changed, 146 insertions(+), 101 deletions(-) create mode 100644 types/ramda/tools.d.ts diff --git a/types/ramda/index.d.ts b/types/ramda/index.d.ts index e1b1f21334..e7536220be 100644 --- a/types/ramda/index.d.ts +++ b/types/ramda/index.d.ts @@ -27,8 +27,9 @@ // John Ottenlips // Nitesh Phadatare // Krantisinh Deshmukh +// Pierre-Antoine Mills // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 3.2 /// /// @@ -275,6 +276,7 @@ /// /// /// +/// declare let R: R.Static; @@ -366,77 +368,6 @@ declare namespace R { never }; - // @see https://gist.github.com/donnut/fd56232da58d25ceecf1, comment by @albrow - interface CurriedTypeGuard2 { - (t1: T1): (t2: T2) => t2 is R; - (t1: T1, t2: T2): t2 is R; - } - - interface CurriedTypeGuard3 { - (t1: T1): CurriedTypeGuard2; - (t1: T1, t2: T2): (t3: T3) => t3 is R; - (t1: T1, t2: T2, t3: T3): t3 is R; - } - - interface CurriedTypeGuard4 { - (t1: T1): CurriedTypeGuard3; - (t1: T1, t2: T2): CurriedTypeGuard2; - (t1: T1, t2: T2, t3: T3): (t4: T4) => t4 is R; - (t1: T1, t2: T2, t3: T3, t4: T4): t4 is R; - } - - interface CurriedTypeGuard5 { - (t1: T1): CurriedTypeGuard4; - (t1: T1, t2: T2): CurriedTypeGuard3; - (t1: T1, t2: T2, t3: T3): CurriedTypeGuard2; - (t1: T1, t2: T2, t3: T3, t4: T4): (t5: T5) => t5 is R; - (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): t5 is R; - } - - interface CurriedTypeGuard6 { - (t1: T1): CurriedTypeGuard5; - (t1: T1, t2: T2): CurriedTypeGuard4; - (t1: T1, t2: T2, t3: T3): CurriedTypeGuard3; - (t1: T1, t2: T2, t3: T3, t4: T4): CurriedTypeGuard2; - (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): (t6: T6) => t6 is R; - (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6): t6 is R; - } - - interface CurriedFunction2 { - (t1: T1): (t2: T2) => R; - (t1: T1, t2: T2): R; - } - - interface CurriedFunction3 { - (t1: T1): CurriedFunction2; - (t1: T1, t2: T2): (t3: T3) => R; - (t1: T1, t2: T2, t3: T3): R; - } - - interface CurriedFunction4 { - (t1: T1): CurriedFunction3; - (t1: T1, t2: T2): CurriedFunction2; - (t1: T1, t2: T2, t3: T3): (t4: T4) => R; - (t1: T1, t2: T2, t3: T3, t4: T4): R; - } - - interface CurriedFunction5 { - (t1: T1): CurriedFunction4; - (t1: T1, t2: T2): CurriedFunction3; - (t1: T1, t2: T2, t3: T3): CurriedFunction2; - (t1: T1, t2: T2, t3: T3, t4: T4): (t5: T5) => R; - (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): R; - } - - interface CurriedFunction6 { - (t1: T1): CurriedFunction5; - (t1: T1, t2: T2): CurriedFunction4; - (t1: T1, t2: T2, t3: T3): CurriedFunction3; - (t1: T1, t2: T2, t3: T3, t4: T4): CurriedFunction2; - (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): (t6: T6) => R; - (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6): R; - } - interface Placeholder { __isRamdaPlaceholder__: true; } interface Reduced { @@ -463,11 +394,11 @@ declare namespace R { * Creates a new list iteration function from an existing one by adding two new parameters to its callback * function: the current index, and the entire list. */ - addIndex(fn: (f: (item: T) => U, list: T[]) => U[]): CurriedFunction2<(item: T, idx: number, list?: T[]) => U, ReadonlyArray, U[]>; + addIndex(fn: (f: (item: T) => U, list: T[]) => U[]): Curry.Curry<(a: (item: T, idx: number, list?: T[]) => U, b: ReadonlyArray) => U[]>; /* Special case for forEach */ - addIndex(fn: (f: (item: T) => void, list: T[]) => T[]): CurriedFunction2<(item: T, idx: number, list?: T[]) => void, ReadonlyArray, T[]>; + addIndex(fn: (f: (item: T) => void, list: T[]) => T[]): Curry.Curry<(a: (item: T, idx: number, list?: T[]) => void, b: ReadonlyArray) => T[]>; /* Special case for reduce */ - addIndex(fn: (f: (acc: U, item: T) => U, aci: U, list: T[]) => U): CurriedFunction3<(acc: U, item: T, idx: number, list?: T[]) => U, U, ReadonlyArray, U>; + addIndex(fn: (f: (acc: U, item: T) => U, aci: U, list: T[]) => U): Curry.Curry<(a: (acc: U, item: T, idx: number, list?: T[]) => U, b: U, c: ReadonlyArray) => U>; /** * Applies a function to the value at the given index of an array, returning a new copy of the array with the @@ -583,7 +514,7 @@ declare namespace R { assocPath(path: Path, __: Placeholder, obj: U): (val: T) => U; assocPath(path: Path, val: T, obj: U): U; assocPath(path: Path, val: T): (obj: U) => U; - assocPath(path: Path): CurriedFunction2; + assocPath(path: Path): Curry.Curry<(a: T, b: U) => U>; /** * Wraps a function of any arity (including nullary) in a function that accepts exactly 2 @@ -835,17 +766,7 @@ declare namespace R { * Returns a curried equivalent of the provided function. The curried function has two unusual capabilities. * First, its arguments needn't be provided one at a time. */ - curry(fn: (a: T1, b: T2) => b is TResult): CurriedTypeGuard2; - curry(fn: (a: T1, b: T2, c: T3) => c is TResult): CurriedTypeGuard3; - curry(fn: (a: T1, b: T2, c: T3, d: T4) => d is TResult): CurriedTypeGuard4; - curry(fn: (a: T1, b: T2, c: T3, d: T4, e: T5) => e is TResult): CurriedTypeGuard5; - curry(fn: (a: T1, b: T2, c: T3, d: T4, e: T5, f: T6) => f is TResult): CurriedTypeGuard6; - curry(fn: (a: T1, b: T2) => TResult): CurriedFunction2; - curry(fn: (a: T1, b: T2, c: T3) => TResult): CurriedFunction3; - curry(fn: (a: T1, b: T2, c: T3, d: T4) => TResult): CurriedFunction4; - curry(fn: (a: T1, b: T2, c: T3, d: T4, e: T5) => TResult): CurriedFunction5; - curry(fn: (a: T1, b: T2, c: T3, d: T4, e: T5, f: T6) => TResult): CurriedFunction6; - curry(fn: (...a: any[]) => any): (...a: any[]) => any; + curry any>(f: F): Curry.Curry; /** * Returns a curried equivalent of the provided function, with the specified arity. The curried function has @@ -970,7 +891,7 @@ declare namespace R { */ eqBy(fn: (a: T) => U, a: T, b: T): boolean; eqBy(fn: (a: T) => U, a: T): (b: T) => boolean; - eqBy(fn: (a: T) => U): CurriedFunction2; + eqBy(fn: (a: T) => U): Curry.Curry<(a: T, b: T) => boolean>; /** * Reports whether two functions have the same value for the specified property. @@ -1444,7 +1365,7 @@ declare namespace R { */ maxBy(keyFn: (a: T) => Ord, a: T, b: T): T; maxBy(keyFn: (a: T) => Ord, a: T): (b: T) => T; - maxBy(keyFn: (a: T) => Ord): CurriedFunction2; + maxBy(keyFn: (a: T) => Ord): Curry.Curry<(a: T, b: T) => T>; /** * Returns the mean of the given list of numbers. @@ -1558,7 +1479,7 @@ declare namespace R { */ minBy(keyFn: (a: T) => Ord, a: T, b: T): T; minBy(keyFn: (a: T) => Ord, a: T): (b: T) => T; - minBy(keyFn: (a: T) => Ord): CurriedFunction2; + minBy(keyFn: (a: T) => Ord): Curry.Curry<(a: T, b: T) => T>; /** * Divides the second parameter by the first and returns the remainder. @@ -1727,7 +1648,7 @@ declare namespace R { */ pathEq(path: Path, val: any, obj: any): boolean; pathEq(path: Path, val: any): (obj: any) => boolean; - pathEq(path: Path): CurriedFunction2; + pathEq(path: Path): Curry.Curry<(a: any, b: any) => boolean>; /** * If the given, non-null object has a value at the given path, returns the value at that path. @@ -1735,14 +1656,14 @@ declare namespace R { */ pathOr(defaultValue: T, path: Path, obj: any): any; pathOr(defaultValue: T, path: Path): (obj: any) => any; - pathOr(defaultValue: T): CurriedFunction2; + pathOr(defaultValue: T): Curry.Curry<(a: Path, b: any) => any>; /** * Returns true if the specified object property at given path satisfies the given predicate; false otherwise. */ pathSatisfies(pred: (val: T) => boolean, path: Path, obj: U): boolean; pathSatisfies(pred: (val: T) => boolean, path: Path): (obj: U) => boolean; - pathSatisfies(pred: (val: T) => boolean): CurriedFunction2; + pathSatisfies(pred: (val: T) => boolean): Curry.Curry<(a: Path, b: U) => boolean>; /** * Returns a partial copy of an object containing only the keys specified. If the key does not exist, the @@ -2180,7 +2101,7 @@ declare namespace R { */ propSatisfies(pred: (val: T) => boolean, name: string, obj: U): boolean; propSatisfies(pred: (val: T) => boolean, name: string): (obj: U) => boolean; - propSatisfies(pred: (val: T) => boolean): CurriedFunction2; + propSatisfies(pred: (val: T) => boolean): Curry.Curry<(a: string, b: U) => boolean>; /** * Returns a list of numbers from `from` (inclusive) to `to` @@ -2205,8 +2126,8 @@ declare namespace R { */ reduceBy(valueFn: (acc: TResult, elem: T) => TResult, acc: TResult, keyFn: (elem: T) => string, list: ReadonlyArray): { [index: string]: TResult }; reduceBy(valueFn: (acc: TResult, elem: T) => TResult, acc: TResult, keyFn: (elem: T) => string): (list: ReadonlyArray) => { [index: string]: TResult }; - reduceBy(valueFn: (acc: TResult, elem: T) => TResult, acc: TResult): CurriedFunction2<(elem: T) => string, ReadonlyArray, { [index: string]: TResult }>; - reduceBy(valueFn: (acc: TResult, elem: T) => TResult): CurriedFunction3 string, ReadonlyArray, { [index: string]: TResult }>; + reduceBy(valueFn: (acc: TResult, elem: T) => TResult, acc: TResult): Curry.Curry<(a: (elem: T) => string, b: ReadonlyArray) => { [index: string]: TResult }>; + reduceBy(valueFn: (acc: TResult, elem: T) => TResult): Curry.Curry<(a: TResult, b: (elem: T) => string, c: ReadonlyArray) => { [index: string]: TResult }>; /** * Returns a value wrapped to indicate that it is the final value of the reduce and @@ -2232,8 +2153,8 @@ declare namespace R { */ reduceWhile(predicate: (acc: TResult, elem: T) => boolean, fn: (acc: TResult, elem: T) => TResult, acc: TResult, list: ReadonlyArray): TResult; reduceWhile(predicate: (acc: TResult, elem: T) => boolean, fn: (acc: TResult, elem: T) => TResult, acc: TResult): (list: ReadonlyArray) => TResult; - reduceWhile(predicate: (acc: TResult, elem: T) => boolean, fn: (acc: TResult, elem: T) => TResult): CurriedFunction2, TResult>; - reduceWhile(predicate: (acc: TResult, elem: T) => boolean): CurriedFunction3<(acc: TResult, elem: T) => TResult, TResult, ReadonlyArray, TResult>; + reduceWhile(predicate: (acc: TResult, elem: T) => boolean, fn: (acc: TResult, elem: T) => TResult): Curry.Curry<(a: TResult, b: ReadonlyArray) => TResult>; + reduceWhile(predicate: (acc: TResult, elem: T) => boolean): Curry.Curry<(a: (acc: TResult, elem: T) => TResult, b: TResult, c: ReadonlyArray) => TResult>; /** * Similar to `filter`, except that it keeps only values for which the given predicate @@ -2387,7 +2308,7 @@ declare namespace R { * Duplication is determined according to the value returned by applying the supplied predicate to two list elements. */ symmetricDifferenceWith(pred: (a: T, b: T) => boolean, list1: ReadonlyArray, list2: ReadonlyArray): T[]; - symmetricDifferenceWith(pred: (a: T, b: T) => boolean): CurriedFunction2, ReadonlyArray, T[]>; + symmetricDifferenceWith(pred: (a: T, b: T) => boolean): Curry.Curry<(a: ReadonlyArray, b: ReadonlyArray) => T[]>; /** * A function that always returns true. Any passed in parameters are ignored. @@ -2581,7 +2502,7 @@ declare namespace R { * determined according to the value returned by applying the supplied predicate to two list elements. */ unionWith(pred: (a: T, b: T) => boolean, list1: ReadonlyArray, list2: ReadonlyArray): T[]; - unionWith(pred: (a: T, b: T) => boolean): CurriedFunction2, ReadonlyArray, T[]>; + unionWith(pred: (a: T, b: T) => boolean): Curry.Curry<(a: ReadonlyArray, b: ReadonlyArray) => T[]>; /** * Returns a new list containing only one copy of each element in the original list. diff --git a/types/ramda/ramda-tests.ts b/types/ramda/ramda-tests.ts index 16ba23d85b..fdac7648db 100644 --- a/types/ramda/ramda-tests.ts +++ b/types/ramda/ramda-tests.ts @@ -68,6 +68,10 @@ class F2 { return a + b + c + d; } + function addTenFixedNumbers(a: 0, b: 1, c: 2, d: 3, e: 4, f: 5, g: 6, h: 7, i: 8, k: 9, l: 10): number { + return a + b + c + d; + } + const x1: (a: number, b: number, c: number, d: number) => number = R.curry(addFourNumbers); // because of the current way of currying, the following call results in a type error // const x2: Function = R.curry(addFourNumbers)(1,2,4) @@ -76,6 +80,8 @@ class F2 { const y1: number = R.curry(addFourNumbers)(1)(2)(3)(4); const y2: number = R.curry(addFourNumbers)(1, 2)(3, 4); const y3: number = R.curry(addFourNumbers)(1, 2, 3)(4); + const y4: number = R.curry(addTenFixedNumbers)(R.__, 1, 2)(0)(3)(R.__, R.__)(R.__, 5)(4)(6, 7)(R.__)(8, R.__, R.__)(9, 10); + const y5: number = R.curry(addTenFixedNumbers)(R.__, 1, R.__)(R.__, 2)(0, 3)(R.__, 5)(4, R.__)(R.__)(6, R.__, 8, 9, 10)(7); R.nAry(0); R.nAry(0, takesNoArg); @@ -119,7 +125,8 @@ class F2 { const cars: Car[] = [{speed: 65}, {}]; for (const car of cars) { if (typeGuardCurried(1)(2)(3)(4)(5)(car)) { - drive(car); + drive(car); // $ExpectError + // Generic Curry solved a previously non reported issue } } }; @@ -2784,3 +2791,5 @@ class Why { () => { R.bind(console.log, console); }; + +// Curry tests diff --git a/types/ramda/tools.d.ts b/types/ramda/tools.d.ts new file mode 100644 index 0000000000..b6f814012b --- /dev/null +++ b/types/ramda/tools.d.ts @@ -0,0 +1,114 @@ +/// + +// All the following types are explained here: +// https://medium.freecodecamp.org/typescript-curry-ramda-types-f747e99744ab +// https://github.com/pirix-gh/medium/blob/master/types-curry-ramda/src/index.ts +declare namespace Tools { + type Head = + T extends [any, ...any[]] + ? T[0] + : never; + + type Tail = + ((...t: T) => any) extends ((_: any, ...tail: infer TT) => any) + ? TT + : []; + + type HasTail = + T extends ([] | [any]) + ? false + : true; + + type Last = { + 0: Last>; + 1: Head; + }[ + HasTail extends true + ? 0 + : 1 + ]; + + type Length = + T['length']; + + type Prepend = + ((head: E, ...args: T) => any) extends ((...args: infer U) => any) + ? U + : T; + + type Drop = { + 0: Drop, Prepend>; + 1: T; + }[ + Length extends N + ? 1 + : 0 + ]; + + type Cast = X extends Y ? X : Y; + + type Pos = + Length; + + type Next = + Prepend; + + type Prev = + Tail; + + type Iterator = { + 0: Iterator, Next>; + 1: From; + }[ + Pos extends Index + ? 1 + : 0 + ]; + + type Reverse = { + 0: Reverse], R>, Next>; + 1: R; + }[ + Pos extends Length + ? 1 + : 0 + ]; + + type Concat = + Reverse extends infer R ? Cast : never, T2>; + + type Append = + Concat; +} + +declare namespace Curry { + type GapOf = + T1[Tools.Pos] extends R.Placeholder + ? Tools.Append], TN> + : TN; + + type GapsOf = { + 0: GapsOf extends infer G ? Tools.Cast : never, Tools.Next>; + 1: Tools.Concat, T2> extends infer D ? Tools.Cast : never>; + }[ + Tools.Pos extends Tools.Length + ? 1 + : 0 + ]; + + type PartialGaps = { + [K in keyof T]?: T[K] | R.Placeholder + }; + + type CleanedGaps = { + [K in keyof T]: NonNullable + }; + + type Gaps = CleanedGaps>; + + type Curry any)> = + (...args: Tools.Cast>>, any[]>) => + GapsOf> extends [any, ...any[]] + ? Curry<(...args: GapsOf> extends infer G ? Tools.Cast : never) => ReturnType> + : ReturnType; +} diff --git a/types/ramda/tsconfig.json b/types/ramda/tsconfig.json index 4de4f10d8f..92fcdd531d 100644 --- a/types/ramda/tsconfig.json +++ b/types/ramda/tsconfig.json @@ -19,6 +19,7 @@ }, "files": [ "index.d.ts", + "tools.d.ts", "ramda-tests.ts" ] } \ No newline at end of file From 33d021fc473863667468290f569a1fc70923c11e Mon Sep 17 00:00:00 2001 From: Ostad Date: Tue, 5 Mar 2019 14:29:31 -0500 Subject: [PATCH 386/924] - add type to headers probperty instead of any --- types/sendmail/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/sendmail/index.d.ts b/types/sendmail/index.d.ts index ec748e0118..1bab6d27b6 100644 --- a/types/sendmail/index.d.ts +++ b/types/sendmail/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/guileen/node-sendmail // Definitions by: Saeid Ostad // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 +// TypeScript Version: 2.2 declare namespace sendMailFactory { interface Options { @@ -42,7 +42,7 @@ declare namespace sendMailFactory { charset?: string; encoding?: string; id?: string; - headers?: any; + headers?: object; content?: string; html?: string; attachments?: Array<{ From 3ea931135ed7225b0182cf4b5aefdb887e5a4252 Mon Sep 17 00:00:00 2001 From: pirix-gh Date: Tue, 5 Mar 2019 21:59:08 +0200 Subject: [PATCH 387/924] ramda update version --- types/ramda/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/ramda/index.d.ts b/types/ramda/index.d.ts index e7536220be..e0313e5957 100644 --- a/types/ramda/index.d.ts +++ b/types/ramda/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ramda 0.25 +// Type definitions for ramda 0.26 // Project: https://github.com/donnut/typescript-ramda, https://ramdajs.com // Definitions by: Erwin Poeze // Tycho Grouwstra From 53804821fc3acd0cdec1195a8f1c5e7ed2b2b0c1 Mon Sep 17 00:00:00 2001 From: Seth Butler Date: Tue, 5 Mar 2019 15:06:56 -0500 Subject: [PATCH 388/924] Allowing ttl to be a function --- types/connect-redis/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/connect-redis/index.d.ts b/types/connect-redis/index.d.ts index c5a26de73a..9b56777ac3 100644 --- a/types/connect-redis/index.d.ts +++ b/types/connect-redis/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for connect-redis // Project: https://npmjs.com/package/connect-redis // Definitions by: Xavier Stouder +// Seth Butler // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -26,7 +27,7 @@ declare module "connect-redis" { port?: number; socket?: string; url?: string; - ttl?: number; + ttl?: number | string | ((store: RedisStore, sess: Express.SessionData, sid: string) => number); disableTTL?: boolean; db?: number; pass?: string; From 6fecca7b45ade9ea7cff9166e4e80c128eb01bde Mon Sep 17 00:00:00 2001 From: Jordi Oliveras Rovira Date: Tue, 5 Mar 2019 21:01:19 +0100 Subject: [PATCH 389/924] Remove 'del' package. --- notNeededPackages.json | 7 +++- types/del/del-tests.ts | 47 ------------------------- types/del/index.d.ts | 29 --------------- types/del/tsconfig.json | 23 ------------ types/del/tslint.json | 6 ---- types/del/v2/del-tests.ts | 37 ------------------- types/del/v2/index.d.ts | 19 ---------- types/del/v2/tsconfig.json | 28 --------------- types/del/v2/tslint.json | 6 ---- types/gulp/package.json | 3 +- types/rollup-plugin-delete/package.json | 1 + types/vinyl-paths/package.json | 7 ++++ 12 files changed, 16 insertions(+), 197 deletions(-) delete mode 100644 types/del/del-tests.ts delete mode 100644 types/del/index.d.ts delete mode 100644 types/del/tsconfig.json delete mode 100644 types/del/tslint.json delete mode 100644 types/del/v2/del-tests.ts delete mode 100644 types/del/v2/index.d.ts delete mode 100644 types/del/v2/tsconfig.json delete mode 100644 types/del/v2/tslint.json create mode 100644 types/vinyl-paths/package.json diff --git a/notNeededPackages.json b/notNeededPackages.json index acdb379b38..5752f85be4 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -420,6 +420,12 @@ "sourceRepoURL": "git@github.com:KyleAMathews/deepmerge.git", "asOfVersion": "2.2.0" }, + { + "libraryName": "del", + "typingsPackageName": "del", + "sourceRepoURL": "https://github.com/sindresorhus/del", + "asOfVersion": "4.0.0" + }, { "libraryName": "delay", "typingsPackageName": "delay", @@ -1169,7 +1175,6 @@ "typingsPackageName": "p-limit", "sourceRepoURL": "https://github.com/sindresorhus/p-limit", "asOfVersion": "2.2.0" - }, { "libraryName": "p-map", diff --git a/types/del/del-tests.ts b/types/del/del-tests.ts deleted file mode 100644 index f9d01f644f..0000000000 --- a/types/del/del-tests.ts +++ /dev/null @@ -1,47 +0,0 @@ -import del = require('del'); - -let paths = ['build', 'dist/**/*.js']; - -del(['tmp/*.js', '!tmp/unicorn.js']); -del(['tmp/*.js', '!tmp/unicorn.js'], { force: true }); -del(['tmp/*.js', '!tmp/unicorn.js'], { dryRun: true }); -del(['tmp/*.js', '!tmp/unicorn.js'], { concurrency: 20 }); -del(['tmp/*.js', '!tmp/unicorn.js'], { cwd: '' }); - -del(['tmp/*.js', '!tmp/unicorn.js']).then((paths: string[]) => { - console.log('Deleted files/folders:\n', paths.join('\n')); -}); - -del(['tmp/*.js', '!tmp/unicorn.js'], { force: true }).then( - (paths: string[]) => { - console.log('Deleted files/folders:\n', paths.join('\n')); - } -); - -del('tmp/*.js'); -del('tmp/*.js', { force: true }); -del('tmp/*.js', { dryRun: true }); -del('tmp/*.js', { concurrency: 20 }); -del('tmp/*.js', { cwd: '' }); -del('tmp/*.js').then((paths: string[]) => { - console.log('Deleted files/folders:\n', paths.join('\n')); -}); - -del('tmp/*.js', { force: true }).then((paths: string[]) => { - console.log('Deleted files/folders:\n', paths.join('\n')); -}); - -paths = del.sync(['tmp/*.js', '!tmp/unicorn.js']); -paths = del.sync(['tmp/*.js', '!tmp/unicorn.js'], { force: true }); - -paths = del.sync('tmp/*.js'); -paths = del.sync('tmp/*.js', { force: true }); -paths = del.sync('tmp/*.js', { dryRun: true }); -paths = del.sync('tmp/*.js', { concurrency: 20 }); -paths = del.sync('tmp/*.js', { cwd: '' }); - -const immutable: ReadonlyArray = ['tmp/*.js', '!tmp/unicorn.js']; -const mutable = del(immutable); -const mutablePaths = del.sync(immutable); -mutable.then(paths => paths.push('test')); -mutablePaths.push('test'); diff --git a/types/del/index.d.ts b/types/del/index.d.ts deleted file mode 100644 index ec92f96c84..0000000000 --- a/types/del/index.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Type definitions for del 3.0 -// Project: https://github.com/sindresorhus/del -// Definitions by: Asana -// Aya Morisawa -// BendingBender -// Jason Dreyzehner -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -import glob = require('glob'); - -declare function del( - patterns: string | ReadonlyArray, - options?: del.Options -): Promise; - -declare namespace del { - function sync( - patterns: string | ReadonlyArray, - options?: Options - ): string[]; - - interface Options extends glob.IOptions { - force?: boolean; - dryRun?: boolean; - concurrency?: number; - } -} - -export = del; diff --git a/types/del/tsconfig.json b/types/del/tsconfig.json deleted file mode 100644 index 6143d08346..0000000000 --- a/types/del/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "del-tests.ts" - ] -} \ No newline at end of file diff --git a/types/del/tslint.json b/types/del/tslint.json deleted file mode 100644 index 26bcea6634..0000000000 --- a/types/del/tslint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "dt-header": false - } -} diff --git a/types/del/v2/del-tests.ts b/types/del/v2/del-tests.ts deleted file mode 100644 index 09702c4b39..0000000000 --- a/types/del/v2/del-tests.ts +++ /dev/null @@ -1,37 +0,0 @@ -import del = require("del"); - -let paths = ["build", "dist/**/*.js"]; - -del(["tmp/*.js", "!tmp/unicorn.js"]); - -del(["tmp/*.js", "!tmp/unicorn.js"], {force: true}); - -del(["tmp/*.js", "!tmp/unicorn.js"]).then((paths: string[]) => { - console.log('Deleted files/folders:\n', paths.join('\n')); -}); - -del(["tmp/*.js", "!tmp/unicorn.js"], {force: true}).then((paths: string[]) => { - console.log('Deleted files/folders:\n', paths.join('\n')); -}); - -del("tmp/*.js"); - -del("tmp/*.js", {force: true}); - -del("tmp/*.js").then((paths: string[]) => { - console.log('Deleted files/folders:\n', paths.join('\n')); -}); - -del("tmp/*.js", {force: true}).then((paths: string[]) => { - console.log('Deleted files/folders:\n', paths.join('\n')); -}); - -paths = del.sync(["tmp/*.js", "!tmp/unicorn.js"]); - -paths = del.sync(["tmp/*.js", "!tmp/unicorn.js"], {force: true}); - -paths = del.sync("tmp/*.js"); - -paths = del.sync("tmp/*.js", {force: true}); - -paths = del.sync("tmp/*.js", {dryRun: true}); diff --git a/types/del/v2/index.d.ts b/types/del/v2/index.d.ts deleted file mode 100644 index 50634e39eb..0000000000 --- a/types/del/v2/index.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Type definitions for del 2.2 -// Project: https://github.com/sindresorhus/del -// Definitions by: Asana , Aya Morisawa -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -import glob = require("glob"); - -declare function del(patterns: string | string[], options?: del.Options): Promise; - -declare namespace del { - function sync(patterns: string | string[], options?: Options): string[]; - - interface Options extends glob.IOptions { - force?: boolean; - dryRun?: boolean; - } -} - -export = del; diff --git a/types/del/v2/tsconfig.json b/types/del/v2/tsconfig.json deleted file mode 100644 index 568d1a8a21..0000000000 --- a/types/del/v2/tsconfig.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../../", - "typeRoots": [ - "../../" - ], - "paths": { - "del": [ - "del/v2" - ] - }, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "del-tests.ts" - ] -} \ No newline at end of file diff --git a/types/del/v2/tslint.json b/types/del/v2/tslint.json deleted file mode 100644 index 65c83fb1e3..0000000000 --- a/types/del/v2/tslint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "dt-header": false - } -} diff --git a/types/gulp/package.json b/types/gulp/package.json index a0e2ec3c5c..bae72230b6 100644 --- a/types/gulp/package.json +++ b/types/gulp/package.json @@ -1,6 +1,7 @@ { "private": true, "dependencies": { - "chokidar": "^2.1.2" + "chokidar": "^2.1.2", + "del": "*" } } diff --git a/types/rollup-plugin-delete/package.json b/types/rollup-plugin-delete/package.json index 272f65edde..cca5c8c155 100644 --- a/types/rollup-plugin-delete/package.json +++ b/types/rollup-plugin-delete/package.json @@ -1,6 +1,7 @@ { "private": true, "dependencies": { + "del": "*", "rollup": ">=0.60.0" } } diff --git a/types/vinyl-paths/package.json b/types/vinyl-paths/package.json new file mode 100644 index 0000000000..d03842a47b --- /dev/null +++ b/types/vinyl-paths/package.json @@ -0,0 +1,7 @@ +{ + "private": true, + "dependencies": { + "del": "*", + "rollup": ">=0.60.0" + } +} From 9a9277b1a963e152f315ec0f68436e690e472f31 Mon Sep 17 00:00:00 2001 From: Seth Butler Date: Tue, 5 Mar 2019 15:09:50 -0500 Subject: [PATCH 390/924] Adding test for ttl as function --- types/connect-redis/connect-redis-tests.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/types/connect-redis/connect-redis-tests.ts b/types/connect-redis/connect-redis-tests.ts index a312ffd3ca..603b226dcc 100644 --- a/types/connect-redis/connect-redis-tests.ts +++ b/types/connect-redis/connect-redis-tests.ts @@ -6,5 +6,8 @@ const store = new RedisStore({ host: 'localhost', port: 6379, logErrors: error => console.warn(error), - scanCount: 80, + scanCount: 80, + ttl: (store, sess, sessionID) => { + return 60; + } }); From b61c3407454aa7cedc55309fc4d6e77645e5b0e5 Mon Sep 17 00:00:00 2001 From: Heber Date: Tue, 5 Mar 2019 14:14:10 -0700 Subject: [PATCH 391/924] Update Flickity Types Add types for "on" event binding --- types/flickity/index.d.ts | 88 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/types/flickity/index.d.ts b/types/flickity/index.d.ts index 4d9a8a4c25..880b53943a 100644 --- a/types/flickity/index.d.ts +++ b/types/flickity/index.d.ts @@ -2,6 +2,7 @@ // Project: https://flickity.metafizzy.co // Definitions by: Chris McGrath // Michael Wagner +// Anthony Heber // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -506,4 +507,91 @@ interface FlickityOptions { * javascript dictionary of points or path to SVG file */ arrowShape?: string | { x0: number, x1: number, y1: number, x2: number, y2: number, x3: number }; + + /** + * Bind events within Flickity's options by setting on to an Object. The object's keys should match the event names. on is useful for capturing events as Flickity is initialized, like ready + */ + on?: { + + /** + * Triggered after Flickity has been activated. + */ + ready?: () => void; + + /** + * Triggered when the selected slide is changed. + */ + change?: (index?: Number) => void; + + /** + * Triggered when a slide is selected. + * + * select is triggered any time a slide is selected, even on the same slide. change is triggered only when a different slide is selected. + * + * This event was previously cellSelect in Flickity v1. cellSelect will continue to work in Flickity v2. + */ + select?: (index?: Number) => void; + + /** + * Triggered when the slider is settled at its end position. + */ + settle?: (index?: Number) => void; + + /** + * Triggered when the slider moves. + */ + scroll?: (progress?: Number) => void; + + /** + * Triggered when dragging starts and the slider starts moving. + */ + dragStart?: (event?: Event, pointer?: Element | Touch) => void; + + /** + * Triggered when dragging moves and the slider moves. + */ + dragMove?: (event?: Event, pointer?: Element | Touch, moveVector?: { x: number, y: number }) => void; + + /** + * Triggered when dragging ends. + */ + dragEnd?: (event: Event, pointer?: Element | Touch) => void; + + /** + * Triggered when the user's pointer (mouse, touch, pointer) presses down. + */ + pointerDown?: (event: Event, pointer?: Element | Touch) => void; + + /** + * Triggered when the user's pointer moves. + */ + pointerMove?: (event?: Event, pointer?: Element | Touch, moveVector?: { x: number, y: number }) => void; + + /** + * Triggered when the user's pointer unpresses. + */ + pointerUp?: (event?: Event, pointer?: Element | Touch) => void; + + /** + * Triggered when the user's pointer is pressed and unpressed and has not moved enough to start dragging. + * + * click events are hard to detect with draggable UI, as they are triggered whenever a user drags. Flickity's staticClick event resolves this, as it is triggered when the user has not dragged. + */ + staticClick?: (event?: Event, pointer?: Element | Touch, cellElement?: Element, cellIndex?: Number) => void; + + /** + * Triggered after an image has been loaded with lazyLoad. + */ + lazyLoad?: (event?: Event, cellElement?: Element) => void; + + /** + * Triggered after a background image has been loaded with bgLazyLoad. + */ + bgLazyLoad?: (event?: Event, element?: Element) => void; + + /** + * Triggered after entering or exiting fullscreen view. + */ + fullscreenChange?: (isFullscreen?: Boolean) => void; + } } From 60bfbc16ff78bd0fbe6c5932157e52458ee63375 Mon Sep 17 00:00:00 2001 From: Peter Oxenham Date: Wed, 6 Mar 2019 07:16:46 +1000 Subject: [PATCH 392/924] Updated definition of 'tests' on SchemaDescription --- types/yup/index.d.ts | 2 +- types/yup/yup-tests.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/yup/index.d.ts b/types/yup/index.d.ts index 58067b926b..f29fe60d23 100644 --- a/types/yup/index.d.ts +++ b/types/yup/index.d.ts @@ -296,7 +296,7 @@ export interface SchemaDescription { type: string; label: string; meta: object; - tests: string[]; + tests: Array<{ name: string, params: object }>; fields: object; } diff --git a/types/yup/yup-tests.ts b/types/yup/yup-tests.ts index 0c515ef78c..152fdd25e4 100644 --- a/types/yup/yup-tests.ts +++ b/types/yup/yup-tests.ts @@ -420,7 +420,7 @@ const description: SchemaDescription = { type: "type", label: "label", meta: { key: "value" }, - tests: ["test1", "test2"], + tests: [{ name: "test1", params: {} }, { name: "test2", params: {} }], fields: { key: "value" } }; From 1240929245ca5c59e57673ce2d0d6d0ca6882588 Mon Sep 17 00:00:00 2001 From: Vincent Pizzo Date: Tue, 5 Mar 2019 13:29:46 -0800 Subject: [PATCH 393/924] Add types for react-csv --- .../react-csv/components/CommonPropTypes.d.ts | 22 ++++++ types/react-csv/components/Download.d.ts | 9 +++ types/react-csv/components/Link.d.ts | 5 ++ types/react-csv/index.d.ts | 8 ++ types/react-csv/react-csv-tests.tsx | 78 +++++++++++++++++++ types/react-csv/tsconfig.json | 30 +++++++ types/react-csv/tslint.json | 7 ++ 7 files changed, 159 insertions(+) create mode 100644 types/react-csv/components/CommonPropTypes.d.ts create mode 100644 types/react-csv/components/Download.d.ts create mode 100644 types/react-csv/components/Link.d.ts create mode 100644 types/react-csv/index.d.ts create mode 100644 types/react-csv/react-csv-tests.tsx create mode 100644 types/react-csv/tsconfig.json create mode 100644 types/react-csv/tslint.json diff --git a/types/react-csv/components/CommonPropTypes.d.ts b/types/react-csv/components/CommonPropTypes.d.ts new file mode 100644 index 0000000000..4bad3dd766 --- /dev/null +++ b/types/react-csv/components/CommonPropTypes.d.ts @@ -0,0 +1,22 @@ +import { MouseEventHandler } from "react"; + +export interface LabelKeyObject { + label: string; + key: string; +} + +export type Data = object[]; +export type Headers = LabelKeyObject[] | string[]; +export type SyncClickHandler = (event: MouseEventHandler) => boolean | void; +export type AsyncClickHandler = (event: MouseEventHandler, done: (proceed?: boolean) => void) => void; + +export interface CommonPropTypes { + data: string | Data; + headers?: Headers; + enclosingCharacter?: string; + separator?: string; + filename?: string; + uFEFF?: boolean; + onClick?: SyncClickHandler | AsyncClickHandler; + asyncOnClick?: boolean; +} diff --git a/types/react-csv/components/Download.d.ts b/types/react-csv/components/Download.d.ts new file mode 100644 index 0000000000..282f41596a --- /dev/null +++ b/types/react-csv/components/Download.d.ts @@ -0,0 +1,9 @@ +import { Component } from "react"; +import { CommonPropTypes } from "./CommonPropTypes"; + +export interface DownloadPropTypes extends CommonPropTypes { + target?: string; +} + +export default class Download extends Component { +} diff --git a/types/react-csv/components/Link.d.ts b/types/react-csv/components/Link.d.ts new file mode 100644 index 0000000000..3e133095de --- /dev/null +++ b/types/react-csv/components/Link.d.ts @@ -0,0 +1,5 @@ +import { Component } from "react"; +import { CommonPropTypes } from "./CommonPropTypes"; + +export default class Link extends Component { +} diff --git a/types/react-csv/index.d.ts b/types/react-csv/index.d.ts new file mode 100644 index 0000000000..2fe767d3e7 --- /dev/null +++ b/types/react-csv/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for react-csv 1.1.1 +// Project: https://github.com/react-csv/react-csv +// Definitions by: Vincent Pizzo +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +export { default as CSVLink } from "./components/Link"; +export { default as CSVDownload } from "./components/Download"; diff --git a/types/react-csv/react-csv-tests.tsx b/types/react-csv/react-csv-tests.tsx new file mode 100644 index 0000000000..a075b8161f --- /dev/null +++ b/types/react-csv/react-csv-tests.tsx @@ -0,0 +1,78 @@ +import * as React from "react"; +import { MouseEventHandler } from "react"; +import { render } from "react-dom"; +import { CSVLink, CSVDownload } from "react-csv"; + +const headers = [ + {label: 'First Name', key: 'details.firstName'}, + {label: 'Last Name', key: 'details.lastName'}, + {label: 'Job', key: 'job'}, +]; + +const headersStrings = ['foo', 'bar']; + +const data = [ + {details: {firstName: 'Ahmed', lastName: 'Tomi'}, job: 'manager'}, + {details: {firstName: 'John', lastName: 'Jones'}, job: 'developer'}, +]; + +const dataString = `firstname,lastname +Ahmed,Tomi +Raed,Labes +Yezzi,Min l3b +`; + +const syncOnClickReturn = (event: MouseEventHandler) => { + window.console.log(event); + return true; +}; +const syncOnClickVoid = (event: MouseEventHandler) => window.console.log(event); +const asyncOnClickReturn = (event: MouseEventHandler, done: (proceed?: boolean) => void) => { + window.console.log(event); + done(true); +}; +const asyncOnClickVoid = (event: MouseEventHandler, done: (proceed?: boolean) => void) => { + window.console.log(event); + done(); +}; + +const node = document.getElementById("main"); + +render(, node); +render(, node); +render(, node); +render(, node); +render(, node); +render(, node); +render(, node); +render(, node); +render(, node); +render(, node); +render(, node); +render(, node); +render(, node); + +render(, node); +render(, node); +render(, node); +render(, node); +render(, node); +render(, node); +render(, node); +render(, node); +render(, node); +render(, node); +render(, node); +render(, node); +render(, node); diff --git a/types/react-csv/tsconfig.json b/types/react-csv/tsconfig.json new file mode 100644 index 0000000000..cc91fd7689 --- /dev/null +++ b/types/react-csv/tsconfig.json @@ -0,0 +1,30 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react", + "noUnusedParameters": true, + "noUnusedLocals": true + }, + "files": [ + "index.d.ts", + "components/CommonPropTypes.d.ts", + "components/Download.d.ts", + "components/Link.d.ts", + "react-csv-tests.tsx" + ] +} diff --git a/types/react-csv/tslint.json b/types/react-csv/tslint.json new file mode 100644 index 0000000000..b2ecae2fd2 --- /dev/null +++ b/types/react-csv/tslint.json @@ -0,0 +1,7 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + // TODO + "no-duplicate-imports": false + } +} From a29a1cc518f05808125d978e444e92dee9e3c0e6 Mon Sep 17 00:00:00 2001 From: Dimitri Benin Date: Tue, 5 Mar 2019 22:30:16 +0100 Subject: [PATCH 394/924] Remove upstreamed types --- notNeededPackages.json | 55 ++++++++++++- types/camelcase/camelcase-tests.ts | 10 --- types/camelcase/index.d.ts | 9 --- types/camelcase/tsconfig.json | 23 ------ types/camelcase/tslint.json | 1 - types/conf/conf-tests.ts | 54 ------------- types/conf/index.d.ts | 37 --------- types/conf/tsconfig.json | 24 ------ types/conf/tslint.json | 1 - types/conf/v0/conf-tests.ts | 20 ----- types/conf/v0/index.d.ts | 29 ------- types/conf/v0/tsconfig.json | 29 ------- types/conf/v0/tslint.json | 1 - types/conf/v1/conf-tests.ts | 41 ---------- types/conf/v1/index.d.ts | 31 -------- types/conf/v1/tsconfig.json | 29 ------- types/conf/v1/tslint.json | 1 - types/env-paths/env-paths-tests.ts | 10 --- types/env-paths/index.d.ts | 18 ----- types/env-paths/tsconfig.json | 19 ----- types/env-paths/tslint.json | 3 - types/globby/globby-tests.ts | 71 ----------------- types/globby/index.d.ts | 99 ------------------------ types/globby/package.json | 6 -- types/globby/tsconfig.json | 24 ------ types/globby/tslint.json | 1 - types/log-update/index.d.ts | 17 ---- types/log-update/log-update-tests.ts | 19 ----- types/log-update/tsconfig.json | 23 ------ types/log-update/tslint.json | 1 - types/make-dir/index.d.ts | 41 ---------- types/make-dir/make-dir-tests.ts | 13 ---- types/make-dir/tsconfig.json | 23 ------ types/make-dir/tslint.json | 3 - types/move-file/index.d.ts | 20 ----- types/move-file/move-file-tests.ts | 10 --- types/move-file/tsconfig.json | 23 ------ types/move-file/tslint.json | 1 - types/on-change/index.d.ts | 9 --- types/on-change/on-change-tests.ts | 17 ---- types/on-change/tsconfig.json | 23 ------ types/on-change/tslint.json | 1 - types/query-string/index.d.ts | 48 ------------ types/query-string/query-string-tests.ts | 44 ----------- types/query-string/tsconfig.json | 23 ------ types/query-string/tslint.json | 6 -- 46 files changed, 54 insertions(+), 957 deletions(-) delete mode 100644 types/camelcase/camelcase-tests.ts delete mode 100644 types/camelcase/index.d.ts delete mode 100644 types/camelcase/tsconfig.json delete mode 100644 types/camelcase/tslint.json delete mode 100644 types/conf/conf-tests.ts delete mode 100644 types/conf/index.d.ts delete mode 100644 types/conf/tsconfig.json delete mode 100644 types/conf/tslint.json delete mode 100644 types/conf/v0/conf-tests.ts delete mode 100644 types/conf/v0/index.d.ts delete mode 100644 types/conf/v0/tsconfig.json delete mode 100644 types/conf/v0/tslint.json delete mode 100644 types/conf/v1/conf-tests.ts delete mode 100644 types/conf/v1/index.d.ts delete mode 100644 types/conf/v1/tsconfig.json delete mode 100644 types/conf/v1/tslint.json delete mode 100644 types/env-paths/env-paths-tests.ts delete mode 100644 types/env-paths/index.d.ts delete mode 100644 types/env-paths/tsconfig.json delete mode 100644 types/env-paths/tslint.json delete mode 100644 types/globby/globby-tests.ts delete mode 100644 types/globby/index.d.ts delete mode 100644 types/globby/package.json delete mode 100644 types/globby/tsconfig.json delete mode 100644 types/globby/tslint.json delete mode 100644 types/log-update/index.d.ts delete mode 100644 types/log-update/log-update-tests.ts delete mode 100644 types/log-update/tsconfig.json delete mode 100644 types/log-update/tslint.json delete mode 100644 types/make-dir/index.d.ts delete mode 100644 types/make-dir/make-dir-tests.ts delete mode 100644 types/make-dir/tsconfig.json delete mode 100644 types/make-dir/tslint.json delete mode 100644 types/move-file/index.d.ts delete mode 100644 types/move-file/move-file-tests.ts delete mode 100644 types/move-file/tsconfig.json delete mode 100644 types/move-file/tslint.json delete mode 100644 types/on-change/index.d.ts delete mode 100644 types/on-change/on-change-tests.ts delete mode 100644 types/on-change/tsconfig.json delete mode 100644 types/on-change/tslint.json delete mode 100644 types/query-string/index.d.ts delete mode 100644 types/query-string/query-string-tests.ts delete mode 100644 types/query-string/tsconfig.json delete mode 100644 types/query-string/tslint.json diff --git a/notNeededPackages.json b/notNeededPackages.json index acdb379b38..4b38d00307 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -216,6 +216,12 @@ "sourceRepoURL": "https://github.com/blakeembrey/camel-case", "asOfVersion": "1.2.1" }, + { + "libraryName": "camelcase", + "typingsPackageName": "camelcase", + "sourceRepoURL": "https://github.com/sindresorhus/camelcase", + "asOfVersion": "5.2.0" + }, { "libraryName": "catalog", "typingsPackageName": "catalog", @@ -264,6 +270,12 @@ "sourceRepoURL": "https://github.com/tj/commander.js", "asOfVersion": "2.12.2" }, + { + "libraryName": "conf", + "typingsPackageName": "conf", + "sourceRepoURL": "https://github.com/sindresorhus/conf", + "asOfVersion": "3.0.0" + }, { "libraryName": "confirmdialog", "typingsPackageName": "confirmdialog", @@ -516,6 +528,12 @@ "sourceRepoURL": "https://github.com/Sembiance/email-validator", "asOfVersion": "1.0.6" }, + { + "libraryName": "env-paths", + "typingsPackageName": "env-paths", + "sourceRepoURL": "https://github.com/sindresorhus/env-paths", + "asOfVersion": "2.1.0" + }, { "libraryName": "error-stack-parser", "typingsPackageName": "error-stack-parser", @@ -684,6 +702,12 @@ "sourceRepoURL": "https://github.com/jdalrymple/node-gitlab", "asOfVersion": "2.0.0" }, + { + "libraryName": "globby", + "typingsPackageName": "globby", + "sourceRepoURL": "https://github.com/sindresorhus/globby", + "asOfVersion": "9.1.0" + }, { "libraryName": "Google Cloud Storage", "typingsPackageName": "google-cloud__storage", @@ -1002,6 +1026,12 @@ "sourceRepoURL": "https://github.com/steelsojka/lodash-decorators", "asOfVersion": "4.0.0" }, + { + "libraryName": "log-update", + "typingsPackageName": "log-update", + "sourceRepoURL": "https://github.com/sindresorhus/log-update", + "asOfVersion": "3.1.0" + }, { "libraryName": "log4javascript", "typingsPackageName": "log4javascript", @@ -1026,6 +1056,12 @@ "sourceRepoURL": "https://github.com/blakeembrey/lower-case-first", "asOfVersion": "1.0.1" }, + { + "libraryName": "make-dir", + "typingsPackageName": "make-dir", + "sourceRepoURL": "https://github.com/sindresorhus/make-dir", + "asOfVersion": "2.1.0" + }, { "libraryName": "mali", "typingsPackageName": "mali", @@ -1098,6 +1134,12 @@ "sourceRepoURL": "https://github.com/LearnBoost/monk.git", "asOfVersion": "6.0.0" }, + { + "libraryName": "move-file", + "typingsPackageName": "move-file", + "sourceRepoURL": "https://github.com/sindresorhus/move-file", + "asOfVersion": "1.1.0" + }, { "libraryName": "MQTT", "typingsPackageName": "mqtt", @@ -1152,6 +1194,12 @@ "sourceRepoURL": "https://github.com/foretagsplatsen/numbro/", "asOfVersion": "1.9.3" }, + { + "libraryName": "on-change", + "typingsPackageName": "on-change", + "sourceRepoURL": "https://github.com/sindresorhus/on-change", + "asOfVersion": "1.1.0" + }, { "libraryName": "Onsen UI", "typingsPackageName": "onsenui", @@ -1169,7 +1217,6 @@ "typingsPackageName": "p-limit", "sourceRepoURL": "https://github.com/sindresorhus/p-limit", "asOfVersion": "2.2.0" - }, { "libraryName": "p-map", @@ -1309,6 +1356,12 @@ "sourceRepoURL": "https://github.com/kazuhikoarase/qrcode-generator", "asOfVersion": "1.0.6" }, + { + "libraryName": "query-string", + "typingsPackageName": "query-string", + "sourceRepoURL": "https://github.com/sindresorhus/query-string", + "asOfVersion": "6.3.0" + }, { "libraryName": "Raven JS", "typingsPackageName": "raven-js", diff --git a/types/camelcase/camelcase-tests.ts b/types/camelcase/camelcase-tests.ts deleted file mode 100644 index 871ec5c3b2..0000000000 --- a/types/camelcase/camelcase-tests.ts +++ /dev/null @@ -1,10 +0,0 @@ -import camelCase = require('camelcase'); - -camelCase('foo-bar'); -camelCase('foo_bar'); -camelCase('Foo-Bar'); -camelCase('--foo.bar'); -camelCase('__foo__bar__'); -camelCase('foo bar'); -camelCase('foo', 'bar'); -camelCase('__foo__', '--bar'); diff --git a/types/camelcase/index.d.ts b/types/camelcase/index.d.ts deleted file mode 100644 index 83abf5a8a5..0000000000 --- a/types/camelcase/index.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -// Type definitions for camelcase 4.1 -// Project: https://github.com/sindresorhus/camelcase -// Definitions by: Sam Verschueren -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export = camelcase; - -declare function camelcase(...args: string[]): string; -declare namespace camelcase {} diff --git a/types/camelcase/tsconfig.json b/types/camelcase/tsconfig.json deleted file mode 100644 index bcc1b505e1..0000000000 --- a/types/camelcase/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "camelcase-tests.ts" - ] -} \ No newline at end of file diff --git a/types/camelcase/tslint.json b/types/camelcase/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/camelcase/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" } diff --git a/types/conf/conf-tests.ts b/types/conf/conf-tests.ts deleted file mode 100644 index ce67cd4799..0000000000 --- a/types/conf/conf-tests.ts +++ /dev/null @@ -1,54 +0,0 @@ -import Conf = require('conf'); - -const conf = new Conf(); -new Conf({ - defaults: { - foo: 'bar', - unicorn: 'rainbow', - }, -}); -new Conf({ configName: '' }); -new Conf({ projectName: 'foo' }); -new Conf({ cwd: '' }); -new Conf({ encryptionKey: '' }); -new Conf({ encryptionKey: new Buffer('') }); -new Conf({ encryptionKey: new Uint8Array([1]) }); -new Conf({ encryptionKey: new DataView(new ArrayBuffer(2)) }); -new Conf({ fileExtension: '.foo' }); - -// $ExpectError -new Conf({ - defaults: { - foo: 'bar', - unicorn: ['rainbow'], - }, -}); -conf.set('foo', 'bar'); -conf.set('hello', 1); -conf.set('unicorn', false); -conf.set('null', null); // $ExpectError - -conf.get('foo'); // $ExpectType string | number | boolean -conf.get('foo', 'bar'); // $ExpectType string | number | boolean -conf.get('foo', null); // $ExpectError -conf.delete('foo'); -conf.has('foo'); // $ExpectType boolean -conf.clear(); -conf.onDidChange('foo', (oldVal, newVal) => { - // $ExpectType string | number | boolean | undefined - oldVal; - // $ExpectType string | number | boolean | undefined - newVal; -}); - -conf.size; // $ExpectType number -conf.store = { - foo: 'bar', - unicorn: 'rainbow', -}; -conf.path; // $ExpectType string - -for (const [key, value] of conf) { - key; // $ExpectType string - value; // $ExpectType string | number | boolean -} diff --git a/types/conf/index.d.ts b/types/conf/index.d.ts deleted file mode 100644 index 57d7285a3e..0000000000 --- a/types/conf/index.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -// Type definitions for conf 2.1 -// Project: https://github.com/sindresorhus/conf -// Definitions by: Sam Verschueren -// BendingBender -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -/// - -declare class Conf implements Iterable<[string, T]> { - store: { [key: string]: T }; - readonly path: string; - readonly size: number; - - constructor(options?: Conf.Options); - get(key: string, defaultValue?: T): T; - set(key: string, val: T): void; - set(object: { [key: string]: T }): void; - has(key: string): boolean; - delete(key: string): void; - clear(): void; - onDidChange(key: string, callback: (oldVal: T | undefined, newVal: T | undefined) => void): void; - [Symbol.iterator](): Iterator<[string, T]>; -} - -declare namespace Conf { - interface Options { - defaults?: { [key: string]: T }; - configName?: string; - projectName?: string; - cwd?: string; - encryptionKey?: string | Buffer | NodeJS.TypedArray | DataView; - fileExtension?: string; - } -} - -export = Conf; diff --git a/types/conf/tsconfig.json b/types/conf/tsconfig.json deleted file mode 100644 index 479fa6b41f..0000000000 --- a/types/conf/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "target": "es6", - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "conf-tests.ts" - ] -} diff --git a/types/conf/tslint.json b/types/conf/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/conf/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" } diff --git a/types/conf/v0/conf-tests.ts b/types/conf/v0/conf-tests.ts deleted file mode 100644 index 1368e45c29..0000000000 --- a/types/conf/v0/conf-tests.ts +++ /dev/null @@ -1,20 +0,0 @@ -import Conf = require('conf'); - -const conf = new Conf(); -conf.set('foo', 'bar'); -conf.set('hello', 1); -conf.set('unicorn', false); -conf.set('object', { - foo: 'bar', - unicorn: ['rainbow'] -}); - -conf.get('foo'); -conf.delete('foo'); -conf.has('foo'); -conf.clear(); - -for (const [key, value] of conf) { - key; // $ExpectType string - value; // $ExpectType string | number | boolean | symbol | {} -} diff --git a/types/conf/v0/index.d.ts b/types/conf/v0/index.d.ts deleted file mode 100644 index 21c136e823..0000000000 --- a/types/conf/v0/index.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Type definitions for conf 0.11 -// Project: https://github.com/sindresorhus/conf -// Definitions by: Sam Verschueren -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface Options { - defaults?: any; - configName?: string; - projectName?: string; - cwd?: string; -} - -declare class Conf implements Iterable<[string, string | number | boolean | symbol | {}]> { - path: string; - store: any; - - readonly size: number; - - constructor(options?: Options); - get(key: string): any; - set(key: string, val: string | number | boolean | symbol | {}): void; - set(object: {}): void; - has(key: string): boolean; - delete(key: string): void; - clear(): void; - [Symbol.iterator](): Iterator<[string, string | number | boolean | symbol | {}]>; -} - -export = Conf; diff --git a/types/conf/v0/tsconfig.json b/types/conf/v0/tsconfig.json deleted file mode 100644 index 004bd4a1b5..0000000000 --- a/types/conf/v0/tsconfig.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "target": "es6", - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../../", - "typeRoots": [ - "../../" - ], - "paths": { - "conf": [ - "conf/v0" - ] - }, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "conf-tests.ts" - ] -} \ No newline at end of file diff --git a/types/conf/v0/tslint.json b/types/conf/v0/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/conf/v0/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" } diff --git a/types/conf/v1/conf-tests.ts b/types/conf/v1/conf-tests.ts deleted file mode 100644 index 4ee492da8d..0000000000 --- a/types/conf/v1/conf-tests.ts +++ /dev/null @@ -1,41 +0,0 @@ -import Conf = require('conf'); - -const conf = new Conf(); -new Conf({ - defaults: { - foo: 'bar', - unicorn: 'rainbow', - }, - configName: '', - projectName: 'foo', - cwd: '', -}); -// $ExpectError -new Conf({ - defaults: { - foo: 'bar', - unicorn: ['rainbow'], - }, -}); -conf.set('foo', 'bar'); -conf.set('hello', 1); -conf.set('unicorn', false); -conf.set('null', null); // $ExpectError - -conf.get('foo'); // $ExpectType string | number | boolean -conf.get('foo', 'bar'); // $ExpectType string | number | boolean -conf.get('foo', null); // $ExpectError -conf.delete('foo'); -conf.has('foo'); // $ExpectType boolean -conf.clear(); - -conf.store = { - foo: 'bar', - unicorn: 'rainbow', -}; -conf.path; // $ExpectType string - -for (const [key, value] of conf) { - key; // $ExpectType string - value; // $ExpectType string | number | boolean -} diff --git a/types/conf/v1/index.d.ts b/types/conf/v1/index.d.ts deleted file mode 100644 index f08cff1584..0000000000 --- a/types/conf/v1/index.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -// Type definitions for conf 1.4 -// Project: https://github.com/sindresorhus/conf -// Definitions by: Sam Verschueren -// BendingBender -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -interface Options { - defaults?: { [key: string]: T }; - configName?: string; - projectName?: string; - cwd?: string; -} - -declare class Conf implements Iterable<[string, T]> { - store: { [key: string]: T }; - readonly path: string; - readonly size: number; - - constructor(options?: Options); - get(key: string, defaultValue?: T): T; - set(key: string, val: T): void; - set(object: { [key: string]: T }): void; - has(key: string): boolean; - delete(key: string): void; - clear(): void; - onDidChange(key: string, callback: (oldVal: any, newVal: any) => void): void; - [Symbol.iterator](): Iterator<[string, T]>; -} - -export = Conf; diff --git a/types/conf/v1/tsconfig.json b/types/conf/v1/tsconfig.json deleted file mode 100644 index 86b3a62f41..0000000000 --- a/types/conf/v1/tsconfig.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "target": "es6", - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../../", - "typeRoots": [ - "../../" - ], - "paths": { - "conf": [ - "conf/v1" - ] - }, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "conf-tests.ts" - ] -} diff --git a/types/conf/v1/tslint.json b/types/conf/v1/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/conf/v1/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" } diff --git a/types/env-paths/env-paths-tests.ts b/types/env-paths/env-paths-tests.ts deleted file mode 100644 index 9f360bbe41..0000000000 --- a/types/env-paths/env-paths-tests.ts +++ /dev/null @@ -1,10 +0,0 @@ -import envPaths = require('env-paths'); - -// $ExpectType Paths -envPaths('./'); -// $ExpectType Paths -envPaths('./', {suffix: 'test'}); -// $ExpectType Paths -envPaths('./', {suffix: false}); -// $ExpectType Paths -envPaths('./', {suffix: true}); diff --git a/types/env-paths/index.d.ts b/types/env-paths/index.d.ts deleted file mode 100644 index 8b594d8a61..0000000000 --- a/types/env-paths/index.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -// Type definitions for env-paths 1.0 -// Project: https://github.com/sindresorhus/env-paths -// Definitions by: Daniel Byrne -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export = envPaths; - -declare function envPaths(name: string, opts?: { suffix: string | boolean }): envPaths.Paths; - -declare namespace envPaths { - interface Paths { - readonly data: string; - readonly config: string; - readonly cache: string; - readonly log: string; - readonly temp: string; - } -} diff --git a/types/env-paths/tsconfig.json b/types/env-paths/tsconfig.json deleted file mode 100644 index 62dcbca022..0000000000 --- a/types/env-paths/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": ["es6"], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": ["../"], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "env-paths-tests.ts" - ] -} diff --git a/types/env-paths/tslint.json b/types/env-paths/tslint.json deleted file mode 100644 index d88586e5bd..0000000000 --- a/types/env-paths/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "dtslint/dt.json" -} diff --git a/types/globby/globby-tests.ts b/types/globby/globby-tests.ts deleted file mode 100644 index e1a57adb74..0000000000 --- a/types/globby/globby-tests.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { IOptions } from 'glob'; - -import globby = require('globby'); - -(async () => { - let result: string[]; - - /** - * Standard `pattern` usage - */ - result = await globby('*.tmp'); - result = await globby(['a.tmp', '*.tmp', '!{c,d,e}.tmp']); - - result = globby.sync('*.tmp'); - result = globby.sync(['a.tmp', '*.tmp', '!{c,d,e}.tmp']); - - /** - * `expandDirectories` option - */ - result = await globby('*.tmp', { expandDirectories: false }); - result = globby.sync('*.tmp', { expandDirectories: false }); - result = await globby('*.tmp', { expandDirectories: ['a*', 'b*'] }); - result = globby.sync('*.tmp', { expandDirectories: ['a*', 'b*'] }); - result = await globby('*.tmp', { - expandDirectories: { - files: ['a', 'b'], - extensions: ['tmp'] - } - }); - result = globby.sync('*.tmp', { - expandDirectories: { - files: ['a', 'b'], - extensions: ['tmp'] - } - }); - - /** - * Options passed through from `fast-glob` - */ - result = await globby('*.tmp', { ignore: ['**/b.tmp'] }); - result = globby.sync('*.tmp', { ignore: ['**/b.tmp'] }); -})(); - -const tasks: Array<{ - pattern: string; - options: IOptions; -}> = globby.generateGlobTasks(['*.tmp', '!b.tmp'], { ignore: ['c.tmp'] }); - -console.log(globby.hasMagic('**')); -console.log(globby.hasMagic(['**', 'path1', 'path2'])); -console.log(!globby.hasMagic(['path1', 'path2'])); - -(async () => { - let result: (path: string) => boolean; - - /** - * Standard `gitignore` usage - */ - result = await globby.gitignore(); - result = globby.gitignore.sync(); - - /** With options */ - result = await globby.gitignore({ - cwd: __dirname, - ignore: ['**/b.tmp'] - }); - result = globby.gitignore.sync({ - cwd: __dirname, - ignore: ['**/b.tmp'] - }); -})(); diff --git a/types/globby/index.d.ts b/types/globby/index.d.ts deleted file mode 100644 index af49813432..0000000000 --- a/types/globby/index.d.ts +++ /dev/null @@ -1,99 +0,0 @@ -// Type definitions for globby 8.0 -// Project: https://github.com/sindresorhus/globby#readme -// Definitions by: Douglas Duteil -// Ika -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -import { IOptions as NodeGlobOptions } from 'glob'; -import { Options as FastGlobOptions } from 'fast-glob'; - -type ExpandDirectoriesOption = boolean | string[] | { files: string[]; extensions: string[] }; - -interface Options extends FastGlobOptions { - /** - * If set to `true`, `globby` will automatically glob directories for you. - * If you define an `Array` it will only glob files that matches the patterns inside the Array. - * You can also define an `Object` with `files` and `extensions` like below: - * - * ```js - * (async () => { - * const paths = await globby('images', { - * expandDirectories: { - * files: ['cat', 'unicorn', '*.jpg'], - * extensions: ['png'] - * } - * }); - * console.log(paths); - * //=> ['cat.png', 'unicorn.png', 'cow.jpg', 'rainbow.jpg'] - * })(); - * ``` - * - * Note that if you set this option to `false`, you won't get back matched directories unless - * you set `onlyFiles: false`. - */ - expandDirectories?: ExpandDirectoriesOption; - /** - * Respect ignore patterns in `.gitignore` files that apply to the globbed files. - */ - gitignore?: boolean; -} - -/** - * Returns a `Promise` of matching paths. - */ -declare function globby(patterns: string | string[], options?: Options): Promise; - -declare namespace globby { - /** - * Returns an `Array` of matching paths. - */ - function sync(patterns: string | string[], options?: Options): string[]; - /** - * Returns an `Array` in the format `{ pattern: string, opts: Object }`, - * which can be passed as arguments to [`fast-glob`](https://github.com/mrmlnc/fast-glob). - * This is useful for other globbing-related packages. - * - * Note that you should avoid running the same tasks multiple times as they contain a file system cache. - * Instead, run this method each time to ensure file system changes are taken into consideration. - */ - function generateGlobTasks(patterns: string | string[], options?: Options): Array<{ pattern: string; options: Options }>; - /** - * Returns a boolean of whether there are any special glob characters in the `patterns`. - * - * Note that the options affect the results. If `noext: true` is set, then `+(a|b)` will not - * be considered a magic pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}`, - * then that is considered magical, unless `nobrace: true` is set. - * - * This function is backed by [`node-glob`](https://github.com/isaacs/node-glob#globhasmagicpattern-options) - */ - function hasMagic(patterns: string | string[], options?: NodeGlobOptions): boolean; - /** - * Returns a Promise<(path: string) => boolean> indicating whether a given path is ignored - * via a `.gitignore` file. - * - * Takes `cwd?: string` and `ignore?: string[]` as options. `.gitignore` files matched by the - * ignore config are not used for the resulting filter function. - * - * ```js - * const {gitignore} = require('globby'); - * - * (async () => { - * const isIgnored = await gitignore(); - * console.log(isIgnored('some/file')); - * })(); - * ``` - */ - function gitignore(options?: { cwd?: string; ignore?: string[]; }): Promise<(path: string) => boolean>; - - namespace gitignore { - /** - * Returns a `(path: string) => boolean` indicating whether a given path is ignored via a `.gitignore` file. - * - * Takes the same options as `globby.gitignore`. - */ - function sync(options?: { cwd?: string; ignore?: string[]; }): (path: string) => boolean; - } -} - -export = globby; diff --git a/types/globby/package.json b/types/globby/package.json deleted file mode 100644 index 136d4694e9..0000000000 --- a/types/globby/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "private": true, - "dependencies": { - "fast-glob": "^2.0.2" - } -} diff --git a/types/globby/tsconfig.json b/types/globby/tsconfig.json deleted file mode 100644 index 5cc0a3fe62..0000000000 --- a/types/globby/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "target": "es6", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "globby-tests.ts" - ] -} \ No newline at end of file diff --git a/types/globby/tslint.json b/types/globby/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/globby/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" } diff --git a/types/log-update/index.d.ts b/types/log-update/index.d.ts deleted file mode 100644 index 544223a766..0000000000 --- a/types/log-update/index.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -// Type definitions for log-update 2.0 -// Project: https://github.com/sindresorhus/log-update#readme -// Definitions by: BendingBender -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -export = logUpdate; - -declare function logUpdate(...text: string[]): void; - -declare namespace logUpdate { - function clear(): void; - function done(): void; - const stderr: typeof logUpdate; - function create(stream: NodeJS.WritableStream): typeof logUpdate; -} diff --git a/types/log-update/log-update-tests.ts b/types/log-update/log-update-tests.ts deleted file mode 100644 index 9a0955f7d4..0000000000 --- a/types/log-update/log-update-tests.ts +++ /dev/null @@ -1,19 +0,0 @@ -import logUpdate = require('log-update'); - -logUpdate(` - ♄♄ - unicorns - ♄♄ -`); - -logUpdate.clear(); -logUpdate.done(); - -logUpdate.stderr('oh', 'my', 'oh', 'my'); -logUpdate.stderr.clear(); -logUpdate.stderr.done(); - -const logStdOut = logUpdate.create(process.stdout); -logStdOut('oh', 'my', 'oh', 'my'); -logStdOut.clear(); -logStdOut.done(); diff --git a/types/log-update/tsconfig.json b/types/log-update/tsconfig.json deleted file mode 100644 index 888455297b..0000000000 --- a/types/log-update/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "log-update-tests.ts" - ] -} \ No newline at end of file diff --git a/types/log-update/tslint.json b/types/log-update/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/log-update/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" } diff --git a/types/make-dir/index.d.ts b/types/make-dir/index.d.ts deleted file mode 100644 index 1805280240..0000000000 --- a/types/make-dir/index.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -// Type definitions for make-dir 1.0 -// Project: https://github.com/sindresorhus/make-dir -// Definitions by: Ika -// BendingBender -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 - -/// -import * as fs from 'fs'; - -export = makeDir; - -/** - * Returns a `Promise` for the path to the created directory. - * @param path Directory to create. - */ -declare function makeDir(path: string, options?: makeDir.Options): Promise; - -declare namespace makeDir { - /** - * Returns the path to the created directory. - * @param path Directory to create. - */ - function sync(path: string, options?: Options): string; - - interface Options { - /** - * Default: `0o777 & (~process.umask())` - * - * Directory [permissions](https://x-team.com/blog/file-system-permissions-umask-node-js/). - */ - mode?: number; - - /** - * Default: `require('fs')` - * - * Use a custom `fs` implementation. For example [`graceful-fs`](https://github.com/isaacs/node-graceful-fs). - */ - fs?: typeof fs; - } -} diff --git a/types/make-dir/make-dir-tests.ts b/types/make-dir/make-dir-tests.ts deleted file mode 100644 index 2767706bf6..0000000000 --- a/types/make-dir/make-dir-tests.ts +++ /dev/null @@ -1,13 +0,0 @@ -import makeDir = require('make-dir'); -import * as fs from 'fs'; -import * as gfs from 'graceful-fs'; - -makeDir('path/to/somewhere').then(dirname => { - // do something -}); - -const dirname = makeDir.sync('path/to/somewhere'); - -makeDir('path/to/somewhere', {mode: parseInt('777', 8)}); -makeDir('path/to/somewhere', {fs}); -makeDir('path/to/somewhere', {fs: gfs}); diff --git a/types/make-dir/tsconfig.json b/types/make-dir/tsconfig.json deleted file mode 100644 index f1770d52af..0000000000 --- a/types/make-dir/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "make-dir-tests.ts" - ] -} \ No newline at end of file diff --git a/types/make-dir/tslint.json b/types/make-dir/tslint.json deleted file mode 100644 index f93cf8562a..0000000000 --- a/types/make-dir/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "dtslint/dt.json" -} diff --git a/types/move-file/index.d.ts b/types/move-file/index.d.ts deleted file mode 100644 index 7c86feca71..0000000000 --- a/types/move-file/index.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -// Type definitions for move-file 1.0 -// Project: https://github.com/sindresorhus/move-file#readme -// Definitions by: BendingBender -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export = moveFile; - -declare function moveFile( - source: string, - destination: string, - options?: moveFile.Options -): Promise; - -declare namespace moveFile { - function sync(source: string, destination: string, options?: Options): void; - - interface Options { - overwrite?: boolean; - } -} diff --git a/types/move-file/move-file-tests.ts b/types/move-file/move-file-tests.ts deleted file mode 100644 index 36badd38c1..0000000000 --- a/types/move-file/move-file-tests.ts +++ /dev/null @@ -1,10 +0,0 @@ -import moveFile = require('move-file'); - -// $ExpectType Promise -moveFile('source/unicorn.png', 'destination/unicorn.png'); -// $ExpectType Promise -moveFile('source/unicorn.png', 'destination/unicorn.png', { overwrite: false }); -// $ExpectType void -moveFile.sync('source/unicorn.png', 'destination/unicorn.png'); -// $ExpectType void -moveFile.sync('source/unicorn.png', 'destination/unicorn.png', { overwrite: false }); diff --git a/types/move-file/tsconfig.json b/types/move-file/tsconfig.json deleted file mode 100644 index bcd3f7550e..0000000000 --- a/types/move-file/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "move-file-tests.ts" - ] -} diff --git a/types/move-file/tslint.json b/types/move-file/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/move-file/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" } diff --git a/types/on-change/index.d.ts b/types/on-change/index.d.ts deleted file mode 100644 index 44fff26e60..0000000000 --- a/types/on-change/index.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -// Type definitions for on-change 0.1 -// Project: https://github.com/sindresorhus/on-change#readme -// Definitions by: BendingBender -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 - -export = onChange; - -declare function onChange(object: T, onChange: () => void): T; diff --git a/types/on-change/on-change-tests.ts b/types/on-change/on-change-tests.ts deleted file mode 100644 index 003d89aab7..0000000000 --- a/types/on-change/on-change-tests.ts +++ /dev/null @@ -1,17 +0,0 @@ -import onChange = require('on-change'); - -const object = { - foo: false, - a: { - b: [ - { - c: false, - }, - ], - }, -}; - -const watchedObject = onChange(object, () => {}); - -watchedObject.foo = true; -watchedObject.a.b[0].c = true; diff --git a/types/on-change/tsconfig.json b/types/on-change/tsconfig.json deleted file mode 100644 index 433629ab82..0000000000 --- a/types/on-change/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "on-change-tests.ts" - ] -} diff --git a/types/on-change/tslint.json b/types/on-change/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/on-change/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" } diff --git a/types/query-string/index.d.ts b/types/query-string/index.d.ts deleted file mode 100644 index 3eaf34c159..0000000000 --- a/types/query-string/index.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -// Type definitions for query-string 6.2 -// Project: https://github.com/sindresorhus/query-string -// Definitions by: Sam Verschueren -// Tanguy Krotoff -// HuHuanming -// Madara Uchiha -// Josh Holmer -// Simon Van den Broeck -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 - -export interface ParseOptions { - arrayFormat?: 'bracket' | 'index' | 'none'; - decode?: boolean; -} - -export interface InputParams { - [key: string]: any; -} - -export interface OutputParams { - [key: string]: string | string[] | undefined; -} - -/** - * Parse a query string into an object. - * Leading ? or # are ignored, so you can pass location.search or location.hash directly. - */ -export function parse(str: string, options?: ParseOptions): OutputParams; - -export function parseUrl(str: string, options?: ParseOptions): {url: string, query: OutputParams}; - -export interface StringifyOptions { - strict?: boolean; - encode?: boolean; - arrayFormat?: 'bracket' | 'index' | 'none'; - sort?: ((m: string, n: string) => boolean) | boolean; -} - -/** - * Stringify an object into a query string, sorting the keys. - */ -export function stringify(obj: InputParams, options?: StringifyOptions): string; - -/** - * Extract a query string from a URL that can be passed into .parse(). - */ -export function extract(str: string): string; diff --git a/types/query-string/query-string-tests.ts b/types/query-string/query-string-tests.ts deleted file mode 100644 index 33152ce445..0000000000 --- a/types/query-string/query-string-tests.ts +++ /dev/null @@ -1,44 +0,0 @@ -import * as queryString from 'query-string'; - -// stringify -{ - let result: string; - // test obj - result = queryString.stringify({ - str: 'bar', - strArray: ['baz'], - num: 123, - numArray: [456], - bool: true, - boolArray: [false] - }); - - // test options - result = queryString.stringify({ foo: 'bar' }, { strict: false }); - result = queryString.stringify({ foo: 'bar' }, { encode: false }); - result = queryString.stringify({ foo: 'bar' }, { strict: false, encode: false }); -} - -// For each section below, the second line ensures the real answer is of the declared -// type. You can find the real answer by running the first line of each section. - -// parse -{ - let fooBar = queryString.parse('?foo=bar'); - fooBar = {foo: "bar"}; - - let fooBarBaz1 = queryString.parse('&foo=bar&foo=baz'); - fooBarBaz1 = { foo: [ 'bar', 'baz' ] }; - - let fooBarBaz2 = queryString.parse('&foo[]=bar&foo[]=baz', {arrayFormat: 'bracket'}); - fooBarBaz2 = { foo: [ 'bar', 'baz' ] }; -} - -// extract -{ - let result1 = queryString.extract('http://foo.bar/?abc=def&hij=klm'); - result1 = 'abc=def&hij=klm'; - - let result2 = queryString.extract('http://foo.bar/?foo=bar'); - result2 = 'foo=bar'; -} diff --git a/types/query-string/tsconfig.json b/types/query-string/tsconfig.json deleted file mode 100644 index 83d5a52072..0000000000 --- a/types/query-string/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "query-string-tests.ts" - ] -} \ No newline at end of file diff --git a/types/query-string/tslint.json b/types/query-string/tslint.json deleted file mode 100644 index e765bc9e16..0000000000 --- a/types/query-string/tslint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "no-single-declare-module": false - } -} From 7059ba1e9f54c3c439d522b7234e2a7dde8103a0 Mon Sep 17 00:00:00 2001 From: Vincent Pizzo Date: Tue, 5 Mar 2019 14:31:36 -0800 Subject: [PATCH 395/924] Don't use patch in version --- types/react-csv/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-csv/index.d.ts b/types/react-csv/index.d.ts index 2fe767d3e7..1390ce1361 100644 --- a/types/react-csv/index.d.ts +++ b/types/react-csv/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-csv 1.1.1 +// Type definitions for react-csv 1.1 // Project: https://github.com/react-csv/react-csv // Definitions by: Vincent Pizzo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 52b5a630abe0329c02208051dd211d5799bf92a3 Mon Sep 17 00:00:00 2001 From: Anthony Heber Date: Tue, 5 Mar 2019 15:39:05 -0700 Subject: [PATCH 396/924] Add tests for new "on" bindings --- types/flickity/flickity-tests.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/types/flickity/flickity-tests.ts b/types/flickity/flickity-tests.ts index 63943119b4..8686d2f587 100644 --- a/types/flickity/flickity-tests.ts +++ b/types/flickity/flickity-tests.ts @@ -140,3 +140,23 @@ let flikty4: Flickity = new Flickity(new HTMLElement(), { x3: 30 } }); + +let flikty5: Flickity = new Flickity(new HTMLElement(), { + on: { + ready: () => {}, + change: (index) => {}, + select: (index) => {}, + settle: (index) => {}, + scroll: (progress) => {}, + dragStart: (event, pointer) => {}, + dragMove: (event, pointer, moveVector) => {}, + dragEnd: (event, pointer) => {}, + pointerDown: (event, pointer) => {}, + pointerMove: (event, pointer, moveVector) => {}, + pointerUp: (event, pointer) => {}, + staticClick: (event, pointer, cellElement, cellIndex) => {}, + lazyLoad: (event, cellElement) => {}, + bgLazyLoad: (event, element) => {}, + fullscreenChange: (isFullscreen) => {} + } +}); From d26a3f72ae00530a0a8a170393da5a1e47581080 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Tue, 5 Mar 2019 14:39:38 -0800 Subject: [PATCH 397/924] Cleanup from DT nightly run 1. A couple of updated project urls. (one typo and one https) 2. Possible bug in ts@next, or at least surprising behaviour. Work around it in jest-in-case. TS bug #30234 --- types/chart.js/index.d.ts | 2 +- types/jest-in-case/jest-in-case-tests.ts | 4 ++-- types/storybook__addon-storyshots/index.d.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts index 7745713c84..e2af872c9e 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for Chart.js 2.7 -// Project: https://github.com/nnnick/Chart.js, http://www.chartjs.org +// Project: https://github.com/nnnick/Chart.js, https://www.chartjs.org // Definitions by: Alberto Nuti // Fabien Lavocat // KentarouTakeda diff --git a/types/jest-in-case/jest-in-case-tests.ts b/types/jest-in-case/jest-in-case-tests.ts index b38ccff0bc..2e3631efab 100644 --- a/types/jest-in-case/jest-in-case-tests.ts +++ b/types/jest-in-case/jest-in-case-tests.ts @@ -25,7 +25,7 @@ afterEach(() => { test('array', () => { const title = 'add(augend, addend)'; - const tester = jest.fn(opts => { + const tester = jest.fn((opts, cb) => { expect(add(opts.augend, opts.addend)).toBe(opts.total); }); @@ -59,7 +59,7 @@ test('object', () => { const title = 'add(augend, addend)'; - const tester = jest.fn(opts => { + const tester = jest.fn((opts, cb) => { expect(subtract(opts.minuend, opts.subtrahend)).toBe(opts.difference); }); diff --git a/types/storybook__addon-storyshots/index.d.ts b/types/storybook__addon-storyshots/index.d.ts index 546386ce40..6310e7f55e 100644 --- a/types/storybook__addon-storyshots/index.d.ts +++ b/types/storybook__addon-storyshots/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for @storybook/addon-storyshots 3.4 -// Project: https://github.com/storybooks/storybook/tree/master/addons/storyshots, https://github.com/storybooks/storybook/tree/master/addons/storyshorts/storyshots-core +// Project: https://github.com/storybooks/storybook/tree/master/addons/storyshots, https://github.com/storybooks/storybook/tree/master/addons/storyshots/storyshots-core // Definitions by: Bradley Ayers // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 3.1 From b6265bae6fc5a9a751eb62b288bdb7b75195bfa4 Mon Sep 17 00:00:00 2001 From: Anthony Heber Date: Tue, 5 Mar 2019 15:43:58 -0700 Subject: [PATCH 398/924] Clean up linting --- types/flickity/index.d.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/types/flickity/index.d.ts b/types/flickity/index.d.ts index 880b53943a..5d9f3fa510 100644 --- a/types/flickity/index.d.ts +++ b/types/flickity/index.d.ts @@ -512,7 +512,6 @@ interface FlickityOptions { * Bind events within Flickity's options by setting on to an Object. The object's keys should match the event names. on is useful for capturing events as Flickity is initialized, like ready */ on?: { - /** * Triggered after Flickity has been activated. */ @@ -525,9 +524,7 @@ interface FlickityOptions { /** * Triggered when a slide is selected. - * * select is triggered any time a slide is selected, even on the same slide. change is triggered only when a different slide is selected. - * * This event was previously cellSelect in Flickity v1. cellSelect will continue to work in Flickity v2. */ select?: (index?: Number) => void; @@ -574,7 +571,6 @@ interface FlickityOptions { /** * Triggered when the user's pointer is pressed and unpressed and has not moved enough to start dragging. - * * click events are hard to detect with draggable UI, as they are triggered whenever a user drags. Flickity's staticClick event resolves this, as it is triggered when the user has not dragged. */ staticClick?: (event?: Event, pointer?: Element | Touch, cellElement?: Element, cellIndex?: Number) => void; @@ -593,5 +589,5 @@ interface FlickityOptions { * Triggered after entering or exiting fullscreen view. */ fullscreenChange?: (isFullscreen?: Boolean) => void; - } + }; } From 9929fd321f9f12616851f65d817f16572e30066b Mon Sep 17 00:00:00 2001 From: Jamie Sykes Date: Tue, 5 Mar 2019 22:46:02 +0000 Subject: [PATCH 399/924] Update examples. --- types/collectionsjs/collectionsjs-tests.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/types/collectionsjs/collectionsjs-tests.ts b/types/collectionsjs/collectionsjs-tests.ts index bc71c9e544..3748dc234e 100644 --- a/types/collectionsjs/collectionsjs-tests.ts +++ b/types/collectionsjs/collectionsjs-tests.ts @@ -30,7 +30,7 @@ collection.contains(stark => stark.name === 'John Snow'); // $ExpectType boolean collection.count(); // $ExpectType number collection.each(stark => stark.age = 3); // $ExpectType Collection<{ name: string; age: number; }> collection.filter(stark => stark.age === 14); // $ExpectType Collection<{ name: string; age: number; }> -collection.find('bran'); // $ExpectType number +collection.find({ name: 'Bran Stark', age: 7 }); // $ExpectType number collection.first(item => item.age > 7); // $ExpectType { name: string; age: number; } collection.flatten(true); // $ExpectType Collection<{ name: string; age: number; }> collection.get(2); // $ExpectType { name: string; age: number; } @@ -41,7 +41,11 @@ collection.last(); // $ExpectType { name: string; age: number; } collection.map(stark => stark.name); // $ExpectType Collection<{ name: string; age: number; }> collection.pluck('name'); // $ExpectType Collection<{ name: string; age: number; }> collection.push({name: 'Robb Stark', age: 17}); // $ExpectType Collection<{ name: string; age: number; }> -collection.reduce((previous, current) => previous.age + current.age, 0); // $ExpectType any + +const value = new Collection([1, 2, 3]).reduce( + (previous, current) => previous + current, + 0 + ); // $ExpectType number collection.reject(stark => stark.age < 14); // $ExpectType Collection<{ name: string; age: number; }> collection.remove({name: 'Robb Stark', age: 17}); // $ExpectType boolean collection.reverse(); // $ExpectType Collection<{ name: string; age: number; }> From fa2d5d5e91e661d6891f1871f60652b38bcbf47d Mon Sep 17 00:00:00 2001 From: Jamie Sykes Date: Tue, 5 Mar 2019 22:51:45 +0000 Subject: [PATCH 400/924] Amend a few tests and types for linting. --- types/collectionsjs/collectionsjs-tests.ts | 10 ++-------- types/collectionsjs/index.d.ts | 6 +++--- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/types/collectionsjs/collectionsjs-tests.ts b/types/collectionsjs/collectionsjs-tests.ts index 3748dc234e..5f40824445 100644 --- a/types/collectionsjs/collectionsjs-tests.ts +++ b/types/collectionsjs/collectionsjs-tests.ts @@ -41,11 +41,7 @@ collection.last(); // $ExpectType { name: string; age: number; } collection.map(stark => stark.name); // $ExpectType Collection<{ name: string; age: number; }> collection.pluck('name'); // $ExpectType Collection<{ name: string; age: number; }> collection.push({name: 'Robb Stark', age: 17}); // $ExpectType Collection<{ name: string; age: number; }> - -const value = new Collection([1, 2, 3]).reduce( - (previous, current) => previous + current, - 0 - ); // $ExpectType number +const value = new Collection([1, 2, 3]).reduce((previous, current) => previous + current, 0); // $ExpectType number collection.reject(stark => stark.age < 14); // $ExpectType Collection<{ name: string; age: number; }> collection.remove({name: 'Robb Stark', age: 17}); // $ExpectType boolean collection.reverse(); // $ExpectType Collection<{ name: string; age: number; }> @@ -56,9 +52,7 @@ collection.sortBy('name'); // $ExpectType Collection<{ name: string; age: number collection.stringify(); // $ExpectType string collection.sum('age'); // $ExpectType any collection.take(2); // $ExpectType Collection<{ name: string; age: number; }> - -// Collection.macro('addToMembers', (collection, n) => collection.map((collectionItem: any) => collectionItem + n)); -// const collection2 = new Collection([1,2,3,4]).addToMembers(3); +Collection.macro('addToMembers', (collection, n) => collection.map((collectionItem: any) => collectionItem + n)); collection.unique(stark => stark.age); // $ExpectType Collection<{ name: string; age: number; }> collection.values(); // $ExpectType Collection<{ name: string; age: number; }> diff --git a/types/collectionsjs/index.d.ts b/types/collectionsjs/index.d.ts index 364877050d..aaf92fe61e 100644 --- a/types/collectionsjs/index.d.ts +++ b/types/collectionsjs/index.d.ts @@ -36,12 +36,12 @@ export default class Collection { sort(compare?: () => boolean): Collection; sortBy(property: string, order?: string): Collection; stringify(): string; - sum(property: T extends object ? keyof T : never): number + sum(property: T extends object ? keyof T : never): number; take(count: number): Collection; static macro(name: string, callback: (coll: Collection, ...args: unknown[]) => unknown): void; unique(callback?: string|null|((item: T) => any)): Collection; values(): Collection; - where(key: K, value: T[K]): Collection - where(callback: (item: T) => boolean): Collection + where(key: K, value: T[K]): Collection; + where(callback: (item: T) => boolean): Collection; zip(array: T[]|Collection): Collection; } From ee356e5c4ddbf0b5c95e27e449f6a7dfee2061e6 Mon Sep 17 00:00:00 2001 From: Jamie Sykes Date: Tue, 5 Mar 2019 22:55:55 +0000 Subject: [PATCH 401/924] Picks up on the final two issues during testing. --- types/collectionsjs/collectionsjs-tests.ts | 2 +- types/collectionsjs/index.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/collectionsjs/collectionsjs-tests.ts b/types/collectionsjs/collectionsjs-tests.ts index 5f40824445..98cc95cabc 100644 --- a/types/collectionsjs/collectionsjs-tests.ts +++ b/types/collectionsjs/collectionsjs-tests.ts @@ -50,7 +50,7 @@ collection.slice(1, 3); // $ExpectType Collection<{ name: string; age: number; } collection.sort(); // $ExpectType Collection<{ name: string; age: number; }> collection.sortBy('name'); // $ExpectType Collection<{ name: string; age: number; }> collection.stringify(); // $ExpectType string -collection.sum('age'); // $ExpectType any +collection.sum('age'); // $ExpectType number collection.take(2); // $ExpectType Collection<{ name: string; age: number; }> Collection.macro('addToMembers', (collection, n) => collection.map((collectionItem: any) => collectionItem + n)); diff --git a/types/collectionsjs/index.d.ts b/types/collectionsjs/index.d.ts index aaf92fe61e..1a9bfe7062 100644 --- a/types/collectionsjs/index.d.ts +++ b/types/collectionsjs/index.d.ts @@ -24,7 +24,7 @@ export default class Collection { join(separator?: string): string; keys(): Collection; last(callback?: ((item: T) => boolean)|null): T; - map(callback: (item: T) => R): Collection; + map(callback: (item: T) => R): Collection; pluck(property: string): Collection; push(item: T): Collection; reduce(callback: (previous: R, current: T) => R, initial: R): R; From ec421510feb521fd3a1c9892b518498222e2a903 Mon Sep 17 00:00:00 2001 From: Jamie Sykes Date: Tue, 5 Mar 2019 22:59:03 +0000 Subject: [PATCH 402/924] Found another issue with the map function. --- types/collectionsjs/collectionsjs-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/collectionsjs/collectionsjs-tests.ts b/types/collectionsjs/collectionsjs-tests.ts index 98cc95cabc..47ab0b00bb 100644 --- a/types/collectionsjs/collectionsjs-tests.ts +++ b/types/collectionsjs/collectionsjs-tests.ts @@ -38,7 +38,7 @@ collection.has({ name: 'Bran Stark', age: 7 }); // $ExpectType boolean collection.join(); // $ExpectType string collection.keys(); // $ExpectType Collection<{ name: string; age: number; }> collection.last(); // $ExpectType { name: string; age: number; } -collection.map(stark => stark.name); // $ExpectType Collection<{ name: string; age: number; }> +collection.map(stark => stark.name); // $ExpectType Collection collection.pluck('name'); // $ExpectType Collection<{ name: string; age: number; }> collection.push({name: 'Robb Stark', age: 17}); // $ExpectType Collection<{ name: string; age: number; }> const value = new Collection([1, 2, 3]).reduce((previous, current) => previous + current, 0); // $ExpectType number From 161917a82a844502caeac3687db37f4c1701959b Mon Sep 17 00:00:00 2001 From: Queenie Ma Date: Tue, 5 Mar 2019 15:00:24 -0800 Subject: [PATCH 403/924] Update keytar typings for v4.4.1 --- types/keytar/index.d.ts | 20 ++++++++++++++++---- types/keytar/keytar-tests.ts | 4 +++- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/types/keytar/index.d.ts b/types/keytar/index.d.ts index cf6a16e4f7..f5e8e7367a 100644 --- a/types/keytar/index.d.ts +++ b/types/keytar/index.d.ts @@ -1,6 +1,9 @@ -// Type definitions for keytar 4.0.2 +// Type definitions for keytar 4.4.1 // Project: http://atom.github.io/node-keytar/ -// Definitions by: Milan Burda , Brendan Forster , Hari Juturu +// Definitions by: Milan Burda +// Brendan Forster +// Hari Juturu +// Queenie Ma // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -15,7 +18,7 @@ export declare function getPassword(service: string, account: string): Promise; /** - * Add the password for the service and account to the keychain. + * Save the password for the service and account to the keychain. Adds a new entry if necessary, or updates an existing entry if one exists. * * @param service The string service name. * @param account The string account name. @@ -36,7 +39,16 @@ export declare function setPassword(service: string, account: string, password: export declare function deletePassword(service: string, account: string): Promise; /** - * Find a password for the service in the keychain. + * Find all accounts and password for the service in the keychain. + * + * @param service The string service name. + * + * @returns A promise for the credentials array. + */ +export declare function findCredentials(service: string): Promise>; + +/** + * Find a password for the service in the keychain. This is ideal for scenarios where an account is not required. * * @param service The string service name. * diff --git a/types/keytar/keytar-tests.ts b/types/keytar/keytar-tests.ts index f6873838c2..18a7423450 100644 --- a/types/keytar/keytar-tests.ts +++ b/types/keytar/keytar-tests.ts @@ -8,6 +8,8 @@ let success: Promise; success = keytar.deletePassword('keytar-tests', 'username'); let password: Promise; - password = keytar.findPassword('keytar-tests'); password = keytar.getPassword('keytar-tests', 'username'); + +let credentials: Promise>; +credentials = keytar.findCredentials('keytar-tests'); From 38c7f6fe6a1d02acfbf09a7ee369417504ebb9d5 Mon Sep 17 00:00:00 2001 From: zzanol Date: Tue, 5 Mar 2019 17:00:05 -0800 Subject: [PATCH 404/924] fix callback argument shape --- types/react-credit-cards/index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types/react-credit-cards/index.d.ts b/types/react-credit-cards/index.d.ts index 4cbf2f9830..015334e1c3 100644 --- a/types/react-credit-cards/index.d.ts +++ b/types/react-credit-cards/index.d.ts @@ -1,14 +1,14 @@ -// Type definitions for react-credit-cards 0.7 +// Type definitions for react-credit-cards 0.8 // Project: https://github.com/amarofashion/react-credit-cards -// Definitions by: Vytautas Strimaitis , Ole Frank +// Definitions by: Vytautas Strimaitis , Ole Frank , zzanol // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 import * as React from "react"; export interface CallbackArgument { - isValid: boolean; - type: { issuer: string; maxLength: number }; + issuer: string; + maxLength: number; } export type Focused = "name" | "number" | "expiry" | "cvc"; From 8b1beff944f6c7bf913b6fcee31fb5f7129064a7 Mon Sep 17 00:00:00 2001 From: James Reggio Date: Wed, 27 Feb 2019 11:52:11 -0800 Subject: [PATCH 405/924] [react-redux] Add NonReactStatics to ConnectedComponentClass --- types/react-redux/index.d.ts | 7 ++++- types/react-redux/react-redux-tests.tsx | 42 +++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/types/react-redux/index.d.ts b/types/react-redux/index.d.ts index 5adeb43612..624bc0b680 100644 --- a/types/react-redux/index.d.ts +++ b/types/react-redux/index.d.ts @@ -44,6 +44,8 @@ import { Store } from 'redux'; +import { NonReactStatics } from 'hoist-non-react-statics'; + // Omit taken from https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html export type Omit = Pick>; @@ -96,7 +98,10 @@ export type GetProps = C extends ComponentType ? P : never; // Applies LibraryManagedAttributes (proper handling of defaultProps // and propTypes), as well as defines WrappedComponent. -export type ConnectedComponentClass = ComponentClass> & { +export type ConnectedComponentClass< + C extends ComponentType, + P +> = ComponentClass> & NonReactStatics & { WrappedComponent: C; }; diff --git a/types/react-redux/react-redux-tests.tsx b/types/react-redux/react-redux-tests.tsx index ee5b9c1d94..085874a523 100644 --- a/types/react-redux/react-redux-tests.tsx +++ b/types/react-redux/react-redux-tests.tsx @@ -1167,6 +1167,48 @@ function TestLibraryManagedAttributes() { { }} />; } +function TestNonReactStatics() { + interface OwnProps { + bar: number; + } + + interface MapStateProps { + foo: string; + } + + class Component extends React.Component { + static defaultProps = { + bar: 0, + }; + + static meaningOfLife = 42; + + render() { + return
; + } + } + + function mapStateToProps(state: any): MapStateProps { + return { + foo: 'foo', + }; + } + + Component.meaningOfLife; + Component.defaultProps.bar; + + const ConnectedComponent = connect(mapStateToProps)(Component); + + // This is a non-React static and should be hoisted as-is. + ConnectedComponent.meaningOfLife; + + // This is a React static, so it's not hoisted. + // However, ConnectedComponent is still a ComponentClass, which specifies `defaultProps` + // as an optional static member. We can force an error (and assert that `defaultProps` + // wasn't hoisted) by reaching into the `defaultProps` object without a null check. + ConnectedComponent.defaultProps.bar; // $ExpectError +} + function TestProviderContext() { const store: Store = createStore((state = {}) => state); const nullContext = React.createContext(null); From 4aadffd8bcffa7dc0ba170414e78b020aa08b633 Mon Sep 17 00:00:00 2001 From: "Matt R. Wilson" Date: Tue, 5 Mar 2019 20:35:03 -0700 Subject: [PATCH 406/924] [express-bunyan-logger] Update Options. The options are passed through to bunyan.createLogger so all those options need to be valid. A `Partial` is used because the only required option by `createLogger` is `name` but the middleware provides a default. --- .../express-bunyan-logger/express-bunyan-logger-tests.ts | 9 +++++++++ types/express-bunyan-logger/index.d.ts | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/types/express-bunyan-logger/express-bunyan-logger-tests.ts b/types/express-bunyan-logger/express-bunyan-logger-tests.ts index daac949c0e..564f27d020 100644 --- a/types/express-bunyan-logger/express-bunyan-logger-tests.ts +++ b/types/express-bunyan-logger/express-bunyan-logger-tests.ts @@ -22,3 +22,12 @@ const logger = Bunyan.createLogger({ const middleware5 = expressBunyan({ logger }); + +expressBunyan({ + format: () => "some format", + genReqId: req => req.header("foo") || "other", + name: "foo_app", + parseUA: false, + serializers: Bunyan.stdSerializers, + streams: [{ level: 'info', stream: process.stdout }] +}); diff --git a/types/express-bunyan-logger/index.d.ts b/types/express-bunyan-logger/index.d.ts index 6697a26a20..45e3544a3d 100644 --- a/types/express-bunyan-logger/index.d.ts +++ b/types/express-bunyan-logger/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for express-bunyan-logger 1.3 // Project: https://github.com/villadora/express-bunyan-logger // Definitions by: Shrey Jain +// Matt R. Wilson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -17,7 +18,7 @@ declare namespace Factory { type RequestIdGenFunction = (req: express.Request) => string; type LevelFunction = (status: number, err: Error | null, meta: any) => string; - interface Options { + interface Options extends Partial { logger?: Bunyan; format?: string | FormatFunction; parseUA?: boolean; @@ -26,7 +27,6 @@ declare namespace Factory { excludes?: string[]; obfuscate?: string[]; obfuscatePlaceholder?: string; - serializers?: { [field: string]: Bunyan.Serializer }; immediate?: boolean; genReqId?: RequestIdGenFunction; } From 2ba47ba8919dbd7a7613a6c4fdbf687b86273538 Mon Sep 17 00:00:00 2001 From: pdeva Date: Tue, 5 Mar 2019 20:14:13 -0800 Subject: [PATCH 407/924] removing myself from list --- types/react-redux/index.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/types/react-redux/index.d.ts b/types/react-redux/index.d.ts index 5adeb43612..bd9ea1cae2 100644 --- a/types/react-redux/index.d.ts +++ b/types/react-redux/index.d.ts @@ -6,7 +6,6 @@ // Frank Tan // Nicholas Boll // Dibyo Majumdar -// Prashant Deva // Thomas Charlat // Valentin Descamps // Johann Rakotoharisoa From 1c3a4a3c99e3f9665cb1bd9f9b43356ddfa704d1 Mon Sep 17 00:00:00 2001 From: "Adam A. Zerella" Date: Wed, 6 Mar 2019 15:49:56 +1100 Subject: [PATCH 408/924] Added type defs for is-date-object --- types/is-date-object/index.d.ts | 8 +++++++ types/is-date-object/is-date-object-tests.ts | 14 +++++++++++ types/is-date-object/tsconfig.json | 25 ++++++++++++++++++++ types/is-date-object/tslint.json | 3 +++ 4 files changed, 50 insertions(+) create mode 100644 types/is-date-object/index.d.ts create mode 100644 types/is-date-object/is-date-object-tests.ts create mode 100644 types/is-date-object/tsconfig.json create mode 100644 types/is-date-object/tslint.json diff --git a/types/is-date-object/index.d.ts b/types/is-date-object/index.d.ts new file mode 100644 index 0000000000..08885dce51 --- /dev/null +++ b/types/is-date-object/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for is-date-object 1.0 +// Project: https://github.com/ljharb/is-date-object +// Definitions by: Adam Zerella +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function isDateObject(value?: any): boolean; + +export = isDateObject; diff --git a/types/is-date-object/is-date-object-tests.ts b/types/is-date-object/is-date-object-tests.ts new file mode 100644 index 0000000000..68fb22d684 --- /dev/null +++ b/types/is-date-object/is-date-object-tests.ts @@ -0,0 +1,14 @@ +import isDate = require("is-date-object"); + +isDate(); +isDate(undefined); +isDate(null); +isDate(false); +isDate(true); +isDate(42); +isDate('foo'); +isDate([]); +isDate({}); +isDate(/a/g); +isDate(new RegExp('a', 'g')); +isDate(new Date()); diff --git a/types/is-date-object/tsconfig.json b/types/is-date-object/tsconfig.json new file mode 100644 index 0000000000..7c42b57df2 --- /dev/null +++ b/types/is-date-object/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [ + + ], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "is-date-object-tests.ts" + ] +} diff --git a/types/is-date-object/tslint.json b/types/is-date-object/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/is-date-object/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file From 1f3fbac02514c332857735efbe8db0172109c1a1 Mon Sep 17 00:00:00 2001 From: "Adam A. Zerella" Date: Wed, 6 Mar 2019 16:57:59 +1100 Subject: [PATCH 409/924] Added type defs for date-now --- types/date-now/date-now-tests.ts | 5 +++++ types/date-now/index.d.ts | 8 ++++++++ types/date-now/seed.d.ts | 6 ++++++ types/date-now/tsconfig.json | 26 ++++++++++++++++++++++++++ types/date-now/tslint.json | 3 +++ 5 files changed, 48 insertions(+) create mode 100644 types/date-now/date-now-tests.ts create mode 100644 types/date-now/index.d.ts create mode 100644 types/date-now/seed.d.ts create mode 100644 types/date-now/tsconfig.json create mode 100644 types/date-now/tslint.json diff --git a/types/date-now/date-now-tests.ts b/types/date-now/date-now-tests.ts new file mode 100644 index 0000000000..f16487de44 --- /dev/null +++ b/types/date-now/date-now-tests.ts @@ -0,0 +1,5 @@ +import seeded = require('date-now/seed'); +import dateNow = require('date-now'); + +seeded(123); +dateNow(); diff --git a/types/date-now/index.d.ts b/types/date-now/index.d.ts new file mode 100644 index 0000000000..7ed6ab7df3 --- /dev/null +++ b/types/date-now/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for date-now 1.0 +// Project: https://github.com/Raynos/date-now +// Definitions by: Adam Zerella +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function dateNow(): number; + +export = dateNow; diff --git a/types/date-now/seed.d.ts b/types/date-now/seed.d.ts new file mode 100644 index 0000000000..c87a702c55 --- /dev/null +++ b/types/date-now/seed.d.ts @@ -0,0 +1,6 @@ +/** + * Returns a Date.now() like function that's in sync with the seed value. + */ +declare function seeded(seed: number): number; + +export = seeded; diff --git a/types/date-now/tsconfig.json b/types/date-now/tsconfig.json new file mode 100644 index 0000000000..705da71b7b --- /dev/null +++ b/types/date-now/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [ + + ], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "seed.d.ts", + "date-now-tests.ts" + ] +} diff --git a/types/date-now/tslint.json b/types/date-now/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/date-now/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file From 778d161e489437881cc16eebfd415708c494714b Mon Sep 17 00:00:00 2001 From: Rob Valentine Date: Wed, 6 Mar 2019 08:12:03 +0200 Subject: [PATCH 410/924] Fixed space issue --- types/react-dnd-multi-backend/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-dnd-multi-backend/index.d.ts b/types/react-dnd-multi-backend/index.d.ts index 9797be6e28..e0a152c610 100644 --- a/types/react-dnd-multi-backend/index.d.ts +++ b/types/react-dnd-multi-backend/index.d.ts @@ -100,7 +100,7 @@ export interface PreviewProps { export class Preview extends PureComponent {} /** * Pre-existing/default react-dnd-multi-backend transition available to use. - */ + */ export const MouseTransition: Transition; /** * Pre-existing/default react-dnd-touch-backend transition available to use. From dc82564d793ee57de681f47782381a0bdc4cb558 Mon Sep 17 00:00:00 2001 From: Jordi Oliveras Rovira Date: Wed, 6 Mar 2019 07:56:41 +0100 Subject: [PATCH 411/924] Resolve tests errors. --- types/gulp/package.json | 3 +-- types/gulp/test/index.ts | 2 +- types/rollup-plugin-delete/package.json | 2 +- types/vinyl-paths/package.json | 1 - types/vinyl-paths/vinyl-paths-tests.ts | 3 ++- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/types/gulp/package.json b/types/gulp/package.json index bae72230b6..a0e2ec3c5c 100644 --- a/types/gulp/package.json +++ b/types/gulp/package.json @@ -1,7 +1,6 @@ { "private": true, "dependencies": { - "chokidar": "^2.1.2", - "del": "*" + "chokidar": "^2.1.2" } } diff --git a/types/gulp/test/index.ts b/types/gulp/test/index.ts index f5ca436450..4b096a8704 100644 --- a/types/gulp/test/index.ts +++ b/types/gulp/test/index.ts @@ -1,12 +1,12 @@ import * as gulp from 'gulp'; import * as undertaker from 'undertaker'; import * as registry from 'undertaker-registry'; -import del = require("del"); const minify: () => any = () => { }; const jade: () => any = () => { }; const someplugin: () => any = () => { }; const promisedDel: (list: string[]) => any = (list) => { }; +const del: (pattern: string | string[]) => any = (pattern) => { }; gulp.src('client/templates/*.jade') .pipe(jade()) diff --git a/types/rollup-plugin-delete/package.json b/types/rollup-plugin-delete/package.json index cca5c8c155..8971fd5346 100644 --- a/types/rollup-plugin-delete/package.json +++ b/types/rollup-plugin-delete/package.json @@ -2,6 +2,6 @@ "private": true, "dependencies": { "del": "*", - "rollup": ">=0.60.0" + "rollup": ">=0.60.0 <1.2.0" } } diff --git a/types/vinyl-paths/package.json b/types/vinyl-paths/package.json index d03842a47b..d24e43befc 100644 --- a/types/vinyl-paths/package.json +++ b/types/vinyl-paths/package.json @@ -1,7 +1,6 @@ { "private": true, "dependencies": { - "del": "*", "rollup": ">=0.60.0" } } diff --git a/types/vinyl-paths/vinyl-paths-tests.ts b/types/vinyl-paths/vinyl-paths-tests.ts index 3e66d44e3a..4c2c7d940e 100644 --- a/types/vinyl-paths/vinyl-paths-tests.ts +++ b/types/vinyl-paths/vinyl-paths-tests.ts @@ -1,7 +1,8 @@ import gulp = require('gulp'); -import del = require('del'); import paths = require('vinyl-paths'); +const del: (pattern: string | string[]) => any = (pattern) => { }; + gulp.task('delete', function () { return gulp.src('app/*') .pipe(paths(del)); From 52b22e46ae22bb99542cbd23f183da1e0731777c Mon Sep 17 00:00:00 2001 From: Jordi Oliveras Rovira Date: Wed, 6 Mar 2019 08:00:40 +0100 Subject: [PATCH 412/924] Remove unneeded package.json on vinyl-paths --- types/vinyl-paths/package.json | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 types/vinyl-paths/package.json diff --git a/types/vinyl-paths/package.json b/types/vinyl-paths/package.json deleted file mode 100644 index d24e43befc..0000000000 --- a/types/vinyl-paths/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "private": true, - "dependencies": { - "rollup": ">=0.60.0" - } -} From 462c6f2a82f59451f91fe3372928c5dd70edb3cf Mon Sep 17 00:00:00 2001 From: "Adam A. Zerella" Date: Wed, 6 Mar 2019 16:17:47 +1100 Subject: [PATCH 413/924] Updated any type to unknown --- types/is-date-object/index.d.ts | 7 ++++++- types/is-date-object/is-date-object-tests.ts | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/types/is-date-object/index.d.ts b/types/is-date-object/index.d.ts index 08885dce51..4564b5e34b 100644 --- a/types/is-date-object/index.d.ts +++ b/types/is-date-object/index.d.ts @@ -2,7 +2,12 @@ // Project: https://github.com/ljharb/is-date-object // Definitions by: Adam Zerella // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.3 -declare function isDateObject(value?: any): boolean; +type InvalidTypes = undefined | null | boolean | string | number | [] | {}; + +declare function isDateObject(value: Date): true; +declare function isDateObject(value: InvalidTypes | unknown): false; +declare function isDateObject(value?: unknown): false; export = isDateObject; diff --git a/types/is-date-object/is-date-object-tests.ts b/types/is-date-object/is-date-object-tests.ts index 68fb22d684..9946c42d54 100644 --- a/types/is-date-object/is-date-object-tests.ts +++ b/types/is-date-object/is-date-object-tests.ts @@ -7,6 +7,7 @@ isDate(false); isDate(true); isDate(42); isDate('foo'); +isDate((): void => {}); isDate([]); isDate({}); isDate(/a/g); From 7f1bccc091d452d9d90ada531792c09a309f1adc Mon Sep 17 00:00:00 2001 From: Adam Zerella Date: Wed, 6 Mar 2019 21:44:52 +1100 Subject: [PATCH 414/924] Updated export type --- types/repeat-string/index.d.ts | 4 +++- types/repeat-string/repeat-string-tests.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/types/repeat-string/index.d.ts b/types/repeat-string/index.d.ts index e593a62b68..5664484e22 100644 --- a/types/repeat-string/index.d.ts +++ b/types/repeat-string/index.d.ts @@ -6,4 +6,6 @@ /** * Repeat the given `string` the specified `number` of times. */ -export default function(str: string, num: number): string; +declare function repeat(str: string, num: number): string; + +export = repeat; diff --git a/types/repeat-string/repeat-string-tests.ts b/types/repeat-string/repeat-string-tests.ts index 7095ea672b..c2692d7569 100644 --- a/types/repeat-string/repeat-string-tests.ts +++ b/types/repeat-string/repeat-string-tests.ts @@ -1,3 +1,3 @@ -import Repeat from "repeat-string"; +import Repeat = require("repeat-string"); Repeat('A', 5); From c19c506eb9a6688895537f07267f97d8fbe8e49c Mon Sep 17 00:00:00 2001 From: Adam Zerella Date: Wed, 6 Mar 2019 21:56:07 +1100 Subject: [PATCH 415/924] Updated export type --- types/cipher-base/cipher-base-tests.ts | 2 +- types/cipher-base/index.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/cipher-base/cipher-base-tests.ts b/types/cipher-base/cipher-base-tests.ts index 173a72b7f6..b81238ee98 100644 --- a/types/cipher-base/cipher-base-tests.ts +++ b/types/cipher-base/cipher-base-tests.ts @@ -1,4 +1,4 @@ -import CipherBase from "cipher-base"; +import CipherBase = require("cipher-base"); const buf = new Buffer(1); diff --git a/types/cipher-base/index.d.ts b/types/cipher-base/index.d.ts index 228920ac91..f43ca2cdb9 100644 --- a/types/cipher-base/index.d.ts +++ b/types/cipher-base/index.d.ts @@ -11,4 +11,4 @@ declare abstract class CipherBase { abstract update(value: Buffer, inputEnc?: string, outputEnc?: string): Buffer; } -export default CipherBase; +export = CipherBase; From 0219d7546ed10178d5659696ee431a6613abe088 Mon Sep 17 00:00:00 2001 From: Adam Zerella Date: Wed, 6 Mar 2019 21:51:56 +1100 Subject: [PATCH 416/924] Updated export type --- types/html-truncate/html-truncate-tests.ts | 2 +- types/html-truncate/index.d.ts | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/types/html-truncate/html-truncate-tests.ts b/types/html-truncate/html-truncate-tests.ts index 0c46bf560b..30f6a19e7c 100644 --- a/types/html-truncate/html-truncate-tests.ts +++ b/types/html-truncate/html-truncate-tests.ts @@ -1,4 +1,4 @@ -import Truncate from "html-truncate"; +import Truncate = require("html-truncate"); Truncate('hello world', 4); diff --git a/types/html-truncate/index.d.ts b/types/html-truncate/index.d.ts index 8be4a950a3..4784caa925 100644 --- a/types/html-truncate/index.d.ts +++ b/types/html-truncate/index.d.ts @@ -2,8 +2,9 @@ // Project: https://github.com/huang47/nodejs-html-truncate // Definitions by: Adam Zerella // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.0 -export interface TruncateOptions { +interface TruncateOptions { /** * Flag to specify if keep image tag, false by default. */ @@ -17,4 +18,6 @@ export interface TruncateOptions { /** * Truncate HTML text and also keep tag safe. */ -export default function truncate(input: string, maxLength: number, options?: TruncateOptions): string; +declare function truncate(input: string, maxLength: number, options?: TruncateOptions): string; + +export = truncate; From 57ee13062763ab3faa6f104624a03dab0f12e0de Mon Sep 17 00:00:00 2001 From: Rocky Warren <1085683+therockstorm@users.noreply.github.com> Date: Wed, 6 Mar 2019 08:31:31 -0600 Subject: [PATCH 417/924] Update SQSMessageAttribute in aws-lambda --- types/aws-lambda/aws-lambda-tests.ts | 14 +++++++++++++- types/aws-lambda/index.d.ts | 12 +++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/types/aws-lambda/aws-lambda-tests.ts b/types/aws-lambda/aws-lambda-tests.ts index ad063c20b6..dc5f9b3eba 100644 --- a/types/aws-lambda/aws-lambda-tests.ts +++ b/types/aws-lambda/aws-lambda-tests.ts @@ -1003,7 +1003,15 @@ const SQSEvent: AWSLambda.SQSEvent = { SenderId: "594035263019", ApproximateFirstReceiveTimestamp: "1529104986230" }, - messageAttributes: {}, + messageAttributes: { + testAttr: { + stringValue: "100", + binaryValue: "base64Str", + stringListValues: [], + binaryListValues: [], + dataType: "Number" + } + }, md5OfBody: "9bb58f26192e4ba00f01e2e7b136bbd8", eventSource: "aws:sqs", eventSourceARN: "arn:aws:sqs:us-west-2:594035263019:NOTFIFOQUEUE", @@ -1039,6 +1047,10 @@ const SQSMessageNode8AsyncHandler: AWSLambda.SQSHandler = async ( event; str = event.Records[0].messageId; anyObj = event.Records[0].body; + strOrUndefined = event.Records[0].messageAttributes.testAttr.stringValue; + strOrUndefined = event.Records[0].messageAttributes.testAttr.binaryValue; + str = event.Records[0].messageAttributes.testAttr.dataType; + // $ExpectType Context context; str = context.functionName; diff --git a/types/aws-lambda/index.d.ts b/types/aws-lambda/index.d.ts index 6ebccd452a..25d5c471eb 100644 --- a/types/aws-lambda/index.d.ts +++ b/types/aws-lambda/index.d.ts @@ -878,11 +878,17 @@ export interface SQSRecordAttributes { SenderId: string; ApproximateFirstReceiveTimestamp: string; } + +export type SQSMessageAttributeDataType = 'String' | 'Number' | 'Binary' | string; + export interface SQSMessageAttribute { - Name: string; - Type: string; - Value: string; + stringValue?: string; + binaryValue?: string; + stringListValues: never[]; // Not implemented. Reserved for future use. + binaryListValues: never[]; // Not implemented. Reserved for future use. + dataType: SQSMessageAttributeDataType; } + export interface SQSMessageAttributes { [name: string]: SQSMessageAttribute; } From ca73f3043114ae55ee3a018311ab031b424e34dd Mon Sep 17 00:00:00 2001 From: Anthony Heber Date: Wed, 6 Mar 2019 07:56:20 -0700 Subject: [PATCH 418/924] Expose Options interface Expose the Options interface directly so it can be constructed before it is passed to the constructor. --- types/flickity/flickity-tests.ts | 46 +++ types/flickity/index.d.ts | 571 ++++++++++++++++--------------- 2 files changed, 333 insertions(+), 284 deletions(-) diff --git a/types/flickity/flickity-tests.ts b/types/flickity/flickity-tests.ts index 8686d2f587..6e24f16b3e 100644 --- a/types/flickity/flickity-tests.ts +++ b/types/flickity/flickity-tests.ts @@ -160,3 +160,49 @@ let flikty5: Flickity = new Flickity(new HTMLElement(), { fullscreenChange: (isFullscreen) => {} } }); + +let fliktyOpts1: Flickity.Options = { + initialIndex: 0, + accessibility: true, + asNavFor: "#nav-bar", + autoPlay: true, + cellAlign: "left", + cellSelector: ".gallery-cell", + contain: true, + draggable: true, + freeScroll: false, + freeScrollFriction: 0.5, + friction: 0.8, + imagesLoaded: false, + lazyLoad: false, + pageDots: false, + arrowShape: "arrow.svg", + percentPosition: false, + prevNextButtons: false, + selectedAttraction: 0.050, + setGallerySize: true, + watchCSS: true, + wrapAround: true, + resize: true, + rightToLeft: false +}; + +let fliktyOpts2: Flickity.Options = { + on: { + ready: () => {}, + change: (index) => {}, + select: (index) => {}, + settle: (index) => {}, + scroll: (progress) => {}, + dragStart: (event, pointer) => {}, + dragMove: (event, pointer, moveVector) => {}, + dragEnd: (event, pointer) => {}, + pointerDown: (event, pointer) => {}, + pointerMove: (event, pointer, moveVector) => {}, + pointerUp: (event, pointer) => {}, + staticClick: (event, pointer, cellElement, cellIndex) => {}, + lazyLoad: (event, cellElement) => {}, + bgLazyLoad: (event, element) => {}, + fullscreenChange: (isFullscreen) => {} + } +}; diff --git a/types/flickity/index.d.ts b/types/flickity/index.d.ts index 5d9f3fa510..44812373d9 100644 --- a/types/flickity/index.d.ts +++ b/types/flickity/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Flickity 2.0 +// Type definitions for Flickity 2.2 // Project: https://flickity.metafizzy.co // Definitions by: Chris McGrath // Michael Wagner @@ -11,7 +11,7 @@ export = Flickity; declare global { interface JQuery { - flickity(options?: FlickityOptions): this; + flickity(options?: Flickity.Options): this; flickity(command: string, ...params: any[]): this; } } @@ -67,6 +67,288 @@ declare namespace Flickity { * Triggered after a background image has been loaded with bgLazyLoad. */ "bgLazyLoad"; + + + + interface Options { + /** + * Specify selector for cell elements. cellSelector is useful if you have other elements in your gallery elements that are not cells. + * + * default: '.gallery-cell' + */ + cellSelector?: string; + + /** + * Zero-based index of the initial selected cell. + */ + initialIndex?: number; + + /** + * Enable keyboard navigation. Users can tab to a Flickity gallery, and pressing left & right keys to change cells. + * + * default: true + */ + accessibility?: boolean; + + /** + * Sets the height of the gallery to the height of the tallest cell. Set to false if you prefer to size the gallery with CSS, rather than using the size of cells. + * + * default: true + */ + setGallerySize?: boolean; + + /** + * Adjusts sizes and positions when window is resized. + * + * default: true + */ + resize?: boolean; + + /** + * Align cells within the gallery element. + * opttions: 'left', 'center', 'right' + * + * default: 'center' + */ + cellAlign?: string; + + /** + * Contains cells to gallery element to prevent excess scroll at beginning or end. Has no effect if wrapAround is enabled + * + * default: true + */ + contain?: boolean; + + /** + * Unloaded images have no size, which can throw off cell positions. To fix this, the imagesLoaded option re-positions cells once their images have loaded. + * + * default: true + */ + imagesLoaded?: boolean; + + /** + * Sets positioning in percent values, rather than pixel values. If your cells do not have percent widths, we recommended percentPosition: false. + * + * default: false + */ + percentPosition?: boolean; + + /** + * Enables right-to-left layout. + * + * default: false + */ + rightToLeft?: boolean; + + /** + * Enables dragging and flicking + * + * default: true + */ + draggable?: boolean; + + /** + * Enables content to be freely scrolled and flicked without aligning cells to an end position. + * Enable freeScroll and wrapAround and you can flick forever, man. + * + * default: false + */ + freeScroll?: boolean; + + /** + * At the end of cells, wrap-around to the other end for infinite scrolling. + * + * default: false + */ + wrapAround?: boolean; + + /** + * Groups cells together in slides. Flicking, page dots, and previous/next buttons are mapped to group slides, not individual cells. + * `is-selected` class is added to the multiple cells in the selected slide. + * If set to true, group cells that fit in carousel viewport. + * If set to a number, group cells by that number. + * If set to a percent string, group cells that fit in the percent of the width of the carousel viewport. + */ + groupCells?: boolean | number | string; + + /** + * Loads cell images when a cell is selected. + * Set the image's URL to load with the `data-flickity-lazyload` attribute. + * If set to `true`, lazyloads image in selected slide + * If set to a number n, load images in selected slide and next n slides and previous n slides. + * + * default: false + */ + lazyLoad?: boolean | number; + + /** + * Loads cell background image when a cell is selected. + * Set the background image's URL to load with the `data-flickity-bg-lazyload` attribute. + * If set to `true`, lazyloads background image in selected slide + * If set to a number n, load background images in selected slide and next n slides and previous n slides. + * bgLazyLoad requires the flickity-bg-lazyload package. This package is not included and must be installed separately. + */ + bgLazyLoad?: boolean | number; + + /** + * Automatically advances to the next cell. + * + * default: false + */ + autoPlay?: boolean | number; + + /** + * Changes height of carousel to fit height of selected slide. + */ + adaptiveHeight?: boolean; + + /** + * You can enable and disable Flickity with CSS. watchCSS option watches the content of :after of the gallery element. Flickity is enabled if :after content is 'flickity'. + * note: IE8 and Android 2.3 do not support watching :after. Flickity will be disabled when watchCSS: true. Set watchCSS: 'fallbackOn' to enable Flickity for these browsers. + * + * default: false + */ + watchCSS?: boolean | string; + + /** + * Use one Flickity gallery as navigation for another. + * + * default: disabled + */ + asNavFor?: string | HTMLElement; + + /** + * The number of pixels a mouse or touch has to move before dragging begins. Increase dragThreshold to allow for more wiggle room for vertical page scrolling on touch devices. + * + * default: 3 + */ + dragThreshold?: number; + + /** + * selectedAttraction attracts the position of the slider to the selected cell. Higher attraction makes the slider move faster. Lower makes it move slower. + * + * default: 0.025 + */ + selectedAttraction?: number; + + /** + * Friction slows the movement of slider. Higher friction makes the slider feel stickier and less bouncy. Lower friction makes the slider feel looser and more wobbly. + * + * default: 0.28 + */ + friction?: number; + + /** + * Slows movement of slider when freeScroll: true. Higher friction makes the slider feel stickier. Lower friction makes the slider feel looser. + * + * default: 0.075 + */ + freeScrollFriction?: number; + + /** + * Creates and enables previous & next buttons. + * + * default: true + */ + prevNextButtons?: boolean; + + /** + * Creates and enables paging dots. + * + * default: true + */ + pageDots?: boolean; + + /** + * Draws the shape of the arrows in the previous & next buttons. + * javascript dictionary of points or path to SVG file + */ + arrowShape?: string | { x0: number, x1: number, y1: number, x2: number, y2: number, x3: number }; + + /** + * Bind events within Flickity's options by setting on to an Object. The object's keys should match the event names. on is useful for capturing events as Flickity is initialized, like ready + */ + on?: { + /** + * Triggered after Flickity has been activated. + */ + ready?: () => void; + + /** + * Triggered when the selected slide is changed. + */ + change?: (index?: Number) => void; + + /** + * Triggered when a slide is selected. + * select is triggered any time a slide is selected, even on the same slide. change is triggered only when a different slide is selected. + * This event was previously cellSelect in Flickity v1. cellSelect will continue to work in Flickity v2. + */ + select?: (index?: Number) => void; + cellSelect?: (index?: Number) => void; + /** + * Triggered when the slider is settled at its end position. + */ + settle?: (index?: Number) => void; + + /** + * Triggered when the slider moves. + */ + scroll?: (progress?: Number) => void; + + /** + * Triggered when dragging starts and the slider starts moving. + */ + dragStart?: (event?: Event, pointer?: Element | Touch) => void; + + /** + * Triggered when dragging moves and the slider moves. + */ + dragMove?: (event?: Event, pointer?: Element | Touch, moveVector?: { x: number, y: number }) => void; + + /** + * Triggered when dragging ends. + */ + dragEnd?: (event: Event, pointer?: Element | Touch) => void; + + /** + * Triggered when the user's pointer (mouse, touch, pointer) presses down. + */ + pointerDown?: (event: Event, pointer?: Element | Touch) => void; + + /** + * Triggered when the user's pointer moves. + */ + pointerMove?: (event?: Event, pointer?: Element | Touch, moveVector?: { x: number, y: number }) => void; + + /** + * Triggered when the user's pointer unpresses. + */ + pointerUp?: (event?: Event, pointer?: Element | Touch) => void; + + /** + * Triggered when the user's pointer is pressed and unpressed and has not moved enough to start dragging. + * click events are hard to detect with draggable UI, as they are triggered whenever a user drags. Flickity's staticClick event resolves this, as it is triggered when the user has not dragged. + */ + staticClick?: (event?: Event, pointer?: Element | Touch, cellElement?: Element, cellIndex?: Number) => void; + + /** + * Triggered after an image has been loaded with lazyLoad. + */ + lazyLoad?: (event?: Event, cellElement?: Element) => void; + + /** + * Triggered after a background image has been loaded with bgLazyLoad. + */ + bgLazyLoad?: (event?: Event, element?: Element) => void; + + /** + * Triggered after entering or exiting fullscreen view. + */ + fullscreenChange?: (isFullscreen?: Boolean) => void; + }; + } + } declare class Flickity { @@ -74,9 +356,9 @@ declare class Flickity { * Initializes an new instance of Flickity . * * @param element Element selector string or container Element to initialize Flickity on - * @param options (IFlickityOptions) Flickity options + * @param options (IOptions) Flickity options */ - constructor(selector: string | Element, options?: FlickityOptions); + constructor(selector: string | Element, options?: Flickity.Options); // properties @@ -292,7 +574,7 @@ declare class Flickity { once(eventname: string, callback: (event?: Event, pointer?: Element | Touch, cellElement?: Element, cellIndex?: number) => any): void; /** - * one time event handler + * one time event handl`er * @param eventName name of event (@see Flickity.FlickityEvents class for filckity supported events) * @param callback callback funtion to execute when event fires */ @@ -312,282 +594,3 @@ declare class Flickity { */ once(eventname: string, callback: (event?: Event, pointer?: Element | Touch) => any): void; } - -interface FlickityOptions { - /** - * Specify selector for cell elements. cellSelector is useful if you have other elements in your gallery elements that are not cells. - * - * default: '.gallery-cell' - */ - cellSelector?: string; - - /** - * Zero-based index of the initial selected cell. - */ - initialIndex?: number; - - /** - * Enable keyboard navigation. Users can tab to a Flickity gallery, and pressing left & right keys to change cells. - * - * default: true - */ - accessibility?: boolean; - - /** - * Sets the height of the gallery to the height of the tallest cell. Set to false if you prefer to size the gallery with CSS, rather than using the size of cells. - * - * default: true - */ - setGallerySize?: boolean; - - /** - * Adjusts sizes and positions when window is resized. - * - * default: true - */ - resize?: boolean; - - /** - * Align cells within the gallery element. - * opttions: 'left', 'center', 'right' - * - * default: 'center' - */ - cellAlign?: string; - - /** - * Contains cells to gallery element to prevent excess scroll at beginning or end. Has no effect if wrapAround is enabled - * - * default: true - */ - contain?: boolean; - - /** - * Unloaded images have no size, which can throw off cell positions. To fix this, the imagesLoaded option re-positions cells once their images have loaded. - * - * default: true - */ - imagesLoaded?: boolean; - - /** - * Sets positioning in percent values, rather than pixel values. If your cells do not have percent widths, we recommended percentPosition: false. - * - * default: false - */ - percentPosition?: boolean; - - /** - * Enables right-to-left layout. - * - * default: false - */ - rightToLeft?: boolean; - - /** - * Enables dragging and flicking - * - * default: true - */ - draggable?: boolean; - - /** - * Enables content to be freely scrolled and flicked without aligning cells to an end position. - * Enable freeScroll and wrapAround and you can flick forever, man. - * - * default: false - */ - freeScroll?: boolean; - - /** - * At the end of cells, wrap-around to the other end for infinite scrolling. - * - * default: false - */ - wrapAround?: boolean; - - /** - * Groups cells together in slides. Flicking, page dots, and previous/next buttons are mapped to group slides, not individual cells. - * `is-selected` class is added to the multiple cells in the selected slide. - * If set to true, group cells that fit in carousel viewport. - * If set to a number, group cells by that number. - * If set to a percent string, group cells that fit in the percent of the width of the carousel viewport. - */ - groupCells?: boolean | number | string; - - /** - * Loads cell images when a cell is selected. - * Set the image's URL to load with the `data-flickity-lazyload` attribute. - * If set to `true`, lazyloads image in selected slide - * If set to a number n, load images in selected slide and next n slides and previous n slides. - * - * default: false - */ - lazyLoad?: boolean | number; - - /** - * Loads cell background image when a cell is selected. - * Set the background image's URL to load with the `data-flickity-bg-lazyload` attribute. - * If set to `true`, lazyloads background image in selected slide - * If set to a number n, load background images in selected slide and next n slides and previous n slides. - * bgLazyLoad requires the flickity-bg-lazyload package. This package is not included and must be installed separately. - */ - bgLazyLoad?: boolean | number; - - /** - * Automatically advances to the next cell. - * - * default: false - */ - autoPlay?: boolean | number; - - /** - * Changes height of carousel to fit height of selected slide. - */ - adaptiveHeight?: boolean; - - /** - * You can enable and disable Flickity with CSS. watchCSS option watches the content of :after of the gallery element. Flickity is enabled if :after content is 'flickity'. - * note: IE8 and Android 2.3 do not support watching :after. Flickity will be disabled when watchCSS: true. Set watchCSS: 'fallbackOn' to enable Flickity for these browsers. - * - * default: false - */ - watchCSS?: boolean | string; - - /** - * Use one Flickity gallery as navigation for another. - * - * default: disabled - */ - asNavFor?: string | HTMLElement; - - /** - * The number of pixels a mouse or touch has to move before dragging begins. Increase dragThreshold to allow for more wiggle room for vertical page scrolling on touch devices. - * - * default: 3 - */ - dragThreshold?: number; - - /** - * selectedAttraction attracts the position of the slider to the selected cell. Higher attraction makes the slider move faster. Lower makes it move slower. - * - * default: 0.025 - */ - selectedAttraction?: number; - - /** - * Friction slows the movement of slider. Higher friction makes the slider feel stickier and less bouncy. Lower friction makes the slider feel looser and more wobbly. - * - * default: 0.28 - */ - friction?: number; - - /** - * Slows movement of slider when freeScroll: true. Higher friction makes the slider feel stickier. Lower friction makes the slider feel looser. - * - * default: 0.075 - */ - freeScrollFriction?: number; - - /** - * Creates and enables previous & next buttons. - * - * default: true - */ - prevNextButtons?: boolean; - - /** - * Creates and enables paging dots. - * - * default: true - */ - pageDots?: boolean; - - /** - * Draws the shape of the arrows in the previous & next buttons. - * javascript dictionary of points or path to SVG file - */ - arrowShape?: string | { x0: number, x1: number, y1: number, x2: number, y2: number, x3: number }; - - /** - * Bind events within Flickity's options by setting on to an Object. The object's keys should match the event names. on is useful for capturing events as Flickity is initialized, like ready - */ - on?: { - /** - * Triggered after Flickity has been activated. - */ - ready?: () => void; - - /** - * Triggered when the selected slide is changed. - */ - change?: (index?: Number) => void; - - /** - * Triggered when a slide is selected. - * select is triggered any time a slide is selected, even on the same slide. change is triggered only when a different slide is selected. - * This event was previously cellSelect in Flickity v1. cellSelect will continue to work in Flickity v2. - */ - select?: (index?: Number) => void; - - /** - * Triggered when the slider is settled at its end position. - */ - settle?: (index?: Number) => void; - - /** - * Triggered when the slider moves. - */ - scroll?: (progress?: Number) => void; - - /** - * Triggered when dragging starts and the slider starts moving. - */ - dragStart?: (event?: Event, pointer?: Element | Touch) => void; - - /** - * Triggered when dragging moves and the slider moves. - */ - dragMove?: (event?: Event, pointer?: Element | Touch, moveVector?: { x: number, y: number }) => void; - - /** - * Triggered when dragging ends. - */ - dragEnd?: (event: Event, pointer?: Element | Touch) => void; - - /** - * Triggered when the user's pointer (mouse, touch, pointer) presses down. - */ - pointerDown?: (event: Event, pointer?: Element | Touch) => void; - - /** - * Triggered when the user's pointer moves. - */ - pointerMove?: (event?: Event, pointer?: Element | Touch, moveVector?: { x: number, y: number }) => void; - - /** - * Triggered when the user's pointer unpresses. - */ - pointerUp?: (event?: Event, pointer?: Element | Touch) => void; - - /** - * Triggered when the user's pointer is pressed and unpressed and has not moved enough to start dragging. - * click events are hard to detect with draggable UI, as they are triggered whenever a user drags. Flickity's staticClick event resolves this, as it is triggered when the user has not dragged. - */ - staticClick?: (event?: Event, pointer?: Element | Touch, cellElement?: Element, cellIndex?: Number) => void; - - /** - * Triggered after an image has been loaded with lazyLoad. - */ - lazyLoad?: (event?: Event, cellElement?: Element) => void; - - /** - * Triggered after a background image has been loaded with bgLazyLoad. - */ - bgLazyLoad?: (event?: Event, element?: Element) => void; - - /** - * Triggered after entering or exiting fullscreen view. - */ - fullscreenChange?: (isFullscreen?: Boolean) => void; - }; -} From f775dda6dca2d1f728c74d4058f6a7e5d758627e Mon Sep 17 00:00:00 2001 From: Anthony Heber Date: Wed, 6 Mar 2019 08:03:30 -0700 Subject: [PATCH 419/924] Clean up linting --- types/flickity/index.d.ts | 44 +++++++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/types/flickity/index.d.ts b/types/flickity/index.d.ts index 44812373d9..c2c475d6af 100644 --- a/types/flickity/index.d.ts +++ b/types/flickity/index.d.ts @@ -67,9 +67,6 @@ declare namespace Flickity { * Triggered after a background image has been loaded with bgLazyLoad. */ "bgLazyLoad"; - - - interface Options { /** * Specify selector for cell elements. cellSelector is useful if you have other elements in your gallery elements that are not cells. @@ -299,48 +296,70 @@ declare namespace Flickity { /** * Triggered when dragging starts and the slider starts moving. */ - dragStart?: (event?: Event, pointer?: Element | Touch) => void; + dragStart?: ( + event?: Event, + pointer?: Element | Touch) => void; /** * Triggered when dragging moves and the slider moves. */ - dragMove?: (event?: Event, pointer?: Element | Touch, moveVector?: { x: number, y: number }) => void; + dragMove?: ( + event?: Event, + pointer?: Element | Touch, + moveVector?: { x: number, y: number }) => void; /** * Triggered when dragging ends. */ - dragEnd?: (event: Event, pointer?: Element | Touch) => void; + dragEnd?: ( + event: Event, + pointer?: Element | Touch) => void; /** * Triggered when the user's pointer (mouse, touch, pointer) presses down. */ - pointerDown?: (event: Event, pointer?: Element | Touch) => void; + pointerDown?: ( + event: Event, + pointer?: Element | Touch) => void; /** * Triggered when the user's pointer moves. */ - pointerMove?: (event?: Event, pointer?: Element | Touch, moveVector?: { x: number, y: number }) => void; + pointerMove?: ( + event?: Event, + pointer?: Element | Touch, + moveVector?: { x: number, y: number }) => void; /** * Triggered when the user's pointer unpresses. */ - pointerUp?: (event?: Event, pointer?: Element | Touch) => void; + pointerUp?: ( + event?: Event, + pointer?: Element | Touch) => void; /** * Triggered when the user's pointer is pressed and unpressed and has not moved enough to start dragging. * click events are hard to detect with draggable UI, as they are triggered whenever a user drags. Flickity's staticClick event resolves this, as it is triggered when the user has not dragged. */ - staticClick?: (event?: Event, pointer?: Element | Touch, cellElement?: Element, cellIndex?: Number) => void; + staticClick?: ( + event?: Event, + pointer?: Element | Touch, + cellElement?: Element, + cellIndex?: Number) => void; /** * Triggered after an image has been loaded with lazyLoad. */ - lazyLoad?: (event?: Event, cellElement?: Element) => void; + lazyLoad?: ( + event?: Event, + cellElement?: Element) => void; /** * Triggered after a background image has been loaded with bgLazyLoad. */ - bgLazyLoad?: (event?: Event, element?: Element) => void; + bgLazyLoad?: ( + event?: Event, + element?: Element) => void; /** * Triggered after entering or exiting fullscreen view. @@ -348,7 +367,6 @@ declare namespace Flickity { fullscreenChange?: (isFullscreen?: Boolean) => void; }; } - } declare class Flickity { From e46cb9d61a0960cd707d41fb9452468578257705 Mon Sep 17 00:00:00 2001 From: Anthony Heber Date: Wed, 6 Mar 2019 08:09:14 -0700 Subject: [PATCH 420/924] More lint fixing --- types/flickity/index.d.ts | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/types/flickity/index.d.ts b/types/flickity/index.d.ts index c2c475d6af..8b5b7b2ffe 100644 --- a/types/flickity/index.d.ts +++ b/types/flickity/index.d.ts @@ -297,68 +297,69 @@ declare namespace Flickity { * Triggered when dragging starts and the slider starts moving. */ dragStart?: ( - event?: Event, + event?: Event, pointer?: Element | Touch) => void; /** * Triggered when dragging moves and the slider moves. */ dragMove?: ( - event?: Event, - pointer?: Element | Touch, + event?: Event, + pointer?: Element | Touch, moveVector?: { x: number, y: number }) => void; /** * Triggered when dragging ends. */ dragEnd?: ( - event: Event, + event: Event, pointer?: Element | Touch) => void; /** * Triggered when the user's pointer (mouse, touch, pointer) presses down. */ pointerDown?: ( - event: Event, + event: Event, pointer?: Element | Touch) => void; /** * Triggered when the user's pointer moves. */ pointerMove?: ( - event?: Event, - pointer?: Element | Touch, + event?: Event, + pointer?: Element | Touch, moveVector?: { x: number, y: number }) => void; /** * Triggered when the user's pointer unpresses. */ pointerUp?: ( - event?: Event, + event?: Event, pointer?: Element | Touch) => void; /** * Triggered when the user's pointer is pressed and unpressed and has not moved enough to start dragging. - * click events are hard to detect with draggable UI, as they are triggered whenever a user drags. Flickity's staticClick event resolves this, as it is triggered when the user has not dragged. + * click events are hard to detect with draggable UI, as they are triggered whenever a user drags. + * Flickity's staticClick event resolves this, as it is triggered when the user has not dragged. */ staticClick?: ( - event?: Event, - pointer?: Element | Touch, - cellElement?: Element, + event?: Event, + pointer?: Element | Touch, + cellElement?: Element, cellIndex?: Number) => void; /** * Triggered after an image has been loaded with lazyLoad. */ lazyLoad?: ( - event?: Event, + event?: Event, cellElement?: Element) => void; /** * Triggered after a background image has been loaded with bgLazyLoad. */ bgLazyLoad?: ( - event?: Event, + event?: Event, element?: Element) => void; /** From 5c9faedd41649bed7ab58670b8dda60f552947c1 Mon Sep 17 00:00:00 2001 From: Jojoshua Date: Wed, 6 Mar 2019 10:17:05 -0500 Subject: [PATCH 421/924] Initial --- types/tabulator-tables/index.d.ts | 1729 +++++++++++++++++ .../tabulator-tables-tests.ts | 427 ++++ types/tabulator-tables/tsconfig.json | 16 + types/tabulator-tables/tslint.json | 1 + 4 files changed, 2173 insertions(+) create mode 100644 types/tabulator-tables/index.d.ts create mode 100644 types/tabulator-tables/tabulator-tables-tests.ts create mode 100644 types/tabulator-tables/tsconfig.json create mode 100644 types/tabulator-tables/tslint.json diff --git a/types/tabulator-tables/index.d.ts b/types/tabulator-tables/index.d.ts new file mode 100644 index 0000000000..3fe21f805f --- /dev/null +++ b/types/tabulator-tables/index.d.ts @@ -0,0 +1,1729 @@ +// Type definitions for tabulator-tables 4.2 +// Project: https://github.com/olifolkerd/tabulator +// Definitions by: Josh Harris +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +declare namespace Tabulator { + interface Options extends OptionsGeneral, OptionsHistory, OptionsLocale, OptionsDownload, OptionsColumns, OptionsRows, OptionsData, OptionsSorting, OptionsFiltering, OptionsRowGrouping, OptionsPagination, OptionsPersistentConfiguration, OptionsClipboard, OptionsDataTree, OptionsCell {} + + interface OptionsCells extends CellCallbacks { + /**The validationFailed event is triggered when the value entered into a cell during an edit fails to pass validation. */ + validationFailed?: (cell: CellComponent, value: any, validators: Validator[] | StandardValidatorType[]) => void; + } + type OptionsDataTree = { + /**To enable data trees in your table, set the dataTree property to true in your table constructor: */ + dataTree?: boolean; + /** By default the toggle element will be inserted into the first column on the table. If you want the toggle element to be inserted in a different column you can pass the feild name of the column to the dataTreeElementColumn setup option*/ + dataTreeElementColumn?: boolean | string; + /**Show tree branch icon */ + dataTreeBranchElement?: boolean | string; + /**Tree level indent in pixels */ + dataTreeChildIndent?: number; + /**By default Tabulator will look for child rows in the _children field of a row data object. You can change this to look in a different field using the dataTreeChildField property in your table constructor: */ + dataTreeChildField?: string; + /**The toggle button that allows users to collapse and expand the column can be customised to meet your needs. There are two options, dataTreeExpandElement and dataTreeCollapseElement, that can be set to replace the default toggle elements with your own. + + Both options can take either an html string representing the contents of the toggle element */ + dataTreeCollapseElement?: string | HTMLElement | boolean; + /** */ + dataTreeExpandElement?: string | HTMLElement | boolean; + /** By default all nodes on the tree will start collapsed, you can customize the initial expansion state of the tree using the dataTreeStartExpanded option. + * + This option can take one of three possible value types, either a boolean to indicate whether all nodes should start expanded or collapsed: */ + dataTreeStartExpanded?: boolean | boolean[] | ((row: RowComponent, level: number) => boolean); + }; + type OptionsClipboard = { + /**You can enable clipboard functionality using the clipboard config option. It can take one of four possible values: + + true - enable clipboard copy and paste + "copy" - enable only copy functionality + "paste" - enable only paste functionality + false - disable all clipboard functionality (default) */ + clipboard?: boolean | "copy" | "paste"; + /** + * The copy selector is a function that is used to choose which data is copied into the clipboard. Tabulator comes with a few different selectors built in: + active - Copy all table data currently displayed in the table to the clipboard (default) + table - Copy all table data to the clipboard, including data that is currently filtered out + selected - Copy the currently selected rows to the clipboard, including data that is currently filtered out + Tabulator will try to use the best selector to match your table setup. If any text is selected on the table, then it will be that text which is copied. If the table has selectable rows enabled, the it will be the currently selected rows copied to the clipboard in the order in which they were selected. Otherwise the currently visible data in the table will be copied. + + These selectors can also be used when programatically triggering a copy event. in this case if the selector is not specified it will default to the value set in the clipboardCopySelector property (which is active by default). + */ + clipboardCopySelector?: "active" | "table" | "selected"; + /** The copy formatter is used to take the row data provided by the selector and turn it into a text string for the clipboard. + There is one built in copy formatter called table, if you have extended the clipboard module and want to change the default you can use the clipboardCopyFormatter property. you can also pass in a formatting function directly into this property.*/ + clipboardCopyFormatter?: "table" | ((rowData: any[]) => string); + /**By default Tabulator will include the column header titles in any clipboard data, this can be turned off by passing a value of false to the clipboardCopyHeader property: */ + clipboardCopyHeader?: boolean; + /** Tabulator has one built in paste parser, that is designed to take a table formatted text string from the clipboard and turn it into row data. it breaks the tada into rows on a newline character \n and breaks the rows down to columns on a tab character \t. + + It will then attempt to work out which columns in the data correspond to columns in the table. It tries three different ways to achieve this. First it checks the values of all columns in the first row of data to see if they match the titles of columns in the table. If any of the columns don't match it then tries the same approach but with the column fields. If either of those options match, Tabulator will map those columns to the incoming data and import it into rows. If there is no match then Tabulator will assume the columns in the data are in the same order as the visible columns in the table and import them that way. + + The inbuilt parser will reject any clipboard data that does not contain at least one row and two columns, in that case the clipboardPasteError will be triggered. + + If you extend the clipboard module to add your own parser, you can set it to be used as default with the clipboardPasteParser property.*/ + clipboardPasteParser?: string | ((clipboard: any) => any[]); + /**Once the data has been parsed into row data, it will be passed to a paste action to be added to the table. There are three inbuilt paste actions: + + insert - Inserts data into the table using the addRows function (default) + update - Updates data in the table using the updateOrAddData function + replace - replaces all data in the table using the setData function */ + clipboardPasteAction?: "insert" | "update" | "replace"; + + /**By default Tabulator will copy some of the tables styling along with the data to give a better visual appearance when pasted into other documents. + + If you want to only copy the unstyled data then you should set the clipboardCopyStyled option to false in the table options object: */ + clipboardCopyStyled?: boolean; + + /**By default Tabulator includes column headers, row groups and column calculations in the clipboard output. + + You can choose to remove column headers groups, row groups or column calculations from the output data by setting the values in the clipboardCopyConfig option in the table definition: */ + clipboardCopyConfig?: + | { + columnHeaders?: boolean; + rowGroups?: boolean; + columnCalcs?: boolean; + } + | boolean; + + /**The clipboardCopied event is triggered whenever data is copied to the clipboard. */ + clipboardCopied: () => void; + /**The clipboardPasted event is triggered whenever data is successfuly pasted into the table. */ + clipboardPasted: () => void; + /**The clipboardPasteError event is triggered whenever an atempt to paste data into the table has failed because it was rejected by the paste parser. */ + clipboardPasteError: () => void; + }; + + type OptionsPersistentConfiguration = { + /**ID tag used to identify persistent storage information */ + persistenceID?: string; + /** Persistence information can either be stored in a cookie or in the localSotrage object, you can use the persistenceMode to choose which. It can take three possible values: + + local - (string) Store the persistence information in the localStorage object + cookie - (string) Store the persistence information in a cookie + true - (boolean) check if localStorage is available and store persistence information, otherwise store in cookie (Default option) */ + persistenceMode?: "local" | "cookie" | true; + /**Enable persistsnt storage of column layout information */ + persistentLayout?: boolean; + /**You can ensure the data sorting is stored for the next page load by setting the persistentSort option to true */ + persistentSort?: boolean; + /** You can ensure the data filtering is stored for the next page load by setting the persistentFilter option to true*/ + persistentFilter?: boolean; + }; + + type OptionsPagination = { + /**Choose pagination method, "local" or "remote" */ + pagination?: "remote" | "local"; + /**Set the number of rows in each page */ + paginationSize?: number; + /** Setting this option to true will cause Tabulator to create a list of page size options, that are multiples of the current page size. In the example below, the list will have the values of 5, 10, 15 and 20. + + When using the page size selector like this, if you use the setPageSize function to set the page size to a value not in the list, the list will be regenerated using the new page size as the starting valuer */ + paginationSizeSelector?: true | number[]; + /** By default the pagination controls are added to the footer of the table. If you wish the controls to be created in another element pass a DOM node or a CSS selector for that element to the paginationElement option.*/ + paginationElement?: HTMLElement | "string"; + /**Lookup list to link expected data feilds from the server to their function + * default + * { + "current_page":"current_page", + "last_page":"last_page", + "data":"data", + } + * + * + */ + paginationDataReceived?: Record; + /**Lookup list to link fields expected by the server to their function + * default: + * { + "page":"page", + "size":"size", + "sorters":"sorters", + "filters":"filters", + } + */ + paginationDataSent?: Record; + /**When using the addRow function on a paginated table, rows will be added relative to the current page (ie to the top or bottom of the current page), with overflowing rows being shifted onto the next page. + + If you would prefer rows to be added relative to the table (firs/last page) then you can use the paginationAddRow option. it can take one of two values: + + page - add rows relative to current page (default) + table - add rows relative to the table */ + paginationAddRow?: "table" | "page"; + /** The number of pagination page buttons shown in the footer using the paginationButtonCount option. By default this has a value of 5.*/ + paginationButtonCount?: number; + }; + + type OptionsRowGrouping = { + /**String/function to select field to group rows by */ + groupBy?: string | ((data: any) => any); + /**By default Tabulator will create groups for rows based on the values contained in the row data. if you want to explicitly define which field values groups should be created for at each level, you can use the groupValues option. + + This option takes an array of value arrays, each item in the first array should be a list of acceptable field values for groups at that level */ + groupValues?: any[][]; + + /**You can use the setGroupHeader function to change the header generation function for each group. This function has one argument and takes the same values as passed to the groupHeader setup option. */ + groupHeader?: ((value: any, count: number, data: any, group: GroupComponent) => string) | ((value: any, count: number, data: any) => string)[]; + + /**You can set the default open state of groups using the groupStartOpen property + * + * This can take one of three possible values: + + true - all groups start open (default value) + false - all groups start closed + function() - a callback to decide if a group should start open or closed + Group Open Function + If you want to decide on a group by group basis which should start open or closed then you can pass a function to the groupStartOpen property. This should return true if the group should start open or false if the group should start closed. + */ + groupStartOpen?: boolean | ((value: any, count: number, data: any, group: GroupComponent) => boolean); + + /**By default Tabulator allows users to toggle a group open or closed by clicking on the arrow icon in the left of the group header. If you would prefer a different behaviour you can use the groupToggleElement option to choose a different option: + * + * The option can take one of three values: + arrow - togggle group on arrow element click + header - toggle group on click anywhere on the group header element + false - prevent clicking anywhere in the group toggling the group + */ + groupToggleElement?: "arrow" | "header" | false; + + /**show/hide column calculations when group is closed */ + groupClosedShowCalcs?: boolean; + + /**The dataGrouping callback is triggered whenever a data grouping event occurs, before grouping happens. */ + dataGrouping?: () => void; + /**The dataGrouping callback is triggered whenever a data grouping event occurs, after grouping happens. */ + dataGrouped?: () => void; + /**The groupVisibilityChanged callback is triggered whenever a group changes between hidden and visible states. */ + groupVisibilityChanged?: (group: GroupComponent, visible: boolean) => void; + + /**The groupClick callback is triggered when a user clicks on a group header. */ + groupClick?: GroupEventCallback; + /**The groupDblClick callback is triggered when a user double clicks on a group header. */ + groupDblClick?: GroupEventCallback; + /**The groupContext callback is triggered when a user right clicks on a group header. + + If you want to prevent the browsers context menu being triggered in this event you will need to include the preventDefault() function in your callback. */ + groupContext?: GroupEventCallback; + /**The groupTap callback is triggered when a user taps on a group header on a touch display. */ + groupTap?: GroupEventCallback; + /**The groupDblTap callback is triggered when a user taps on a group header on a touch display twice in under 300ms. */ + groupDblTap?: GroupEventCallback; + /**The groupTapHold callback is triggered when a user taps on a group header on a touch display and holds their finger down for over 1 second */ + groupTapHold?: GroupEventCallback; + }; + + interface Filter { + field: string; + type: FilterType; + value: any; + } + + type FilterFunction = (field: string, type: Tabulator.FilterType, value: any) => void; + + type OptionsFiltering = { + /**Array of filters to be applied on load. */ + initialFilter?: Filter[]; + + /**array of initial values for header filters. */ + initialHeaderFilter?: Pick[]; + + /**The dataFiltering callback is triggered whenever a filter event occurs, before the filter happens. */ + dataFiltering?: (filters: Filter[]) => void; + /**The dataFiltered callback is triggered after the table dataset is filtered. */ + dataFiltered?: (filters: Filter[], rows: RowComponent[]) => void; + }; + type OptionsSorting = { + /**Array of sorters to be applied on load. */ + initialSort?: Sorter[]; + + /**reverse the order that multiple sorters are applied to the table. */ + sortOrderReverse?: boolean; + }; + + interface Sorter { + column: string; + dir: SortDirection; + } + type OptionsData = { + /**A unique index value should be present for each row of data if you want to be able to programatically alter that data at a later point, this should be either numeric or a string. By default Tabulator will look for this value in the id field for the data. If you wish to use a different field as the index, set this using the index option parameter. */ + index?: number | string; + //**Array to hold data that should be loaded on table creation */ + data?: any[]; + + /**If you wish to retrieve your data from a remote source you can set the URL for the request in the ajaxURL option. */ + ajaxURL?: string; + + /**Parameters to be passed to remote Ajax data loading request */ + ajaxParams?: {}; + + /**The HTTP request type for Ajax requests or config object for the request */ + ajaxConfig?: HttpMethod | AjaxConfig; + + /**When using a request method other than "GET" Tabulator will send any parameters with a content type of form data. You can change the content type with the ajaxContentType option. This will ensure parameters are sent in the format you expect, with the correct headers. + * + * The ajaxContentType option can take one of two values: + "form" - send parameters as form data (default option) + "json" - send parameters as JSON encoded string + If you want to use a custom content type then you can pass a content type formatter object into the ajaxContentType option. this object must have two properties, the headers property should contain all headers that should be sent with the request and the body property should contain a function that returns the body content of the request + */ + + ajaxContentType?: "form" | "json" | AjaxContentType; + + /**If you need more control over the url of the request that you can get from the ajaxURL and ajaxParams properties, the you can use the ajaxURLGenerator property to pass in a callback that will generate the URL for you. + + The callback should return a string representing the URL to be requested. */ + ajaxURLGenerator?: (url: string, config: any, params: any) => string; + + /**callback function to replace inbuilt ajax request functionality */ + ajaxRequestFunc?: (url: string, config: any, params: any) => Promise; + + /**Send filter config to server instead of processing locally */ + ajaxFiltering?: boolean; + + /**Send sorter config to server instead of processing locally */ + ajaxSorting?: boolean; + + /**If you are loading a lot of data from a remote source into your table in one go, it can sometimes take a long time for the server to return the request, which can slow down the user experience. + + To speed things up in this situation Tabulator has a progressive load mode, this uses the pagination module to make a series of requests for part of the data set, one at a time, appending it to the table as the data arrives. This mode can be enable using the ajaxProgressiveLoad option. No pagination controls will be visible on screen, it just reusues the functionality of the pagination module to sequentially load the data. + + With this mode enabled, all of the settings outlined in the Ajax Documentation are still available + + There are two different progressive loading modes, to give you a choice of how data is loaded into the table. */ + ajaxProgressiveLoad?: "load" | "scroll"; + /**By default tabulator will make the requests to fill the table as quickly as possible. On some servers these repeates requests from the same client may trigger rate limiting or security systems. In this case you can use the ajaxProgressiveLoadDelay option to add a delay in milliseconds between each page request. */ + ajaxProgressiveLoadDelay?: number; + /**The ajaxProgressiveLoadScrollMargin property determines how close to the bottom of the table in pixels, the scroll bar must be before the next page worth of data is loaded, by default it is set to twice the height of the table. */ + ajaxProgressiveLoadScrollMargin?: number; + + /**Show loader while data is loading, can also take a function that must return a boolean */ + ajaxLoader?: boolean | (() => boolean); + + /**html for loader element */ + ajaxLoaderLoading?: string; + /**html for the loader element in the event of an error */ + ajaxLoaderError?: string; + + /**The ajaxRequesting callback is triggered when ever an ajax request is made. */ + ajaxRequesting?: (url: string, params: any) => boolean; + /**The ajaxResponse callback is triggered when a successful ajax request has been made. This callback can also be used to modify the received data before it is parsed by the table. If you use this callback it must return the data to be parsed by Tabulator, otherwise no data will be rendered */ + ajaxResponse?: (url: string, params: any, response: any) => any; + /**The ajaxError callback is triggered there is an error response to an ajax request. */ + ajaxError?: (xhr: any, textStatus: any, errorThrown: any) => void; + }; + + interface AjaxContentType { + headers: JSONRecord; + body: (url: string, config: any, params: any) => any; + } + + type HttpMethod = "GET" | "POST"; + interface AjaxConfig { + method?: HttpMethod; + headers?: JSONRecord; + mode?: string; + credentials?: string; + } + + type OptionsRows = { + /**Tabulator also allows you to define a row level formatter using the rowFormatter option. this lets you alter each row of the table based on the data it contains. + + The function accepts one argument, the RowComponent for the row being formatted. */ + rowFormatter?: (row: RowComponent) => any; + + /**The position in the table for new rows to be added, "bottom" or "top" */ + addRowPos?: "bottom" | "top"; + + /**The selectable option can take one of a several values: + + false - selectable rows are disabled + true - selectable rows are enabled, and you can select as many as you want + integer - any integer value, this sets the maximum number of rows that can be selected (when the maximum number of selected rows is exeded, the first selected row will be deselected to allow the next row to be selected). + "highlight" (default) - rows have the same hover stylings as selectable rows but do not change state when clicked. This is great for when you want to show that a row is clickable but don't want it to be selectable. */ + selectable?: boolean | number | "highlight"; + + /**By default you can select a range of rows by holding down the shift key and click dragging over a number of rows to toggle the selected state state of all rows the cursor passes over. + + If you would prefere to select a range of row by clicking on the first row then holding down shift and clicking on the end row then you can acheive this by setting the selectableRangeMode to click */ + selectableRangeMode?: "click"; + + /**By default, row selection works on a rolling basis, if you set the selectable option to a numeric value then when you select past this number of rows, the first row to be selected will be deselected. If you want to disable this behaviour and instead prevent selection of new rows once the limit is reached you can set the selectableRollingSelection option to false. */ + selectableRollingSelection?: boolean; + + /**By default Tabulator will maintain selected rows when the table is filtered, sorted or paginated (but NOT when the setData function is used). If you want the selected rows to be cleared whenever the table view is updated then set the selectablePersistence option to false. */ + selectablePersistence?: boolean; + + /**You many want to exclude certain rows from being selected. The selectableCheck options allows you to pass a function to check if the current row should be selectable, returning true will allow row selection, false will result in nothing happening. The function should accept a RowComponent as its first argument. */ + selectableCheck?: (row: RowComponent) => boolean; + + /**To allow the user to move rows up and down the table, set the movableRows parameter in the options: */ + movableRows?: boolean; + + /**Tabulator also allows you to move rows between tables. To enable this you should supply either a valid CSS selector string a DOM node for the table or the Tabuator object for the table to the movableRowsConnectedTables option. if you want to connect to multple tables then you can pass in an array of values to this option. */ + movableRowsConnectedTables?: string | string[] | HTMLElement | HTMLElement[]; + + /**The movableRowsSender option should be set on the sending table, and sets the action that should be taken after the row has been successfuly dropped into the receiving table. + + There are several inbuilt sender functions: + + false - do nothing(default) + delete - deletes the row from the table + You can also pass a callback to the movableRowsSender option for custom sender functionality + */ + movableRowsSender?: false | "delete" | ((fromRow: RowComponent, toRow: RowComponent, toTable: Tabulator) => any); + + /** The movableRowsReceiver option should be set on the receiving tables, and sets the action that should be taken when the row is dropped into the table. + There are several inbuilt receiver functions: + + insert - inserts row next to the row it was dropped on, if not dropped on a row it is added to the table (default) + add - adds row to the table + update - updates the row it is dropped on with the sent rows data + replace - replaces the row it is dropped on with the sent row*/ + movableRowsReceiver?: "insert" | "add" | "update" | "replace" | ((fromRow: RowComponent, toRow: RowComponent, fromTable: Tabulator) => any); + + /**You can allow the user to manually resize rows by dragging the top or bottom border of a row. To enable this functionality, set the resizableRows property to true */ + resizableRows?: boolean; + + /** + * The default ScrollTo position can be set using the scrollToRowPosition option. It can take one of four possible values: + + top - position row with its top edge at the top of the table (default) + center - position row with its top edge in the center of the table + bottom - position row with its bottom edge at the bottom of the table + nearest - position row on the edge of the table it is closest to + */ + scrollToRowPosition?: ScrollToRowPostition; + + /**The default option for triggering a ScrollTo on a visible element can be set using the scrollToRowIfVisible option. It can take a boolean value: + + true - scroll to row, even if it is visible (default) + false - scroll to row, unless it is currently visible, then don't move */ + scrollToRowIfVisible?: boolean; + + /**The dataTreeRowExpanded callback is triggered when a row with child rows is expanded to reveal the children. */ + dataTreeRowExpanded?: (row: RowComponent, level: number) => void; + + /**The dataTreeRowCollapsed callback is triggered when a row with child rows is collapsed to hide its children.*/ + dataTreeRowCollapsed?: (row: RowComponent, level: number) => void; + + /**The movableRowsSendingStart callback is triggered on the sending table when a row is picked up from a sending table. */ + movableRowsSendingStart?: (toTables: any[]) => void; + + /**The movableRowsSent callback is triggered on the sending table when a row has been successfuly received by a receiving table. */ + movableRowsSent?: (fromRow: RowComponent, toRow: RowComponent, toTable: Tabulator) => void; + + /**The movableRowsSentFailed callback is triggered on the sending table when a row has failed to be received by the receiving table.*/ + movableRowsSentFailed?: (fromRow: RowComponent, toRow: RowComponent, toTable: Tabulator) => void; + + /**The movableRowsSendingStop callback is triggered on the sending table after a row has been dropped and any senders and receivers have been handled. */ + movableRowsSendingStop?: (toTables: any[]) => void; + + /**The movableRowsReceivingStart callback is triggered on a receiving table when a connection is established with a sending table. */ + movableRowsReceivingStart?: (fromRow: RowComponent, toTable: Tabulator) => void; + + /**The movableRowsReceived callback is triggered on a receiving table when a row has been successfuly received.*/ + movableRowsReceived?: (fromRow: RowComponent, toRow: RowComponent, fromTable: Tabulator) => void; + + /**The movableRowsReceivedFailed callback is triggered on a receiving table when a row receiver has returned false.*/ + movableRowsReceivedFailed?: (fromRow: RowComponent, toRow: RowComponent, fromTable: Tabulator) => void; + + /**The movableRowsReceivingStop callback is triggered on a receiving table after a row has been dropped and any senders and receivers have been handled.*/ + movableRowsReceivingStop?: (fromTable: Tabulator) => void; + + /**The rowClick callback is triggered when a user clicks on a row. */ + rowClick?: RowEventCallback; + /**The rowDblClick callback is triggered when a user double clicks on a row. */ + rowDblClick?: RowEventCallback; + /**The rowContext callback is triggered when a user right clicks on a row. + + If you want to prevent the browsers context menu being triggered in this event you will need to include the preventDefault() function in your callback. */ + rowContext?: RowEventCallback; + /**The rowTap callback is triggered when a user taps on a row on a touch display. */ + rowTap?: RowEventCallback; + /**The rowDblTap callback is triggered when a user taps on a row on a touch display twice in under 300ms. */ + rowDblTap?: RowEventCallback; + /**The rowTapHold callback is triggered when a user taps on a row on a touch display and holds their finger down for over 1 second. */ + rowTapHold?: RowEventCallback; + /**The rowMouseEnter callback is triggered when the mouse pointer enters a row. */ + rowMouseEnter?: RowEventCallback; + /**The rowMouseLeave callback is triggered when the mouse pointer leaves a row. */ + rowMouseLeave?: RowEventCallback; + /** The rowMouseOver callback is triggered when the mouse pointer enters a row or any of its child elements.*/ + rowMouseOver?: RowEventCallback; + /**The rowMouseOut callback is triggered when the mouse pointer leaves a row or any of its child elements. */ + rowMouseOut?: RowEventCallback; + /**The rowMouseMove callback is triggered when the mouse pointer moves over a row. */ + rowMouseMove?: RowEventCallback; + /**The rowAdded callback is triggered when a row is added to the table by the addRow and updateOrAddRow functions. */ + rowAdded?: RowChangedCallback; + /**The rowUpdated callback is triggered when a row is updated by the updateRow, updateOrAddRow, updateData or updateOrAddData, functions. */ + rowUpdated?: RowChangedCallback; + /**The rowDeleted callback is triggered when a row is deleted from the table by the deleteRow function. */ + rowDeleted?: RowChangedCallback; + /**The rowMoved callback will be triggered when a row has been successfuly moved. */ + rowMoved?: RowChangedCallback; + /**The rowResized callback will be triggered when a row has been resized by the user. */ + rowResized?: RowChangedCallback; + /**Whenever the number of selected rows changes, through selection or deselection, the rowSelectionChanged event is triggered. This passes an array of the data objects for each row in the order they were selected as the first argument, and an array of row components for each of the rows in order of selection as the second argument. */ + rowSelectionChanged?: (data: any[], rows: RowComponent[]) => void; + /**The rowSelected event is triggered when a row is selected, either by the user or programatically. */ + rowSelected?: RowChangedCallback; + /**The rowDeselected event is triggered when a row is deselected, either by the user or programatically. */ + rowDeselected?: RowChangedCallback; + }; + + type OptionsColumns = { + /**The column definitions are provided to Tabluator in the columns property of the table constructor object and should take the format of an array of objects, with each object representing the configuration of one column. */ + columns?: ColumnDefinition[]; + + /** + * If you set the autoColumns option to true, every time data is loaded into the table through the data option or through the setData function, Tabulator will examine the first row of the data and build columns to match that data. + */ + autoColumns?: boolean; + + /**By default Tabulator will use the fitData layout mode, which will resize the tables columns to fit the data held in each column, unless you specify a width or minWidth in the column constructor. If the width of all columns exceeds the width of the containing element, a scroll bar will appear. */ + layout?: "fitData" | "fitColumns" | "fitDataFill"; + + /**To keep the layout of the columns consistent, once the column widths have been set on the first data load (either from the data property in the constructor or the setData function) they will not be changed when new data is loaded. + + If you would prefer that the column widths adjust to the data each time you load it into the table you can set the layoutColumnsOnNewData property to true. */ + layoutColumnsOnNewData?: boolean; + + /**Responsive layout will automatically hide/show columns to fit the width of the Tabulator element. This allows for clean rendering of tables on smaller mobile devices, showing important data while avoiding horizontal scroll bars. You can enable responsive layouts using the responsiveLayout option. + + There are two responsive layout modes available: + + hide - hide columns that no longer fit in the table + collapse - collapse columns that no longer fit on the table into a list under the row + + Hide Extra Columns + By default, columns will be hidden from right to left as the width of the table decreases. You can choose exactlyhow columns are hidden using the responsive property in the column definition object. + + When responsive layout is enabled, all columns are given a default responsive value of 1. The higher you set this value the sooner that column will be hidden as the table width decreases. If two columns have the same responsive value then they are hidden from right to left (as defined in the column definition array, ignoring user moving of the columns). If you set the value to 0 then the column will never be hidden regardless of how narrow the table gets. */ + responsiveLayout?: boolean | "hide" | "collapse"; + + /**Collapsed lists are displayed to the user by default, if you would prefer they start closed so the user can open them you can use the responsiveLayoutCollapseStartOpen option */ + responsiveLayoutCollapseStartOpen?: boolean; + + /**By default any formatter set on the column is applied to the value that will appear in the list. while this works for most formatters it can cause issues with the progress formatter which relies on being inside a cell. + + If you would like to disable column formatting in the collapsed list, you can use the responsiveLayoutCollapseUseFormatters option: */ + responsiveLayoutCollapseUseFormatters?: boolean; + + /**If you set the responsiveLayout option to collapse the values from hidden columns will be displayed in a title/value list under the row. + + In this mode an object containing the title of each hidden column and its value is generated and then used to generate a list displayed in a div .tabulator-responsive-collapse under the row data. + + The inbuilt collapse formatter creates a table to neatly display the hidden columns. If you would like to format the data in your own way you can use the responsiveLayoutCollapseFormatter, it take an object of the column values as an argument and must return the HTML content of the div. + + This function should return an empty string if there is no data to display. */ + responsiveLayoutCollapseFormatter?: (data: any[]) => any; + + /**It is possible to set a minimum column width to prevent resizing columns from becoming too small. + + This can be set globally, by setting the columnMinWidth option to the column width when you create your Tabulator. + + This option can be overridden on a per column basis by setting the minWidth property on the column definition. */ + columnMinWidth?: number; + + /**By default it is possible to manually resize columns by dragging the borders of the column in both the column headers and the cells of the column. + + If you want to alter this behaviour you can use the resizableColumns to choose where the resize handles are available. */ + resizableColumns?: true | false | "header" | "cell"; + + /**To allow the user to move columns along the table, set the movableColumns parameter in the options: */ + movableColumns?: boolean; + + /**Header tooltips can be set globally using the tooltipsHeader options parameter */ + tooltipsHeader?: boolean; + + /**You can use the columnVertAlign option to set how the text in your column headers should be vertically */ + columnVertAlign?: "top" | "middle" | "bottom"; + + /**The default placeholder text used for input elements can be set using the headerFilterPlaceholder option in the table definition */ + headerFilterPlaceholder?: string; + + /**The default ScrollTo position can be set using the scrollToColumnPosition option. It can take one of three possible values: + + left - position column with its left edge at the left of the table (default) + center - position column with its left edge in the center of the table + right - position column with its right edge at the right of the table */ + scrollToColumnPosition?: ScrollToColumnPosition; + + /**The default option for triggering a ScrollTo on a visible element can be set using the scrollToColumnIfVisible option. It can take a boolean value: + + true - scroll to column, even if it is visible (default) + false - scroll to column, unless it is currently visible, then don't move */ + scrollToColumnIfVisible?: boolean; + + /**By default column calculations are shown at the top and bottom of the table, unless row grouping is enabled, in which case they are shown at the top and bottom of each group. + + The columnCalcs option lets you decided where the calculations should be displayed, it can take one of four values: + + true - show calcs at top and bottom of the table, unless grouped, then show in groups (boolean, default) + both - show calcs at top and bottom of the table and show in groups + table - show calcs at top and bottom of the table only + group - show calcs in groups only */ + columnCalcs?: boolean | "both" | "table" | "group"; + + /**If you need to use the . character as part of your field name, you can change the separator to any other character using the nestedFieldSeparator option + * Set to false to disable nested data parsing + */ + nestedFieldSeparator?: string | boolean; + + /**multiple or single column sorting */ + columnHeaderSortMulti?: boolean; + + /**The columnMoved callback will be triggered when a column has been successfuly moved. */ + columnMoved?: (column: ColumnComponent, columns: any[]) => void; + columnResized?: (column: ColumnComponent) => void; + /**The columnVisibilityChanged callback is triggered whenever a column changes between hidden and visible states. */ + columnVisibilityChanged?: (column: ColumnComponent, visible: boolean) => void; + + /**The columnTitleChanged callback is triggered whenever a user edits a column title when the editableTitle parameter has been enabled in the column definition array. */ + columnTitleChanged?: (column: ColumnComponent) => void; + }; + + type OptionsCell = { + /**The cellClick callback is triggered when a user left clicks on a cell, it can be set on a per column basis using the option in the columns definition object. */ + cellClick?: CellEventCallback; + cellDblClick?: CellEventCallback; + cellContext?: CellEventCallback; + cellTap?: CellEventCallback; + cellDblTap?: CellEventCallback; + cellTapHold?: CellEventCallback; + cellMouseEnter?: CellEventCallback; + cellMouseLeave?: CellEventCallback; + cellMouseOver?: CellEventCallback; + cellMouseOut?: CellEventCallback; + cellMouseMove?: CellEventCallback; + cellEditing?: CellEditEventCallback; + cellEdited?: CellEditEventCallback; + cellEditCancelled?: CellEditEventCallback; + }; + + type OptionsGeneral = { + /**Sets the height of the containing element, can be set to any valid height css value. If set to false (the default), the height of the table will resize to fit the table data. */ + height?: string | number | false; + /**Enable rendering using the Virtual DOM engine */ + virtualDom?: boolean; + + /**Manually set the size of the virtual DOM buffer */ + virtualDomBuffer?: boolean; + /**placeholder element to display on empty table */ + placeholder?: string | HTMLElement; + + /**Footer element to display for the table */ + footerElement?: string | HTMLElement; + + /**Function to generate tooltips for cells */ + tooltips?: GlobalTooltipOption; + /**When to regenerate cell tooltip value */ + tooltipGenerationMode?: "load"; + + /**Keybinding configuration object */ + keybindings?: false | KeyBinding; + + /** + * The reactivity systems allow Tabulator to watch arrays and objects passed into the table for changes and then automatically update the table. + + This approach means you no longer need to worry about calling a number of different functions on the table to make changes, you simply update the array or object you originally passed into the table and Tabulator will take care of the rest. + + You can enable reactive data by setting the reactiveData option to true in the table constructor, and then passing your data array to the data option. + + Once the table is built any changes to the array will automatically be replicated to the table without needing to call any functions on the table itself*/ + + reactiveData?: boolean; + + //Not listed in options-------------------- + /**Tabulator will automatically attempt to redraw the data contained in the table if the containing element for the table is resized. To disable this functionality, set the autoResize property to false */ + autoResize?: boolean; + + /**When a the tabulator constructor is called, the tableBuilding callback will triggered */ + tableBuilding?: () => void; + + /**When a the tabulator constructor is called and the table has finished being rendered, the tableBuilt callback will triggered: */ + tableBuilt?: () => void; + + /**The renderStarted callback is triggered whenever all the rows in the table are about to be rendered. This can include: + Data is loaded into the table when setData is called + A page is loaded through any form of pagination + Rows are added to the table during progressive rendering + Columns are changed by setColumns + The data is filtered + The data is sorted + The redraw function is called */ + renderStarted?: () => void; + + /**The renderComplete callback is triggered after the table has been rendered */ + renderComplete?: () => void; + + /**The htmlImporting callback is triggered when Tabulator starts importing data from an HTML table. */ + htmlImporting?: EmptyCallback; + + /**The htmlImported callback is triggered when Tabulator finishes importing data from an HTML table. */ + htmlImported?: EmptyCallback; + + /**The dataLoading callback is triggered whenever new data is loaded into the table. */ + dataLoading?: (data: any) => void; + /**The dataLoaded callback is triggered when a new set of data is loaded into the table. */ + dataLoaded?: (data: any) => void; + /**The dataEdited callback is triggered whenever the table data is changed by the user. Triggers for this include editing any cell in the table, adding a row and deleting a row. */ + dataEdited?: (data: any) => void; + + /**Whenever a page has been loaded, the pageLoaded callback is called, passing the current page number as an argument. */ + pageLoaded?: (pageno: number) => void; + + /**The dataSorting callback is triggered whenever a sort event occurs, before sorting happens. */ + dataSorting?: (sorters: Sorter[]) => void; + + /**The dataSorted callback is triggered after the table dataset is sorted. */ + dataSorted?: (sorters: Sorter[], rows: RowComponent[]) => void; + }; + + type DownloadType = "csv" | "json" | "xlsx" | "pdf"; + + interface DownloadOptions extends DownloadCSV, DownloadXLXS, DownloadPDF { + downloadType: DownloadType; + fileName: string; + } + + interface DownloadCSV { + /**By default CSV files are created using a comma (,) delimiter. If you need to change this for any reason the you can pass the options object with a delimiter property to the download function which will then use this delimiter instead of the comma. */ + delimiter?: "string"; + /**If you need the output CSV to include a byte order mark (BOM) to ensure that output with UTF-8 characters can be correctly interpereted across didfferent applications, you should set the bom option to true */ + bom?: boolean; + } + + interface DownloadXLXS { + /**The sheet name must be a valid Excel sheet name, and cannot include any of the following characters \, /, *, [, ], :, */ + sheetName?: string; + } + + interface DownloadPDF { + orientation?: "portrait" | "landscape"; + title?: string; + rowGroupStyles?: any; + rowCalcStyles?: any; + jsPDF?: any; + autoTable?: {} | ((doc: any) => any); + } + + type OptionsDownload = { + /**If you want to make any bulk changes to the table data before it is parsed into the download file you can pass a mutator function to the downloadDataFormatter option in the table definition */ + downloadDataFormatter?: (data: any[]) => any; + + /**The downloadReady callback allows you to intercept the download file data before the users is prompted to save the file. + + In order for the download to proceed the downloadReady callback is expected to return a blob of file to be downloaded. + + If you would prefer to abort the download you can return false from this callback. This could be useful for example if you want to send the created file to a server via ajax rather than allowing the user to download the file. */ + downloadReady?: (fileContents: any, blob: any) => any; + + /**The downloadComplete callback is triggered when the user has been prompted to download the file. */ + downloadComplete?: () => void; + + /**By default Tabulator includes column headers, row groups and column calculations in the download output. + + You can choose to remove column headers groups, row groups or column calculations from the output data by setting the values in the downloadConfig option in the table definition: */ + + downloadConfig?: { + columnGroups?: boolean; + rowGroups?: boolean; + columnCalcs?: boolean; + }; + }; + + type OptionsLocale = { + /**You can set the current local in one of two ways. If you want to set it when the table is created, simply include the locale option in your Tabulator constructor. You can either pass in a string matching one of the language options you have defined, or pass in the boolean true which will cause Tabulator to auto-detect the browsers language settings from the navigator.language object. */ + locale?: boolean | string; + + /**You can store as many languages as you like, creating an object inside the langs object with a property of the locale code for that language. A list of locale codes can be found here. + + At present there are three parts of the table that can be localised, the column headers, the header filter placeholder text and the pagination buttons. To localize the pagination buttons, create a pagination property inside your language object and give it the properties outlined below. + + If you wish you can also localize column titles by adding a columns property to your language object. You should store a property of the field name of the column you wish to change, with a value of its title. Any fields that match this will use this title instead of the one provided by the column definition array. */ + langs?: any; + + /**When a localization event has occurred , the localized callback will triggered, passing the current locale code and language object: */ + localized?: (locale: string, lang: any) => void; + }; + + type HistoryAction = "cellEdit" | "rowAdd" | "rowDelete" | "rowMoved"; + type OptionsHistory = { + /**Enable user interaction history functionality */ + history?: boolean; + + /**The historyUndo event is triggered when the undo action is triggered. */ + historyUndo: (action: HistoryAction, component: CellComponent | RowComponent, data: any) => void; + /**The historyRedo event is triggered when the redo action is triggered. */ + historyRedo: (action: HistoryAction, component: CellComponent | RowComponent, data: any) => void; + }; + + interface ColumnLayout { + /**title - Required This is the title that will be displayed in the header for this column */ + title: string; + /**field - Required (not required in icon/button columns) this is the key for this column in the data array*/ + field?: string; + /**visible - (boolean, default - true) determines if the column is visible. (see Column Visibility for more details */ + visible?: boolean; + + /**sets the width of this column, this can be set in pixels or as a percentage of total table width (if not set the system will determine the best) */ + width?: number | string; + } + + interface ColumnDefinition extends ColumnLayout, CellCallbacks { + //Layout + /**sets the text alignment for this column */ + align?: "left" | "center" | "right"; //Align? + /**sets the minimum width of this column, this should be set in pixels (this takes priority over the global option of columnMinWidth) */ + minWidth?: number; + + /**The widthGrow property should be used on columns without a width property set. The value is used to work out what fraction of the available will be allocated to the column. The value should be set to a number greater than 0, by default any columns with no width set have a widthGrow value of 1 */ + widthGrow?: number; + + /**The widthShrink property should be used on columns with a width property set. The value is used to work out how to shrink columns with a fixed width when the table is too narrow to fit in all the columns. The value should be set to a number greater than 0, by default columns with a width set have a widthShrink value of 0, meaning they will not be shrunk if the table gets too narrow, and may cause the horizontal scrollbar to appear. */ + widthShrink?: number; + + /**set whether column can be resized by user dragging its edges */ + resizable?: boolean; + /**You can freeze the position of columns on the left and right of the table using the frozen property in the column definition array. This will keep the column still when the table is scrolled horizontally. */ + frozen?: boolean; + /**an integer to determine when the column should be hidden in responsive mode */ + responsive?: number; + /**sets the on hover tooltip for each cell in this column + * + * The tooltip parameter can take three different types of value + boolean - a value of false disables the tooltip, a value of true sets the tooltip of the cell to its value + string - a string that will be displayed for all cells in the matching column/table. + function - a callback function that returns the string for the cell + + * Note: setting a tooltip value on a column will override the global setting. + */ + tooltip?: string | GlobalTooltipOption; + /**sets css classes on header and cells in this column. (value should be a string containing space separated class names) */ + cssClass?: string; + /**sets the column as a row handle, allowing it to be used to drag movable rows. */ + rowHandle?: boolean; + /**When the getHtml function is called, hide the column from the output. */ + hideInHtml?: boolean; + + //Data Manipulation + /** By default Tabulator will attempt to guess which sorter should be applied to a column based on the data contained in the first row. It can determine sorters for strings, numbers, alphanumeric sequences and booleans, anything else will be treated as a string. + +To specify a sorter to be used on a column use the sorter property in the columns definition object + +You can pass an optional additional property with sorter, sorterParams that should contain an object with additional information for configuring the sorter*/ + sorter?: "string" | "number" | "alphanum" | "boolean" | "exists" | "date" | "time" | "datetime" | "array" | ((a: any, b: any, aRow: RowComponent, bRow: RowComponent, column: ColumnComponent, dir: SortDirection, sorterParams: {}) => number); + /**If you want to dynamically generate the sorterParams at the time the sort is called you can pass a function into the property that should return the params object. */ + sorterParams?: ColumnDefinitionSorterParams | ColumnSorterParamLookupFunction; + /** set how you would like the data to be formatted*/ + formatter?: Formatter; + /** You can pass an optional additional parameter with the formatter, formatterParams that should contain an object with additional information for configuring the formatter.*/ + formatterParams?: FormatterParams; + /**alter the row height to fit the contents of the cell instead of hiding overflow */ + variableHeight?: boolean; + /** There are some circumstances where you may want to block editibility of a cell for one reason or another. To meet this need you can use the editable option. This lets you set a callback that is executed before the editor is built, if this callback returns true the editor is added, if it returns false the edit is aborted and the cell remains a non editable cell. The function is passed one parameter, the CellComponent of the cell about to be edited. You can also pass a boolean value instead of a function to this property.*/ + editable?: boolean | ((cell: CellComponent) => boolean); + /**When a user clicks on an editable column the will be able to edit the value for that cell. + + By default Tabulator will use an editor that matches the current formatter for that cell. if you wish to specify a specific editor, you can set them per column using the editor option in the column definition. Passing a value of true to this option will result in Tabulator applying the editor that best matches the columns formatter, if present. + + You can pass an optional additional parameter with the editor, editorParams that should contain an object with additional information for configuring the editor. */ + editor?: Editor; + /** */ + editorParams?: EditorParams; + + /**Validators are used to ensure that any user input into your editable cells matches your requirements. + + Validators can be applied by using the validator property in a columns definition object (see Define Columns for more details). */ + validator?: StandardValidatorType | StandardValidatorType[] | Validator | Validator[]; + + /**Mutators are used to alter data as it is parsed into Tabulator. For example if you wanted to convert a numeric column into a boolean based on its value, before the data is used to build the table. + + You can set mutators on a per column basis using the mutator option in the column definition object. + + You can pass an optional additional parameter with mutator, mutatorParams that should contain an object with additional information for configuring the mutator. */ + mutator?: CustomMutator; + /**You can pass an optional additional parameter with mutator, mutatorParams that should contain an object with additional information for configuring the mutator. */ + mutatorParams?: CustomMutatorParams; + /** only called when data is loaded via a command {eg. setData). */ + mutatorData?: CustomMutator; + mutatorDataParams?: CustomMutatorParams; + + /**only called when data is changed via a user editing a cell. */ + mutatorEdit?: CustomMutator; + mutatorEditParams?: CustomMutatorParams; + + /**only called when data is changed via a user editing a cell. */ + mutatorClipboard?: CustomMutator; + mutatorClipboardParams?: CustomMutatorParams; + + /** Accessors are used to alter data as it is extracted from the table, through commands, the clipboard, or download. + + You can set accessors on a per column basis using the accessor option in the column definition object.*/ + accessor?: CustomAccessor; + /** Each accessor function has its own matching params option, for example accessorDownload has accessorDownloadParams.*/ + accessorParams?: CustomAccessorParams; + /**only called when data is being converted into a downloadable file. */ + accessorDownload?: CustomAccessor; + /** */ + accessorDownloadParams?: CustomAccessorParams; + + /**only called when data is being copied into the clipboard. */ + accessorClipboard?: CustomAccessor; + /** */ + accessorClipboardParams?: CustomAccessorParams; + + /**show or hide column in downloaded data */ + download?: boolean; + /**set custom title for column in download */ + downloadTitle?: string; + + /** the column calculation to be displayed at the top of this column(see Column Calculations for more details) */ + topCalc?: ColumnCalc; + /**additional parameters you can pass to the topCalc calculation function (see Column Calculations for more details) */ + topCalcParams?: ColumnCalcParams; + /**formatter for the topCalc calculation cell */ + topCalcFormatter?: Formatter; + /** additional parameters you can pass to the topCalcFormatter function */ + topCalcFormatterParams?: FormatterParams; + + bottomCalc?: ColumnCalc; + bottomCalcParams?: ColumnCalcParams; + bottomCalcFormatter?: Formatter; + /** additional parameters you can pass to the bottomCalcFormatter function */ + bottomCalcFormatterParams?: FormatterParams; + + //Column Header + /**By default all columns in a table are sortable by clicking on the column header, if you want to disable this behaviour, set the headerSort property to false in the column definition array: */ + headerSort?: boolean; + /**set the starting sort direction when a user first clicks on a header */ + headerSortStartingDir?: SortDirection; + + /**allow tristate toggling of column header sort direction */ + headerSortTristate?: boolean; + + /** callback for when user clicks on the header for this column*/ + headerClick?: ColumnEventCallback; + /** callback for when user double clicks on the header for this column */ + headerDblClick?: ColumnEventCallback; + /**callback for when user right clicks on the header for this column */ + headerContext?: ColumnEventCallback; + /** callback for when user taps on a header for this column, triggered in touch displays. */ + headerTap?: ColumnEventCallback; + /**callback for when user double taps on a header for this column, triggered in touch displays when a user taps the same header twice in under 300ms */ + headerDblTap?: ColumnEventCallback; + /**callback for when user taps and holds on a header for this column, triggered in touch displays when a user taps and holds the same header for 1 second. */ + headerTapHold?: ColumnEventCallback; + /**sets the on hover tooltip for the column header + * + * The tooltip headerTooltip can take three different types of value + + boolean - a value of false disables the tooltip, a value of true sets the tooltip of the column header to its title value. + string - a string that will be displayed for the tooltip. + function - a callback function that returns the string for the column header + * + */ + headerTooltip?: boolean | string | ((column: ColumnComponent) => string); + /**change the orientation of the column header to vertical + * + * The headerVertical property can take one of three values: + + false - vertical columns disabled (default value) + true - vertical columns enabled + "flip" - vertical columns enabled, with text direction flipped by 180 degrees + * + */ + headerVertical?: boolean | "flip"; + + /**allows the user to edit the header titles */ + editableTitle?: boolean; + /** formatter function for header title */ + titleFormatter?: Formatter; + + /**additional parameters you can pass to the header title formatter */ + titleFormatterParams?: FormatterParams; + /** filtering of columns from elements in the header */ + headerFilter?: Editor; + /**additional parameters you can pass to the header filter */ + headerFilterParams?: EditorParams; + + /** placeholder text for the header filter */ + headerFilterPlaceholder?: string; + + /** function to check when the header filter is empty */ + headerFilterEmptyCheck?: ValueBooleanCallback; + /** By default Tabulator will try and match the comparison type to the type of element used for the header filter. + + Standard input elements will use the "like" filter, this allows for the matches to be displayed as the user types. + + For all other element types (select boxes, check boxes, input elements of type number) an "=" filter type is used. + + If you want to specify the type of filter used you can pass it to the headerFilterFunc option in the column definition object. This will take any of the standard filters outlined above or a custom function*/ + headerFilterFunc?: FilterType | ((headerValue: any, rowValue: any, rowdata: any, filterparams: any) => boolean); + /** additional parameters object passed to the headerFilterFunc function */ + headerFilterFuncParams?: any; + + /**disable live filtering of the table */ + headerFilterLiveFilter?: boolean; + } + + interface CellCallbacks { + //Cell Events + /**callback for when user clicks on a cell in this column */ + cellClick?: CellEventCallback; + /** callback for when user double clicks on a cell in this column */ + cellDblClick?: CellEventCallback; + /**callback for when user right clicks on a cell in this column */ + cellContext?: CellEventCallback; + /**callback for when user taps on a cell in this column, triggered in touch displays. */ + cellTap?: CellEventCallback; + /** callback for when user double taps on a cell in this column, triggered in touch displays when a user taps the same cell twice in under 300ms. */ + cellDblTap?: CellEventCallback; + /** callback for when user taps and holds on a cell in this column, triggered in touch displays when a user taps and holds the same cell for 1 second.*/ + cellTapHold?: CellEventCallback; + + /**callback for when the mouse pointer enters a cell */ + cellMouseEnter?: CellEventCallback; + /** callback for when the mouse pointer leaves a cell */ + cellMouseLeave?: CellEventCallback; + + /** callback for when the mouse pointer enters a cell or one of its child elements */ + cellMouseOver?: CellEventCallback; + + /**callback for when the mouse pointer enters a cell or one of its child elements */ + cellMouseOut?: CellEventCallback; + + /**callback for when the mouse pointer moves over a cell */ + cellMouseMove?: CellEventCallback; + + //Cell editing + /**callback for when a cell in this column is being edited by the user */ + cellEditing?: CellEditEventCallback; + + /**callback for when a cell in this column has been edited by the user */ + cellEdited?: CellEditEventCallback; + + /** callback for when an edit on a cell in this column is aborted by the user */ + cellEditCancelled?: CellEditEventCallback; + } + + interface ColumnDefinitionSorterParams { + format?: string; + locale?: string | boolean; + alignEmptyValues?: "top" | "bottom"; + type?: "length" | "sum" | "max" | "min" | "avg"; + } + + type GlobalTooltipOption = boolean | ((cell: CellComponent) => string); + type CustomMutator = (value: any, data: any, type: "data" | "edit", mutatorParams: any, cell?: CellComponent) => any; + type CustomMutatorParams = {} | ((value: any, data: any, type: "data" | "edit", cell?: CellComponent) => any); + type CustomAccessor = (value: any, data: any, type: "data" | "download" | "clipboard", AccessorParams: any, column?: ColumnComponent) => any; + type CustomAccessorParams = {} | ((value: any, data: any, type: "data" | "download" | "clipboard", column?: ColumnComponent) => any); + type ColumnCalc = "avg" | "max" | "min" | "sum" | "concat" | "count" | ((values: Array, data: Array, calcParams: {}) => number); + type ColumnCalcParams = (values: any, data: any) => any; + type Formatter = "plaintext" | "textarea" | "html" | "money" | "image" | "datetime" | "datetimediff" | "link" | "tickCross" | "color" | "star" | "traffic" | "progress" | "lookup" | "buttonTick" | "buttonCross" | "rownum" | "handle" | ((cell: CellComponent, formatterParams: {}, onRendered: EmptyCallback) => string | HTMLElement); + type FormatterParams = MoneyParams | ImageParams | LinkParams | DateTimeParams | DateTimeDifferenceParams | TickCrossParams | TrafficParams | StarRatingParams | JSONRecord | ((cell: CellComponent) => {}); + + type Editor = true | "input" | "textarea" | "number" | "range" | "tick" | "star" | "select" | "autocomplete" | ((cell: CellComponent, onRendered: EmptyCallback, success: ValueVoidCallback, cancel: ValueVoidCallback, editorParams: {}) => HTMLElement | false); + + type EditorParams = NumberParams | CheckboxParams | SelectParams | AutoCompleteParams | ((cell: CellComponent) => {}); + + type ScrollToRowPostition = "top" | "center" | "bottom" | "nearest"; + type ScrollToColumnPosition = "left" | "center" | "middle" | "right"; + + interface MoneyParams { + //Money + decimal?: string; + thousand?: string; + symbol?: string; + symbolAfter?: boolean; + precision?: boolean | number; + } + interface ImageParams { + //Image + height?: string; + width?: string; + } + interface LinkParams { + //Link + labelField?: string; + label?: string; + urlPrefix?: string; + urlField?: string; + url?: string; + target?: string; + } + + interface DateTimeParams { + //datetime + inputFormat?: string; + outputFormat?: string; + invalidPlaceholder?: true | string | number | ValueStringCallback; + } + + interface DateTimeDifferenceParams extends DateTimeParams { + //Date Time Difference + date?: any; + humanize?: boolean; + unit?: "years" | "months" | "weeks" | "days" | "hours" | "minutes" | "seconds"; + suffix?: boolean; + } + interface TickCrossParams { + //Tick Cross + allowEmpty?: boolean; + allowTruthy?: boolean; + tickElement?: boolean | string; + crossElement?: boolean | string; + } + + interface TrafficParams { + //Traffic + min?: number; + max?: number; + color?: Color; + } + interface ProgressBarParams extends TrafficParams { + //Progress Bar + legend?: string | true | ValueStringCallback; + legendColor?: Color; + legendAlign?: Align; + } + + interface StarRatingParams { + //Star Rating + stars?: number; + } + + interface NumberParams { + //range,number + min?: number; + max?: number; + step?: number; + } + + interface CheckboxParams { + //tick + tristate?: boolean; + indeterminateValue?: string; + } + + interface SelectParams { + values: true | string[] | JSONRecord | SelectParamsGroup[]; + listItemFormatter?: (value: string, text: string) => string; + } + + interface SelectParamsGroup { + label: string; + value?: string | number | boolean; + options?: SelectLabelValue[]; + } + type SelectLabelValue = { label: string; value: string | number | boolean }; + + interface AutoCompleteParams { + values: true | string[] | JSONRecord; + listItemFormatter?: (value: string, text: string) => string; + searchFunc: (term: string, values: string[]) => string[]; + allowEmpty?: boolean; + freetext?: boolean; + showListOnEmpty?: boolean; + } + + type ValueStringCallback = (value: any) => string; + type ValueBooleanCallback = (value: any) => boolean; + type ValueVoidCallback = (value: any) => void; + type EmptyCallback = (callback: () => void) => void; + type CellEventCallback = (e: any, cell: CellComponent) => void; + type CellEditEventCallback = (cell: CellComponent) => void; + type ColumnEventCallback = (e: any, column: ColumnComponent) => void; + type RowEventCallback = (e: any, row: RowComponent) => void; + type RowChangedCallback = (row: RowComponent) => void; + type GroupEventCallback = (e: any, group: GroupComponent) => void; + + type SortDirection = "asc" | "desc"; + type FilterType = "=" | "!=" | "like" | "<" | ">" | "<=" | ">=" | "in" | "regex"; + type Color = string | any[] | ValueStringCallback; + type Align = "center" | "left" | "right" | "justify"; + + type JSONRecord = Record; + + type StandardValidatorType = "required" | "unique" | "integer" | "float" | "numeric" | "string"; + interface Validator { + type: StandardValidatorType | ((cell: CellComponent, value: any, parameters?: any) => boolean); + parameters?: any; + } + + type ColumnSorterParamLookupFunction = (column: ColumnComponent, dir: SortDirection) => {}; + + type ColumnLookup = ColumnComponent | ColumnDefinition | HTMLElement | string; + type RowLookup = RowComponent | HTMLElement | string | number; + + interface KeyBinding { + navPrev?: string | boolean; + navNext?: string | boolean; + navLeft?: string | boolean; + navRight?: string | boolean; + navUp?: string | boolean; + navDown?: string | boolean; + undo?: string | boolean; + redo?: string | boolean; + scrollPageUp?: string | boolean; + scrollPageDown?: string | boolean; + scrollToStart?: string | boolean; + scrollToEnd?: string | boolean; + copyToClipboard?: string | boolean; + } + + //Components------------------------------------------------------------------- + interface CellComponent { + /**The getValue function returns the current value for the cell. */ + getValue: () => any; + /**The getOldValue function returns the previous value of the cell. Very usefull in the event of cell update callbacks. */ + getOldValue: () => any; + /**The restoreOldValue reverts the value of the cell back to its previous value, without triggering any of the cell edit callbacks. */ + restoreOldValue: () => any; + /**The getElement function returns the DOM node for the cell. */ + + getElement: () => HTMLElement; + /**The getTable function returns the Tabulator object for the table containing the cell. */ + getTable: () => Tabulator; + /**The getRow function returns the RowComponent for the row that contains the cell. */ + getRow: () => RowComponent; + + /**The getColumn function returns the ColumnComponent for the column that contains the cell. */ + getColumn: () => ColumnComponent; + + /**The getData function returns the data for the row that contains the cell. */ + getData: () => {}; + /**The getField function returns the field name for the column that contains the cell. */ + getField: () => string; + /**You can change the value of the cell using the setValue function. The first parameter should be the new value for the cell, the second optional parameter will apply the column mutators to the value when set to true (default = true). */ + setValue: (value: any, mutate?: boolean) => void; + /**If you are making manual adjustments to elements contained withing the cell, or the cell itself, it may sometimes be necessary to recalculate the height of all the cells in the row to make sure they remain aligned. Call the checkHeight function to check if the height of the cell has changed and normalize the row if it has. */ + checkHeight: () => void; + /**You and programatically cause a cell to open its editor element using the edit function */ + edit: (ignoreEditable?: boolean) => void; + /**You and programatically cancel a cell edit that is currently in progress by calling the cancelEdit function */ + cancelEdit: () => void; + /**When a cell is being edited it is possible to move the editor focus from the current cell to one if its neighbours. There are a number of functions that can be called on the nav function to move the focus in different directions. */ + nav: () => CellNavigation; + } + + interface CellNavigation { + /**prev - next editable cell on the left, if none available move to the right most editable cell on the row above */ + prev: () => boolean; + /**next - next editable cell on the right, if none available move to left most editable cell on the row below */ + next: () => boolean; + /**left - next editable cell on the left, return false if none available on row */ + left: () => boolean; + /**right - next editable cell on the right, return false if none available on row */ + right: () => boolean; + /**up - move to the same cell in the row above */ + up: () => void; + /**down - move to the same cell in the row below */ + down: () => void; + } + + interface RowComponent { + /**The getData function returns the data object for the row.*/ + getData: () => {}; + /**The getElement function returns the DOM node for the row.*/ + getElement: () => HTMLElement; + + /**The getTable function returns the Tabulator object for the table containing the row. */ + getTable: () => Tabulator; + + /**The getNextRow function returns the Row Component for the next visible row in the table, if there is no next row it will return a value of false */ + getNextRow: () => RowComponent | false; + /**The getNextRow function returns the Row Component for the previous visible row in the table, if there is no next row it will return a value of false */ + getPrevRow: () => RowComponent | false; + + /**The getCells function returns an array of CellComponent objects, one for each cell in the row.*/ + getCells: () => Array; + /**The getCell function returns the CellComponent for the specified column from this row.*/ + getCell: (column: ColumnComponent | HTMLElement | string) => CellComponent; + /**The getIndex function returns the index value for the row. (this is the value from the defined index column, NOT the row's position in the table)*/ + getIndex: () => any; + + /**Use the getPosition function to retrieve the numerical position of a row in the table. By default this will return the position of the row in all data, including data currently filtered out of the table. + + If you want to get the position of the row in the currently filtered/sorted data, you can pass a value of true to the optional first argument of the function. */ + getPosition: (filteredPosition?: boolean) => number; + + /**When using grouped rows, you can retrieve the group component for the current row using the getGroup function. */ + getGroup: () => GroupComponent; + /**The delete function deletes the row, removing its data from the table + * + * The delete method returns a promise, this can be used to run any other commands that have to be run after the row has been deleted. By running them in the promise you ensure they are only run after the row has been deleted. + */ + delete: () => Promise; + /**The scrollTo function will scroll the table to the row if it passes the current filters.*/ + scrollTo: () => Promise; + + /**The pageTo function will load the page for the row if it passes the current filters.*/ + pageTo: () => Promise; + + /** You can move a row next to another row using the move function. + + The first argument should be the target row that you want to move to, and can be any of the standard row component look up options. + + The second argument determines whether the row is moved to above or below the target row. A value of false will cause to the row to be placed below the target row, a value of true will result in the row being placed above the target*/ + + move: (lookup: RowComponent | HTMLElement | number, belowTarget?: boolean) => void; + + /**You can update the data in the row using the update function. You should pass an object to the function containing any fields you wish to update. This object will not replace the row data, only the fields included in the object will be updated.*/ + update: (data: {}) => Promise; + /**The select function will select the current row.*/ + select: () => void; + /**The deselect function will deselect the current row.*/ + deselect: () => void; + /**The deselect function will toggle the current row.*/ + toggleSelect: () => void; + /**The isSelected function will return a boolean representing the current selected state of the row. */ + isSelected: () => boolean; + /**If you are making manual adjustments to elements contained within the row, it may sometimes be necessary to recalculate the height of all the cells in the row to make sure they remain aligned. Call the normalizeHeight function to do this.*/ + normalizeHeight: () => void; + + /**If you want to re-format a row once it has been rendered to re-trigger the cell formatters and the rowFormatter callback, Call the reformat function. */ + reformat: () => void; + + /**You can freeze a row at the top of the table by calling the freeze function. This will insert the row above the scrolling portion of the table in the table header. */ + freeze: () => void; + + /**A frozen row can be unfrozen using the unfreeze function. This will remove the row from the table header and re-insert it back in the table. */ + unfreeze: () => void; + + /**When the tree structure is enabled the treeExpand function will expand current row and show its children. */ + treeExpand: () => void; + + /**When the tree structure is enabled the treeCollapse function will collapse current row and hide its children */ + treeCollapse: () => void; + + /**When the tree structure is enabled the treeToggle function will toggle the collapsed state of the current row. */ + treeToggle: () => void; + + /**When the tree structure is enabled the getTreeParent function will return the Row Component for the parent of this row. If no parent exists, a value of false will be returned. */ + getTreeParent: () => RowComponent | false; + /**When the tree structure is enabled the getTreeChildren function will return an array of Row Components for this rows children. */ + getTreeChildren: () => RowComponent[]; + } + + interface GroupComponent { + /**The getElement function returns the DOM node for the group header. */ + getElement: () => HTMLElement; + + /**The getTable function returns the Tabulator object for the table containing the group */ + getTable: () => Tabulator; + + /**The getKey function returns the unique key that is shared between all rows in this group. */ + getKey: () => any; + + /**The getRows function returns an array of RowComponent objects, one for each row in the group */ + getRows: () => RowComponent[]; + + /**The getSubGroups function returns an array of GroupComponent objects, one for each sub group of this group. */ + getSubGroups: () => GroupComponent[]; + + /**The getParentGroup function returns the GroupComponent for the parent group of this group. if no parent exists, this function will return false */ + getParentGroup: () => GroupComponent | false; + + /** The getVisibility function returns a boolean to show if the group is visible, a value of true means it is visible.*/ + getVisibility: () => boolean; + + /**The show function shows the group if it is hidden. */ + show: () => void; + /**The hide function hides the group if it is visible. */ + hide: () => void; + /**The toggle function toggles the visibility of the group, switching between hidden and visible. */ + toggle: () => void; + } + + interface ColumnComponent { + /*The getElement function returns the DOM node for the colum*/ + getElement: () => HTMLElement; + /**The getTable function returns the Tabulator object for the table containing the column */ + getTable: () => Tabulator; + /**The getDefinition function returns the column definition object for the column.*/ + getDefinition: () => ColumnDefinition; + /**The getField function returns the field name for the column.*/ + getField: () => string; + /**The getCells function returns an array of CellComponent objects, one for each cell in the column.*/ + getCells: () => Array; + + /**The getNextColumn function returns the Column Component for the next visible column in the table, if there is no next column it will return a value of false. */ + getNextColumn: () => ColumnComponent | false; + /**The getPrevColumn function returns the Column Component for the previous visible column in the table, if there is no previous column it will return a value of false. */ + getPrevColumn: () => ColumnComponent | false; + /**The getVisibility function returns a boolean to show if the column is visible, a value of true means it is visible.*/ + getVisibility: () => boolean; + /**The show function shows the column if it is hidden.*/ + show: () => void; + /**The hide function hides the column if it is visible.*/ + hide: () => void; + /**The toggle function toggles the visibility of the column, switching between hidden and visible.*/ + toggle: () => void; + /**The delete function deletes the column, removing it from the table*/ + delete: () => void; + /**The scrollTo function will scroll the table to the column if it is visible. */ + scrollTo: () => Promise; + /**The getSubColumns function returns an array of ColumnComponent objects, one for each sub column of this column. */ + getSubColumns: () => ColumnComponent[]; + + /**The getParentColumn function returns the ColumnComponent for the parent column of this column. if no parent exists, this function will return false */ + getParentColumn: () => ColumnComponent | false; + /**The headerFilterFocus function will place focus on the header filter element for this column if it exists. */ + headerFilterFocus: () => void; + /**The setHeaderFilterValue function set the value of the columns header filter element to the value provided in the first argument. */ + setHeaderFilterValue: (value: any) => void; + /**The reloadHeaderFilter function rebuilds the header filter element, updating any params passed into the editor used to generate the filter. */ + reloadHeaderFilter: () => void; + } +} + +//Tabulator.prototype.(?!registerModule|helpers|_)\w+ +declare class Tabulator { + constructor(selector: string | HTMLElement, options?: Tabulator.Options); + + columnManager: any; + rowManager: any; + footerManager: any; + browser: string; + browserSlow: boolean; + modules: any; + options: Tabulator.Options; + + /**You have a choice of four file types to choose from: + csv - Comma separated value file + json - JSON formatted text file + xlsx - Excel File (Requires the SheetJS Library) + pdf - PDF File (Requires the jsPDF Library and jsPDF-AutoTable Plugin) + To trigger a download, call the download function, passing the file type (from the above list) as the first argument, and an optional second argument of the file name for the download (if this is left out it will be "Tabulator.ext"). The optional third argument is an object containing any setup options for the formatter, such as the delimiter choice for CSV's). + + The PDF downloader requires that the jsPDF Library and jsPDF-AutoTable Plugin be included on your site, this can be included with the following script tags. + + If you want to create a custom file type from the table data then you can pass a function to the type argument, instead of a string value. At the end of this function you must call the setFileContents function, passing the formatted data and the mime type. + */ + download: (downloadType: Tabulator.DownloadType | ((columns: Tabulator.ColumnDefinition[], data: any, options: any, setFileContents: any) => any), fileName: string, params?: Tabulator.DownloadOptions) => void; + + /**If you want to open the generated file in a new browser tab rather than downloading it straight away, you can use the downloadToTab function. This is particularly useful with the PDF downloader, as it allows you to preview the resulting PDF in a new browser ta */ + downloadToTab: (downloadType: Tabulator.DownloadType, fileName: string, params?: Tabulator.DownloadOptions) => void; + + /**The copyToClipboard function allows you to copy the current table data to the clipboard. + + The first argument is the copy selector, you can choose from any of the built in options or pass a function in to the argument, that must return the selected row components. + + If you leave this argument undefined, Tabulator will use the value of the clipboardCopySelector property, which has a default value of table */ + copyToClipboard: (type: "selection" | "table") => void; + + /**With history enabled you can use the undo function to automatically undo a user action, the more times you call the function, the further up the history log you go. */ + undo: () => boolean; + + /**You can use the getHistoryUndoSize function to get a count of the number of history undo actions available. */ + getHistoryUndoSize: () => number | false; + + /**With history enabled you can use the redo function to automatically redo user action that has been undone, the more times you call the function, the further up the history log you go. once a user interacts with the table then can no longer redo any further actions until an undo is performe */ + redo: () => boolean; + + /**You can use the getHistoryRedoSize function to get a count of the number of history redo actions available.*/ + getHistoryRedoSize: () => number | false; + /**Deconstructor */ + destroy: () => void; + /**By default Tabulator will only allow files with a .json extension to be loaded into the table. + + You can allow any other type of file into the file picker by passing the extension or mime type into the first argument of the setDataFromLocalFile function as a comma separated list. This argument will accept any of the values valid for the accept field of an input element */ + setDataFromLocalFile: (extensions: string) => void; + setData: (data: any, params?: any, config?: any) => Promise; + /**You can remove all data from the table using clearData */ + clearData: () => void; + /**You can retrieve the data stored in the table using the getData function. */ + getData: (activeOnly?: boolean) => any[]; + getDataCount: (activeOnly?: boolean) => number; + /**The searchRows function allows you to retreive an array of row components that match any filters you pass in. it accepts the same arguments as the setFilter function. */ + searchRows: Tabulator.FilterFunction; + /**The searchData function allows you to retreive an array of table row data that match any filters you pass in. it accepts the same arguments as the setFilter function. */ + searchData: Tabulator.FilterFunction; + /**You can retrieve the table data as a simple HTML table using the getHtml function. */ + getHtml: (activeOnly?: boolean) => void; + /**You can retrieve the current AJAX URL of the table with the getAjaxUrl function. + * + * This will return a HTML encoded string of the table data. + + By default getHtml will return a table containing all the data held in the Tabulator. If you only want to access the currently filtered/sorted elements, you can pass a value of true to the first argument of the function. + */ + getAjaxUrl: () => string; + /**The replaceData function lets you silently replace all data in the table without updating scroll position, sort or filtering, and without triggering the ajax loading popup. This is great if you have a table you want to periodically update with new/updated information without alerting the user to a change. + + It takes the same arguments as the setData function, and behaves in the same way when loading data (ie, it can make ajax requests, parse JSON etc) */ + replaceData: (data?: {}[] | string, params?: any, config?: any) => Promise; + /**If you want to update an existing set of data in the table, without completely replacing the data as the setData method would do, you can use the updateData method. + + This function takes an array of row objects and will update each row based on its index value. (the index defaults to the "id" parameter, this can be set using the index option in the tabulator constructor). Options without an index will be ignored, as will items with an index that is not already in the table data. The addRow function should be used to add new data to the table. */ + updateData: (data: {}[]) => Promise; + /**The addData method returns a promise, this can be used to run any other commands that have to be run after the data has been loaded into the table. By running them in the promise you ensure they are only run after the table has loaded the data. */ + addData: (data?: {}[], addToTop?: boolean, positionTarget?: Tabulator.RowLookup) => Promise; + + /**If the data you are passng to the table contains a mix of existing rows to be updated and new rows to be added then you can call the updateOrAddData function. This will check each row object provided and update the existing row if available, or else create a new row with the data. */ + updateOrAddData: (data: {}[]) => Promise; + /**To rereive the DOM Node of a specific row, you can retrieve the RowComponent with the getRow function, then use the getElement function on the component. The first argument is the row you are looking for, it will take any of the standard row component look up options. */ + getRow: (row: Tabulator.RowLookup) => Tabulator.RowComponent; + + /**You can retrieve the Row Component of a row at a given position in the table using getRowFromPosition function. By default this will return the row based in its position in all table data, including data currently filtered out of the table. + + If you want to get a row based on its position in the currently filtered/sorted data, you can pass a value of true to the optional second argument of the function. */ + getRowFromPosition: (position: number, activeOnly?: boolean) => void; + /**You can delete any row in the table using the deleteRow function. */ + deleteRow: (row: Tabulator.RowLookup) => void; + + /**You can add a row to the table using the addRow function. + + The first argument should be a row data object. If you do not pass data for a column, it will be left empty. To create a blank row (ie for a user to fill in), pass an empty object to the function. + + The second argument is optional and determines whether the row is added to the top or bottom of the table. A value of true will add the row to the top of the table, a value of false will add the row to the bottom of the table. If the parameter is not set the row will be placed according to the addRowPos global option. */ + addRow: (data?: {}, addToTop?: boolean, positionTarget?: Tabulator.RowLookup) => Promise; + /**If you don't know whether a row already exists you can use the updateOrAddRow function. This will check if a row with a matching index exists, if it does it will update it, if not it will add a new row with that data. This takes the same arguments as the updateRow function. */ + updateOrAddRow: (row: Tabulator.RowLookup, data: {}) => Promise; + /**You can update any row in the table using the updateRow function. + + The first argument is the row you want to update, it will take any of the standard row component look up options. + + The second argument should be the updated data object for the row. As with the updateData function, this will not replace the existing row data object, it will only update any of the provided parameters. + + Once complete, this function will trigger the rowUpdated and dataEdited events. + + This function will return true if the update was successful or false if the requested row could not be found. If the new data matches the existing row data, no update will be performed. + */ + updateRow: (row: Tabulator.RowLookup, data: {}) => boolean; + /**If you want to trigger an animated scroll to a row then you can use the scrollToRow function. + + The first argument should be any of the standard row component look up options for the row you want to scroll to. + + The second argument is optional, and is used to set the position of the row, it should be a string with a value of either top, center, bottom or nearest, if omitted it will be set to the value of the scrollToRowPosition option which has a default value of top. + + The third argument is optional, and is a boolean used to set if the table should scroll if the row is already visible, true to scroll, false to not, if omitted it will be set to the value of the scrollToRowIfVisible option, which defaults to true */ + scrollToRow: (row: Tabulator.RowLookup, position?: Tabulator.ScrollToRowPostition, ifVisible?: boolean) => Promise; + /**If you want to programmatically move a row to a new position you can use the moveRow function. + + The first argument should be the row you want to move, and can be any of the standard row component look up options. + + The second argument should be the target row that you want to move to, and can be any of the standard row component look up options. + + The third argument determines whether the row is moved to above or below the target row. A value of false will cause to the row to be placed below the target row, a value of true will result in the row being placed above the target */ + moveRow: (fromRow: Tabulator.RowLookup, toRow: Tabulator.RowLookup, placeAboveTarget?: boolean) => void; + /**You can retrieve all the row components in the table using the getRows function. + * By default getRows will return an array containing all the Row Component's held in the Tabulator. If you only want to access the currently filtered/sorted elements, you can pass a value of true to the first argument of the function. + */ + getRows: (activeOnly?: boolean) => Tabulator.RowComponent[]; + /**Use the getRowPosition function to retrieve the numerical position of a row in the table. By default this will return the position of the row in all data, including data currently filtered out of the table. + + The first argument is the row you are looking for, it will take any of the standard row component look up options. If you want to get the position of the row in the currently filtered/sorted data, you can pass a value of true to the optional second argument of the function. + + Note: If the row is not found, a value of -1 will be returned, row positions start at 0 + */ + getRowPosition: (row: Tabulator.RowLookup, activeOnly?: boolean) => number; + /**To replace the current column definitions for a table use the setColumns function. This function takes a column definition array as its only argument. */ + setColumns: (definitions: Tabulator.ColumnDefinition[]) => void; + /**To get an array of Column Components for the current table setup, call the getColumns function. This will only return actual data columns not column groups. + * + * To get a structured array of Column Components that includes column groups, pass a value of true as an argument. + */ + getColumns: (includeColumnGroups?: boolean) => Tabulator.ColumnComponent[] | Tabulator.GroupComponent[]; + /**Using the getColumn function you can retrieve the Column Component */ + getColumn: (column: Tabulator.ColumnLookup) => Tabulator.ColumnComponent; + /**To get the current column definition array (including any changes made through user actions, such as resizing or re-ordering columns), call the getColumnDefinitions function. this will return the current columns definition array. */ + getColumnDefinitions: () => Tabulator.ColumnDefinition[]; + /**If you want to handle column layout persistence manually, for example storing it in a database to use elsewhere, you can use the getColumnLayout function to retrieve a layout object for the current table. */ + getColumnLayout: () => Tabulator.ColumnLayout[]; + /**If you have previously used the getColumnLayout function to retrieve a tables layout, you can use the setColumnLayout function to apply it to a table. */ + setColumnLayout: (layout: Tabulator.ColumnLayout) => void; + /**You can show a hidden column at any point using the showColumn function. */ + showColumn: (column?: Tabulator.ColumnLookup) => void; + /**You can hide a visible column at any point using the hideColumn function. */ + hideColumn: (column?: Tabulator.ColumnLookup) => void; + /**You can toggle the visibility of a column at any point using the toggleColumn function. */ + toggleColumn: (column?: Tabulator.ColumnLookup) => void; + /**If you wish to add a single column to the table, you can do this using the addColumn function. + * This function takes three arguments: + + Columns Definition - The column definition object for the column you want to add. + Before (optional) - Determines how to position the new column. A value of true will insert the column to the left of existing columns, a value of false will insert it to the right. If a Position argument is supplied then this will determine whether the new colum is inserted before or after this column. + Position (optional) - The field to insert the new column next to, this can be any of the standard column component look up options. + * + */ + addColumn: (definition: Tabulator.ColumnDefinition, insertRightOfTarget?: boolean, positionTarget?: Tabulator.ColumnLookup) => void; + /**To permanently remove a column from the table deleteColumn function. This function takes any of the standard column component look up options as its first parameter */ + deleteColumn: (column: Tabulator.ColumnLookup) => void; + /**If you want to trigger an animated scroll to a column then you can use the scrollToColumn function. The first argument should be any of the standard column component look up options for the column you want to scroll to. + + The second argument is optional, and is used to set the position of the column, it should be a string with a value of either left, middle or right, if omitted it will be set to the value of the scrollToColumnPosition option which has a default value of left. + + The third argument is optional, and is a boolean used to set if the table should scroll if the column is already visible, true to scroll, false to not, if omitted it will be set to the value of the scrollToColumnIfVisible option, which defaults to true + */ + scrollToColumn: (column: Tabulator.ColumnLookup, position?: Tabulator.ScrollToColumnPosition, ifVisible?: boolean) => Promise; + /**You can also set the language at any point after the table has loaded using the setLocale function, which takes the same range of values as the locale setup option mentioned above. */ + setLocale: (locale: string | boolean) => void; + /**It is possible to retrieve the locale code currently being used by Tabulator using the getLocale function: */ + getLocale: () => string; + /**You can then access these at any point using the getLang function, which will return the language object for the currently active locale. */ + getLang: (locale?: string) => any; + /**If the size of the element containing the Tabulator changes (and you are not able to use the in built auto-resize functionality) or you create a table before its containing element is visible, it will necessary to redraw the table to make sure the rows and columns render correctly. + + This can be done by calling the redraw method. For example, to trigger a redraw whenever the viewport width is changed. + + The redraw function also has an optional boolean argument that when set to true triggers a full rerender of the table including all data on all rows.*/ + redraw: (force?: boolean) => void; + /**If you want to manually change the height of the table at any time, you can use the setHeight function, which will also redraw the virtual DOM if necessary. */ + setHeight: (height: number) => void; + /**You can trigger sorting using the setSort function */ + setSort: (sortList: string | Tabulator.Sorter[], dir?: Tabulator.SortDirection) => void; + getSorters: () => void; + /**To remove all sorting from the table, call the clearSort function. */ + clearSort: () => void; + /**To set a filter you need to call the setFilter method, passing the field you wish to filter, the comparison type and the value to filter for. + + This function will replace any exiting filters on the table with the specified filter + + If you want to perform a more complicated filter then you can pass a callback function to the setFilter method, you can also pass an optional second argument, an object with parameters to be passed to the filter function. + */ + setFilter: (p1: string | Tabulator.Filter[] | any[] | ((data: any, filterParams: any) => boolean), p2?: Tabulator.FilterType | {}, value?: any) => void; + /**If you want to add another filter to the existing filters then you can call the addFilter function: */ + addFilter: Tabulator.FilterFunction; + /**You can retrieve an array of the current programtic filters using the getFilters function, this will not include any of the header filters: */ + getFilters: (includeHeaderFilters: boolean) => Tabulator.Filter[]; + /**You can programatically set the header filter value of a column by calling the setHeaderFilterValue function, This function takes any of the standard column component look up options as its first parameter, with the value for the header filter as the second option */ + setHeaderFilterValue: (column: Tabulator.ColumnLookup, value: string) => void; + + /**You can programatically set the focus on a header filter element by calling the setHeaderFilterFocus function, This function takes any of the standard column component look up options as its first parameter */ + setHeaderFilterFocus: (column: Tabulator.ColumnLookup) => void; + /**If you just want to retrieve the current header filters, you can use the getHeaderFilters function: */ + getHeaderFilters: () => Tabulator.Filter[]; + /**If you want to remove one filter from the current list of filters you can use the removeFilter function: */ + removeFilter: Tabulator.FilterFunction; + /**To remove all filters from the table, use the clearFilter function. */ + clearFilter: (includeHeaderFilters: boolean) => void; + /**To remove just the header filters, leaving the programatic filters in place, use the clearHeaderFilter function. */ + clearHeaderFilter: () => void; + /**To programmatically select a row you can use the selectRow function. + + To select a specific row you can pass the any of the standard row component look up options into the first argument of the function. If you leave the argument blank you will select all rows (if you have set the selectable option to a numeric value, it will be ignored when selecting all rows). */ + selectRow: (row?: Tabulator.RowLookup) => void; + deselectRow: (row?: Tabulator.RowLookup) => void; + toggleSelectRow: (row?: Tabulator.RowLookup) => void; + /**To get the RowComponent's for the selected rows at any time you can use the getSelectedRows function. + + This will return an array of RowComponent's for the selected rows in the order in which they were selected. */ + getSelectedRows: () => Tabulator.RowComponent[]; + /**To get the data objects for the selected rows you can use the getSelectedData function. + + This will return an array of the selected rows data objects in the order in which they were selected */ + getSelectedData: () => any[]; + /**set the maxmum page */ + setMaxPage: (max: number) => void; + /**When pagination is enabled the table footer will contain a number of pagination controls for navigating through the data. + + In addition to these controls it is possible to change page using the setPage function + The setPage function takes one parameter, which should be an integer representing the page you wish to see. There are also four strings that you can pass into the parameter for special functions. + + "first" - show the first page + "prev" - show the previous page + "next" - show the next page + "last" - show the last page + The setPage method returns a promise, this can be used to run any other commands that have to be run after the data has been loaded into the table. By running them in the promise you ensure they are only run after the table has loaded the data. + */ + setPage: (page: number | "first" | "prev" | "next" | "last") => Promise; + /**You can load the page for a specific row using the setPageToRow function and passing in any of the standard row component look up options for the row you want to scroll to. + * + * The setPageToRow method returns a promise, this can be used to run any other commands that have to be run after the data has been loaded into the table. By running them in the promise you ensure they are only run after the table has loaded the data. + */ + setPageToRow: (row: Tabulator.RowLookup) => Promise; + + /**You can change the page size at any point by using the setPageSize function. (this setting will be ignored if using remote pagination with the page size set by the server) */ + setPageSize: (size: number) => void; + /**To retrieve the number of rows allowed per page you can call the getPageSize function: */ + getPageSize: () => number; + /**You can change to show the previous page using the previousPage function. */ + previousPage: () => Promise; + /**You can change to show the next page using the previousPage function. */ + + nextPage: () => Promise; + /**To retrieve the current page use the getPage function. this will return the number of the current page. If pagination is disabled this will return false. */ + getPage: () => number | false; + /**To retrieve the maximum available page use the getPageMax function. this will return the number of the maximum available page. If pagination is disabled this will return false. */ + getPageMax: () => number | false; + /**You can use the setGroupBy function to change the fields that rows are grouped by. This function has one argument and takes the same values as passed to the groupBy setup option. */ + setGroupBy: (groups: string | ((data: any) => any)) => void; + /**You can use the setGroupStartOpen function to change the default open state of groups. This function has one argument and takes the same values as passed to the groupStartOpen setup option. + * + * Note: If you use the setGroupStartOpen or setGroupHeader before you have set any groups on the table, the table will not update until the setGroupBy function is called. + */ + setGroupStartOpen: (values: boolean | ((value: any, count: number, data: any, group: Tabulator.GroupComponent) => boolean)) => void; + /**You can use the setGroupHeader function to change the header generation function for each group. This function has one argument and takes the same values as passed to the groupHeader setup option. */ + setGroupHeader: (values: ((value: any, count: number, data: any, group: Tabulator.GroupComponent) => string) | ((value: any, count: number, data: any) => string)[]) => void; + /**You can use the getGroups function to retrieve an array of all the first level Group Components in the table. */ + getGroups: () => Tabulator.GroupComponent[]; + /**get grouped table data in the same format as getData() */ + getGroupedData: (activeOnly?: boolean) => any; + /**You can retrieve the results of the column calculations at any point using the getCalcResults function. + * For a table without grouped rows, this will return an object with top and bottom properties, that contain a row data object for all the columns in the table for the top calculations and bottom calculations respectively. + */ + getCalcResults: () => any; + /**Use the navigatePrev function to shift focus to the next editable cell on the left, if none available move to the right most editable cell on the row above. + * + * Note: These actions will only work when a cell is editable and has focus. + + Note: Navigation commands will only focus on editable cells, that is cells with an editor and if present an editable function that returns true. + * + */ + navigatePrev: () => void; + /**Use the navigateNext function to shift focus to the next editable cell on the right, if none available move to left most editable cell on the row below. + * + * Note: These actions will only work when a cell is editable and has focus. + + Note: Navigation commands will only focus on editable cells, that is cells with an editor and if present an editable function that returns true. + * + */ + navigateNext: () => void; + /**Use the navigateLeft function to shift focus to next editable cell on the left, return false if none available on row. + * + * Note: These actions will only work when a cell is editable and has focus. + + Note: Navigation commands will only focus on editable cells, that is cells with an editor and if present an editable function that returns true. + * + */ + navigateLeft: () => void; + /**Use the navigateRight function to shift focus to next editable cell on the right, return false if none available on row. + * + * Note: These actions will only work when a cell is editable and has focus. + + Note: Navigation commands will only focus on editable cells, that is cells with an editor and if present an editable function that returns true. + * + */ + navigateRight: () => void; + /**Use the navigateUp function to shift focus to the same cell in the row above. + + * Note: These actions will only work when a cell is editable and has focus. + + Note: Navigation commands will only focus on editable cells, that is cells with an editor and if present an editable function that returns true. + * + */ + navigateUp: () => void; + + /*Use the navigateDown function to shift focus to the same cell in the row below. + + * Note: These actions will only work when a cell is editable and has focus. + + Note: Navigation commands will only focus on editable cells, that is cells with an editor and if present an editable function that returns true. + * + */ + navigateDown: () => void; + + /**A lot of the modules come with a range of default settings to make setting up your table easier, for example the sorters, formatters and editors that ship with Tabulator as standard. + + If you are using a lot of custom settings over and over again (for example a custom sorter). you can end up re-delcaring it several time for different tables. To make your life easier Tabulator allows you to extend the default setup of each module to make your custom options as easily accessible as the defaults. + + Using the extendModule function on the global Tabulator variable allows you to globally add these options to all tables. + + The function takes three arguments, the name of the module, the name of the property you want to extend, and an object containing the elements you want to add in your module. In the example below we extend the format module to add two new default formatters: */ + extendModule: (name: string, property: string, values: {}) => void; +} diff --git a/types/tabulator-tables/tabulator-tables-tests.ts b/types/tabulator-tables/tabulator-tables-tests.ts new file mode 100644 index 0000000000..470dce2c76 --- /dev/null +++ b/types/tabulator-tables/tabulator-tables-tests.ts @@ -0,0 +1,427 @@ +//constructor +let table = new Tabulator("#test"); +table.copyToClipboard("selection"); +table.searchRows("name", "<", 3); +table.setFilter("name", "<=", 3); +table.setFilter([ + { field: "age", type: ">", value: 52 }, //filter by age greater than 52 + { field: "height", type: "<", value: 142 }, //and by height less than 142 + { field: "name", type: "in", value: ["steve", "bob", "jim"] } //name must be steve, bob or jim +]); +table.setFilter( + (data, filterParams) => { + //data - the data for the row being filtered + //filterParams - params object passed to the filter + return data.name == "bob" && data.height < filterParams.height; //must return a boolean, true if it passes the filter. + }, + { height: 3 } +); +table.setFilter("age", "in", ["steve", "bob", "jim"]); +table.setFilter([ + { field: "age", type: ">", value: 52 }, //filter by age greater than 52 + [ + { field: "height", type: "<", value: 142 }, //with a height of less than 142 + { field: "name", type: "=", value: "steve" } //or a name of steve + ] +]); + +table + .setPageToRow(12) + .then(function() { + //run code after table has been successfuly updated + }) + .catch(function(error) { + //handle error loading data + }); + +table.setGroupBy("gender"); +table.setGroupStartOpen(true); + +table.setGroupHeader((value, count, data, group) => { + return ""; +}); +table.setGroupHeader((value, count, data) => { + return ""; +}); + +table.setSort([ + { column: "age", dir: "asc" }, //sort by this first + { column: "height", dir: "desc" } //then sort by this second +]); + +table + .scrollToColumn("age", "middle", false) + .then(function() { + //run code after column has been scrolled to + }) + .catch(function(error) { + //handle error scrolling to column + }); + +table + .updateOrAddData([{ id: 1, name: "bob" }, { id: 3, name: "steve" }]) + .then(function(rows) { + //rows - array of the row components for the rows updated or added + //run code after data has been updated + }) + .catch(function(error) { + //handle error updating data + }); + +table.updateData([{ id: 1, name: "bob", gender: "male" }, { id: 2, name: "Jenny", gender: "female" }]); +table + .updateData([{ id: 1, name: "bob" }]) + .then(function() { + //run code after data has been updated + }) + .catch(function(error) { + //handle error updating data + }); + +let row1: Tabulator.RowComponent; +let row2: Tabulator.RowComponent; + +//column definitions +let colDef: Tabulator.ColumnDefinition = {} as Tabulator.ColumnDefinition; +colDef.title = "title"; +colDef.sorter = customSorter; + +function customSorter(a: any, b: any, aRow: Tabulator.RowComponent, bRow: Tabulator.RowComponent, column: Tabulator.ColumnComponent, dir: Tabulator.SortDirection, sorterParams: Tabulator.ColumnDefinitionSorterParams): number { + return 1; +} + +colDef.sorterParams = (col: Tabulator.ColumnComponent, dir: Tabulator.SortDirection) => { + return {}; +}; +colDef.sorterParams = { format: "DD/MM/YY" }; +colDef.formatterParams = { + invalidPlaceholder: val => { + return ""; + } +}; + +colDef.formatterParams = cell => { + //cell - the cell component + + //do some processing and return the param object + return { param1: "green" }; +}; + +//List lookup +colDef.formatterParams = { + small: "Cute", + medium: "Fine", + big: 2, + huge: true +}; +//Custom Formatter +colDef.formatter = (cell: Tabulator.CellComponent, formatterParams: {}, onRendered) => { + onRendered = () => {}; + return ""; +}; + +colDef.editor = true; +colDef.editor = "number"; +colDef.editor = function(cell, onRendered, success, cancel, editorParams) { + //cell - the cell component for the editable cell + //onRendered - function to call when the editor has been rendered + //success - function to call to pass the successfuly updated value to Tabulator + //cancel - function to call to abort the edit and return to a normal cell + //editorParams - params object passed into the editorParams column definition property + + //create and style editor + var editor = document.createElement("input"); + + editor.setAttribute("type", "date"); + + //create and style input + editor.style.padding = "3px"; + editor.style.width = "100%"; + editor.style.boxSizing = "border-box"; + + //Set value of editor to the current value of the cell + editor.value = moment(cell.getValue(), "DD/MM/YYYY"); + + //set focus on the select box when the editor is selected (timeout allows for editor to be added to DOM) + onRendered(function() { + editor.focus(); + editor.style.cssText = "100%"; + }); + + //when the value has been set, trigger the cell to update + function successFunc() { + success(moment(editor.value, "YYYY-MM-DD")); + } + + editor.addEventListener("change", successFunc); + editor.addEventListener("blur", successFunc); + + //return the editor element + return editor; +}; +//Dummy function +function moment(a: any, b: any) { + return ""; +} + +colDef.cellClick = (_e, cell) => { + console.log(cell.checkHeight); +}; + +colDef.formatterParams = { stars: 3 }; + +colDef.editorParams = {}; +colDef.editorParams = { + values: [ + { + //option group + label: "Men", + options: [ + //options in option group + { + label: "Steve Boberson", + value: "steve" + }, + { + label: "Bob Jimmerson", + value: "bob" + } + ] + }, + { + //option group + label: "Women", + options: [ + //options in option group + { + label: "Jenny Jillerson", + value: "jenny" + }, + { + label: "Jill Betterson", + value: "jill" + } + ] + }, + { + //ungrouped option + label: "Other", + value: "other" + } + ] +}; + +let selectParamValues: Tabulator.JSONRecord; +selectParamValues = { + steve: "Steve Boberson", + bob: "Bob Jimmerson", + jim: true +}; +colDef.editorParams = { + values: selectParamValues +}; + +colDef.editorParams = function(cell) { + return {}; +}; + +let autoComplete: Tabulator.AutoCompleteParams = { + showListOnEmpty: true, //show all values when the list is empty, + freetext: true, //allow the user to set the value of the cell to a free text entry + allowEmpty: true, //allow empty string values + searchFunc: (term, values) => { + //search for exact matches + var matches: string[] = []; + return matches; + }, + listItemFormatter: function(value, title) { + //prefix all titles with the work "Mr" + return "Mr " + title; + }, + values: true //create list of values from all values contained in this column +}; +colDef.editorParams = autoComplete; + +colDef.editorParams = { + values: [ + { + //option group + label: "Men", + options: [ + //options in option group + { + label: "Steve Boberson", + value: "steve" + }, + { + label: "Bob Jimmerson", + value: "bob" + } + ] + }, + { + //option group + label: "Women", + options: [ + //options in option group + { + label: "Jenny Jillerson", + value: "jenny" + }, + { + label: "Jill Betterson", + value: "jill" + } + ] + }, + { + //ungrouped option + label: "Other", + value: "other" + } + ] +}; + +//Validators +colDef.validator = { + type: (cell, value, parameters) => { + return true; + }, + parameters: { + divisor: 5 + } +}; +colDef.validator = "float"; +colDef.validator = { type: "float", parameters: {} }; + +let validators: Tabulator.Validator[] = [ + { type: "integer", parameters: {} }, + { + type: (cell, value, parameters) => { + return true; + }, + parameters: {} + } +]; + +colDef.headerFilterFunc = "!="; +colDef.headerFilterFunc = (headerValue, rowValue, rowData, filterParams) => { + return rowData.name == filterParams.name && rowValue < headerValue; //must return a boolean, true if it passes the filter. +}; + +//Cell Component +let cell: Tabulator.CellComponent = {} as Tabulator.CellComponent; +cell.nav().down(); + +let data = cell.getData(); +table = cell.getTable(); + +//Row Component +let row: Tabulator.RowComponent = {} as Tabulator.RowComponent; +row.delete() + .then(function() { + //run code after row has been deleted + }) + .catch(function(error) { + //handle error deleting row + }); + +//Options +let options: Tabulator.Options = {} as Tabulator.Options; +options.keybindings = { + navPrev: "ctrl + 1", + navNext: false +}; + +options.downloadDataFormatter = data => { + // data.forEach(function(row){ + // row.age = row.age >= 18 ? "adult" : "child"; +}; + +options.downloadConfig = { + columnGroups: false, //include column groups in column headers for download + rowGroups: false, //do not include row groups in download + columnCalcs: false //do not include column calculation rows in download +}; + +options.ajaxConfig = "GET"; +options.ajaxConfig = { + mode: "cors", //set request mode to cors + credentials: "same-origin", //send cookies with the request from the matching origin + headers: { + Accept: "application/json", //tell the server we need JSON back + "X-Requested-With": "XMLHttpRequest", //fix to help some frameworks respond correctly to request + "Content-type": "application/json; charset=utf-8", //set the character encoding of the request + "Access-Control-Allow-Origin": "http://yout-site.com" //the URL origin of the site making the request + } +}; +options.ajaxConfig = { + method: "POST", //set request type to Position + headers: { + "Content-type": "application/json; charset=utf-8" //set specific content type + } +}; + +options.ajaxContentType = { + headers: { + "Content-Type": "text/html" + }, + body: function(url, config, params) { + //url - the url of the request + //config - the fetch config object + //params - the request parameters + + //return comma list of params:values + var output = []; + + for (var key in params) { + output.push(key + ":" + params[key]); + } + + return output.join(","); + } +}; + +options.initialSort = [{ column: "name", dir: "asc" }, { column: "name2", dir: "desc" }]; +options.initialFilter = [{ field: "color", type: "=", value: "red" }]; +options.initialHeaderFilter = [ + { field: "color", value: "red" } //set the initial value of the header filter to "red" +]; + +options.groupValues = [ + ["red", "blue", "green"], //create groups for color values of "red", "blue", and "green", + [10, 20, 30] //create sub groups for ages of 10, 20 and 30 +]; + +options.groupHeader = (value, count, data, group) => { + //value - the value all members of this group share + //count - the number of rows in this group + //data - an array of all the row data objects in this group + //group - the group component for the group + + return value + "(" + count + " item)"; +}; + +options.groupHeader = [ + function(value, count, data) { + //generate header contents for gender groups + return value + "(" + count + " item)"; + }, + function(value, count, data) { + //generate header contents for color groups + return value + "(" + count + " item)"; + } +]; + +options.paginationDataReceived = { + last_page: "max_pages", + a: "b" +}; + +options.clipboardPasteParser = clipboard => { + return []; //return array +}; + +options.cellEditing = cell => { + console.log(cell); +}; diff --git a/types/tabulator-tables/tsconfig.json b/types/tabulator-tables/tsconfig.json new file mode 100644 index 0000000000..7f97e421b8 --- /dev/null +++ b/types/tabulator-tables/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6", "dom"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "tabulator-tables-tests.ts"] +} diff --git a/types/tabulator-tables/tslint.json b/types/tabulator-tables/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/tabulator-tables/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From ad7bc3d6e41fa0008dc9fbf1ba27b45e744f8030 Mon Sep 17 00:00:00 2001 From: Anthony Heber Date: Wed, 6 Mar 2019 08:18:31 -0700 Subject: [PATCH 422/924] Abstract binding to their own interface Clean up types and abstract types into their own interface --- types/flickity/flickity-tests.ts | 41 ++++--- types/flickity/index.d.ts | 180 ++++++++++++++++--------------- 2 files changed, 111 insertions(+), 110 deletions(-) diff --git a/types/flickity/flickity-tests.ts b/types/flickity/flickity-tests.ts index 6e24f16b3e..7fa5dc78eb 100644 --- a/types/flickity/flickity-tests.ts +++ b/types/flickity/flickity-tests.ts @@ -161,6 +161,24 @@ let flikty5: Flickity = new Flickity(new HTMLElement(), { } }); +let fliktyBindings: Flickity.EventBindings = { + ready: () => {}, + change: (index) => {}, + select: (index) => {}, + settle: (index) => {}, + scroll: (progress) => {}, + dragStart: (event, pointer) => {}, + dragMove: (event, pointer, moveVector) => {}, + dragEnd: (event, pointer) => {}, + pointerDown: (event, pointer) => {}, + pointerMove: (event, pointer, moveVector) => {}, + pointerUp: (event, pointer) => {}, + staticClick: (event, pointer, cellElement, cellIndex) => {}, + lazyLoad: (event, cellElement) => {}, + bgLazyLoad: (event, element) => {}, + fullscreenChange: (isFullscreen) => {} +}; + let fliktyOpts1: Flickity.Options = { initialIndex: 0, accessibility: true, @@ -184,25 +202,6 @@ let fliktyOpts1: Flickity.Options = { watchCSS: true, wrapAround: true, resize: true, - rightToLeft: false -}; - -let fliktyOpts2: Flickity.Options = { - on: { - ready: () => {}, - change: (index) => {}, - select: (index) => {}, - settle: (index) => {}, - scroll: (progress) => {}, - dragStart: (event, pointer) => {}, - dragMove: (event, pointer, moveVector) => {}, - dragEnd: (event, pointer) => {}, - pointerDown: (event, pointer) => {}, - pointerMove: (event, pointer, moveVector) => {}, - pointerUp: (event, pointer) => {}, - staticClick: (event, pointer, cellElement, cellIndex) => {}, - lazyLoad: (event, cellElement) => {}, - bgLazyLoad: (event, element) => {}, - fullscreenChange: (isFullscreen) => {} - } + rightToLeft: false, + on: fliktyBindings }; diff --git a/types/flickity/index.d.ts b/types/flickity/index.d.ts index 8b5b7b2ffe..69d4dbda10 100644 --- a/types/flickity/index.d.ts +++ b/types/flickity/index.d.ts @@ -265,108 +265,110 @@ declare namespace Flickity { /** * Bind events within Flickity's options by setting on to an Object. The object's keys should match the event names. on is useful for capturing events as Flickity is initialized, like ready */ - on?: { - /** - * Triggered after Flickity has been activated. - */ - ready?: () => void; + on?: EventBindings; + } - /** - * Triggered when the selected slide is changed. - */ - change?: (index?: Number) => void; + interface EventBindings { + /** + * Triggered after Flickity has been activated. + */ + ready?: () => void; - /** - * Triggered when a slide is selected. - * select is triggered any time a slide is selected, even on the same slide. change is triggered only when a different slide is selected. - * This event was previously cellSelect in Flickity v1. cellSelect will continue to work in Flickity v2. - */ - select?: (index?: Number) => void; - cellSelect?: (index?: Number) => void; - /** - * Triggered when the slider is settled at its end position. - */ - settle?: (index?: Number) => void; + /** + * Triggered when the selected slide is changed. + */ + change?: (index?: number) => void; - /** - * Triggered when the slider moves. - */ - scroll?: (progress?: Number) => void; + /** + * Triggered when a slide is selected. + * select is triggered any time a slide is selected, even on the same slide. change is triggered only when a different slide is selected. + * This event was previously cellSelect in Flickity v1. cellSelect will continue to work in Flickity v2. + */ + select?: (index?: number) => void; + cellSelect?: (index?: number) => void; + /** + * Triggered when the slider is settled at its end position. + */ + settle?: (index?: number) => void; - /** - * Triggered when dragging starts and the slider starts moving. - */ - dragStart?: ( - event?: Event, - pointer?: Element | Touch) => void; + /** + * Triggered when the slider moves. + */ + scroll?: (progress?: number) => void; - /** - * Triggered when dragging moves and the slider moves. - */ - dragMove?: ( - event?: Event, - pointer?: Element | Touch, - moveVector?: { x: number, y: number }) => void; + /** + * Triggered when dragging starts and the slider starts moving. + */ + dragStart?: ( + event?: Event, + pointer?: Element | Touch) => void; - /** - * Triggered when dragging ends. - */ - dragEnd?: ( - event: Event, - pointer?: Element | Touch) => void; + /** + * Triggered when dragging moves and the slider moves. + */ + dragMove?: ( + event?: Event, + pointer?: Element | Touch, + moveVector?: { x: number, y: number }) => void; - /** - * Triggered when the user's pointer (mouse, touch, pointer) presses down. - */ - pointerDown?: ( - event: Event, - pointer?: Element | Touch) => void; + /** + * Triggered when dragging ends. + */ + dragEnd?: ( + event: Event, + pointer?: Element | Touch) => void; - /** - * Triggered when the user's pointer moves. - */ - pointerMove?: ( - event?: Event, - pointer?: Element | Touch, - moveVector?: { x: number, y: number }) => void; + /** + * Triggered when the user's pointer (mouse, touch, pointer) presses down. + */ + pointerDown?: ( + event: Event, + pointer?: Element | Touch) => void; - /** - * Triggered when the user's pointer unpresses. - */ - pointerUp?: ( - event?: Event, - pointer?: Element | Touch) => void; + /** + * Triggered when the user's pointer moves. + */ + pointerMove?: ( + event?: Event, + pointer?: Element | Touch, + moveVector?: { x: number, y: number }) => void; - /** - * Triggered when the user's pointer is pressed and unpressed and has not moved enough to start dragging. - * click events are hard to detect with draggable UI, as they are triggered whenever a user drags. - * Flickity's staticClick event resolves this, as it is triggered when the user has not dragged. - */ - staticClick?: ( - event?: Event, - pointer?: Element | Touch, - cellElement?: Element, - cellIndex?: Number) => void; + /** + * Triggered when the user's pointer unpresses. + */ + pointerUp?: ( + event?: Event, + pointer?: Element | Touch) => void; - /** - * Triggered after an image has been loaded with lazyLoad. - */ - lazyLoad?: ( - event?: Event, - cellElement?: Element) => void; + /** + * Triggered when the user's pointer is pressed and unpressed and has not moved enough to start dragging. + * click events are hard to detect with draggable UI, as they are triggered whenever a user drags. + * Flickity's staticClick event resolves this, as it is triggered when the user has not dragged. + */ + staticClick?: ( + event?: Event, + pointer?: Element | Touch, + cellElement?: Element, + cellIndex?: number) => void; - /** - * Triggered after a background image has been loaded with bgLazyLoad. - */ - bgLazyLoad?: ( - event?: Event, - element?: Element) => void; + /** + * Triggered after an image has been loaded with lazyLoad. + */ + lazyLoad?: ( + event?: Event, + cellElement?: Element) => void; - /** - * Triggered after entering or exiting fullscreen view. - */ - fullscreenChange?: (isFullscreen?: Boolean) => void; - }; + /** + * Triggered after a background image has been loaded with bgLazyLoad. + */ + bgLazyLoad?: ( + event?: Event, + element?: Element) => void; + + /** + * Triggered after entering or exiting fullscreen view. + */ + fullscreenChange?: (isFullscreen?: boolean) => void; } } From c79ee7b65f500c19ec2bf6e5dccfa9111efe434f Mon Sep 17 00:00:00 2001 From: Jojoshua Date: Wed, 6 Mar 2019 10:39:56 -0500 Subject: [PATCH 423/924] Update project url --- types/tabulator-tables/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/tabulator-tables/index.d.ts b/types/tabulator-tables/index.d.ts index 3fe21f805f..3a3e3de64a 100644 --- a/types/tabulator-tables/index.d.ts +++ b/types/tabulator-tables/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for tabulator-tables 4.2 -// Project: https://github.com/olifolkerd/tabulator +// Project: http://tabulator.info // Definitions by: Josh Harris // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 From 1c4ca4d8bf630730711f616e1fd671c032757e9e Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Wed, 6 Mar 2019 08:43:53 -0800 Subject: [PATCH 424/924] Add codeowners update (#33654) * Add update-codeowners script Right now it works but doesn't open a PR for you. Also not present as an npm script. * Dump in a bunch of code from TS * A few fixes and updates 1. Fix package.json formatting. 2. Adapt copied code from TS. * Ready to test locally * Fix git add * Put everything in one Promise chain Also start compiling JS files in scripts/ --- package.json | 1 + scripts/tsconfig.json | 11 ++- scripts/update-codeowners.js | 126 +++++++++++++++++++++++++++++++++++ 3 files changed, 131 insertions(+), 7 deletions(-) create mode 100644 scripts/update-codeowners.js diff --git a/package.json b/package.json index 1a5124c035..f4c48b1b32 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "scripts": { "compile-scripts": "tsc -p scripts", "not-needed": "node scripts/not-needed.js", + "update-codeowners": "node scripts/update-codeowners.js", "test": "node node_modules/types-publisher/bin/tester/test.js --run-from-definitely-typed", "lint": "dtslint types" }, diff --git a/scripts/tsconfig.json b/scripts/tsconfig.json index 899f96af64..6e0fd5a58c 100644 --- a/scripts/tsconfig.json +++ b/scripts/tsconfig.json @@ -1,13 +1,10 @@ { "compilerOptions": { + "allowJs": true, + "checkJs": true, "module": "commonjs", "target": "es6", - "noImplicitAny": true, - "strictNullChecks": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "noUnusedLocals": true, - "noUnusedParameters": true, + "strict": true, "baseUrl": "../types", "typeRoots": [ "../types" @@ -15,4 +12,4 @@ "types": [], "forceConsistentCasingInFileNames": true } -} \ No newline at end of file +} diff --git a/scripts/update-codeowners.js b/scripts/update-codeowners.js new file mode 100644 index 0000000000..56eda138c6 --- /dev/null +++ b/scripts/update-codeowners.js @@ -0,0 +1,126 @@ +/// +// Must reference esnext.asynciterable lib, since octokit uses AsyncIterable internally +const cp = require("child_process"); +const Octokit = require("@octokit/rest"); +const { AllPackages, getDefinitelyTyped, loggerWithErrors, + parseDefinitions, parseNProcesses, clean } = require("types-publisher"); +const { writeFile } = require("fs-extra"); + +async function main() { + const options = { definitelyTypedPath: ".", progress: false, parseInParallel: true }; + const log = loggerWithErrors()[0]; + + clean(); + const dt = await getDefinitelyTyped(options, log); + await parseDefinitions(dt, { nProcesses: parseNProcesses(), definitelyTypedPath: "." }, log); + const allPackages = await AllPackages.read(dt); + const typings = allPackages.allTypings(); + const maxPathLen = Math.max(...typings.map(t => t.subDirectoryPath.length)); + const entries = mapDefined(typings, t => getEntry(t, maxPathLen)); + await writeFile([options.definitelyTypedPath, ".github", "CODEOWNERS"].join("/"), `${header}\n\n${entries.join("\n")}\n`, { encoding: "utf-8" }); +} + +const token = /** @type {string} */(process.env.GH_TOKEN); +const gh = new Octokit(); +const reviewers = ["weswigham", "sandersn", "RyanCavanaugh"] +const now = new Date(); +const branchName = `codeowner-update-${now.getFullYear()}${padNum(now.getMonth())}${padNum(now.getDay())}`; +const remoteUrl = `https://${token}@github.com/DefinitelyTyped/DefinitelyTyped.git`; +runSequence([ + ["git", ["checkout", "."]], // reset any changes +]); + +main().then(() => { + runSequence([ + ["git", ["checkout", "-b", branchName]], // create a branch + ["git", ["add", ".github/CODEOWNERS"]], // Add CODEOWNERS + ["git", ["commit", "-m", `"Update CODEOWNERS"`]], // Commit all changes + ["git", ["remote", "add", "fork", remoteUrl]], // Add the remote fork + ["git", ["push", "--set-upstream", "fork", branchName, "-f"]] // push the branch + ]); + + gh.authenticate({ + type: "token", + token, + }); + return gh.pulls.create({ + owner: "DefinitelyTyped", + repo: "DefinitelyTyped", + maintainer_can_modify: true, + title: `đŸ€– CODEOWNERS has changed`, + head: `DefinitelyTyped:${branchName}`, + base: "master", + body: + `Please review the diff and merge if no changes are unexpected. + +cc ${reviewers.map(r => "@" + r).join(" ")}`, + }) +}).then(r => { + const num = r.data.number; + console.log(`Pull request ${num} created.`); + return gh.pulls.createReviewRequest({ + owner: "DefinitelyTyped", + repo: "DefinitelyTyped", + number: num, + reviewers, + }); +}).then(() => { + console.log(`Reviewers requested, done.`); +}).catch(e => { + console.error(e); + process.exit(1); +}); + +/** @param {[string, string[]][]} tasks */ +function runSequence(tasks) { + for (const task of tasks) { + console.log(`${task[0]} ${task[1].join(" ")}`); + const result = cp.spawnSync(task[0], task[1], { timeout: 100000, shell: true, stdio: "inherit" }); + if (result.status !== 0) throw new Error(`${task[0]} ${task[1].join(" ")} failed: ${result.stderr && result.stderr.toString()}`); + } +} + +/** @param {number} number */ +function padNum(number) { + const str = "" + number; + return str.length >= 2 ? str : "0" + str; +} + + +const header = +`# This file is generated. +# Add yourself to the "Definitions by:" list instead. +# See https://github.com/DefinitelyTyped/DefinitelyTyped#edit-an-existing-package`; + +/** + * @param { { contributors: ReadonlyArray<{githubUsername?: string }>, subDirectoryPath: string} } pkg + * @param {number} maxPathLen + * @return {string | undefined} + */ +function getEntry(pkg, maxPathLen) { + const users = mapDefined(pkg.contributors, c => c.githubUsername); + if (!users.length) { + return undefined; + } + + const path = `${pkg.subDirectoryPath}/`.padEnd(maxPathLen); + return `/types/${path} ${users.map(u => `@${u}`).join(" ")}`; +} + +/** + * @template T,U + * @param {ReadonlyArray} arr + * @param {(t: T) => U | undefined} mapper + * @return U[] + */ +function mapDefined(arr, mapper) { + const out = []; + for (const a of arr) { + const res = mapper(a); + if (res !== undefined) { + out.push(res); + } + } + return out; +} + From 789bf69f40fc7d95a13084178515fb1cd4ddb23a Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Wed, 6 Mar 2019 09:15:53 -0800 Subject: [PATCH 425/924] Bump chokidar deprecation (#33658) --- notNeededPackages.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notNeededPackages.json b/notNeededPackages.json index 945f418211..6d943f4b08 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -244,7 +244,7 @@ "libraryName": "chokidar", "typingsPackageName": "chokidar", "sourceRepoURL": "https://github.com/paulmillr/chokidar", - "asOfVersion": "2.1.2" + "asOfVersion": "2.1.3" }, { "libraryName": "chunked-dc", From a205830fc92a70ac964cda10264fffb9f02028a6 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Wed, 6 Mar 2019 09:53:22 -0800 Subject: [PATCH 426/924] Nightly cleanup 06-03-2019 1. Add handlebars depdencies missed in #33518, which deprecated @types/handlebars now that handlebars ships its own types. 2. Add project homepage for kafkajs. --- types/ember/v1/package.json | 6 ++++++ types/ember/v2/package.json | 6 ++++++ types/hbs/package.json | 6 ++++++ types/kafkajs/index.d.ts | 2 +- types/koa-hbs/package.json | 6 ++++++ types/snazzy-info-window/package.json | 6 ++++++ types/swag/package.json | 6 ++++++ 7 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 types/ember/v1/package.json create mode 100644 types/ember/v2/package.json create mode 100644 types/hbs/package.json create mode 100644 types/koa-hbs/package.json create mode 100644 types/snazzy-info-window/package.json create mode 100644 types/swag/package.json diff --git a/types/ember/v1/package.json b/types/ember/v1/package.json new file mode 100644 index 0000000000..77c0c562ac --- /dev/null +++ b/types/ember/v1/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "handlebars": "^4.1.0" + } +} diff --git a/types/ember/v2/package.json b/types/ember/v2/package.json new file mode 100644 index 0000000000..77c0c562ac --- /dev/null +++ b/types/ember/v2/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "handlebars": "^4.1.0" + } +} diff --git a/types/hbs/package.json b/types/hbs/package.json new file mode 100644 index 0000000000..77c0c562ac --- /dev/null +++ b/types/hbs/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "handlebars": "^4.1.0" + } +} diff --git a/types/kafkajs/index.d.ts b/types/kafkajs/index.d.ts index a28377e369..c416a07063 100644 --- a/types/kafkajs/index.d.ts +++ b/types/kafkajs/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for kafkajs 1.4 -// Project: https://github.com/tulios/kafkajs +// Project: https://github.com/tulios/kafkajs, https://kafka.js.org // Definitions by: Michal Kaminski // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.9 diff --git a/types/koa-hbs/package.json b/types/koa-hbs/package.json new file mode 100644 index 0000000000..77c0c562ac --- /dev/null +++ b/types/koa-hbs/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "handlebars": "^4.1.0" + } +} diff --git a/types/snazzy-info-window/package.json b/types/snazzy-info-window/package.json new file mode 100644 index 0000000000..77c0c562ac --- /dev/null +++ b/types/snazzy-info-window/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "handlebars": "^4.1.0" + } +} diff --git a/types/swag/package.json b/types/swag/package.json new file mode 100644 index 0000000000..77c0c562ac --- /dev/null +++ b/types/swag/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "handlebars": "^4.1.0" + } +} From 4ca1f9a325b641d48938222e845889630eb28c25 Mon Sep 17 00:00:00 2001 From: Adam Zerella Date: Thu, 7 Mar 2019 05:00:35 +1100 Subject: [PATCH 427/924] [repeat-element] Add typing for repeat-element (#33503) * Added type defs for repeat-element * Updated export type --- types/repeat-element/index.d.ts | 12 ++++++++++ types/repeat-element/repeat-element-tests.ts | 9 +++++++ types/repeat-element/tsconfig.json | 25 ++++++++++++++++++++ types/repeat-element/tslint.json | 3 +++ 4 files changed, 49 insertions(+) create mode 100644 types/repeat-element/index.d.ts create mode 100644 types/repeat-element/repeat-element-tests.ts create mode 100644 types/repeat-element/tsconfig.json create mode 100644 types/repeat-element/tslint.json diff --git a/types/repeat-element/index.d.ts b/types/repeat-element/index.d.ts new file mode 100644 index 0000000000..2c3cd5d633 --- /dev/null +++ b/types/repeat-element/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for repeat-element 1.1 +// Project: https://github.com/jonschlinkert/repeat-element +// Definitions by: Adam Zerella +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.0 + +/** + * Create an array by repeating the given value n times. + */ +declare function repeat(element: unknown, num: number): unknown[]; + +export = repeat; diff --git a/types/repeat-element/repeat-element-tests.ts b/types/repeat-element/repeat-element-tests.ts new file mode 100644 index 0000000000..b76b7b4b7e --- /dev/null +++ b/types/repeat-element/repeat-element-tests.ts @@ -0,0 +1,9 @@ +import repeat = require("repeat-element"); + +repeat(5, 5); + +repeat({some: 'object'}, 5); + +repeat('a', 5); + +repeat(null, 5); diff --git a/types/repeat-element/tsconfig.json b/types/repeat-element/tsconfig.json new file mode 100644 index 0000000000..6e7674eafd --- /dev/null +++ b/types/repeat-element/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [ + + ], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "repeat-element-tests.ts" + ] +} diff --git a/types/repeat-element/tslint.json b/types/repeat-element/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/repeat-element/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file From b23cd56977f63341061d45e4fa7f99e13fa6fa66 Mon Sep 17 00:00:00 2001 From: Po Chen Date: Thu, 7 Mar 2019 05:12:58 +1100 Subject: [PATCH 428/924] [phoenix] Improve type definitions (#33247) * Update index.d.ts * Update index.d.ts * Update index.d.ts * Update index.d.ts * Update index.d.ts * Update index.d.ts * Update index.d.ts * Update tslint.json * Update tslint.json * Update index.d.ts * Update tslint.json * Update tslint.json * Update index.d.ts * Update index.d.ts * Update phoenix-tests.ts * Update tslint.json --- types/phoenix/index.d.ts | 117 +++++++++++--------- types/phoenix/phoenix-tests.ts | 42 ++++---- types/phoenix/tslint.json | 192 ++++++++++++++++++++------------- 3 files changed, 202 insertions(+), 149 deletions(-) diff --git a/types/phoenix/index.d.ts b/types/phoenix/index.d.ts index 8b0e6574d8..daff513651 100644 --- a/types/phoenix/index.d.ts +++ b/types/phoenix/index.d.ts @@ -1,22 +1,26 @@ -// Type definitions for phoenix +// Type definitions for phoenix 1.4 // Project: https://github.com/phoenixframework/phoenix -// Definitions by: MirosƂaw Ciastek , John Goff +// Definitions by: MirosƂaw Ciastek , John Goff , Po Chen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 -declare module "phoenix" { +declare module 'phoenix' { class Push { - constructor(channel: Channel, event: string, payload: any, timeout: number); + constructor( + channel: Channel, + event: string, + payload: object, + timeout: number, + ); - resend(timeout: number): void; send(): void; + resend(timeout: number): void; - receive(status: string, callback: (response?: any) => void): Push; + receive(status: string, callback: (response?: any) => any): this; } - export class Channel { - constructor(topic: string, params?: Object, socket?: Socket); - - rejoinUntilConnected(): void; + class Channel { + constructor(topic: string, params?: object | Function, socket?: Socket); join(timeout?: number): Push; leave(timeout?: number): Push; @@ -28,50 +32,50 @@ declare module "phoenix" { on(event: string, callback: (response?: any) => void): void; off(event: string): void; - canPush(): boolean; - - push(event: string, payload: Object, timeout?: number): Push; + push(event: string, payload: object, timeout?: number): Push; } - export class Socket { - constructor(endPoint: string, opts?: Object); + type ConnectionState = 'connecting' | 'open' | 'closing' | 'closed'; + + interface SocketConnectOption { + params: object | Function; + transport: any; + timeout: number; + heartbeatIntervalMs: number; + reconnectAfterMs: number; + longpollernumber: number; + encode: (payload: object, callback: Function) => any; + decode: (payload: string, callback: Function) => any; + logger: (kind: string, message: string, data: any) => void; + } + + class Socket { + constructor(endPoint: string, opts?: Partial); protocol(): string; endPointURL(): string; - disconnect(callback?: Function, code?: string, reason?: any): void; connect(params?: any): void; + disconnect(callback?: Function, code?: number, reason?: string): void; + connectionState(): ConnectionState; + isConnected(): boolean; - log(kind: string, msg: string, data: any): void; + remove(channel: Channel): void; + channel(topic: string, chanParams?: object): Channel; + push(data: object): void; + + log(kind: string, message: string, data: object): void; + hasLogger(): boolean; onOpen(callback: Function): void; onClose(callback: Function): void; onError(callback: Function): void; onMessage(callback: Function): void; - onConnOpen(): void; - onConnClose(event: any): void; - onConnError(error: any): void; - - triggerChanError(): void; - - connectionState(): string; - - isConnected(): boolean; - - remove(channel: Channel): void; - channel(topic: string, chanParams?: Object): Channel; - - push(data: any): void; - makeRef(): string; - sendHeartbeat(): void; - flushSendBuffer(): void; - - onConnMessage(rawMessage: any): void; } - export class LongPoll { + class LongPoll { constructor(endPoint: string); normalizeEndpoint(endPoint: string): string; @@ -86,8 +90,10 @@ declare module "phoenix" { close(code?: any, reason?: any): void; } - export class Ajax { - request( + class Ajax { + static states: {[state: string]: number}; + + static request( method: string, endPoint: string, accept: string, @@ -97,7 +103,7 @@ declare module "phoenix" { callback?: (response?: any) => void ): void; - xdomainRequest( + static xdomainRequest( req: any, method: string, endPoint: string, @@ -107,7 +113,7 @@ declare module "phoenix" { callback?: (response?: any) => void ): void; - xhrRequest( + static xhrRequest( req: any, method: string, endPoint: string, @@ -118,28 +124,37 @@ declare module "phoenix" { callback?: (response?: any) => void ): void; - parseJSON(resp: string): JSON; - serialize(obj: any, parentKey: string): string; - appendParams(url: string, params: any): string; + static parseJSON(resp: string): JSON; + static serialize(obj: any, parentKey: string): string; + static appendParams(url: string, params: any): string; } - export class Presence { - constructor(channel: Channel, opts?: Object); + class Presence { + constructor(channel: Channel, opts?: object); + + onJoin(callback: Function): void; + onLeave(callback: Function): void; + onSync(callback: Function): void; + list(chooser?: (key: string, presence: any) => T): T[]; + inPendingSyncState(): boolean; static syncState( - currentState: any, - newState: any, + currentState: object, + newState: object, onJoin?: (key?: string, currentPresence?: any, newPresence?: any) => void, onLeave?: (key?: string, currentPresence?: any, newPresence?: any) => void ): any; static syncDiff( - currentState: any, - newState: any, + currentState: object, + diff: {joins: object; leaves: object}, onJoin?: (key?: string, currentPresence?: any, newPresence?: any) => void, onLeave?: (key?: string, currentPresence?: any, newPresence?: any) => void ): any; - static list(presences: Object, chooser?: Function): any; + static list( + presences: object, + chooser?: (key: string, presence: any) => T, + ): T[]; } } diff --git a/types/phoenix/phoenix-tests.ts b/types/phoenix/phoenix-tests.ts index 1e7641fc91..6e34b5c50c 100644 --- a/types/phoenix/phoenix-tests.ts +++ b/types/phoenix/phoenix-tests.ts @@ -1,46 +1,46 @@ import { Socket, Channel, Presence } from 'phoenix'; function test_socket() { - const socket = new Socket("/ws", {params: {userToken: "123"}}); + const socket = new Socket('/ws', {params: {userToken: '123'}}); socket.connect(); } function test_channel() { - const socket = new Socket("/ws", {params: {userToken: "123"}}); + const socket = new Socket('/ws', {params: {userToken: '123'}}); socket.connect(); - const channel = socket.channel("room:123", {token: '123'}); + const channel = socket.channel('room:123', {token: '123'}); - channel.on("new_msg", msg => console.log("Got message", msg)); + channel.on('new_msg', msg => console.log('Got message', msg)); - channel.push("new_msg", {body: 'some value'}, 10000) - .receive("ok", (msg) => console.log("created message", msg)) - .receive("error", (reasons) => console.log("create failed", reasons)) - .receive("timeout", () => console.log("Networking issue...")); + channel.push('new_msg', {body: 'some value'}, 10000) + .receive('ok', (msg) => console.log('created message', msg)) + .receive('error', (reasons) => console.log('create failed', reasons)) + .receive('timeout', () => console.log('Networking issue...')); channel.join() - .receive("ok", ({messages}) => console.log("catching up", messages)) - .receive("error", ({reason}) => console.log("failed join", reason)) - .receive("timeout", () => console.log("Networking issue. Still waiting...")); + .receive('ok', ({messages}) => console.log('catching up', messages)) + .receive('error', ({reason}) => console.log('failed join', reason)) + .receive('timeout', () => console.log('Networking issue. Still waiting...')); } function test_hooks() { - const socket = new Socket("/ws", {params: {userToken: "123"}}); + const socket = new Socket('/ws', {params: {userToken: '123'}}); socket.connect(); - socket.onError(() => console.log("there was an error with the connection!")); - socket.onClose(() => console.log("the connection dropped")); + socket.onError(() => console.log('there was an error with the connection!')); + socket.onClose(() => console.log('the connection dropped')); - const channel = socket.channel("room:123", {token: '123'}); + const channel = socket.channel('room:123', {token: '123'}); - channel.onError(() => console.log("there was an error!")); - channel.onClose(() => console.log("the channel has gone away gracefully")) + channel.onError(() => console.log('there was an error!')); + channel.onClose(() => console.log('the channel has gone away gracefully')); } function test_presence() { - const socket = new Socket("/ws", {params: {userToken: "123"}}); + const socket = new Socket('/ws', {params: {userToken: '123'}}); - const channel = socket.channel("room:123", {token: '123'}); + const channel = socket.channel('room:123', {token: '123'}); const presence = new Presence(channel); let presenceState = {}; @@ -49,12 +49,12 @@ function test_presence() { Presence.list(state, (id: string) => id).forEach(console.log); }; - channel.on("presence_state", (state) => { + channel.on('presence_state', (state) => { presenceState = Presence.syncState(presenceState, state); logState(presenceState); }); - channel.on("presence_diff", (diff) => { + channel.on('presence_diff', (diff) => { presenceState = Presence.syncState(presenceState, diff); logState(presenceState); }); diff --git a/types/phoenix/tslint.json b/types/phoenix/tslint.json index a41bf5d19a..6fca40ff8d 100644 --- a/types/phoenix/tslint.json +++ b/types/phoenix/tslint.json @@ -1,79 +1,117 @@ { - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } + "extends": "dtslint/dt.json", + "rules": { + "arrow-return-shorthand": true, + "ban-types": false, + "callable-types": true, + "class-name": true, + "comment-format": [ + true, + "check-space" + ], + "curly": true, + "deprecation": { + "severity": "warn" + }, + "eofline": true, + "forin": true, + "import-spacing": false, + "indent": [ + true, + "spaces" + ], + "interface-over-type-literal": true, + "label-position": true, + "max-line-length": false, + "member-access": false, + "member-ordering": false, + "no-arg": true, + "no-bitwise": true, + "no-console": [ + true, + "debug", + "info", + "time", + "timeEnd", + "trace" + ], + "no-construct": true, + "no-debugger": true, + "no-declare-current-package": false, + "no-duplicate-super": true, + "no-empty": false, + "no-empty-interface": true, + "no-eval": true, + "no-inferrable-types": [ + true, + "ignore-params" + ], + "no-misused-new": true, + "no-non-null-assertion": true, + "no-redundant-jsdoc": true, + "no-single-declare-module": false, + "no-shadowed-variable": true, + "no-string-literal": false, + "no-string-throw": true, + "no-switch-case-fall-through": true, + "no-trailing-whitespace": true, + "no-unnecessary-class": false, + "no-unnecessary-initializer": true, + "no-unused-expression": true, + "no-use-before-declare": true, + "no-var-keyword": true, + "object-literal-sort-keys": false, + "one-line": [ + true, + "check-open-brace", + "check-catch", + "check-else", + "check-whitespace" + ], + "prefer-const": true, + "quotemark": [ + true, + "single" + ], + "radix": true, + "semicolon": [ + true, + "always" + ], + "triple-equals": [ + true, + "allow-null-check" + ], + "typedef-whitespace": [ + true, + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + } + ], + "unified-signatures": true, + "variable-name": false, + "whitespace": [ + true, + "check-branch", + "check-decl", + "check-operator", + "check-separator", + "check-type" + ], + "no-output-on-prefix": true, + "use-input-property-decorator": true, + "use-output-property-decorator": true, + "use-host-property-decorator": true, + "no-input-rename": true, + "no-output-rename": true, + "use-life-cycle-interface": true, + "use-pipe-transform-interface": true, + "component-class-suffix": true, + "directive-class-suffix": true + } } + From d2b667e02b6abddeabe11c3ba5b8133fa2c74a80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=8A=98=E8=85=BE=E7=AC=94=E8=AE=B0?= Date: Thu, 7 Mar 2019 02:15:57 +0800 Subject: [PATCH 429/924] Added new types for html5plus (#33572) * Added new types for html5plus * change tslint rules for types/html5plus * change types for html5plus --- types/html5plus/html5plus-tests.ts | 2 + types/html5plus/index.d.ts | 15472 +++++++++++++++++++++++++++ types/html5plus/tsconfig.json | 23 + types/html5plus/tslint.json | 7 + 4 files changed, 15504 insertions(+) create mode 100644 types/html5plus/html5plus-tests.ts create mode 100644 types/html5plus/index.d.ts create mode 100644 types/html5plus/tsconfig.json create mode 100644 types/html5plus/tslint.json diff --git a/types/html5plus/html5plus-tests.ts b/types/html5plus/html5plus-tests.ts new file mode 100644 index 0000000000..371e463473 --- /dev/null +++ b/types/html5plus/html5plus-tests.ts @@ -0,0 +1,2 @@ +const webview = plus.webview.currentWebview(); +const style = webview.getStyle(); diff --git a/types/html5plus/index.d.ts b/types/html5plus/index.d.ts new file mode 100644 index 0000000000..2993f829b6 --- /dev/null +++ b/types/html5plus/index.d.ts @@ -0,0 +1,15472 @@ +// Type definitions for non-npm package html5plus 1.0 +// Project: https://www.html5plus.org/doc/ +// Definitions by: Dcloud +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * HTML5+æŽ„ćŁïŒŒç»Ÿäž€æ”è§ˆć™šè‡Ș漚ä艿‰©ć±•ïŒŒæäŸ›ćąžćŒșçš„ćŠŸèƒœă€æ€§èƒœæ‰©ć±•è§„èŒƒïŒŒäœżćŸ—ćŒ€ć‘è€…ćŻćŒ€ć‘ć‡șè·šćčłć°çš„appćč¶æŽ„èż‘ćŽŸç”Ÿçš„ćŠŸèƒœć’Œæ€§èƒœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/h5p.html](http://www.html5plus.org/doc/h5p.html) + */ +declare const plus: Plus; + +/** + * HTML5+æŽ„ćŁïŒŒç»Ÿäž€æ”è§ˆć™šè‡Ș漚ä艿‰©ć±•ïŒŒæäŸ›ćąžćŒșçš„ćŠŸèƒœă€æ€§èƒœæ‰©ć±•è§„èŒƒïŒŒäœżćŸ—ćŒ€ć‘è€…ćŻćŒ€ć‘ć‡șè·šćčłć°çš„appćč¶æŽ„èż‘ćŽŸç”Ÿçš„ćŠŸèƒœć’Œæ€§èƒœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/accelerometer.html](http://www.html5plus.org/doc/zh_cn/accelerometer.html) + */ +interface Plus { + /** + * AccelerometeræšĄć—çźĄç†èźŸć€‡ćŠ é€ŸćșŠäŒ æ„Ÿć™šïŒŒç”šäșŽèŽ·ć–èźŸć€‡ćŠ é€ŸćșŠäżĄæŻïŒŒćŒ…æ‹ŹxïŒˆć±ć蕿°Žćčłæ–čć‘ïŒ‰ă€yïŒˆćž‚ç›Žć±ć蕿°Žćčłæ–čć‘ïŒ‰ă€zïŒˆćž‚ç›Žć±ćč•ćčłéąæ–čć‘ïŒ‰äž‰äžȘæ–č搑的抠速ćșŠäżĄæŻă€‚é€šèż‡plus.accelerometerèŽ·ć–èźŸć€‡ćŠ é€ŸćșŠäŒ æ„Ÿć™šçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/accelerometer.html](http://www.html5plus.org/doc/zh_cn/accelerometer.html) + */ + accelerometer: PlusAccelerometer; + /** + * Native.js for Androidć°èŁ…äž€æĄé€šèż‡JSèŻ­æł•ç›ŽæŽ„è°ƒç”šNative JavaæŽ„ćŁé€šé“ïŒŒé€šèż‡plus.androidćŻè°ƒç”šć‡ äčŽæ‰€æœ‰çš„çł»ç»ŸAPI。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/android.html](http://www.html5plus.org/doc/zh_cn/android.html) + */ + android: PlusAndroid; + /** + * AudioæšĄć—ç”šäșŽæäŸ›éŸłéą‘çš„ćœ•ćˆ¶ć’Œæ’­æ”ŸćŠŸèƒœïŒŒćŻè°ƒç”šçł»ç»Ÿçš„éșŠć…‹éŁŽèźŸć€‡èż›èĄŒćœ•éŸłæ“äœœïŒŒäčŸćŻè°ƒç”šçł»ç»Ÿçš„æ‰ŹćŁ°ć™šèźŸć€‡æ’­æ”ŸéŸłéą‘æ–‡ä»¶ă€‚é€šèż‡plus.audioèŽ·ć–éŸłéą‘çźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + audio: PlusAudio; + /** + * BluetoothæšĄć—ç”šäșŽçźĄç†è“ç‰™èźŸć€‡ïŒŒæœçŽąé™„èż‘è“ç‰™èźŸć€‡ă€èżžæŽ„ćźžçŽ°æ•°æźé€šäżĄç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + bluetooth: PlusBluetooth; + /** + * CameraæšĄć—çźĄç†èźŸć€‡çš„æ‘„ćƒć€ŽïŒŒćŻç”šäșŽæ‹ç…§ă€æ‘„ćƒæ“äœœïŒŒé€šèż‡plus.cameraèŽ·ć–æ‘„ćƒć€ŽçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + camera: PlusCamera; + /** + * ContactsæšĄć—çźĄç†çł»ç»Ÿé€šèźŻćœ•ïŒŒç”šäșŽćŻćŻčçł»ç»Ÿé€šèźŻćœ•èż›èĄŒćąžă€ćˆ ă€æ”čă€æŸ„ç­‰æ“äœœă€‚é€šèż‡plus.contactsèŽ·ć–çł»ç»Ÿé€šèźŻćœ•çźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + contacts: PlusContacts; + /** + * DeviceæšĄć—çźĄç†èźŸć€‡äżĄæŻïŒŒç”šäșŽèŽ·ć–æ‰‹æœșèźŸć€‡çš„ç›žć…łäżĄæŻïŒŒćŠ‚IMEI、IMSIă€ćž‹ć·ă€ćŽ‚ć•†ç­‰ă€‚é€šèż‡plus.deviceèŽ·ć–èźŸć€‡äżĄæŻçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + device: PlusDevice; + /** + * ScreenæšĄć—çźĄç†èźŸć€‡ć±ćč•äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + screen: PlusScreen; + /** + * DisplayæšĄć—çźĄç†ćș”ç”šćŻäœżç”šçš„æ˜Ÿç€șćŒșćŸŸäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + display: PlusDisplay; + /** + * networkinfoæšĄć—ç”šäșŽèŽ·ć–çœ‘ç»œäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + networkinfo: PlusNetworkinfo; + /** + * OSæšĄć—çźĄç†æ“äœœçł»ç»ŸäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + os: PlusOs; + /** + * DownloaderæšĄć—çźĄç†çœ‘ç»œæ–‡ä»¶äž‹èœœä»»ćŠĄïŒŒç”šäșŽä»ŽæœćŠĄć™šäž‹èœœć„ç§æ–‡ä»¶ïŒŒćč¶æ”ŻæŒè·šćŸŸèźżé—źæ“äœœă€‚é€šèż‡plus.downloaderèŽ·ć–äž‹èœœçźĄç†ćŻčè±Ąă€‚Downloaderäž‹èœœäœżç”šHTTP的GET/POSTæ–čćŒèŻ·æ±‚äž‹èœœæ–‡ä»¶ïŒŒçŹŠćˆæ ‡ć‡†HTTP/HTTPSäŒ èŸ“ćèźźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + downloader: PlusDownloader; + /** + * FingerprintæšĄć—çźĄç†æŒ‡çșčèŻ†ćˆ«ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ + fingerprint: PlusFingerprint; + /** + * GalleryæšĄć—çźĄç†çł»ç»Ÿç›žć†ŒïŒŒæ”ŻæŒä»Žç›žć†Œäž­é€‰æ‹©ć›Ÿç‰‡æˆ–è§†éą‘æ–‡ä»¶ă€äżć­˜ć›Ÿç‰‡æˆ–è§†éą‘æ–‡ä»¶ćˆ°ç›žć†Œç­‰ćŠŸèƒœă€‚é€šèż‡plus.galleryèŽ·ć–ç›žć†ŒçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + gallery: PlusGallery; + /** + * GeolocationæšĄć—çźĄç†èźŸć€‡äœçœźäżĄæŻïŒŒç”šäșŽèŽ·ć–ćœ°ç†äœçœźäżĄæŻïŒŒćŠ‚ç»ćșŠă€çșŹćșŠç­‰ă€‚é€šèż‡plus.geolocationćŻèŽ·ć–èźŸć€‡äœçœźçźĄç†ćŻčè±Ąă€‚è™œç„¶W3Cć·Čç»æäŸ›æ ‡ć‡†APIèŽ·ć–äœçœźäżĄæŻïŒŒäœ†ćœšæŸäș›ćčłć°ć­˜ćœšć·źćŒ‚或æœȘćźžçŽ°ïŒŒäžșäș†äżæŒć„ćčłć°çš„ç»Ÿäž€æ€§ïŒŒćźšä艿­€è§„èŒƒæŽ„ćŁèŽ·ć–äœçœźäżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + geolocation: PlusGeolocation; + /** + * iBeaconæšĄć—ç”šäșŽæœçŽąé™„ä»¶çš„iBeaconèźŸć€‡ïŒˆ*èŻ·äœżç”šHBuilderXćč¶æ›Žæ–°ćˆ°æœ€æ–°ç‰ˆæœŹ*ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) + */ + ibeacon: PlusIbeacon; + /** + * IOæšĄć—çźĄç†æœŹćœ°æ–‡ä»¶çł»ç»ŸïŒŒç”šäșŽćŻčæ–‡ä»¶çł»ç»Ÿçš„ç›źćœ•æ”è§ˆă€æ–‡ä»¶çš„èŻ»ć–ă€æ–‡ä»¶çš„ć†™ć…„ç­‰æ“äœœă€‚é€šèż‡plus.ioćŻèŽ·ć–æ–‡ä»¶çł»ç»ŸçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + io: PlusIo; + /** + * Native.js for iOSć°èŁ…äž€æĄé€šèż‡JSèŻ­æł•ç›ŽæŽ„è°ƒç”šNative Objective-CæŽ„ćŁé€šé“ïŒŒé€šèż‡plus.iosćŻè°ƒç”šć‡ äčŽæ‰€æœ‰çš„çł»ç»ŸAPI。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ios.html](http://www.html5plus.org/doc/zh_cn/ios.html) + */ + ios: PlusIos; + /** + * KeyçźĄç†èźŸć€‡æŒ‰é”źäș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ + key: PlusKey; + /** + * MessagingæšĄć—çźĄç†èźŸć€‡é€šèźŻćŠŸèƒœïŒŒćŻç”šäșŽçŸ­äżĄă€ćœ©äżĄă€é‚źä»¶ć‘é€ç­‰ă€‚é€šèż‡plus.messagingćŻèŽ·ć–èźŸć€‡é€šèźŻçźĄç†ćŻčè±Ąă€‚ćŠć€–äčŸćŻä»„ç›ŽæŽ„é€šèż‡html侭的hrefç›ŽæŽ„ćż«é€Ÿć‘é€çŸ­äżĄă€æ‹šæ‰“ç””èŻă€ć‘é€é‚źä»¶ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + messaging: PlusMessaging; + /** + * nativeObjçźĄç†çł»ç»ŸćŽŸç”ŸćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + nativeObj: PlusNativeObj; + /** + * nativeUIçźĄç†çł»ç»ŸćŽŸç”Ÿç•ŒéąïŒŒćŻç”šäșŽćŒčć‡șçł»ç»ŸćŽŸç”Ÿæç€șćŻčèŻæĄ†çȘ—ćŁă€æ—¶é—Žæ—„期选择ćŻčèŻæĄ†ă€ç­‰ćŸ…ćŻčèŻæĄ†ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + nativeUI: PlusNativeUI; + /** + * navigator甹äșŽçźĄç†æ”è§ˆć™šèżèĄŒçŽŻćąƒäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + navigator: PlusNavigator; + /** + * OrientationæšĄć—çźĄç†èźŸć€‡çš„æ–čć‘äżĄæŻïŒŒćŒ…æ‹Źalpha、beta、gamma侉äžȘæ–čć‘äżĄæŻïŒŒé€šèż‡plus.orientationćŻèŽ·ć–èźŸć€‡æ–č搑缡理ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/orientation.html](http://www.html5plus.org/doc/zh_cn/orientation.html) + */ + orientation: PlusOrientation; + /** + * ProximityæšĄć—çźĄç†èźŸć€‡è·çŠ»äŒ æ„Ÿć™šïŒŒćŻèŽ·ć–ćœ“ć‰èźŸć€‡çš„æŽ„èż‘è·çŠ»äżĄæŻïŒŒé€šèż‡plus.proximityćŻèŽ·ć–èźŸć€‡è·çŠ»äŒ æ„ŸçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/proximity.html](http://www.html5plus.org/doc/zh_cn/proximity.html) + */ + proximity: PlusProximity; + /** + * RuntimeæšĄć—çźĄç†èżèĄŒçŽŻćąƒïŒŒćŻç”šäșŽèŽ·ć–ćœ“ć‰èżèĄŒçŽŻćąƒäżĄæŻă€äžŽć…¶ćźƒçš‹ćșèż›èĄŒé€šèźŻç­‰ă€‚é€šèż‡plus.runtimećŻèŽ·ć–èżèĄŒçŽŻćąƒçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + runtime: PlusRuntime; + /** + * StorageæšĄć—çźĄç†ćș”ç”šæœŹćœ°æ•°æźć­˜ć‚šćŒș甚äșŽćș”ç”šæ•°æźçš„äżć­˜ć’ŒèŻ»ć–ă€‚ćș”ç”šæœŹćœ°æ•°æźäžŽlocalStorage、sessionStorage的ćŒșćˆ«ćœšäșŽæ•°æźæœ‰æ•ˆćŸŸäžćŒïŒŒć‰è€…ćŻćœšćș”ç”šć†…è·šćŸŸæ“äœœïŒŒæ•°æźć­˜ć‚šæœŸæ˜ŻæŒäč…ćŒ–çš„ïŒŒćč¶äž”æČĄæœ‰ćźčé‡é™ćˆ¶ă€‚é€šèż‡plus.storagećŻèŽ·ć–ćș”ç”šæœŹćœ°æ•°æźçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/storage.html](http://www.html5plus.org/doc/zh_cn/storage.html) + */ + storage: PlusStorage; + /** + * StreamæšĄć—æ“äœœæ”ćș”甚。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + stream: PlusStream; + /** + * UploaderæšĄć—çźĄç†çœ‘ç»œäžŠäŒ ä»»ćŠĄïŒŒç”šäșŽä»ŽæœŹćœ°äžŠäŒ ć„ç§æ–‡ä»¶ćˆ°æœćŠĄć™šïŒŒćč¶æ”ŻæŒè·šćŸŸèźżé—źæ“äœœă€‚é€šèż‡plus.uploaderćŻèŽ·ć–äžŠäŒ çźĄç†ćŻčè±Ąă€‚UploaderäžŠäŒ äœżç”šHTTP的POSTæ–čćŒæäș€æ•°æźïŒŒæ•°æźæ ŒćŒçŹŠćˆMultipart/form-dataè§„èŒƒïŒŒćłrfc1867Form-based File Upload in HTMLïŒ‰ćèźźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + uploader: PlusUploader; + /** + * VideoæšĄć—çźĄç†ć€šćȘ’äœ“è§†éą‘ç›žć…łèƒœćŠ›ïŒŒćŻç”šćˆ›ć»șè§†éą‘æ’­æ”ŸæŽ§ä»¶ïŒŒç›Žæ’­æŽšæ”æŽ§ä»¶ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + video: PlusVideo; + /** + * WebviewæšĄć—çźĄç†ćș”甚çȘ—ćŁç•ŒéąïŒŒćźžçŽ°ć€šçȘ—ćŁçš„é€»èŸ‘æŽ§ćˆ¶çźĄç†æ“äœœă€‚é€šèż‡plus.webviewćŻèŽ·ć–ćș”ç”šç•ŒéąçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + webview: PlusWebview; + /** + * XMLHttpRequestæšĄć—çźĄç†çœ‘ç»œèŻ·æ±‚ïŒŒäžŽæ ‡ć‡†HTML侭的XMLHttpRequestç”šé€”äž€è‡ŽïŒŒć·źćˆ«ćœšäșŽć‰è€…ćŻä»„èż›èĄŒè·šćŸŸèźżé—źă€‚é€šèż‡plus.netćŻèŽ·ć–çœ‘ç»œèŻ·æ±‚çźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + net: PlusNet; + /** + * ZipæšĄć—çźĄç†æ–‡ä»¶ćŽ‹çŒ©ć’Œè§ŁćŽ‹ïŒŒé€šèż‡plus.zipćŻèŽ·ć–ćŽ‹çŒ©çźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + zip: PlusZip; + /** + * BarcodeæšĄć—çźĄç†æĄç æ‰«æïŒŒæ”ŻæŒćžžè§çš„æĄç ïŒˆäž€ç»Žç ćŠäșŒç»Žç ïŒ‰çš„æ‰«æèŻ†ćˆ«ćŠŸèƒœă€‚ćŻè°ƒç”šèźŸć€‡çš„æ‘„ćƒć€ŽćŻčæĄç ć›Ÿç‰‡æ‰«æèż›èĄŒæ•°æźèŸ“ć…„ïŒŒè§Łç ćŽèż”ć›žç æ•°æźćŠç ç±»ćž‹ă€‚é€šèż‡plus.barcodećŻèŽ·ć–æĄç ç çźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + barcode: PlusBarcode; + /** + * MapsæšĄć—çźĄç†ćœ°ć›ŸæŽ§ä»¶ïŒŒç”šäșŽćœšwebéĄ”éąäž­æ˜Ÿç€șćœ°ć›ŸæŽ§ä»¶ïŒŒæäŸ›ć„ç§æŽ„ćŁæ“äœœćœ°ć›ŸæŽ§ä»¶ïŒŒćŠ‚æ·»ćŠ æ ‡ç‚čă€è·Żçșżç­‰ă€‚é€šèż‡plus.mapsćŻèŽ·ć–ćœ°ć›ŸçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + maps: PlusMaps; + /** + * OAuthæšĄć—çźĄç†ćźąæˆ·ç«Żçš„ç”šæˆ·ç™»ćœ•æŽˆæƒéȘŒèŻćŠŸèƒœïŒŒć…èźžćș”ç”šèźżé—źçŹŹäž‰æ–čćčłć°çš„蔄æșă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + oauth: PlusOauth; + /** + * PaymentæšĄć—çźĄç†æ”Żä»˜ćŠŸèƒœïŒŒç”šäșŽæäŸ›çœ‘éĄ”ćź‰ć…šæ”Żä»˜èƒœćŠ›ïŒŒæ”ŻæŒé€šèż‡WebæŽ„ćŁèż›èĄŒæ”Żä»˜æ“äœœă€‚é€šèż‡plus.paymentćŻèŽ·ć–æ”Żä»˜çźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + payment: PlusPayment; + /** + * PushæšĄć—çźĄç†æŽšé€æ¶ˆæŻćŠŸèƒœïŒŒćŻä»„ćźžçŽ°ćœšçșżă€çŠ»çșżçš„æ¶ˆæŻæŽšé€ïŒŒé€šèż‡plus.pushćŻèŽ·ć–æŽšé€æ¶ˆæŻçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + push: PlusPush; + /** + * ShareæšĄć—çźĄç†ćźąæˆ·ç«Żçš„ç€Ÿäș€ćˆ†äș«ćŠŸèƒœïŒŒæäŸ›è°ƒç”šç»ˆç«Żç€Ÿäș€èœŻä»¶çš„ćˆ†äș«èƒœćŠ›ă€‚é€šèż‡plus.sharećŻèŽ·ć–ç€Ÿäș€ćˆ†äș«çźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + share: PlusShare; + /** + * SpeechæšĄć—çźĄç†èŻ­éŸłèŸ“ć…„ćŠŸèƒœïŒŒæäŸ›èŻ­éŸłèŻ†ćˆ«ćŠŸèƒœïŒŒćŻæ”ŻæŒç”šæˆ·é€šèż‡éșŠć…‹éŁŽèźŸć€‡èż›èĄŒèŻ­éŸłèŸ“ć…„ć†…ćźčă€‚é€šèż‡plus.speechćŻèŽ·ć–èŻ­éŸłèŸ“ć…„çźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + speech: PlusSpeech; + /** + * StatisticæšĄć—çźĄç†ç»ŸèźĄćŠŸèƒœïŒŒç”šäșŽæäŸ›ćș”ç”šć†…ç»ŸèźĄçš„èƒœćŠ›ïŒŒæ”ŻæŒç»ŸèźĄć’Œćˆ†æžç”šæˆ·ć±žæ€§ć’Œç”šæˆ·èĄŒäžșæ•°æźă€‚é€šèż‡plus.statisticćŻèŽ·ć–ç»ŸèźĄçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/statistic.html](http://www.html5plus.org/doc/zh_cn/statistic.html) + */ + statistic: PlusStatistic; +} + +/** + * AccelerometeræšĄć—çźĄç†èźŸć€‡ćŠ é€ŸćșŠäŒ æ„Ÿć™šïŒŒç”šäșŽèŽ·ć–èźŸć€‡ćŠ é€ŸćșŠäżĄæŻïŒŒćŒ…æ‹ŹxïŒˆć±ć蕿°Žćčłæ–čć‘ïŒ‰ă€yïŒˆćž‚ç›Žć±ć蕿°Žćčłæ–čć‘ïŒ‰ă€zïŒˆćž‚ç›Žć±ćč•ćčłéąæ–čć‘ïŒ‰äž‰äžȘæ–č搑的抠速ćșŠäżĄæŻă€‚é€šèż‡plus.accelerometerèŽ·ć–èźŸć€‡ćŠ é€ŸćșŠäŒ æ„Ÿć™šçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/accelerometer.html](http://www.html5plus.org/doc/zh_cn/accelerometer.html) + */ +interface PlusAccelerometer { + /** + * èźŸć€‡ćŠ é€ŸćșŠäżĄæŻćŻčè±Ą + * JSONćŻčè±ĄïŒŒäżć­˜èŽ·ć–èźŸć€‡çš„ćŠ é€ŸćșŠäżĄæŻïŒŒćŒ…æ‹Źx、y、z侉äžȘæ–č搑的抠速ćșŠäżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/accelerometer.html](http://www.html5plus.org/doc/zh_cn/accelerometer.html) + */ + Acceleration?: PlusAccelerometerAcceleration; + /** + * ç›‘ćŹèźŸć€‡ćŠ é€ŸćșŠæ„Ÿćș”ć™šć‚æ•° + * JSONćŻčè±ĄïŒŒç”šäșŽèźŸçœźèŽ·ć–èźŸć€‡ćŠ é€ŸćșŠäżĄæŻçš„ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/accelerometer.html](http://www.html5plus.org/doc/zh_cn/accelerometer.html) + */ + AccelerometerOption?: PlusAccelerometerAccelerometerOption; + /** + * èŽ·ć–ćœ“ć‰èźŸć€‡çš„ćŠ é€ŸćșŠäżĄæŻ + * 抠速ćșŠæ˜ŻèźŸć€‡ćœšćœ“ć‰æ–čć‘äžŠæ‰€ćšç›žćŻčèżćŠšć˜ćŒ–ïŒˆćąžă€ć‡é‡ïŒ‰çš„èżćŠšäŒ æ„Ÿć™šă€‚ćŠ é€ŸćșŠäżĄæŻćŒ…æ‹Źx、y、z侉äžȘæ–čć‘çš„äżĄæŻă€‚ + * 抠速ćșŠäżĄæŻćŻé€šèż‡successCBć›žè°ƒć‡œæ•°èż”ć›žă€‚ćŠ é€ŸćșŠäżĄæŻèŽ·ć–ć€±èŽ„ćˆ™è°ƒç”šć›žè°ƒć‡œæ•°errorCB。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/accelerometer.html](http://www.html5plus.org/doc/zh_cn/accelerometer.html) + */ + getCurrentAcceleration(successCB?: (result: PlusAccelerometerAcceleration) => void, errorCB?: (result: any) => void): void; + /** + * ç›‘ćŹèźŸć€‡ćŠ é€ŸćșŠć˜ćŒ–äżĄæŻ + * 抠速ćșŠæ˜ŻèźŸć€‡ćœšćœ“ć‰æ–čć‘äžŠæ‰€ćšç›žćŻčèżćŠšć˜ćŒ–ïŒˆćąžă€ć‡é‡ïŒ‰çš„èżćŠšäŒ æ„Ÿć™šă€‚ćŠ é€ŸćșŠäżĄæŻćŒ…æ‹Źx、y、z侉äžȘæ–čć‘çš„äżĄæŻă€‚ + * watchAccelerationæŻéš”ć›șćźšæ—¶é—Žć°±èŽ·ć–äž€æŹĄèźŸć€‡çš„ćŠ é€ŸćșŠäżĄæŻïŒŒé€šèż‡successCBć›žè°ƒć‡œæ•°èż”ć›žă€‚ćŻé€šèż‡option的frequencyć‚æ•°èźŸćźšèŽ·ć–èźŸć€‡ćŠ é€ŸćșŠäżĄæŻçš„æ—¶é—Žé—Žéš”。 + * 抠速ćșŠäżĄæŻèŽ·ć–ć€±èŽ„ćˆ™è°ƒç”šć›žè°ƒć‡œæ•°errorCB。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/accelerometer.html](http://www.html5plus.org/doc/zh_cn/accelerometer.html) + */ + watchAcceleration(successCB?: (result: PlusAccelerometerAcceleration) => void, errorCB?: (result: any) => void, options?: PlusAccelerometerAccelerometerOption): number; + /** + * ć…łé—­ç›‘ćŹèźŸć€‡ćŠ é€ŸćșŠäżĄæŻ + * ć…łé—­ç›‘ćŹèźŸć€‡ćŠ é€ŸćșŠäżĄæŻïŒŒćș”ç”šć…łé—­è°ƒç”šwatchAccelerationæ–čæł•çš„ćŒ€ćŻçš„ç›‘ćŹæ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/accelerometer.html](http://www.html5plus.org/doc/zh_cn/accelerometer.html) + */ + clearWatch(watchId?: number): void; +} + +/** + * èźŸć€‡ćŠ é€ŸćșŠäżĄæŻćŻčè±Ą + * JSONćŻčè±ĄïŒŒäżć­˜èŽ·ć–èźŸć€‡çš„ćŠ é€ŸćșŠäżĄæŻïŒŒćŒ…æ‹Źx、y、z侉äžȘæ–č搑的抠速ćșŠäżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/accelerometer.html](http://www.html5plus.org/doc/zh_cn/accelerometer.html) + */ +interface PlusAccelerometerAcceleration { + /** + * x蜎æ–č搑的抠速ćșŠ + * èŽ·ć–ćœ“ć‰èźŸć€‡x蜎æ–č搑的抠速ćșŠïŒŒæ”źç‚čćž‹æ•°æźïŒŒäžŽç‰©ç†ć­Šäž­çš„ćŠ é€ŸćșŠć€Œäž€è‡Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/accelerometer.html](http://www.html5plus.org/doc/zh_cn/accelerometer.html) + */ + xAxis?: number; + /** + * y蜎æ–č搑的抠速ćșŠ + * èŽ·ć–ćœ“ć‰èźŸć€‡y蜎æ–č搑的抠速ćșŠïŒŒæ”źç‚čćž‹æ•°æźïŒŒäžŽç‰©ç†ć­Šäž­çš„ćŠ é€ŸćșŠć€Œäž€è‡Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/accelerometer.html](http://www.html5plus.org/doc/zh_cn/accelerometer.html) + */ + yAxis?: number; + /** + * z蜎æ–č搑的抠速ćșŠ + * èŽ·ć–ćœ“ć‰èźŸć€‡z蜎æ–č搑的抠速ćșŠïŒŒæ”źç‚čćž‹æ•°æźïŒŒäžŽç‰©ç†ć­Šäž­çš„ćŠ é€ŸćșŠć€Œäž€è‡Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/accelerometer.html](http://www.html5plus.org/doc/zh_cn/accelerometer.html) + */ + zAxis?: number; +} + +/** + * ç›‘ćŹèźŸć€‡ćŠ é€ŸćșŠæ„Ÿćș”ć™šć‚æ•° + * JSONćŻčè±ĄïŒŒç”šäșŽèźŸçœźèŽ·ć–èźŸć€‡ćŠ é€ŸćșŠäżĄæŻçš„ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/accelerometer.html](http://www.html5plus.org/doc/zh_cn/accelerometer.html) + */ +interface PlusAccelerometerAccelerometerOption { + /** + * æ›Žæ–°ćŠ é€ŸćșŠäżĄæŻé—Žé𔿗¶é—Ž + * ç›‘ćŹć™šèŽ·ć–ćŠ é€ŸćșŠäżĄæŻçš„æ—¶é—Žé—Žéš”ïŒŒć•äœäžșmsïŒŒé»˜èź€ć€Œäžș500ms + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/accelerometer.html](http://www.html5plus.org/doc/zh_cn/accelerometer.html) + */ + frequency?: number; +} + +/** + * Native.js for Androidć°èŁ…äž€æĄé€šèż‡JSèŻ­æł•ç›ŽæŽ„è°ƒç”šNative JavaæŽ„ćŁé€šé“ïŒŒé€šèż‡plus.androidćŻè°ƒç”šć‡ äčŽæ‰€æœ‰çš„çł»ç»ŸAPI。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/android.html](http://www.html5plus.org/doc/zh_cn/android.html) + */ +interface PlusAndroid { + /** + * Javaç±»ćŻčè±Ą + * Javaç±»ćŻčè±ĄïŒŒćŻé€šèż‡ć…¶ć±žæ€§èŽ·ć–ç±»çš„ćžžé‡ïŒŒćŻé€šèż‡æ–čæł•æ„æ“äœœç±»çš„é™æ€ć˜é‡ć’Œæ–čæł•äčŸé€šèż‡newæ–čæł•æ„ćˆ›ć»șç±»çš„ćźžäŸ‹ćŻčè±Ąă€‚ + * ćŻčäșŽç±»çš„ćžžé‡ïŒŒćˆ™ç›ŽæŽ„é€šèż‡.ćŽéąè·Ÿéšćžžé‡ćç§°è°ƒç”šćłćŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/android.html](http://www.html5plus.org/doc/zh_cn/android.html) + */ + ClassObject?: PlusAndroidClassObject; + /** + * JavaćźžäŸ‹ćŻčè±Ą + * JavaćźžäŸ‹ćŻčè±ĄïŒŒćŻé€šèż‡ć…¶æ–čæł•æ„æ“äœœćźžäŸ‹çš„ć˜é‡ć’Œæ–čæł•。 + * æłšæ„ïŒšćż…éĄ»é€šèż‡plusGetAttribute()æ–čæł•èŻ»ć–ćźžäŸ‹ćŻčè±Ąçš„ć±žæ€§ć€ŒïŒŒé€šèż‡plusSetAttribute()æ–čæł•èźŸçœźćźžäŸ‹ćŻčè±Ąçš„ć±žæ€§ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/android.html](http://www.html5plus.org/doc/zh_cn/android.html) + */ + InstanceObject?: PlusAndroidInstanceObject; + /** + * ćŻŒć…„Javaç±»ćŻčè±Ą + * ćŻŒć…„ç±»ćŻčè±ĄćŽïŒŒć°±ćŻä»„é€šèż‡.æ“äœœçŹŠç›ŽæŽ„è°ƒç”šćŻčè±ĄïŒˆç±»ćŻčè±Ą/ćźžäŸ‹ćŻčè±ĄïŒ‰çš„æ–čæł•。 + * æłšæ„ïŒšćŻŒć…„ç±»ćŻčè±Ąć°†äŒšæ¶ˆè€—èŸƒć€šçš„çł»ç»Ÿè”„æșïŒŒé€šćžžäžćș”èŻ„ćŻŒć…„èż‡ć€šçš„ç±»ćŻčè±ĄïŒŒćŻä»„äœżç”šplus.android.invoke()杄调甚æœȘćŻŒć…„ç±»ćźžäŸ‹ćŻčè±Ąçš„æ–čæł•。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/android.html](http://www.html5plus.org/doc/zh_cn/android.html) + */ + importClass(classname?: string): PlusAndroidClassObject; + /** + * 戛ć»șćźžäŸ‹ćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/android.html](http://www.html5plus.org/doc/zh_cn/android.html) + */ + newObject(classname?: string, args?: any): PlusAndroidInstanceObject; + /** + * èŽ·ć–ćŻčè±ĄïŒˆç±»ćŻčè±Ą/ćźžäŸ‹ćŻčè±ĄïŒ‰çš„ć±žæ€§ć€Œ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/android.html](http://www.html5plus.org/doc/zh_cn/android.html) + */ + getAttribute(obj?: PlusAndroidInstanceObject, name?: string): any; + /** + * èźŸçœźćŻčè±ĄïŒˆç±»ćŻčè±Ą/ćźžäŸ‹ćŻčè±ĄïŒ‰çš„ć±žæ€§ć€Œ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/android.html](http://www.html5plus.org/doc/zh_cn/android.html) + */ + setAttribute(obj?: PlusAndroidInstanceObject, name?: string, value?: any): void; + /** + * 调甚ćŻčè±ĄïŒˆç±»ćŻčè±Ą/ćźžäŸ‹ćŻčè±ĄïŒ‰çš„æ–čæł• + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/android.html](http://www.html5plus.org/doc/zh_cn/android.html) + */ + invoke(obj?: PlusAndroidInstanceObject, name?: string, args?: any): any; + /** + * 漞现Interface的æ–čæł• + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/android.html](http://www.html5plus.org/doc/zh_cn/android.html) + */ + implements(name?: string, obj?: any): PlusAndroidInstanceObject; + /** + * èŽ·ć–ćș”甚䞻ActivityćźžäŸ‹ćŻčè±Ą + * Androidćčłć°ćꌿ•ŽJavaç±»ćäžșandroid.app.ActivityïŒŒćźŒæ•ŽAPIèŻ·ć‚è€ƒAndroidćŒ€ć‘æ–‡æĄŁ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/android.html](http://www.html5plus.org/doc/zh_cn/android.html) + */ + runtimeMainActivity(): PlusAndroidInstanceObject; + /** + * èŽ·ć–ćœ“ć‰WebviewçȘ—揣ćŻčè±Ąçš„nativeć±‚ćźžäŸ‹ćŻčè±Ą + * Androidćčłć°ćꌿ•ŽJavaç±»ćäžșandroid.webkit.WebviewïŒŒćźŒæ•ŽAPIèŻ·ć‚è€ƒAndroidćŒ€ć‘æ–‡æĄŁ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/android.html](http://www.html5plus.org/doc/zh_cn/android.html) + */ + currentWebview(): PlusAndroidInstanceObject; +} + +/** + * Javaç±»ćŻčè±Ą + * Javaç±»ćŻčè±ĄïŒŒćŻé€šèż‡ć…¶ć±žæ€§èŽ·ć–ç±»çš„ćžžé‡ïŒŒćŻé€šèż‡æ–čæł•æ„æ“äœœç±»çš„é™æ€ć˜é‡ć’Œæ–čæł•äčŸé€šèż‡newæ–čæł•æ„ćˆ›ć»șç±»çš„ćźžäŸ‹ćŻčè±Ąă€‚ + * ćŻčäșŽç±»çš„ćžžé‡ïŒŒćˆ™ç›ŽæŽ„é€šèż‡.ćŽéąè·Ÿéšćžžé‡ćç§°è°ƒç”šćłćŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/android.html](http://www.html5plus.org/doc/zh_cn/android.html) + */ +interface PlusAndroidClassObject { + /** + * èŽ·ć–Javaç±»ćŻčè±Ąçš„é™æ€ć±žæ€§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/android.html](http://www.html5plus.org/doc/zh_cn/android.html) + */ + plusGetAttribute(name?: string): any; + /** + * èźŸçœźJavaç±»ćŻčè±Ąçš„é™æ€ć±žæ€§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/android.html](http://www.html5plus.org/doc/zh_cn/android.html) + */ + plusSetAttribute(name?: string, value?: any): void; +} + +/** + * JavaćźžäŸ‹ćŻčè±Ą + * JavaćźžäŸ‹ćŻčè±ĄïŒŒćŻé€šèż‡ć…¶æ–čæł•æ„æ“äœœćźžäŸ‹çš„ć˜é‡ć’Œæ–čæł•。 + * æłšæ„ïŒšćż…éĄ»é€šèż‡plusGetAttribute()æ–čæł•èŻ»ć–ćźžäŸ‹ćŻčè±Ąçš„ć±žæ€§ć€ŒïŒŒé€šèż‡plusSetAttribute()æ–čæł•èźŸçœźćźžäŸ‹ćŻčè±Ąçš„ć±žæ€§ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/android.html](http://www.html5plus.org/doc/zh_cn/android.html) + */ +interface PlusAndroidInstanceObject { + /** + * èŽ·ć–JavaćźžäŸ‹ćŻčè±Ąçš„ć±žæ€§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/android.html](http://www.html5plus.org/doc/zh_cn/android.html) + */ + plusGetAttribute(name?: string): any; + /** + * èźŸçœźJavaćźžäŸ‹ćŻčè±Ąçš„ć±žæ€§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/android.html](http://www.html5plus.org/doc/zh_cn/android.html) + */ + plusSetAttribute(name?: string, value?: any): void; +} + +/** + * AudioæšĄć—ç”šäșŽæäŸ›éŸłéą‘çš„ćœ•ćˆ¶ć’Œæ’­æ”ŸćŠŸèƒœïŒŒćŻè°ƒç”šçł»ç»Ÿçš„éșŠć…‹éŁŽèźŸć€‡èż›èĄŒćœ•éŸłæ“äœœïŒŒäčŸćŻè°ƒç”šçł»ç»Ÿçš„æ‰ŹćŁ°ć™šèźŸć€‡æ’­æ”ŸéŸłéą‘æ–‡ä»¶ă€‚é€šèż‡plus.audioèŽ·ć–éŸłéą‘çźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ +interface PlusAudio { + /** + * ćœ•éŸłćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + AudioRecorder?: PlusAudioAudioRecorder; + /** + * éŸłéą‘æ’­æ”ŸćŻčè±Ą + * éŸłéą‘æ’­æ”ŸćŻčè±ĄïŒŒç”šäșŽéŸłéą‘æ–‡ä»¶çš„æ’­æ”Ÿă€‚äžèƒœé€šèż‡newæ–čæł•ç›ŽæŽ„ćˆ›ć»șćȘèƒœé€šèż‡audio.createPlayeræ–čæł•ćˆ›ć»ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + AudioPlayer?: PlusAudioAudioPlayer; + /** + * JSONćŻčè±ĄïŒŒè°ƒç”šéșŠć…‹éŁŽèźŸć€‡èż›èĄŒćœ•éŸłçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + RecordOptions?: PlusAudioRecordOptions; + /** + * èźŸć€‡çš„æ‰ŹćŁ°ć™šéŸłéą‘èŸ“ć‡șçșżè·Ż + * éŸłéą‘èŸ“ć‡șçșżè·Żćžžé‡ïŒŒć€Œäžș0ă€‚éŸłéą‘æ’­æ”Ÿæ—¶ćœšèźŸć€‡çš„æ‰ŹćŁ°ć™šèŸ“ć‡ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + ROUTE_SPEAKER?: number; + /** + * èźŸć€‡ćŹç­’éŸłéą‘èŸ“ć‡șçșżè·Ż + * éŸłéą‘èŸ“ć‡șçșżè·Żćžžé‡ïŒŒć€Œäžș1ă€‚éŸłéą‘æ’­æ”Ÿæ—¶ćœšèźŸć€‡çš„ćŹç­’èŸ“ć‡ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + ROUTE_EARPIECE?: number; + /** + * èŽ·ć–ćœ“ć‰èźŸć€‡çš„ćœ•éŸłćŻčè±Ą + * èŽ·ć–ćœ“ć‰èźŸć€‡çš„ćœ•éŸłćŻčè±ĄïŒŒèż›èĄŒćœ•éŸłæ“äœœïŒŒćœ•éŸłćŻčè±Ąæ˜ŻèźŸć€‡çš„ç‹Źć è”„æșïŒŒćœšćŒäž€æ—¶é—Žä»…ćŻæ‰§èĄŒäž€äžȘćœ•éŸłæ“äœœïŒŒćŠćˆ™ćŻèƒœäŒšćŻŒè‡Žæ“äœœć€±èŽ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + getRecorder(): PlusAudioAudioRecorder; + /** + * 戛ć»șéŸłéą‘æ’­æ”ŸćŻčè±Ą + * 戛ć»ș侀äžȘéŸłéą‘æ–‡ä»¶æ’­æ”ŸćŻčè±ĄïŒŒç”šäșŽæ‰“ćŒ€éŸłéą‘æ–‡ä»¶ćč¶æ’­æ”Ÿă€‚ + * ćŻé€šèż‡pathć‚æ•°æŒ‡ćźšèŠæ’­æ”Ÿçš„éŸłéą‘æ–‡ä»¶ă€‚ćˆ›ć»șćŽèż”ć›žæ’­æ”ŸćŻčè±ĄïŒŒé€šèż‡Audio.playæ–čæł•ćŒ€ć§‹æ’­æ”Ÿă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + createPlayer(path?: string): PlusAudioAudioPlayer; +} + +/** + * ćœ•éŸłćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ +interface PlusAudioAudioRecorder { + /** + * æ•°ç»„ïŒŒèźŸć€‡ćœ•éŸłæ”ŻæŒçš„é‡‡ç”šçŽ‡ + * ć±žæ€§ç±»ćž‹äžșArray(String)ïŒŒè‹„äžæ”ŻæŒæ­€ć±žæ€§ćˆ™èż”ć›žç©ș数组ćŻčè±Ąă€‚æ”ŻæŒçš„ćœ•éŸłé‡‡æ ·çŽ‡ïŒŒć­—çŹŠäžČæ ŒćŒäžșâ€œé‡‡æ ·éą‘çŽ‡â€ïŒŒćŠ‚â€œ8000â€ïŒ›ć…¶ć•äœäžșHz。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + supportedSamplerates?: string; + /** + * æ•°ç»„ïŒŒèźŸć€‡ćœ•éŸłæ”ŻæŒçš„æ–‡ä»¶æ ŒćŒ + * ć±žæ€§ç±»ćž‹äžșArray(String)ïŒŒè‹„äžæ”ŻæŒæ­€ć±žæ€§ćˆ™èż”ć›žç©ș数组ćŻčè±Ąă€‚æ”ŻæŒçš„ćœ•éŸłæ–‡ä»¶çš„æ ŒćŒïŒŒć­—çŹŠäžČæ ŒćŒäžșæ–‡ä»¶æ ŒćŒćŽçŒ€ćïŒŒćŠ‚"mp3"、"aac"、"wav"等。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + supportedFormats?: string; + /** + * è°ƒç”šèźŸć€‡éșŠć…‹éŁŽèż›èĄŒćœ•éŸłæ“äœœ + * è°ƒç”šèźŸć€‡éșŠć…‹éŁŽćŒ€ć§‹ćœ•éŸłæ“äœœïŒŒćœ•éŸłćźŒæˆéœ€è°ƒç”šstopæ–čæł•ćœæ­ąă€‚ćœ•éŸłćźŒæˆćŽć°†é€šèż‡successCBć›žè°ƒèż”ć›žćœ•éŸłćŽçš„æ–‡ä»¶æ•°æźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + record(option?: PlusAudioRecordOptions, successCB?: (result: string) => void, errorCB?: (result: any) => void): void; + /** + * ç»“æŸćœ•éŸłæ“äœœ + * ç»“æŸćœ•éŸłæ“äœœïŒŒé€šçŸ„èźŸć€‡ćźŒæˆćœ•éŸłæ“äœœă€‚ćœ•éŸłćźŒæˆćŽć°†è°ƒç”šrecordæ–čæł•äž­äŒ ć…„çš„successCBć›žè°ƒèż”ć›žćœ•éŸłæ–‡ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + stop(): void; +} + +/** + * éŸłéą‘æ’­æ”ŸćŻčè±Ą + * éŸłéą‘æ’­æ”ŸćŻčè±ĄïŒŒç”šäșŽéŸłéą‘æ–‡ä»¶çš„æ’­æ”Ÿă€‚äžèƒœé€šèż‡newæ–čæł•ç›ŽæŽ„ćˆ›ć»șćȘèƒœé€šèż‡audio.createPlayeræ–čæł•ćˆ›ć»ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ +interface PlusAudioAudioPlayer { + /** + * ćŒ€ć§‹æ’­æ”ŸéŸłéą‘ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + play(successCB?: () => void, errorCB?: (result: any) => void): void; + /** + * æš‚ćœæ’­æ”ŸéŸłéą‘ + * éœ€ć…ˆè°ƒç”šcreatePlayeræ–čæł•ćˆ›ć»șéŸłéą‘æ’­æ”ŸćŻčè±ĄïŒŒćč¶ćŒ€ć§‹æ’­æ”Ÿă€‚éŸłéą‘æ’­æ”ŸćŻčè±Ąćœšæ’­æ”ŸçŠ¶æ€æ‰èƒœæš‚ćœïŒŒćœšć…¶ćźƒçŠ¶æ€è°ƒç”šæ­€æ–čæł•æ— ä»»äœ•äœœç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + pause(): void; + /** + * æąć€æ’­æ”ŸéŸłéą‘ + * éŸłéą‘æ’­æ”ŸćŻčè±Ąćœšæš‚ćœçŠ¶æ€æ‰èƒœæąć€æ’­æ”ŸïŒŒćœšć…¶ćźƒçŠ¶æ€è°ƒç”šæ­€æ–čæł•æ— ä»»äœ•äœœç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + resume(): void; + /** + * ćœæ­ąæ’­æ”ŸéŸłéą‘ + * ćœæ­ąæ’­æ”ŸéŸłéą‘ïŒŒéŸłéą‘æ’­æ”ŸćŻčè±Ąćœšæ’­æ”Ÿæˆ–æš‚ćœçŠ¶æ€æ‰èƒœćœæ­ąæ’­æ”ŸïŒŒćœšć…¶ćźƒçŠ¶æ€è°ƒç”šæ­€æ–čæł•æ— ä»»äœ•äœœç”šă€‚ + * ćœæ­ąæ’­æ”ŸćŽćŠ‚æžœéœ€èŠç»§ç»­æ’­æ”ŸïŒŒćˆ™éœ€è°ƒç”šplayæ–čæł•é‡æ–°ćŒ€ć§‹æ’­æ”Ÿă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + stop(): void; + /** + * è·łćˆ°æŒ‡ćźšäœçœźæ’­æ”ŸéŸłéą‘ + * è·łćˆ°æŒ‡ćźšäœçœźæ’­æ”ŸéŸłéą‘ïŒŒéŸłéą‘æ’­æ”ŸćŻčè±Ąćœšæ’­æ”Ÿæˆ–æš‚ćœçŠ¶æ€æ‰èƒœè·łćˆ°æŒ‡ćźšæ’­æ”ŸéŸłéą‘ïŒŒćœšć…¶ćźƒçŠ¶æ€è°ƒç”šæ­€æ–čæł•æ— ä»»äœ•äœœç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + seekTo(position?: number): void; + /** + * èŽ·ć–éŸłéą‘æ”çš„æ€»é•żćșŠ + * èŽ·ć–éŸłéą‘æ”çš„æ€»é•żćșŠïŒŒć•䜍äžșç§’ïŒŒè‹„é•żćșŠæœȘçŸ„ćˆ™èż”ć›ž-1ă€‚ćŠ‚æžœèż˜æœȘèŽ·ć–ćˆ°éŸłéą‘æ”äżĄæŻćˆ™èż”ć›žNaNïŒŒæ­€æ—¶éœ€èŠć»¶èżŸèŽ·ć–æ­€äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + getDuration(): number; + /** + * èŽ·ć–éŸłéą‘æ”ćœ“ć‰æ’­æ”Ÿçš„äœçœź + * èŽ·ć–éŸłéą‘æ”ćœ“ć‰æ’­æ”Ÿçš„äœçœźïŒˆć·Čæ’­æ”Ÿçš„é•żćșŠïŒ‰ïŒŒć•䜍äžșs。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + getPosition(): number; + /** + * èźŸçœźéŸłéą‘èŸ“ć‡șçșżè·Ż + * ćŻćœšéŸłéą‘æ–‡ä»¶ćŒ€ć§‹æ’­æ”Ÿć‰æˆ–æ’­æ”Ÿçš„èż‡çš‹äž­æ”čć˜éŸłéą‘èŸ“ć‡șçșżè·ŻïŒŒé»˜èź€äœżç”šæ‰ŹćŁ°ć™šïŒˆplus.audio.ROUTE_SPEAKER蟓ć‡șçșżè·Żă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + setRoute(route?: number): void; +} + +/** + * JSONćŻčè±ĄïŒŒè°ƒç”šéșŠć…‹éŁŽèźŸć€‡èż›èĄŒćœ•éŸłçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ +interface PlusAudioRecordOptions { + /** + * ćœ•éŸłćŁ°é“ + * ćŻć–ć€ŒïŒš + * "mono" - ć•ćŁ°é“ćœ•éŸłïŒ› + * "stereo" - ç«‹äœ“ćŁ°é“ćœ•éŸłă€‚ + * é»˜èź€ć€Œäžș"mono"。 + * - mono: ć•ćŁ°é“ćœ•éŸł + * - stereo: ç«‹äœ“ćŁ°ćœ•éŸł + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + channels?: 'mono' | 'stereo'; + /** + * äżć­˜ćœ•éŸłæ–‡ä»¶çš„è·ŻćŸ„ + * ćŻèźŸçœźć…·äœ“æ–‡ä»¶ćïŒŒäčŸćŻćȘèźŸçœźè·ŻćŸ„ïŒŒćŠ‚æžœä»„â€œ/â€ç»“ć°Ÿćˆ™èĄšæ˜Žæ˜Żè·ŻćŸ„ïŒŒæ–‡ä»¶ćç”±ćœ•éŸłçš‹ćșè‡ȘćŠšç”Ÿæˆă€‚ + * 橂æœȘèźŸçœźćˆ™äœżç”šé»˜èź€ç›źćœ•ç”Ÿæˆéšæœșæ–‡ä»¶ćç§°ïŒŒé»˜èź€ç›źćœ•äžșćș”甚%APPID%例的documentsç›źćœ•ă€‚ + * - _www/: ćș”甚蔄æșç›źćœ• + * - _doc/: ćș”ç”šç§æœ‰æ–‡æĄŁç›źćœ• + * - _documents/: ć…±äș«æ–‡æĄŁç›źćœ• + * - _downloads/: ć…±äș«äž‹èœœç›źćœ• + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + filename?: '_www/' | '_doc/' | '_documents/' | '_downloads/'; + /** + * ćœ•éŸłæ–‡ä»¶çš„é‡‡æ ·çŽ‡ + * éœ€é€šèż‡supportedSampleratesć±žæ€§èŽ·ć–èźŸć€‡æ”ŻæŒçš„é‡‡æ ·çŽ‡ïŒŒè‹„èźŸçœźæ— æ•ˆçš„ć€ŒïŒŒćˆ™äœżç”šçł»ç»Ÿé»˜èź€çš„é‡‡æ ·çŽ‡ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + samplerate?: string; + /** + * ćœ•éŸłæ–‡ä»¶çš„æ ŒćŒ + * éœ€é€šèż‡supportedFormatsć±žæ€§èŽ·ć–èźŸć€‡æ”ŻæŒçš„ćœ•éŸłæ ŒćŒïŒŒè‹„èźŸçœźæ— æ•ˆçš„ć€ŒïŒŒćˆ™äœżç”šçł»ç»Ÿé»˜èź€çš„ćœ•éŸłæ ŒćŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/audio.html](http://www.html5plus.org/doc/zh_cn/audio.html) + */ + format?: string; +} + +/** + * BluetoothæšĄć—ç”šäșŽçźĄç†è“ç‰™èźŸć€‡ïŒŒæœçŽąé™„èż‘è“ç‰™èźŸć€‡ă€èżžæŽ„ćźžçŽ°æ•°æźé€šäżĄç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ +interface PlusBluetooth { + /** + * è“ç‰™èźŸć€‡äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + BluetoothDeviceInfo?: PlusBluetoothBluetoothDeviceInfo; + /** + * è“ç‰™èźŸć€‡æœćŠĄäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + BluetoothService?: PlusBluetoothBluetoothService; + /** + * è“ç‰™èźŸć€‡ç‰čćŸć€Œ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + Bluetoothcharacteristic?: PlusBluetoothBluetoothcharacteristic; + /** + * è“ç‰™èźŸć€‡ç‰čćŸć€Œæ”ŻæŒçš„æ“äœœç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + BluetoothcharacteristicProperties?: PlusBluetoothBluetoothcharacteristicProperties; + /** + * ć…łé—­è“ç‰™æšĄć— + * æ–­ćŒ€æ‰€æœ‰ć·Č经ć»șç«‹çš„èżžæŽ„ïŒŒé‡Šæ”Ÿçł»ç»Ÿè”„æșïŒŒèŠæ±‚ćœšè“ç‰™ćŠŸèƒœäœżç”šćźŒæˆćŽè°ƒç”šïŒˆäșŽopenBluetoothAdapter成ćŻčäœżç”šïŒ‰ă€‚ + * ć…łé—­æˆćŠŸćŽè§Šć‘optionsć‚æ•°äž­çš„successć›žè°ƒïŒŒć€±èŽ„è§Šć‘optionsć‚æ•°äž­çš„failć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + closeBluetoothAdapter(success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + /** + * èŽ·ć–æœŹæœșè“ç‰™é€‚é…ć™šçŠ¶æ€ + * èŽ·ć–æˆćŠŸćŽè§Šć‘optionsć‚æ•°äž­çš„successć›žè°ƒïŒŒć€±èŽ„è§Šć‘optionsć‚æ•°äž­çš„failć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + getBluetoothAdapterState(success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + /** + * èŽ·ć–ć·ČæœçŽąćˆ°çš„è“ç‰™èźŸć€‡ + * ćŒ…æ‹Źć·Čç»ć’ŒæœŹæœș怄äșŽèżžæŽ„çŠ¶æ€çš„èźŸć€‡ă€‚ + * èŽ·ć–æˆćŠŸćŽè§Šć‘optionsć‚æ•°äž­çš„successć›žè°ƒïŒŒć€±èŽ„è§Šć‘optionsć‚æ•°äž­çš„failć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + getBluetoothDevices(success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + /** + * æ čæźuuidèŽ·ć–ć€„äșŽć·ČèżžæŽ„çš„èźŸć€‡ + * èŽ·ć–æˆćŠŸćŽè§Šć‘optionsć‚æ•°äž­çš„successć›žè°ƒïŒŒć€±èŽ„è§Šć‘optionsć‚æ•°äž­çš„failć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + getConnectedBluetoothDevices(services?: any [], success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + /** + * ç›‘ćŹè“ç‰™é€‚é…ć™šçŠ¶æ€ć˜ćŒ–äș‹ä»¶ + * è“ç‰™é€‚é…ć™šçŠ¶æ€ć‘ç”Ÿć˜ćŒ–æ—¶è§Šć‘ć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + onBluetoothAdapterStateChange(changeCB?: (result: any) => void): void; + /** + * ç›‘ćŹæœçŽąćˆ°æ–°èźŸć€‡çš„äș‹ä»¶ + * æœçŽąćˆ°æ–°èźŸć€‡æ—¶è§Šć‘ć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + onBluetoothDeviceFound(callback?: (result: any) => void): void; + /** + * ćˆć§‹ćŒ–è“ç‰™æšĄć— + * ćˆć§‹ćŒ–æˆćŠŸćŽè§Šć‘optionsć‚æ•°äž­çš„successć›žè°ƒïŒŒć€±èŽ„è§Šć‘optionsć‚æ•°äž­çš„failć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + openBluetoothAdapter(success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + /** + * ćŒ€ć§‹æœçŽąé™„èż‘çš„è“ç‰™èźŸć€‡ + * æ­€æ“äœœæŻ”èŸƒè€—èŽčçł»ç»Ÿè”„æșïŒŒèŻ·ćœšæœçŽąćč¶èżžæŽ„ćˆ°èźŸć€‡ćŽè°ƒç”šstopBluetoothDevicesDiscoveryæ–čæł•ćœæ­ąæœçŽąă€‚ + * æœçŽąæˆćŠŸćŽè§Šć‘optionsć‚æ•°äž­çš„successć›žè°ƒïŒŒć€±èŽ„è§Šć‘optionsć‚æ•°äž­çš„failć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + startBluetoothDevicesDiscovery(services?: any [], allowDuplicatesKey?: boolean, interval?: number, success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + /** + * ćœæ­ąæœćŻ»é™„èż‘çš„è“ç‰™ć€–ć›ŽèźŸć€‡ + * è‹„ć·Čç»æ‰Ÿćˆ°éœ€èŠçš„è“ç‰™èźŸć€‡ćč¶äžéœ€èŠç»§ç»­æœçŽąæ—¶ïŒŒćș”èŻ„è°ƒç”šèŻ„æŽ„ćŁćœæ­ąè“ç‰™æœçŽąă€‚ + * ćœæ­ąæˆćŠŸćŽè§Šć‘optionsć‚æ•°äž­çš„successć›žè°ƒïŒŒć€±èŽ„è§Šć‘optionsć‚æ•°äž­çš„failć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + stopBluetoothDevicesDiscovery(success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + /** + * æ–­ćŒ€äžŽäœŽćŠŸè€—è“ç‰™èźŸć€‡çš„èżžæŽ„ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + closeBLEConnection(deviceId?: string, success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + /** + * èżžæŽ„äœŽćŠŸè€—è“ç‰™èźŸć€‡ + * è‹„äč‹ć‰ć·Čæœ‰æœçŽąèż‡æŸäžȘè“ç‰™èźŸć€‡ïŒŒćč¶æˆćŠŸć»șç«‹èżžæŽ„ïŒŒćŻç›ŽæŽ„äŒ ć…„äč‹ć‰æœçŽąèŽ·ć–çš„deviceIdć°èŻ•èżžæŽ„èŻ„èźŸć€‡ïŒŒæ— éœ€èż›èĄŒæœçŽąæ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + createBLEConnection(deviceId?: string, timeout?: number, success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + /** + * èŽ·ć–è“ç‰™èźŸć€‡æŒ‡ćźšæœćŠĄäž­æ‰€æœ‰ç‰čćŸć€Œ(characteristic) + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + getBLEDeviceCharacteristics(deviceId?: string, serviceId?: string, success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + /** + * èŽ·ć–è“ç‰™èźŸć€‡çš„æ‰€æœ‰æœćŠĄ(service) + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + getBLEDeviceServices(deviceId?: string, success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + /** + * ćŻç”šäœŽćŠŸè€—è“ç‰™èźŸć€‡ç‰čćŸć€Œć˜ćŒ–æ—¶çš„notifyćŠŸèƒœïŒŒèźąé˜…ç‰čćŸć€Œ + * è“ç‰™èźŸć€‡æœćŠĄçš„ç‰čćŸć€Œćż…éĄ»æ”ŻæŒnotify或indicateæ‰ćŻä»„æˆćŠŸè°ƒç”šă€‚ + * ćŠć€–ïŒŒćż…éĄ»ć…ˆćŻç”šnotifyBLECharacteristicValueChangeæ‰èƒœç›‘ćŹćˆ°èźŸć€‡characteristicValueChangeäș‹ä»¶,捳ç‰čćŸć€Œć‘ç”Ÿć˜ćŒ–æ—¶é€šèż‡onBLECharacteristicValueChangeæłšć†Œçš„äș‹ä»¶ć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + notifyBLECharacteristicValueChange(deviceId?: string, serviceId?: string, characteristicId?: string, state?: boolean, success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + /** + * ç›‘ćŹäœŽćŠŸè€—è“ç‰™èźŸć€‡çš„ç‰čćŸć€Œć˜ćŒ–äș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + onBLECharacteristicValueChange(callback?: (result: any) => void): void; + /** + * ç›‘ćŹäœŽćŠŸè€—è“ç‰™èźŸć€‡èżžæŽ„çŠ¶æ€ć˜ćŒ–äș‹ä»¶ + * ćŒ…æ‹ŹćŒ€ć‘è€…äž»ćŠšèżžæŽ„æˆ–æ–­ćŒ€èżžæŽ„ïŒŒèźŸć€‡äžąć€±ïŒŒèżžæŽ„ćŒ‚ćžžæ–­ćŒ€ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + onBLEConnectionStateChange(callback?: (result: any) => void): void; + /** + * èŻ»ć–äœŽćŠŸè€—è“ç‰™èźŸć€‡æŒ‡ćźšç‰čćŸć€Œçš„äșŒèż›ćˆ¶æ•°æźć€Œ + * æŒ‡ćźšçš„ç‰čćŸć€Œéœ€æ”ŻæŒreadæ“äœœæ‰ćŻä»„æˆćŠŸè°ƒç”šă€‚ + * ćč¶èĄŒè°ƒç”šć€šæŹĄćŻèƒœćŻŒè‡ŽèŻ»ć–ć€±èŽ„ïŒŒèŻ»ć–çš„æ•°æźéœ€èŠćœšonBLECharacteristicValueChangeæ–čæł•æłšć†Œçš„ć›žè°ƒäž­èŽ·ć–ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + readBLECharacteristicValue(deviceId?: string, serviceId?: string, characteristicId?: string, success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + /** + * ć‘äœŽćŠŸè€—è“ç‰™èźŸć€‡æŒ‡ćźšç‰čćŸć€Œć†™ć…„äșŒèż›ćˆ¶æ•°æź + * æŒ‡ćźšçš„ç‰čćŸć€Œéœ€æ”ŻæŒwriteæ“äœœæ‰ćŻä»„æˆćŠŸè°ƒç”šă€‚ + * ćč¶èĄŒè°ƒç”šć€šæŹĄćŻèƒœćŻŒè‡ŽèŻ»ć–ć€±èŽ„ïŒŒçł»ç»ŸćŻèƒœäŒšé™ćˆ¶ć•æŹĄäŒ èŸ“çš„æ•°æźć€§ć°ïŒŒè¶…èż‡æœ€ć€§ć­—èŠ‚æ•°ćŽćŻèƒœäŒšć‘ç”Ÿć†™ć…„é”™èŻŻïŒŒć»șèźźæŻæŹĄć†™ć…„äžè¶…èż‡20ć­—èŠ‚ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + writeBLECharacteristicValue(deviceId?: string, serviceId?: string, characteristicId?: string, value?: ArrayBuffer, success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; +} + +/** + * è“ç‰™èźŸć€‡äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ +interface PlusBluetoothBluetoothDeviceInfo { + /** + * è“ç‰™èźŸć€‡ćç§° + * 某äș›èźŸć€‡ćŻèƒœæČĄæœ‰æ­€ć­—æź”ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + name?: string; + /** + * è“ç‰™èźŸć€‡çš„id + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + deviceId?: string; + /** + * è“ç‰™èźŸć€‡çš„äżĄć·ćŒșćșŠ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + RSSI?: string; + /** + * è“ç‰™èźŸć€‡çš„ćčżæ’­æ•°æźæź”侭的ManufacturerDataæ•°æźæź” + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + advertisData?: ArrayBuffer; + /** + * è“ç‰™èźŸć€‡çš„ćčżæ’­æ•°æźæź”侭的ServiceUUIDsæ•°æźæź” + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + advertisServiceUUIDs?: any []; + /** + * è“ç‰™èźŸć€‡çš„ćčżæ’­æ•°æźæź”侭的LocalNameæ•°æźæź” + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + localName?: string; + /** + * è“ç‰™èźŸć€‡çš„ćčżæ’­æ•°æźæź”侭的ServiceDataæ•°æźæź” + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + serviceData?: any; +} + +/** + * è“ç‰™èźŸć€‡æœćŠĄäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ +interface PlusBluetoothBluetoothService { + /** + * è“ç‰™èźŸć€‡æœćŠĄçš„uuid + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + uuid?: string; + /** + * æ˜ŻćŠäžșèźŸć€‡çš„äž»æœćŠĄ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + isPrimary?: boolean; +} + +/** + * è“ç‰™èźŸć€‡ç‰čćŸć€Œ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ +interface PlusBluetoothBluetoothcharacteristic { + /** + * è“ç‰™èźŸć€‡ç‰čćŸć€Œçš„uuid + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + uuid?: string; + /** + * èźŸć€‡ç‰čćŸć€Œæ”ŻæŒçš„æ“äœœç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + properties?: PlusBluetoothBluetoothcharacteristicProperties; +} + +/** + * è“ç‰™èźŸć€‡ç‰čćŸć€Œæ”ŻæŒçš„æ“äœœç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ +interface PlusBluetoothBluetoothcharacteristicProperties { + /** + * ç‰čćŸć€Œæ˜ŻćŠæ”ŻæŒread操䜜 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + read?: boolean; + /** + * ç‰čćŸć€Œæ˜ŻćŠæ”ŻæŒwrite操䜜 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + write?: boolean; + /** + * ç‰čćŸć€Œæ˜ŻćŠæ”ŻæŒnotify操䜜 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + notify?: boolean; + /** + * ç‰čćŸć€Œæ˜ŻćŠæ”ŻæŒindicate操䜜 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/bluetooth.html](http://www.html5plus.org/doc/zh_cn/bluetooth.html) + */ + indicate?: boolean; +} + +/** + * CameraæšĄć—çźĄç†èźŸć€‡çš„æ‘„ćƒć€ŽïŒŒćŻç”šäșŽæ‹ç…§ă€æ‘„ćƒæ“äœœïŒŒé€šèż‡plus.cameraèŽ·ć–æ‘„ćƒć€ŽçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ +interface PlusCamera { + /** + * æ‘„ćƒć€ŽćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + Camera?: PlusCameraCamera; + /** + * JSONćŻčè±ĄïŒŒè°ƒç”šæ‘„ćƒć€Žçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + CameraOptions?: PlusCameraCameraOptions; + /** + * JSONćŻčè±ĄïŒŒćŒčć‡șæ‹ç…§æˆ–æ‘„ćƒç•ŒéąæŒ‡ç€șäœçœź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + PopPosition?: PlusCameraPopPosition; + /** + * èŽ·ć–æ‘„ćƒć€ŽçźĄç†ćŻčè±Ą + * èŽ·ć–éœ€èŠæ“äœœçš„æ‘„ćƒć€ŽćŻčè±ĄïŒŒćŠ‚æžœèŠèż›èĄŒæ‹ç…§æˆ–æ‘„ćƒæ“äœœïŒŒéœ€ć…ˆé€šèż‡æ­€æ–čæł•èŽ·ć–æ‘„ćƒć€ŽćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + getCamera(index?: number): PlusCameraCamera; +} + +/** + * æ‘„ćƒć€ŽćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ +interface PlusCameraCamera { + /** + * 歗笩äžČæ•°ç»„ïŒŒæ‘„ćƒć€Žæ”ŻæŒçš„æ‹ç…§ćˆ†èŸšçŽ‡ + * ć±žæ€§ç±»ćž‹äžșString[]ïŒŒè‹„äžæ”ŻæŒæ­€ć±žæ€§ćˆ™èż”ć›žç©ș数组ćŻčè±Ąă€‚ + * æ‘„ćƒć€Žæ”ŻæŒçš„æ‹ç…§ć›Ÿç‰‡ćˆ†èŸšçŽ‡ć­—çŹŠäžČćœąćŒâ€œWIDTH*Heightâ€ïŒŒćŠ‚â€œ400*800â€ïŒ›ćŠ‚æžœæ”ŻæŒä»»æ„è‡Ș漚äč‰ćˆ†èŸšçŽ‡ćˆ™â€œ*”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + supportedImageResolutions?: any []; + /** + * 歗笩äžČæ•°ç»„ïŒŒæ‘„ćƒć€Žæ”ŻæŒçš„æ‘„ćƒćˆ†èŸšçŽ‡ + * ć±žæ€§ç±»ćž‹äžșString[]ïŒŒè‹„äžæ”ŻæŒæ­€ć±žæ€§ćˆ™èż”ć›žç©ș数组ćŻčè±Ąă€‚ + * æ‘„ćƒć€Žæ”ŻæŒçš„è§†éą‘ćˆ†èŸšçŽ‡ć­—çŹŠäžČćœąćŒäžș“WIDTH*Heightâ€ïŒŒćŠ‚â€œ400*800â€ïŒ›ćŠ‚æžœæ”ŻæŒä»»æ„è‡Ș漚äč‰ćˆ†èŸšçŽ‡ćˆ™â€œ*”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + supportedVideoResolutions?: any []; + /** + * 歗笩äžČæ•°ç»„ïŒŒæ‘„ćƒć€Žæ”ŻæŒçš„æ‹ç…§æ–‡ä»¶æ ŒćŒ + * ć±žæ€§ç±»ćž‹äžșString[]ïŒŒè‹„äžæ”ŻæŒæ­€ć±žæ€§ćˆ™èż”ć›žç©ș数组ćŻčè±Ąă€‚ + * æ‘„ćƒć€Žæ”ŻæŒçš„ć›Ÿç‰‡æ–‡ä»¶æ ŒćŒć­—çŹŠäžČćœąćŒäžșæ–‡ä»¶æ ŒćŒćŽçŒ€ćïŒŒćŠ‚â€œjpg”、“png”、“bmp”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + supportedImageFormats?: any []; + /** + * 歗笩äžČæ•°ç»„ïŒŒæ‘„ćƒć€Žæ”ŻæŒçš„æ‘„ćƒæ–‡ä»¶æ ŒćŒ + * ć±žæ€§ç±»ćž‹äžșString[]ïŒŒè‹„äžæ”ŻæŒæ­€ć±žæ€§ćˆ™èż”ć›žç©ș数组ćŻčè±Ąă€‚ + * æ‘„ćƒć€Žæ”ŻæŒçš„è§†éą‘æ–‡ä»¶æ ŒćŒć­—çŹŠäžČćœąćŒäžșæ–‡ä»¶æ ŒćŒćŽçŒ€ćïŒŒćŠ‚â€œ3gp”、“mp4”、“avi”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + supportedVideoFormats?: any []; + /** + * èż›èĄŒæ‹ç…§æ“äœœ + * æ‘„ćƒć€Žè”„æșäžșç‹Źć è”„æșïŒŒćŠ‚æžœć…¶ćźƒçš‹ćșæˆ–饔靱ć·Čç»ć ç”šæ‘„ćƒć€ŽïŒŒć†æŹĄæ“äœœćˆ™ć€±èŽ„ă€‚ + * æ‹ç…§æ“äœœæˆćŠŸć°†é€šèż‡successCBèż”ć›žæ‹ç…§èŽ·ć–çš„ć›Ÿç‰‡è·ŻćŸ„ă€‚ + * ćŻé€šèż‡optionèźŸçœźæ‘„ćƒć€Žçš„ć„ç§ć±žæ€§ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + captureImage(successCB?: (result: string) => void, errorCB?: (result: any) => void, options?: PlusCameraCameraOptions): void; + /** + * è°ƒç”šæ‘„ćƒć€Žèż›èĄŒæ‘„ćƒæ“äœœ + * æ‘„ćƒć€Žè”„æșäžșç‹Źć è”„æșïŒŒćŠ‚æžœć…¶ćźƒçš‹ćșæˆ–饔靱ć·Čç»ć ç”šæ‘„ćƒć€ŽïŒŒć†æŹĄæ“äœœćˆ™ć€±èŽ„ă€‚ + * æ‹ç…§æ“äœœæˆćŠŸć°†é€šèż‡successCBèż”ć›žæ‘„ćƒèŽ·ć–çš„è§†éą‘æ–‡ä»¶è·ŻćŸ„ă€‚ + * ćŻé€šèż‡optionèźŸçœźæ‘„ćƒć€Žçš„ć„ç§ć±žæ€§ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + startVideoCapture(successCB?: (result: string) => void, errorCB?: (result: any) => void, option?: PlusCameraCameraOptions): void; + /** + * ç»“æŸæ‘„ćƒæ“äœœ + * ćŒ€ć§‹è°ƒç”šæ‘„ćƒć€Žèż›èĄŒæ‘„ćƒæ“äœœćŽïŒŒćŻćœšćŽć°ç»“æŸæ‘„ćƒæ“äœœïŒŒäžŽç”šæˆ·ćœšç•Œéąç»“æŸæ“äœœæ•ˆæžœäž€è‡Žă€‚ + * æ‘„ćƒæ“äœœæˆćŠŸć°†é€šèż‡startVideoCaptureć‡œæ•°äž­çš„successCBèż”ć›žæ‹ç…§èŽ·ć–çš„ć›Ÿç‰‡è·ŻćŸ„ă€‚ + * ç”šæˆ·ćŠ‚æžœæČĄæœ‰èż›èĄŒæ‘„ćƒæ“äœœć…łé—­æ‘„ćƒć€ŽéĄ”éąćˆ™è°ƒç”šć€±èŽ„ć›žè°ƒć‡œæ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + stopVideoCapture(): void; +} + +/** + * JSONćŻčè±ĄïŒŒè°ƒç”šæ‘„ćƒć€Žçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ +interface PlusCameraCameraOptions { + /** + * æ‹ç…§æˆ–æ‘„ćƒæ–‡ä»¶äżć­˜çš„è·ŻćŸ„ + * ćŻèźŸçœźć…·äœ“æ–‡ä»¶ćïŒˆćŠ‚"_doc/camera/a.jpg"äčŸćŻćȘèźŸçœźè·ŻćŸ„ïŒŒä»„"/"ç»“ć°Ÿćˆ™èĄšæ˜Žæ˜Żè·ŻćŸ„ïŒˆćŠ‚"_doc/camera/"ïŒ‰ă€‚ + * 橂æœȘèźŸçœźæ–‡ä»¶ćç§°æˆ–èźŸçœźçš„æ–‡ä»¶ćć†ČçȘćˆ™æ–‡ä»¶ćç”±çš‹ćșçš‹ćșè‡ȘćŠšç”Ÿæˆă€‚ + * - _doc/: ćș”ç”šç§æœ‰æ–‡æĄŁç›źćœ• + * - _documents/: ć…±äș«æ–‡æĄŁç›źćœ• + * - _downloads/: ć…±äș«äž‹èœœç›źćœ• + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + filename?: '_doc/' | '_documents/' | '_downloads/'; + /** + * æ‹ç…§æˆ–æ‘„ćƒçš„æ–‡ä»¶æ ŒćŒ + * ćŻé€šèż‡CameraćŻčè±Ąçš„supportedImageFormats或supportedVideoFormatsèŽ·ć–ïŒŒćŠ‚æžœèźŸçœźçš„ć‚æ•°æ— æ•ˆćˆ™äœżç”šçł»ç»Ÿé»˜èź€ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + format?: string; + /** + * æ‹ç…§æˆ–æ‘„ćƒé»˜èź€äœżç”šçš„æ‘„ćƒć€Ž + * æ‹ç…§æˆ–æ‘„ćƒç•Œéąé»˜èź€äœżç”šçš„æ‘„ćƒć€ŽçŒ–ć·ïŒŒ1èĄšç€șäž»æ‘„ćƒć€ŽïŒŒ2èĄšç€șèŸ…æ‘„ćƒć€Žă€‚ + * - 1: äœżç”šèźŸć€‡äž»æ‘„ćƒć€Ž + * - 2: äœżç”šèźŸć€‡èŸ…æ‘„ćƒć€Ž + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + index?: '1' | '2'; + /** + * è§†éą‘é•żćșŠ + * ć•äœäžș秒sïŒ‰ïŒŒć°äșŽç­‰äșŽ0èĄšç€șäžé™ćźšè§†éą‘é•żćșŠă€‚ + * é»˜èź€ć€Œäžș0ïŒˆäžé™ćźšè§†éą‘é•żćșŠïŒ‰ă€‚ + * æłšæ„ïŒšä»…ćœšè°ƒç”šæ‹æ‘„è§†éą‘ïŒˆstartVideoCaptureïŒ‰æ—¶æœ‰æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + videoMaximumDuration?: number; + /** + * æ˜ŻćŠäŒ˜ćŒ–ć›Ÿç‰‡ + * è‡ȘćŠšè°ƒæ•Žć›Ÿç‰‡çš„æ–čć‘ïŒŒćœšéƒšćˆ†èźŸć€‡äžŠćŻèƒœć‡șçŽ°ć›Ÿç‰‡æ–čć‘äžæ­ŁçĄźçš„é—źéą˜ïŒŒæ­€ć‚æ•°ć°†é…çœźæ˜ŻćŠè‡ȘćŠšè°ƒæ•Žć›Ÿç‰‡æ–č搑。 + * ćŻć–ć€ŒïŒš + * true - è‡ȘćŠšè°ƒæ•Žć›Ÿç‰‡æ–čć‘ïŒ› + * false - äžè°ƒæ•Žă€‚ + * é»˜èź€ć€Œäžștrue。 + * æłšæ„ïŒšè‡ȘćŠšè°ƒæ•Žć›Ÿç‰‡æ–čć‘ć°†æ¶ˆè€—éƒšćˆ†çł»ç»Ÿè”„æșïŒŒćŻèƒœäŒšćŻŒè‡Žæ‹ç…§ćŽć›žè°ƒè§Šć‘æ—¶æœșć»¶èżŸïŒŒć°†æ­€ć€ŒèźŸçœźäžșfalsećˆ™ćŻéżć…ć»¶èżŸé—źéą˜ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + optimize?: boolean; + /** + * æ‹ç…§æˆ–æ‘„ćƒäœżç”šçš„ćˆ†èŸšçŽ‡ + * ćŻé€šèż‡CameraćŻčè±Ąçš„supportedImageResolutions或supportedVideoResolutionsèŽ·ć–ïŒŒćŠ‚æžœèźŸçœźçš„ć‚æ•°æ— æ•ˆćˆ™äœżç”šçł»ç»Ÿé»˜èź€ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + resolution?: string; + /** + * æ‹ç…§æˆ–æ‘„ćƒç•ŒéąćŒčć‡ș指ç€șćŒș㟟 + * ćŻčäșŽć€§ć±ćč•èźŸć€‡ćŠ‚iPadïŒŒæ‹ç…§æˆ–æ‘„ćƒç•ŒéąäžșćŒčć‡șçȘ—ćŁïŒŒæ­€æ—¶ćŻé€šèż‡æ­€ć‚æ•°èźŸçœźćŒčć‡șçȘ—ćŁäœçœźïŒŒć…¶äžșJSONćŻčè±ĄïŒŒæ ŒćŒćŠ‚{top:"10px",left:"10px",width:"200px",height:"200px"}ïŒŒé»˜èź€ćŒčć‡șäœçœźäžșć±ćč•汅䞭。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + popover?: PlusCameraPopPosition; +} + +/** + * JSONćŻčè±ĄïŒŒćŒčć‡șæ‹ç…§æˆ–æ‘„ćƒç•ŒéąæŒ‡ç€șäœçœź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ +interface PlusCameraPopPosition { + /** + * 指ç€șćŒșćŸŸè·çŠ»ćźčć™šéĄ¶éƒšçš„è·çŠ» + * ćŒčć‡șæ‹ç…§æˆ–æ‘„ćƒçȘ—ćŁæŒ‡ç€șćŒșćŸŸè·çŠ»ćźčć™šéĄ¶éƒšçš„è·çŠ»ïŒŒæ”ŻæŒćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ć’Œç™Ÿćˆ†æŻ”ïŒˆćŠ‚"50%"ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + top?: string; + /** + * 指ç€șćŒșćŸŸè·çŠ»ćźčć™šć·ŠäŸ§çš„è·çŠ» + * ćŒčć‡șæ‹ç…§æˆ–æ‘„ćƒçȘ—ćŁæŒ‡ç€șćŒșćŸŸè·çŠ»ćźčć™šć·ŠäŸ§çš„è·çŠ»ïŒŒæ”ŻæŒćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ć’Œç™Ÿćˆ†æŻ”ïŒˆćŠ‚"50%"ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + left?: string; + /** + * 指ç€șćŒșćŸŸçš„ćźœćșŠ + * ćŒčć‡șæ‹ç…§æˆ–æ‘„ćƒçȘ—ćŁæŒ‡ç€șćŒșćŸŸçš„ćźœćșŠïŒŒæ”ŻæŒćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ć’Œç™Ÿćˆ†æŻ”ïŒˆćŠ‚"50%"ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + width?: string; + /** + * 指ç€șćŒșćŸŸçš„é«˜ćșŠ + * ćŒčć‡șæ‹ç…§æˆ–æ‘„ćƒçȘ—ćŁæŒ‡ç€șćŒșćŸŸçš„é«˜ćșŠïŒŒæ”ŻæŒćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ć’Œç™Ÿćˆ†æŻ”ïŒˆćŠ‚"50%"ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/camera.html](http://www.html5plus.org/doc/zh_cn/camera.html) + */ + height?: string; +} + +/** + * ContactsæšĄć—çźĄç†çł»ç»Ÿé€šèźŻćœ•ïŒŒç”šäșŽćŻćŻčçł»ç»Ÿé€šèźŻćœ•èż›èĄŒćąžă€ćˆ ă€æ”čă€æŸ„ç­‰æ“äœœă€‚é€šèż‡plus.contactsèŽ·ć–çł»ç»Ÿé€šèźŻćœ•çźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ +interface PlusContacts { + /** + * é€šèźŻćœ•ćŻčè±Ą + * é€šèźŻćœ•çźĄç†ćŻčè±ĄïŒŒćŻćŻčçł»ç»Ÿé€šèźŻćœ•èż›èĄŒè”çł»äșș的汞、戠、æ”čă€æŸ„æ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + AddressBook?: PlusContactsAddressBook; + /** + * è”çł»äșșćŻčè±Ą + * è”çł»äșșćŻčè±ĄïŒŒćŒ…æ‹Źè”çł»äșșçš„ć„ç§äżĄæŻïŒŒćŠ‚ćç§°ă€ç””èŻć·ç ă€ćœ°ć€ç­‰ă€‚äčŸćŒ…æ‹Źæ–°ćąžă€ćˆ é™€è”çł»äșș的操䜜æ–čæł•。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + Contact?: PlusContactsContact; + /** + * JSONćŻčè±ĄïŒŒè”çł»äșșćŸŸæ•°æźćŻčè±Ą + * è”çł»äșșćŸŸæ•°æźćŻčè±ĄïŒŒäżć­˜è”çł»äșșç‰čćźšćŸŸäżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + ContactField?: PlusContactsContactField; + /** + * JSONćŻčè±ĄïŒŒè”çł»äșș損称ćŻčè±Ą + * è”çł»äșș損称ćŻčè±ĄïŒŒäżć­˜è”çł»äșșćç§°äżĄæŻïŒŒćŠ‚ć§“ă€ćç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + ContactName?: PlusContactsContactName; + /** + * JSONćŻčè±ĄïŒŒè”çł»äșș朰杀ćŻčè±Ą + * è”çł»äșș朰杀ćŻčè±ĄïŒŒäżć­˜è”çł»äșșćœ°ć€äżĄæŻïŒŒćŠ‚ć›œćź¶ă€çœä»œă€ćŸŽćž‚ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + ContactAddress?: PlusContactsContactAddress; + /** + * JSONćŻčè±ĄïŒŒè”çł»äșșæ‰€ć±žç»„ç»‡äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + ContactOrganization?: PlusContactsContactOrganization; + /** + * JSONćŻčè±ĄïŒŒæŸ„æ‰Ÿè”çł»äșșć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + ContactFindOption?: PlusContactsContactFindOption; + /** + * JSONćŻčè±ĄïŒŒè”çł»äșșæŸ„æ‰Ÿèż‡æ»€ć™š + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + ContactFindFilter?: PlusContactsContactFindFilter; + /** + * 手æœșé€šèźŻćœ• + * é€šèźŻćœ•ç±»ćž‹ćžžé‡ïŒŒæ•°ć€Œç±»ćž‹ïŒŒć›șćźšć€Œäžș0甚äșŽèŽ·ć–çł»ç»Ÿçš„è”çł»äșșäżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + ADDRESSBOOK_PHONE?: number; + /** + * SIMćĄé€šèźŻćœ• + * é€šèźŻćœ•ç±»ćž‹ćžžé‡ïŒŒæ•°ć€Œç±»ćž‹ïŒŒć›șćźšć€Œäžș1甚äșŽèŽ·ć–SIMćĄäžŠçš„è”çł»äșșäżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + ADDRESSBOOK_SIM?: number; + /** + * èŽ·ć–é€šèźŻćœ•ćŻčè±Ą + * æ čæźæŒ‡ćźšé€šèźŻćœ•ç±»ćž‹èŽ·ć–é€šèźŻćœ•ćŻčè±ĄïŒŒèŽ·ć–é€šèźŻćœ•ćŻčè±ĄćŽćŻćŻčć…¶èż›èĄŒćąžă€ćˆ ă€æ”čæ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + getAddressBook(type?: number, successCB?: (result: PlusContactsAddressBook) => void, errorCB?: (result: any) => void): void; +} + +/** + * é€šèźŻćœ•ćŻčè±Ą + * é€šèźŻćœ•çźĄç†ćŻčè±ĄïŒŒćŻćŻčçł»ç»Ÿé€šèźŻćœ•èż›èĄŒè”çł»äșș的汞、戠、æ”čă€æŸ„æ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ +interface PlusContactsAddressBook { + /** + * 戛ć»șè”çł»äșș + * 戛ć»ș侀äžȘçł»ç»Ÿè”çł»äșșćč¶èż”ć›žè”çł»äșșćŻčè±ĄïŒŒćŻćŻčè”çł»äșșćŻčè±Ąèż›èĄŒæ“äœœèźŸçœźè”çł»äșșäżĄæŻïŒŒćŠ‚ćç§°ă€ćœ°ć€ă€ç””èŻç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + create(): PlusContactsContact; + /** + * ćœšé€šèźŻćœ•äž­æŸ„æ‰Ÿè”çł»äșș + * ćœšé€šèźŻćœ•äž­ćź‰èŁ…æŒ‡ćźšçš„è§„ćˆ™æŸ„æ‰Ÿè”çł»äșșcontactFieldsćŻèźŸćźšæŸ„æ‰Ÿèż”ć›žçš„è”çł»äșșäž­ćŒ…ć«çš„ć­—æź”ć€ŒïŒŒæŸ„æ‰Ÿè”çł»äșșæˆćŠŸæ—¶é€šèż‡successCBć›žè°ƒèż”ć›žïŒŒæŸ„æ‰Ÿè”çł»äșșć€±èŽ„ćˆ™é€šèż‡errorCBć›žè°ƒèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + find(contactFields?: string [], successCB?: (result: PlusContactsContact) => void, errorCB?: (result: any) => void, findOptions?: PlusContactsContactFindOption): void; +} + +/** + * è”çł»äșșćŻčè±Ą + * è”çł»äșșćŻčè±ĄïŒŒćŒ…æ‹Źè”çł»äșșçš„ć„ç§äżĄæŻïŒŒćŠ‚ćç§°ă€ç””èŻć·ç ă€ćœ°ć€ç­‰ă€‚äčŸćŒ…æ‹Źæ–°ćąžă€ćˆ é™€è”çł»äșș的操䜜æ–čæł•。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ +interface PlusContactsContact { + /** + * è”çł»äșș的id + * è”çł»äșșidç”±çł»ç»Ÿćˆ†é…ç»ŽæŠ€ïŒŒä»Žçł»ç»ŸèŽ·ć–è”çł»äșș时è‡ȘćŠšè”‹ć€ŒïŒŒć†æŹĄæŸ„èŻąæ—¶ćŻäœżç”šæ­€idć€Œèż›èĄŒæŁ€çŽąă€‚ + * æłšæ„ïŒšæ­€ć€ŒäžșćȘèŻ»ć±žæ€§ïŒŒæ”čć†™æ­€ć€ŒćŻèƒœäŒšćŻŒè‡Žæ— æł•éą„æœŸçš„é”™èŻŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + id?: string; + /** + * è”çł»äșș星ç€ș的損歗 + * è”çł»äșș星ç€șçš„ćć­—é€šćžžç”±ć…¶ć§“ć’Œćç»„ćˆè€Œæˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + displayName?: string; + /** + * è”çł»äșș的損称 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + name?: PlusContactsContactName; + /** + * è”çł»äșș的昔称 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + nickname?: string; + /** + * æ•°ç»„ïŒŒè”çł»äșșçš„ç””èŻ + * ćŠ‚æžœè”çł»äșșäž­æœȘäżć­˜ç””èŻäżĄæŻïŒŒćˆ™èż”ć›žç©șæ•°ç»„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + phoneNumbers?: PlusContactsContactField; + /** + * æ•°ç»„ïŒŒè”çł»äșș的邟矱 + * ćŠ‚æžœè”çł»äșșäž­æœȘäżć­˜é‚źçź±äżĄæŻïŒŒćˆ™èż”ć›žç©șæ•°ç»„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + emails?: PlusContactsContactField; + /** + * æ•°ç»„ïŒŒè”çł»äșș的朰杀 + * ćŠ‚æžœè”çł»äșșäž­æœȘäżć­˜ćœ°ć€äżĄæŻïŒŒćˆ™èż”ć›žç©șæ•°ç»„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + addresses?: PlusContactsContactAddress; + /** + * æ•°ç»„ïŒŒè”çł»äșșçš„ćłæ—¶é€šèźŻćœ°ć€ + * ćŠ‚æžœè”çł»äșșäž­æœȘäżć­˜ćłæ—¶é€šèźŻćœ°ć€äżĄæŻïŒŒćˆ™èż”ć›žç©șæ•°ç»„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + ims?: PlusContactsContactField; + /** + * æ•°ç»„ïŒŒè”çł»äșșæ‰€ć±žç»„ç»‡äżĄæŻ + * ćŠ‚æžœè”çł»äșșäž­æœȘäżć­˜æ‰€ć±žç»„ç»‡äżĄæŻïŒŒćˆ™èż”ć›žç©șæ•°ç»„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + organizations?: PlusContactsContactOrganization; + /** + * è”çł»äșș的生旄 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + birthday?: Date; + /** + * è”çł»äșșçš„ć€‡æłš + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + note?: string; + /** + * æ•°ç»„ïŒŒè”çł»äșșçš„ć€Žćƒ + * ć…¶ć€Œäžșć€Žćƒć›Ÿç‰‡urlćœ°ć€æˆ–ć›Ÿç‰‡æ•°æźïŒš + * urlćœ°ć€ïŒšä»…æ”ŻæŒæœŹćœ°ć›Ÿç‰‡ćœ°ć€ïŒŒćŻä»„æ˜Żç»ćŻčè·ŻćŸ„æˆ–ç›žćŻčè·ŻćŸ„ïŒŒćŠ‚â€œ_doc/a.png” + * ć›Ÿç‰‡æ•°æźïŒšćż…éĄ»çŹŠćˆData URI schemeRFC2397ïŒ‰æ ŒćŒçš„æ•°æźïŒŒćŠ‚â€œimage/png;base64,XXXXâ€ïŒŒć…¶äž­XXXXäžșbase64çŒ–ç çš„ć›Ÿç‰‡æ•°æźă€‚ćœšèŽ·ć–è”çł»äșșæ—¶é»˜èź€èż”ć›žæ­€ç±»ćž‹çš„æ•°æźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + photos?: PlusContactsContactField; + /** + * æ•°ç»„ïŒŒè”çł»äșșçš„ç»„ć + * ćŠ‚æžœè”çł»äșșäž­æœȘäżć­˜ç»„ćäżĄæŻïŒŒćˆ™èż”ć›žç©șæ•°ç»„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + categories?: PlusContactsContactField; + /** + * æ•°ç»„ïŒŒè”çł»äșșçš„çœ‘ć€ + * ćŠ‚æžœè”çł»äșșäž­æœȘäżć­˜çœ‘ć€äżĄæŻïŒŒćˆ™èż”ć›žç©șæ•°ç»„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + urls?: PlusContactsContactField; + /** + * ć…‹éš†è”çł»äșș + * ć…‹éš†è”çł»äșșïŒŒćˆ›ć»șć‡ș侀äžȘæ–°çš„è”çł»äșșćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + clone(): PlusContactsContact; + /** + * ćˆ é™€è”çł»äșș + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + remove(successCB?: () => void, errorCB?: (result: any) => void): void; + /** + * äżć­˜è”çł»äșș + * ć°†è”çł»äșșæ•°æźäżć­˜ćˆ°é€šèźŻćœ•äž­ïŒŒæ“äœœæˆćŠŸć°†é€šèż‡successCBć›žè°ƒć‡œæ•°èż”ć›žäżć­˜ç»“æžœïŒŒæ“äœœć€±èŽ„ć°†é€šèż‡é€šèż‡errorCBć›žè°ƒć‡œæ•°èż”ć›žé”™èŻŻäżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + save(successCB?: () => void, errorCB?: (result: any) => void): void; +} + +/** + * JSONćŻčè±ĄïŒŒè”çł»äșșćŸŸæ•°æźćŻčè±Ą + * è”çł»äșșćŸŸæ•°æźćŻčè±ĄïŒŒäżć­˜è”çł»äșșç‰čćźšćŸŸäżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ +interface PlusContactsContactField { + /** + * è”çł»äșșćŸŸç±»ćž‹ïŒŒćŠ‚ç””èŻć·ç äž­çš„â€œmobile”、“home”、“company” + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + type?: string; + /** + * è”çł»äșșćŸŸć€Œ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + value?: string; + /** + * æ˜ŻćŠäžș驖选éĄč + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + preferred?: boolean; +} + +/** + * JSONćŻčè±ĄïŒŒè”çł»äșș損称ćŻčè±Ą + * è”çł»äșș損称ćŻčè±ĄïŒŒäżć­˜è”çł»äșșćç§°äżĄæŻïŒŒćŠ‚ć§“ă€ćç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ +interface PlusContactsContactName { + /** + * è”çł»äșșçš„ćźŒæ•Žćç§°ïŒŒç”±ć…¶ćźƒć­—æź”ç»„ćˆç”Ÿæˆ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + formatted?: string; + /** + * è”çł»äșș的槓 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + familyName?: string; + /** + * è”çł»äșș的損 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + givenName?: string; + /** + * è”çł»äșș的侭问損 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + middleName?: string; + /** + * è”çł»äșșçš„ć‰çŒ€ïŒˆćŠ‚Mr.或Dr. + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + honorificPrefix?: string; + /** + * è”çł»äșșçš„ćŽçŒ€ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + honorificSuffix?: string; +} + +/** + * JSONćŻčè±ĄïŒŒè”çł»äșș朰杀ćŻčè±Ą + * è”çł»äșș朰杀ćŻčè±ĄïŒŒäżć­˜è”çł»äșșćœ°ć€äżĄæŻïŒŒćŠ‚ć›œćź¶ă€çœä»œă€ćŸŽćž‚ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ +interface PlusContactsContactAddress { + /** + * è”çł»äșșćœ°ć€ç±»ćž‹ïŒŒćŠ‚â€œhomeâ€èĄšç€șćź¶ćș­ćœ°ć€ă€â€œcompanyâ€èĄšç€șć•äœćœ°ć€ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + type?: string; + /** + * ćźŒæ•Žćœ°ć€ïŒŒç”±ć…¶ćźƒć­—æź”ç»„ćˆè€Œæˆ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + formatted?: string; + /** + * ćźŒæ•Žçš„èĄ—é“ćœ°ć€ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + streetAddress?: string; + /** + * ćŸŽćž‚æˆ–ćœ°ćŒș + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + locality?: string; + /** + * çœæˆ–ćœ°ćŒș + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + region?: string; + /** + * ć›œćź¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + country?: string; + /** + * é‚źæ”żçŒ–ç  + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + postalCode?: string; + /** + * æ˜ŻćŠäžș驖选éĄč + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + preferred?: boolean; +} + +/** + * JSONćŻčè±ĄïŒŒè”çł»äșșæ‰€ć±žç»„ç»‡äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ +interface PlusContactsContactOrganization { + /** + * è”çł»äșșæ‰€ć±žç»„ç»‡ç±»ćž‹ïŒŒćŠ‚"company" + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + type?: string; + /** + * è”çł»äșșæ‰€ć±žç»„ç»‡ćç§° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + name?: string; + /** + * è”çł»äșșæ‰€ć±žç»„ç»‡éƒšé—š + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + department?: string; + /** + * è”çł»äșșćœšç»„ç»‡äž­çš„èŒäœ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + title?: string; + /** + * æ˜ŻćŠäžș驖选éĄč + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + preferred?: boolean; +} + +/** + * JSONćŻčè±ĄïŒŒæŸ„æ‰Ÿè”çł»äșșć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ +interface PlusContactsContactFindOption { + /** + * æ•°ç»„ïŒŒæŸ„æ‰Ÿæ—¶çš„èż‡æ»€ć™š + * ćŻèźŸçœźäžșç©șïŒŒèĄšç€șäžèż‡æ»€ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + filter?: PlusContactsContactFindFilter; + /** + * æ˜ŻćŠæŸ„æ‰Ÿć€šäžȘè”çł»äșșïŒŒé»˜èź€ć€Œäžștrue + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + multiple?: boolean; +} + +/** + * JSONćŻčè±ĄïŒŒè”çł»äșșæŸ„æ‰Ÿèż‡æ»€ć™š + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ +interface PlusContactsContactFindFilter { + /** + * ćŒș配的逻蟑 + * 揯揖“and”、“or”、“notâ€ïŒŒé»˜èź€ć€Œäžș“and”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + logic?: string; + /** + * ćŒșé…çš„è”çł»äșșćŸŸïŒŒćŻć–è”çł»äșșçš„ć±žæ€§ćç§° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + field?: string; + /** + * ćŒșé…çš„è”çł»äșșć€ŒïŒŒćŻäœżç”šćŒșé…çŹŠć·â€œ?”撌“*” + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/contacts.html](http://www.html5plus.org/doc/zh_cn/contacts.html) + */ + value?: string; +} + +/** + * DeviceæšĄć—çźĄç†èźŸć€‡äżĄæŻïŒŒç”šäșŽèŽ·ć–æ‰‹æœșèźŸć€‡çš„ç›žć…łäżĄæŻïŒŒćŠ‚IMEI、IMSIă€ćž‹ć·ă€ćŽ‚ć•†ç­‰ă€‚é€šèż‡plus.deviceèŽ·ć–èźŸć€‡äżĄæŻçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ +interface PlusDevice { + /** + * èźŸć€‡çš„ć›œé™…ç§»ćŠšèźŸć€‡èș«ä»œç  + * è°ƒç”šæ­€ć±žæ€§èŽ·ć–èźŸć€‡çš„ć›œé™…ç§»ćŠšèźŸć€‡èș«ä»œç ă€‚ + * ćŠ‚æžœèźŸć€‡äžæ”ŻæŒćˆ™èż”ć›žç©ș歗笩äžČ。 + * ćŠ‚æžœèźŸć€‡ć­˜ćœšć€šäžȘèș«ä»œç ïŒŒćˆ™ä»„“,”歗笩戆ć‰Čæ‹ŒæŽ„ïŒŒćŠ‚â€œ862470039452950,862470039452943”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + imei?: string; + /** + * èźŸć€‡çš„ć›œé™…ç§»ćŠšç”šæˆ·èŻ†ćˆ«ç  + * 歗笩äžČæ•°ç»„ç±»ćž‹ïŒŒèŽ·ć–èźŸć€‡äžŠæ’ć…„SIMçš„ć›œé™…ç§»ćŠšèźŸć€‡èș«ä»œç ă€‚ + * ćŠ‚æžœèźŸć€‡æ”ŻæŒć€šćĄæšĄćŒćˆ™èż”ć›žæ‰€æœ‰SIMèș«ä»œç ă€‚ + * ćŠ‚æžœèźŸć€‡äžæ”ŻæŒæˆ–æČĄæœ‰æ’ć…„SIMćĄćˆ™èż”ć›žç©șæ•°ç»„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + imsi?: any []; + /** + * èźŸć€‡çš„ćž‹ć· + * è°ƒç”šæ­€ć±žæ€§èŽ·ć–èźŸć€‡çš„ćž‹ć·äżĄæŻă€‚ + * ćŠ‚æžœèźŸć€‡äžæ”ŻæŒćˆ™èż”ć›žç©ș歗笩äžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + model?: string; + /** + * èźŸć€‡çš„ç”Ÿäș§ćނ㕆 + * è°ƒç”šæ­€ć±žæ€§èŽ·ć–èźŸć€‡çš„ç”Ÿäș§ćŽ‚ć•†äżĄæŻă€‚ + * ćŠ‚æžœèźŸć€‡äžæ”ŻæŒćˆ™èż”ć›žç©ș歗笩äžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + vendor?: string; + /** + * èźŸć€‡çš„ć”Żäž€æ ‡èŻ† + * è°ƒç”šæ­€ć±žæ€§èŽ·ć–èźŸć€‡çš„ć”Żäž€æ ‡èŻ†ć·ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + uuid?: string; + /** + * æ‹šæ‰“ç””èŻ + * è°ƒç”šçł»ç»Ÿçš‹ćșæ‹šæ‰“ç””èŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + dial(number?: string, confirm?: boolean): void; + /** + * 揑ć‡șèœ‚éžŁćŁ° + * 调甚歀æ–čæł•äœżćŸ—èźŸć€‡ć‘ć‡șèœ‚éžŁćŁ°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + beep(times?: number): void; + /** + * èźŸć€‡æŒŻćŠš + * 调甚歀æ–čæł•äœżćŸ—èźŸć€‡æŒŻćŠšă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + vibrate(milliseconds?: number): void; + /** + * èźŸçœźćș”ç”šæ˜ŻćŠäżæŒć”€é†’ïŒˆć±ćč•ćžžäșźïŒ‰çŠ¶æ€ + * 调甚歀æ–čæł•èźŸçœźćș”ç”šæ˜ŻćŠäž€ç›ŽäżæŒć”€é†’çŠ¶æ€ïŒŒäżæŒć”€é†’çŠ¶æ€ć°†äŒšćŻŒè‡Žçš‹ćșć±ćč•ćžžäșźă€çł»ç»ŸäžäŒšè‡ȘćŠšé”ć±ïŒŒä»Žè€ŒćŻŒè‡Žæ¶ˆè€—æ›Žć€šçš„ç””é‡ă€‚è‹„æœȘèźŸçœźäž€ç›ŽäżæŒć”€é†’çŠ¶æ€ćˆ™äŒšæ čæźçł»ç»ŸèźŸçœźè‡ȘćŠšé”ćźšć±ćč•。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + setWakelock(lock?: boolean): void; + /** + * èŽ·ć–çš‹ćșæ˜ŻćŠäž€ç›ŽäżæŒć”€é†’ïŒˆć±ćč•ćžžäșźïŒ‰çŠ¶æ€ + * 调甚歀æ–čæł•èŽ·ć–çš‹ćșæ˜ŻćŠäž€è‡ŽäżæŒć”€é†’çŠ¶æ€ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + isWakelock(): boolean; + /** + * èźŸçœźèźŸć€‡çš„çł»ç»ŸéŸłé‡ + * 调甚歀æ–čæł•è°ƒèŠ‚èźŸć€‡çš„çł»ç»ŸéŸłé‡ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + setVolume(volume?: number): void; + /** + * èŽ·ć–èźŸć€‡çš„çł»ç»ŸéŸłé‡ + * çł»ç»ŸéŸłé‡ć€ŒèŒƒć›Žäžș0戰10èĄšç€șé™éŸłïŒŒ1èĄšç€șæœ€ć€§éŸłé‡ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + getVolume(): number; +} + +/** + * ScreenæšĄć—çźĄç†èźŸć€‡ć±ćč•äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ +interface PlusScreen { + /** + * èźŸć€‡ć±ćč•高ćșŠćˆ†èŸšçއ + * èźŸć€‡ć±ćč•ćŒșćŸŸćŒ…æ‹Źçł»ç»ŸçŠ¶æ€æ æ˜Ÿç€șćŒș柟撌ćș”甚星ç€șćŒșćŸŸïŒŒscreenèŽ·ć–çš„æ˜ŻèźŸć€‡ć±ć蕿€»ćŒșćŸŸçš„é€»èŸ‘ćˆ†èŸšçŽ‡ïŒŒć•äœäžșpx。 + * ćŠ‚æžœéœ€èŠèŽ·ć–ćźžé™…ćˆ†èŸšçŽ‡ćˆ™éœ€èŠäč˜ä»„æŻ”äŸ‹ć€Œscale。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + resolutionHeight?: number; + /** + * èźŸć€‡ć±ćč•ćźœćșŠćˆ†èŸšçއ + * èźŸć€‡ć±ćč•ćŒșćŸŸćŒ…æ‹Źçł»ç»ŸçŠ¶æ€æ æ˜Ÿç€șćŒș柟撌ćș”甚星ç€șćŒșćŸŸïŒŒscreenèŽ·ć–çš„æ˜ŻèźŸć€‡ć±ć蕿€»ćŒșćŸŸçš„ćˆ†èŸšçŽ‡ïŒŒć•äœäžșpx。 + * ćŠ‚æžœéœ€èŠèŽ·ć–ćźžé™…ćˆ†èŸšçŽ‡ćˆ™éœ€èŠäč˜ä»„æŻ”äŸ‹ć€Œscale。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + resolutionWidth?: number; + /** + * é€»èŸ‘ćˆ†èŸšçŽ‡äžŽćźžé™…ćˆ†èŸšçŽ‡çš„æŻ”äŸ‹ + * ć±ćč•ćˆ†èŸšçŽ‡ćˆ†é€»èŸ‘ćˆ†èŸšçŽ‡çŽ‡ć’Œćźžé™…ćˆ†èŸšçŽ‡ïŒŒćœšhtmléĄ”éąäž­äœżç”šçš„ćƒçŽ ć€Œéƒœæ˜Żç›žćŻčäșŽé€»èŸ‘ćˆ†èŸšçŽ‡ïŒŒæ­€ć€Œć°±æ˜Żé€»èŸ‘ćˆ†èŸšçŽ‡ć’Œćźžé™…ćˆ†èŸšçŽ‡çš„æŻ”äŸ‹ïŒŒćźžé™…ćˆ†èŸšçŽ‡=é€»èŸ‘ćˆ†èŸšçŽ‡*æŻ”äŸ‹ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + scale?: number; + /** + * èźŸć€‡ć±ć蕿°Žćčłæ–č搑的毆ćșŠ + * èźŸć€‡ć±ćč•çš„ć݆ćșŠäžșæŻè‹±ćŻžæ‰€æ˜Ÿç€ș的惏箠ç‚čæ•°ïŒŒć݆ćșŠè¶Šé«˜æ˜Ÿç€șæž…æ™°ćșŠè¶Šé«˜ïŒŒć•䜍äžșdpi。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + dpiX?: number; + /** + * èźŸć€‡ć±ćč•枂盎æ–č搑的毆ćșŠ + * èźŸć€‡ć±ćč•çš„ć݆ćșŠäžșæŻè‹±ćŻžæ‰€æ˜Ÿç€ș的惏箠ç‚čæ•°ïŒŒć݆ćșŠè¶Šé«˜æ˜Ÿç€șæž…æ™°ćșŠè¶Šé«˜ïŒŒć•䜍äžșdpi。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + dpiY?: number; + /** + * èźŸçœźć±ćč•äșźćșŠ + * 调甚歀æ–čæł•è°ƒèŠ‚èźŸć€‡ć±ćč•äșźćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + setBrightness(brightness?: number): void; + /** + * èŽ·ć–ć±ćč•äșźćșŠć€Œ + * ć±ćč•äșźćșŠć€ŒèŒƒć›Žäžș0戰10èĄšç€ș最䜎äșźćșŠć€ŒïŒŒ1èĄšç€ș最高äșźćșŠć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + getBrightness(): number; + /** + * é”ćźšć±ć蕿–č搑 + * é”ćźšć±ć蕿–čć‘ćŽć±ćč•ćȘèƒœæŒ‰é”ćźšçš„ć±ć蕿–čć‘æ˜Ÿç€șïŒŒć…łé—­ćœ“ć‰éĄ”éąćŽä»ç„¶æœ‰æ•ˆă€‚ + * ćŻć†æŹĄè°ƒç”šæ­€æ–čæł•äżźæ”čć±ćč•锁ćꚿ–čć‘æˆ–è°ƒç”šunlockOrientation()æ–čæł•æąć€ćˆ°ćș”ç”šçš„é»˜èź€ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + lockOrientation(orientation?: string): void; + /** + * è§Łé™€é”ćźšć±ć蕿–č搑 + * è§Łé™€é”ćźšć±ć蕿–čć‘ćŽć°†æąć€ćș”ç”šé»˜èź€çš„ć±ć蕿˜Ÿç€șæ–čć‘ïŒˆé€šćžžäžșćș”ç”šæ‰“ćŒ…ć‘ćžƒæ—¶èźŸçœźçš„æ–čć‘ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + unlockOrientation(): void; +} + +/** + * DisplayæšĄć—çźĄç†ćș”ç”šćŻäœżç”šçš„æ˜Ÿç€șćŒșćŸŸäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ +interface PlusDisplay { + /** + * ćș”ç”šćŻäœżç”šçš„ć±ćč•高ćșŠé€»èŸ‘ćˆ†èŸšçŽ‡ + * èźŸć€‡ć±ćč•ćŒșćŸŸćŒ…æ‹Źçł»ç»ŸçŠ¶æ€æ æ˜Ÿç€șćŒș柟撌ćș”甚星ç€șćŒșćŸŸïŒŒdisplayèŽ·ć–çš„æ˜Żćș”甚星ç€șćŒșćŸŸçš„é€»èŸ‘ćˆ†èŸšçŽ‡ïŒŒć•äœäžșpx。 + * ćŠ‚æžœéœ€èŠèŽ·ć–ćźžé™…ćˆ†èŸšçŽ‡ćˆ™éœ€èŠäč˜ä»„æŻ”äŸ‹ć€Œscale。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + resolutionHeight?: number; + /** + * ćș”ç”šćŻäœżç”šçš„ć±ćč•ćźœćșŠé€»èŸ‘ćˆ†èŸšçŽ‡ + * èźŸć€‡ć±ćč•ćŒșćŸŸćŒ…æ‹Źçł»ç»ŸçŠ¶æ€æ æ˜Ÿç€șćŒș柟撌ćș”甚星ç€șćŒșćŸŸïŒŒdisplayèŽ·ć–çš„æ˜Żćș”甚星ç€șćŒșćŸŸçš„é€»èŸ‘ćˆ†èŸšçŽ‡ïŒŒć•äœäžșpx。 + * ćŠ‚æžœéœ€èŠèŽ·ć–ćźžé™…ćˆ†èŸšçŽ‡ćˆ™éœ€èŠäč˜ä»„æŻ”äŸ‹ć€Œscale。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + resolutionWidth?: number; +} + +/** + * networkinfoæšĄć—ç”šäșŽèŽ·ć–çœ‘ç»œäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ +interface PlusNetworkinfo { + /** + * çœ‘ç»œèżžæŽ„çŠ¶æ€æœȘ矄 + * çœ‘ç»œçŠ¶æ€ćžžé‡ïŒŒèĄšç€șćœ“ć‰èźŸć€‡çœ‘ç»œçŠ¶æ€æœȘ矄ć›șćźšć€Œäžș0。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + CONNECTION_UNKNOW?: number; + /** + * æœȘèżžæŽ„çœ‘ç»œ + * çœ‘ç»œçŠ¶æ€ćžžé‡ïŒŒćœ“ć‰èźŸć€‡çœ‘ç»œæœȘèżžæŽ„çœ‘ç»œïŒŒć›șćźšć€Œäžș1。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + CONNECTION_NONE?: number; + /** + * 有çșżçœ‘络 + * çœ‘ç»œçŠ¶æ€ćžžé‡ïŒŒćœ“ć‰èźŸć€‡èżžæŽ„ćˆ°æœ‰çșżçœ‘络ć›șćźšć€Œäžș2。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + CONNECTION_ETHERNET?: number; + /** + * 无çșżWIFI眑络 + * çœ‘ç»œçŠ¶æ€ćžžé‡ïŒŒćœ“ć‰èźŸć€‡èżžæŽ„ćˆ°æ— çșżWIFI眑络ć›șćźšć€Œäžș3。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + CONNECTION_WIFI?: number; + /** + * 蜂çȘç§»ćŠš2G眑络 + * çœ‘ç»œçŠ¶æ€ćžžé‡ïŒŒćœ“ć‰èźŸć€‡èżžæŽ„ćˆ°èœ‚çȘç§»ćŠš2G眑络ć›șćźšć€Œäžș4。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + CONNECTION_CELL2G?: number; + /** + * 蜂çȘç§»ćŠš3G眑络 + * çœ‘ç»œçŠ¶æ€ćžžé‡ïŒŒćœ“ć‰èźŸć€‡èżžæŽ„ćˆ°èœ‚çȘç§»ćŠš3G眑络ć›șćźšć€Œäžș5。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + CONNECTION_CELL3G?: number; + /** + * 蜂çȘç§»ćŠš4G眑络 + * çœ‘ç»œçŠ¶æ€ćžžé‡ïŒŒćœ“ć‰èźŸć€‡èżžæŽ„ćˆ°èœ‚çȘç§»ćŠš4G眑络ć›șćźšć€Œäžș6。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + CONNECTION_CELL4G?: number; + /** + * èŽ·ć–èźŸć€‡ćœ“ć‰èżžæŽ„çš„çœ‘ç»œç±»ćž‹ + * èŽ·ć–ćœ“ć‰èźŸć€‡èżžæŽ„çš„çœ‘ç»œç±»ćž‹ïŒŒèż”ć›žć€Œäžșçœ‘ç»œç±»ćž‹ćžžé‡ïŒŒćŻć–ć€ŒCONNECTION_*澾量。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + getCurrentType(): number; +} + +/** + * OSæšĄć—çźĄç†æ“äœœçł»ç»ŸäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ +interface PlusOs { + /** + * çł»ç»ŸèŻ­èš€äżĄæŻ + * èŽ·ć–ćœ“ć‰æ“äœœçł»ç»ŸèźŸçœźçš„çł»ç»ŸèŻ­èš€ïŒŒć­—çŹŠäžČç±»ćž‹æ•°æźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + language?: string; + /** + * çł»ç»Ÿç‰ˆæœŹäżĄæŻ + * èŽ·ć–ćœ“ć‰æ“äœœçł»ç»Ÿçš„ç‰ˆæœŹäżĄæŻïŒŒć­—çŹŠäžČç±»ćž‹æ•°æźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + version?: string; + /** + * çł»ç»Ÿçš„ćç§° + * èŽ·ć–ćœ“ć‰æ“äœœçł»ç»Ÿçš„ćç§°ïŒŒć­—çŹŠäžČç±»ćž‹æ•°æźă€‚ + * - iOS: + * iOSçł»ç»Ÿă€‚ + * + * - Android: + * Androidçł»ç»Ÿă€‚ + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + name?: 'iOS' | 'Android'; + /** + * çł»ç»Ÿçš„äŸ›ćș”ć•†äżĄæŻ + * èŽ·ć–ćœ“ć‰æ“äœœçł»ç»Ÿçš„äŸ›ćș”ć•†ćç§°ïŒŒć­—çŹŠäžČç±»ćž‹æ•°æźă€‚ + * - Apple: + * iOSèźŸć€‡ïŒŒćŒ…æ‹ŹiPhone、iPad、iTouch。 + * + * - Google: + * AndroidèźŸć€‡ă€‚ + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/device.html](http://www.html5plus.org/doc/zh_cn/device.html) + */ + vendor?: 'Apple' | 'Google'; +} + +/** + * DownloaderæšĄć—çźĄç†çœ‘ç»œæ–‡ä»¶äž‹èœœä»»ćŠĄïŒŒç”šäșŽä»ŽæœćŠĄć™šäž‹èœœć„ç§æ–‡ä»¶ïŒŒćč¶æ”ŻæŒè·šćŸŸèźżé—źæ“äœœă€‚é€šèż‡plus.downloaderèŽ·ć–äž‹èœœçźĄç†ćŻčè±Ąă€‚Downloaderäž‹èœœäœżç”šHTTP的GET/POSTæ–čćŒèŻ·æ±‚äž‹èœœæ–‡ä»¶ïŒŒçŹŠćˆæ ‡ć‡†HTTP/HTTPSäŒ èŸ“ćèźźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ +interface PlusDownloader { + /** + * DownloadćŻčè±ĄçźĄç†äž€äžȘäž‹èœœä»»ćŠĄ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + Download?: PlusDownloaderDownload; + /** + * äž‹èœœä»»ćŠĄäș‹ä»¶ç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + DownloadEvent?: PlusDownloaderDownloadEvent; + /** + * äž‹èœœä»»ćŠĄçŠ¶æ€ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + DownloadState?: PlusDownloaderDownloadState; + /** + * äž‹èœœä»»ćŠĄć‚æ•° + * 朹戛ć»șäž‹èœœä»»ćŠĄæ—¶èźŸçœźçš„ć‚æ•°ïŒŒćŠ‚èźŸçœźäž‹èœœä»»ćŠĄäœżç”šçš„HTTPćèźźç±»ćž‹ă€äŒ˜ć…ˆçș§ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + DownloadOptions?: PlusDownloaderDownloadOptions; + /** + * 新ć»șäž‹èœœä»»ćŠĄ + * èŻ·æ±‚äž‹èœœçźĄç†ćˆ›ć»șæ–°çš„äž‹èœœä»»ćŠĄïŒŒćˆ›ć»șæˆćŠŸćˆ™èż”ć›žDownloadćŻčè±ĄïŒŒç”šäșŽçźĄç†äž‹èœœä»»ćŠĄă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + createDownload(url?: string, options?: PlusDownloaderDownloadOptions, completedCB?: (result0: PlusDownloaderDownload, result1: number) => void): PlusDownloaderDownload; + /** + * æžšäžŸäž‹èœœä»»ćŠĄ + * æžšäžŸæŒ‡ćźšçŠ¶æ€çš„äž‹èœœä»»ćŠĄćˆ—èĄšïŒŒé€šèż‡enumCBć›žè°ƒć‡œæ•°èż”ć›žç»“æžœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + enumerate(enumCB?: (result: any []) => void, state?: PlusDownloaderDownloadState): void; + /** + * æž…é™€äž‹èœœä»»ćŠĄ + * æž…é™€æŒ‡ćźšçŠ¶æ€çš„äž‹èœœä»»ćŠĄă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + clear(state?: PlusDownloaderDownloadState): void; + /** + * ćŒ€ć§‹æ‰€æœ‰äž‹èœœä»»ćŠĄ + * ćŒ€ć§‹æ‰€æœ‰ć€„äșŽäžșćŒ€ć§‹è°ƒćșŠæˆ–æš‚ćœçŠ¶æ€çš„äž‹èœœä»»ćŠĄă€‚ + * è‹„äž‹èœœä»»ćŠĄæ•°è¶…èż‡ćŻćč¶ć‘ć€„ç†çš„æ€»æ•°ïŒŒè¶…ć‡ș的任报怄äșŽè°ƒćșŠçŠ¶æ€ïŒˆç­‰ćŸ…äž‹èœœïŒ‰ïŒŒćœ“æœ‰ä»»ćŠĄćꌿˆæ—¶æ čæźè°ƒćșŠçŠ¶æ€ä»»ćŠĄçš„äŒ˜ć…ˆçș§é€‰æ‹©ä»»ćŠĄćŒ€ć§‹äž‹èœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + startAll(): void; +} + +/** + * DownloadćŻčè±ĄçźĄç†äž€äžȘäž‹èœœä»»ćŠĄ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ +interface PlusDownloaderDownload { + /** + * äž‹èœœä»»ćŠĄçš„æ ‡èŻ† + * 朹戛ć»șä»»ćŠĄæ—¶çł»ç»Ÿè‡ȘćŠšćˆ†é…ïŒŒç”šäșŽæ ‡èŻ†äž‹èœœä»»ćŠĄçš„ć”Żäž€æ€§ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + id?: string; + /** + * äž‹èœœæ–‡ä»¶çš„ćœ°ć€ + * 调甚plus.donwloader.createDownload()æ–čæł•ćˆ›ć»șäž‹èœœä»»ćŠĄæ—¶èźŸçœźçš„ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + url?: string; + /** + * ä»»ćŠĄçš„çŠ¶æ€ + * èĄšç€șćœ“ć‰äž‹èœœä»»ćŠĄçš„çŠ¶æ€ïŒŒćŻé€šèż‡addEventListener()æ–čæł•监搏statechangedäș‹ä»¶ç›‘ćŹä»»ćŠĄçŠ¶æ€çš„ć˜ćŒ–ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + state?: PlusDownloaderDownloadState; + /** + * äž‹èœœä»»ćŠĄçš„ć‚æ•° + * 调甚plus.donwloader.createDownload()æ–čæł•ćˆ›ć»șäž‹èœœä»»ćŠĄæ—¶èźŸçœźçš„ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + options?: PlusDownloaderDownloadOptions; + /** + * äž‹èœœçš„æ–‡ä»¶ćç§° + * äž‹èœœä»»ćŠĄćœšæœŹćœ°äżć­˜çš„æ–‡ä»¶è·ŻćŸ„ïŒŒäž‹èœœä»»ćŠĄćźŒæˆæ—¶æ›Žæ–°ïŒŒćŻé€šèż‡æ­€ć€Œèźżé—źäž‹èœœçš„æ–‡ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + filename?: string; + /** + * ć·ČćźŒæˆäž‹èœœæ–‡ä»¶çš„ć€§ć° + * æ•Žæ•°ç±»ćž‹ïŒŒć•äœäžșć­—èŠ‚ïŒˆbyteïŒ‰ïŒŒäž‹èœœä»»ćŠĄćŒ€ć§‹äŒ èŸ“æ•°æźæ—¶ïŒŒæŻæŹĄè§Šć‘statechangedäș‹ä»¶æˆ–äž‹èœœä»»ćŠĄćꌿˆæ—¶æ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + downloadedSize?: number; + /** + * äž‹èœœä»»ćŠĄæ–‡ä»¶çš„æ€»ć€§ć° + * æ•Žæ•°ç±»ćž‹ïŒŒć•äœäžșć­—èŠ‚ïŒˆbyteïŒ‰ïŒŒäž‹èœœä»»ćŠĄćŒ€ć§‹äŒ èŸ“æ•°æźæ—¶æ›Žæ–°ïŒŒćœšæ­€äč‹ć‰ć…¶ć€Œäžș0。 + * æ­€ć€Œæ˜Żä»ŽHTTPèŻ·æ±‚ć€Žäž­èŽ·ć–ïŒŒćŠ‚æžœæœćŠĄć™šæœȘèż”ć›žćˆ™æ­€ć€Œć§‹ç»ˆäžș0。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + totalSize?: number; + /** + * ć–æ¶ˆäž‹èœœä»»ćŠĄ + * ćŠ‚æžœä»»ćŠĄæœȘćźŒæˆïŒŒćˆ™ç»ˆæ­ąäž‹èœœïŒŒćč¶ä»Žä»»ćŠĄćˆ—èĄšäž­ćˆ é™€ă€‚ + * ćŠ‚äž‹èœœæœȘćźŒæˆïŒŒć°†ćˆ é™€ć·Čäž‹èœœçš„äžŽæ—¶æ–‡ä»¶ïŒŒćŠ‚æžœäž‹èœœć·ČćźŒæˆïŒŒć°†äžćˆ é™€ć·Čäž‹èœœçš„æ–‡ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + abort(): void; + /** + * æ·»ćŠ äž‹èœœä»»ćŠĄäș‹ä»¶ç›‘搏晚 + * äž‹èœœä»»ćŠĄæ·»ćŠ äș‹ä»¶ç›‘ćŹć™šćŽïŒŒćœ“ç›‘ćŹçš„äș‹ä»¶ć‘ç”Ÿæ—¶è§Šć‘listenerć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + addEventListener(type?: string, listener?: (result0: PlusDownloaderDownload, result1: number) => void, capture?: boolean): void; + /** + * èŽ·ć–äž‹èœœèŻ·æ±‚HTTP操ćș”ć€ŽéƒšäżĄæŻ + * HTTP操ćș”ć€Žéƒšć…šéƒšć†…ćźč䜜äžșæœȘè§Łæžçš„ć­—çŹŠäžČèż”ć›žïŒŒćŠ‚æžœæČĄæœ‰æŽ„æ”¶ćˆ°èż™äžȘHTTP操ćș”ć€Žæ•°æźæˆ–è€…äž‹èœœèŻ·æ±‚æœȘćźŒæˆćˆ™äžșç©ș歗笩äžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + getAllResponseHeaders(): string; + /** + * èŽ·ć–äž‹èœœèŻ·æ±‚æŒ‡ćźšçš„HTTP操ćș”ć€Žéƒšçš„ć€Œ + * ć…¶ć‚æ•°æ˜ŻèŠèż”ć›žçš„HTTP操ćș”ć€Žéƒšçš„ćç§°ïŒŒćŻä»„äœżç”šä»»äœ•ć€§ć°ć†™æ„ćˆ¶ćźšèż™äžȘć€Žéƒšćć­—ïŒŒć’Œć“ćș”ć€Žéƒšçš„æŻ”èŸƒæ˜ŻäžćŒșćˆ†ć€§ć°ć†™çš„ă€‚ + * ćŠ‚æžœæČĄæœ‰æŽ„æ”¶ćˆ°èż™äžȘć€Žéƒšæˆ–è€…äž‹èœœèŻ·æ±‚æœȘćźŒæˆćˆ™äžșç©ș歗笩äžČïŒ›ćŠ‚æžœæŽ„æ”¶ćˆ°ć€šäžȘæœ‰æŒ‡ćźšćç§°çš„ć€ŽéƒšïŒŒèż™äžȘć€Žéƒšçš„ć€Œèą«èżžæŽ„è”·æ„ćč¶èż”ć›žïŒŒäœżç”šé€—ć·ć’Œç©șæ Œćˆ†éš”ćŒ€ć„äžȘć€Žéƒšçš„ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + getResponseHeader(headerName?: string): string; + /** + * æš‚ćœäž‹èœœä»»ćŠĄ + * æš‚ćœäž‹èœœä»»ćŠĄïŒŒćŠ‚æžœä»»ćŠĄć·Čç»ć€„äșŽćˆć§‹çŠ¶æ€æˆ–æš‚ćœçŠ¶æ€ćˆ™æ— ä»»äœ•ć“ćș”。 + * é€šćžžćœšä»»ćŠĄć·ČćŒ€ć§‹ćŽæš‚ćœä»»ćŠĄă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + pause(): void; + /** + * æąć€æš‚ćœçš„äž‹èœœä»»ćŠĄ + * ç»§ç»­æš‚ćœçš„äž‹èœœä»»ćŠĄïŒŒćŠ‚æžœä»»ćŠĄć€„äșŽéžæš‚ćœçŠ¶æ€ćˆ™æ— ä»»äœ•ć“ćș”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + resume(): void; + /** + * èźŸçœźäž‹èœœèŻ·æ±‚çš„HTTPć€Žæ•°æź + * Http的Headerćș”èŻ„ćŒ…ć«ćœšé€šèż‡ćŽç»­start()è°ƒç”šè€Œć‘è”·çš„èŻ·æ±‚äž­ïŒŒæ­€æ–čæł•ćż…éœ€ćœšè°ƒç”šstart()äč‹ć‰èźŸçœźæ‰èƒœç”Ÿæ•ˆă€‚ + * ćŠ‚æžœćžŠæœ‰æŒ‡ćźšćç§°çš„ć€Žéƒšć·Čç»èą«æŒ‡ćźšäș†ïŒŒèż™äžȘć€Žéƒšçš„æ–°ć€Œć°±æ˜ŻïŒšäč‹ć‰æŒ‡ćźšçš„ć€ŒïŒŒćŠ äžŠé€—ć·ă€ä»„ćŠèż™äžȘè°ƒç”šæŒ‡ćźšçš„ć€ŒïŒˆćœąæˆäž€äžȘæ•°ç»„ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + setRequestHeader(headerName?: string, headerValue?: string): void; + /** + * ćŒ€ć§‹äž‹èœœä»»ćŠĄ + * ćŒ€ć§‹äž‹èœœä»»ćŠĄïŒŒćŠ‚æžœä»»ćŠĄć·Čç»ć€„äșŽćŒ€ć§‹çŠ¶æ€ćˆ™æ— ä»»äœ•ć“ćș”。 + * 朹戛ć»șä»»ćŠĄæˆ–ä»»ćŠĄäž‹èœœć€±èŽ„ćŽè°ƒç”šćŻé‡æ–°ćŒ€ć§‹äž‹èœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + start(): void; +} + +/** + * äž‹èœœä»»ćŠĄäș‹ä»¶ç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ +interface PlusDownloaderDownloadEvent { + /** + * äž‹èœœä»»ćŠĄçŠ¶æ€ć˜ćŒ–äș‹ä»¶ + * ćœ“äž‹èœœä»»ćŠĄçŠ¶æ€ć‘ç”Ÿć˜ćŒ–æ—¶è§Šć‘æ­€äș‹ä»¶ïŒŒäș‹ä»¶ćŽŸćž‹ć‚è€ƒDownloadStateChangedCallback。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + statechanged?: string; +} + +/** + * äž‹èœœä»»ćŠĄçŠ¶æ€ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ +type PlusDownloaderDownloadState = undefined | 0 | 1 | 2 | 3 | 4 | 5 | -1; + +/** + * äž‹èœœä»»ćŠĄć‚æ•° + * 朹戛ć»șäž‹èœœä»»ćŠĄæ—¶èźŸçœźçš„ć‚æ•°ïŒŒćŠ‚èźŸçœźäž‹èœœä»»ćŠĄäœżç”šçš„HTTPćèźźç±»ćž‹ă€äŒ˜ć…ˆçș§ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ +interface PlusDownloaderDownloadOptions { + /** + * çœ‘ç»œèŻ·æ±‚ç±»ćž‹ + * æ”ŻæŒhttpćèźźçš„â€œGET”、“POSTâ€ïŒŒé»˜èź€äžș“GETâ€èŻ·æ±‚ă€‚ + * - GET: GETèŻ·æ±‚ + * - POST: POSTèŻ·æ±‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + method?: 'GET' | 'POST'; + /** + * POSTèŻ·æ±‚æ—¶æäș€çš„æ•°æź + * ä»…ćœšçœ‘ç»œèŻ·æ±‚ç±»ćž‹methodèźŸçœźäžș"POST"时有效"GET"èŻ·æ±‚æ—¶ćżœç•„æ­€æ•°æźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + data?: string; + /** + * äž‹èœœæ–‡ä»¶äżć­˜çš„è·ŻćŸ„ + * äżć­˜æ–‡ä»¶è·ŻćŸ„ä»…æ”ŻæŒä»„"_downloads/"、"_doc/"、"_documents/"ćŒ€ć€Žçš„ć­—çŹŠäžČ。 + * æ–‡ä»¶è·ŻćŸ„ä»„æ–‡ä»¶ćŽçŒ€ćç»“ć°ŸïŒˆćŠ‚"_doc/download/a.doc"ïŒ‰èĄšæ˜ŽæŒ‡ćźšäżć­˜æ–‡ä»¶ç›źćœ•ćŠćç§°ïŒŒä»„â€œ/â€ç»“ć°Ÿćˆ™èź€äžșæŒ‡ćźšäżć­˜æ–‡ä»¶çš„ç›źćœ•ïŒˆæ­€æ—¶çš‹ćșè‡ȘćŠšç”Ÿæˆæ–‡ä»¶ćïŒ‰ă€‚ + * ćŠ‚æžœæŒ‡ćźšçš„æ–‡ä»¶ć·Čç»ć­˜ćœšïŒŒćˆ™è‡ȘćŠšćœšæ–‡ä»¶ććŽéąćŠ "(i)"ïŒŒć…¶äž­iäžșæ•°ć­—ïŒŒćŠ‚æžœæ–‡ä»¶ćç§°ćŽéąć·Čç»æ˜Żæ­€æ ŒćŒïŒŒćˆ™æ•°ć­—ié€’ćąžïŒŒćŠ‚"download(1).doc"。 + * é»˜èź€äżć­˜ç›źćœ•äžș"_downloads"ćč¶è‡ȘćŠšç”Ÿæˆæ–‡ä»¶ćç§°ă€‚ + * - _doc/: ćș”ç”šç§æœ‰æ–‡æĄŁç›źćœ• + * - _documents/: ć…±äș«æ–‡æĄŁç›źćœ• + * - _downloads/: ć…±äș«äž‹èœœç›źćœ• + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + filename?: '_doc/' | '_documents/' | '_downloads/'; + /** + * äž‹èœœä»»ćŠĄçš„äŒ˜ć…ˆçș§ + * æ•°ć€Œç±»ćž‹ïŒŒæ•°ć€Œè¶Šć€§äŒ˜ć…ˆçș§è¶Šé«˜ïŒŒé»˜èź€äŒ˜ć…ˆçș§ć€Œäžș0。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + priority?: number; + /** + * äž‹èœœä»»ćŠĄè¶…æ—¶æ—¶é—Ž + * æ•°ć€Œç±»ćž‹ïŒŒć•äœäžșs(秒)ïŒŒé»˜èź€ć€Œäžș120s。 + * è¶…æ—¶æ—¶é—ŽäžșæœćŠĄć™šć“ćș”èŻ·æ±‚çš„æ—¶é—ŽïŒˆäžæ˜Żäž‹èœœä»»ćŠĄćźŒæˆçš„æ€»æ—¶é—ŽïŒ‰ïŒŒćŠ‚æžœèźŸçœźäžș0ćˆ™èĄšç€șæ°žèżœäžè¶…æ—¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + timeout?: number; + /** + * äž‹èœœä»»ćŠĄé‡èŻ•æŹĄæ•° + * æ•°ć€Œç±»ćž‹ïŒŒé»˜èź€äžșé‡èŻ•3æŹĄă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + retry?: number; + /** + * äž‹èœœä»»ćŠĄé‡èŻ•é—Žéš”æ—¶é—Ž + * æ•°ć€Œç±»ćž‹ïŒŒć•äœäžșs(秒)ïŒŒé»˜èź€ć€Œäžș30s。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/downloader.html](http://www.html5plus.org/doc/zh_cn/downloader.html) + */ + retryInterval?: number; +} + +/** + * FingerprintæšĄć—çźĄç†æŒ‡çșčèŻ†ćˆ«ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ +interface PlusFingerprint { + /** + * JSONćŻčè±ĄïŒŒæŒ‡çșčèŻ†ćˆ«èź€èŻć‚æ•° + * 甹äșŽèźŸçœźæŒ‡çșčèŻ†ćˆ«èź€èŻç•Œéąæ˜Ÿç€ș的提ç€șäżĄæŻç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ + AuthenticateOptions?: PlusFingerprintAuthenticateOptions; + /** + * JSONćŻčè±ĄïŒŒæŒ‡çșčèŻ†ćˆ«é”™èŻŻäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ + FingerprintError?: PlusFingerprintFingerprintError; + /** + * ćœ“ć‰èźŸć€‡çŽŻćąƒæ˜ŻćŠæ”ŻæŒæŒ‡çșčèŻ†ćˆ« + * ç›źć‰èż˜æœ‰ćŸˆć€šèźŸć€‡æČĄæœ‰æŒ‡çșčèŻ†ćˆ«æšĄć—ïŒŒéœ€èŠè°ƒç”šæ­€æ–čæł•ćˆ€æ–­æ˜ŻćŠćŻäœżç”šæŒ‡çșčèŻ†ćˆ«ćŠŸèƒœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ + isSupport(): boolean; + /** + * ćœ“ć‰èźŸć€‡æ˜ŻćŠèźŸçœźćŻ†ç é”ć± + * ćŠ‚æžœèźŸć€‡æČĄæœ‰èźŸçœźćŻ†ç é”ć±ïŒŒćˆ™æ— æł•äœżç”šæŒ‡çșčèŻ†ćˆ«ćŠŸèƒœïŒŒć»șèźźè°ƒç”šæŒ‡çșčèŻ†ćˆ«ć‰ć…ˆäœżç”šæ­€æŽ„ćŁæŁ€æŸ„ă€‚ + * 调甚plus.fingerprint.authenticateäŒšèż”ć›žć€±èŽ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ + isKeyguardSecure(): boolean; + /** + * ćœ“ć‰èźŸć€‡æ˜ŻćŠć·Čç»ćœ•ć…„æŒ‡çșč + * ćŠ‚æžœèźŸć€‡æČĄæœ‰ćœ•ć…„指çșčïŒŒćˆ™æ— æł•äœżç”šæŒ‡çșčèŻ†ćˆ«ćŠŸèƒœïŒŒć»șèźźè°ƒç”šæŒ‡çșčèŻ†ćˆ«ć‰ć…ˆäœżç”šæ­€æŽ„ćŁæŁ€æŸ„ă€‚ + * 调甚plus.fingerprint.authenticateäŒšèż”ć›žć€±èŽ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ + isEnrolledFingerprints(): boolean; + /** + * 指çșčèŻ†ćˆ«èź€èŻ + * ç”šæˆ·ćŻä»„ćŒ€ć§‹èŸ“ć…„æŒ‡çșčèż›èĄŒèŻ†ćˆ«ïŒŒćŠ‚æžœèź€èŻæˆćŠŸćˆ™è§Šć‘successCBć›žè°ƒïŒŒèŻ†ćˆ«ć€±èŽ„ćˆ™è§Šć‘errorCBć›žè°ƒèż”ć›žé”™èŻŻäżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ + authenticate(successCB?: () => void, errorCB?: (result: PlusFingerprintFingerprintError) => void, options?: PlusFingerprintAuthenticateOptions): void; + /** + * ć–æ¶ˆæŒ‡çșčèŻ†ćˆ«èź€èŻ + * ć–æ¶ˆćœ“ć‰æ­Łćœšć€„ç†çš„æŒ‡çșčèŻ†ćˆ«èź€èŻæ“äœœă€‚ + * ćŠ‚æžœćœ“ć‰æČĄæœ‰èż›èĄŒæŒ‡çșčèŻ†ćˆ«ćˆ™äžèż›èĄŒä»»äœ•æ“äœœïŒ›ćŠ‚æžœćœ“ć‰æ­Łćœšèż›èĄŒæŒ‡çșčèŻ†ćˆ«ćˆ™è§Šć‘é”™èŻŻć›žè°ƒïŒˆé”™èŻŻç äžș“CANCELâ€ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ + cancel(): void; +} + +/** + * JSONćŻčè±ĄïŒŒæŒ‡çșčèŻ†ćˆ«èź€èŻć‚æ•° + * 甹äșŽèźŸçœźæŒ‡çșčèŻ†ćˆ«èź€èŻç•Œéąæ˜Ÿç€ș的提ç€șäżĄæŻç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ +interface PlusFingerprintAuthenticateOptions { + /** + * ćœšæŒ‡çșčèŻ†ćˆ«èż‡çš‹äž­æ˜Ÿç€șćœšç•ŒéąäžŠçš„æç€șäżĄæŻ + * ćŠ‚æžœæŒ‡çșčèŻ†ćˆ«èź€èŻèż‡çš‹äž­äžæ˜Ÿç€ș提ç€șæĄ†ïŒŒćˆ™äžæ˜Ÿç€șæ­€äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ + message?: string; +} + +/** + * JSONćŻčè±ĄïŒŒæŒ‡çșčèŻ†ćˆ«é”™èŻŻäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ +interface PlusFingerprintFingerprintError { + /** + * äžæ”ŻæŒæŒ‡çșčèŻ†ćˆ« + * ćœ“ć‰èźŸć€‡äžæ”ŻæŒæŒ‡çșčèŻ†ćˆ«ćŠŸèƒœæ—¶èż”ć›žæ­€é”™èŻŻïŒŒé”™èŻŻä»Łç ćžžé‡ć€Œäžș1。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ + UNSUPPORT?: number; + /** + * èźŸć€‡æœȘèźŸçœźćŻ†ç é”ć± + * ćœ“ć‰èźŸć€‡äžșèźŸçœźćŻ†ç é”ć±ćŻŒè‡Žæ— æł•äœżç”šæŒ‡çșčèŻ†ćˆ«ćŠŸèƒœæ—¶èż”ć›žæ­€é”™èŻŻïŒŒé”™èŻŻä»Łç ćžžé‡ć€Œäžș2。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ + KEYGUARD_INSECURE?: number; + /** + * æœȘćœ•ć…„æŒ‡çșčèŻ†ćˆ« + * ćœ“ć‰èźŸć€‡æœȘćœ•ć…„æŒ‡çșčćŻŒè‡Žæ— æł•äœżç”šæŒ‡çșčèŻ†ćˆ«ćŠŸèƒœæ—¶èż”ć›žæ­€é”™èŻŻïŒŒé”™èŻŻä»Łç ćžžé‡ć€Œäžș3。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ + FINGERPRINT_UNENROLLED?: number; + /** + * 指çșčèŻ†ćˆ«äžćŒč配 + * 甚户指çșčèŻ†ćˆ«èź€èŻäžé€šèż‡æ—¶èż”ć›žæ­€é”™èŻŻïŒŒé”™èŻŻä»Łç ćžžé‡ć€Œäžș4。 + * ç”šæˆ·æŻæŹĄć°èŻ•æŒ‡çșčèŻ†ćˆ«èź€èŻæœȘé€šèż‡éƒœäŒšè§Šć‘æ­€é”™èŻŻïŒŒæ­€æ—¶èż˜ćŻä»„ç»§ç»­èŻ†ćˆ«èź€èŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ + AUTHENTICATE_MISMATCH?: number; + /** + * 指çșčèŻ†ćˆ«æŹĄæ•°è¶…èż‡é™ćˆ¶ + * ç”šæˆ·ć€šæŹĄæŒ‡çșčèŻ†ćˆ«èź€èŻäžé€šèż‡æ—¶èż”ć›žæ­€é”™èŻŻïŒŒé”™èŻŻä»Łç ćžžé‡ć€Œäžș5。 + * 通澾ć‡șçŽ°æ­€é”™èŻŻćŽçł»ç»ŸäŒšé”ćźšäž€æź”æ—¶é—ŽçŠæ­ąäœżç”šæŒ‡çșčèŻ†ćˆ«ïŒŒćŠ‚æžœć†æŹĄè°ƒç”šæŒ‡çșčèŻ†ćˆ«èź€èŻäŒšç«‹ćłèż”ć›žæ­€é”™èŻŻïŒŒć› æ­€ć‡șçŽ°æ­€é”™èŻŻæ—¶ćș”èŻ„æç€șç”šæˆ·äœżç”šć…¶ćźƒæ–čćŒèż›èĄŒèź€èŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ + AUTHENTICATE_OVERLIMIT?: number; + /** + * ć–æ¶ˆæŒ‡çșčèŻ†ćˆ« + * ç”šæˆ·ć–æ¶ˆæŒ‡çșčèŻ†ćˆ«èź€èŻæ—¶èż”ć›žæ­€é”™èŻŻïŒŒé”™èŻŻä»Łç ćžžé‡ć€Œäžș6。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ + CANCEL?: number; + /** + * æœȘçŸ„é”™èŻŻ + * ć…¶ćźƒæœȘçŸ„é”™èŻŻïŒŒé”™èŻŻä»Łç ćžžé‡ć€Œäžș7。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ + UNKNOWN_ERROR?: number; + /** + * é”™èŻŻä»Łç  + * ć–ć€ŒèŒƒć›ŽäžșFingerprintErrorćŻčè±Ąçš„é”™èŻŻćžžé‡ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ + code?: number; + /** + * é”™èŻŻæèż°äżĄæŻ + * èŻŠç»†é”™èŻŻæèż°äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/fingerprint.html](http://www.html5plus.org/doc/zh_cn/fingerprint.html) + */ + message?: string; +} + +/** + * GalleryæšĄć—çźĄç†çł»ç»Ÿç›žć†ŒïŒŒæ”ŻæŒä»Žç›žć†Œäž­é€‰æ‹©ć›Ÿç‰‡æˆ–è§†éą‘æ–‡ä»¶ă€äżć­˜ć›Ÿç‰‡æˆ–è§†éą‘æ–‡ä»¶ćˆ°ç›žć†Œç­‰ćŠŸèƒœă€‚é€šèż‡plus.galleryèŽ·ć–ç›žć†ŒçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ +interface PlusGallery { + /** + * JSONćŻčè±ĄïŒŒä»Žç›žć†Œäž­é€‰æ‹©æ–‡ä»¶çš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + GalleryOptions?: PlusGalleryGalleryOptions; + /** + * ç›žć†Œé€‰æ‹©æ–‡ä»¶èż‡æ»€ç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + GalleryFilter?: PlusGalleryGalleryFilter; + /** + * äżć­˜ć›Ÿç‰‡ćˆ°ç›žć†ŒæˆćŠŸäș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + GallerySaveEvent?: PlusGalleryGallerySaveEvent; + /** + * JSONćŻčè±ĄïŒŒćŒčć‡șæ‹ç…§æˆ–æ‘„ćƒç•ŒéąæŒ‡ç€șäœçœź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + PopPosition?: PlusGalleryPopPosition; + /** + * ä»Žçł»ç»Ÿç›žć†Œé€‰æ‹©æ–‡ä»¶ïŒˆć›Ÿç‰‡æˆ–è§†éą‘ïŒ‰ + * ä»Žçł»ç»Ÿç›žć†Œäž­é€‰æ‹©ć›Ÿç‰‡æˆ–è§†éą‘æ–‡ä»¶ă€‚æŻæŹĄä»…èƒœé€‰æ‹©äž€äžȘæ–‡ä»¶ïŒŒé€‰æ‹©ćŽć°†èż”ć›žé€‰æ‹©çš„æ–‡ä»¶è·ŻćŸ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + pick(succesCB?: (result: string) => void, errorCB?: (result: any) => void, options?: PlusGalleryGalleryOptions): void; + /** + * äżć­˜æ–‡ä»¶ćˆ°çł»ç»Ÿç›žć†Œäž­ + * äżć­˜æ–‡ä»¶ćˆ°çł»ç»Ÿç›žć†Œäž­ă€‚ + * æŻæŹĄä»…èƒœäżć­˜äž€äžȘæ–‡ä»¶ïŒŒæ”ŻæŒć›Ÿç‰‡ç±»ćž‹ïŒˆjpg/jpeg、png、bmpç­‰æ ŒćŒïŒ‰ć’Œè§†éą‘æ–‡ä»¶ïŒˆ3gp、movç­‰æ ŒćŒïŒ‰ă€‚ + * è‹„äżć­˜çš„æ–‡ä»¶çł»ç»Ÿäžæ”ŻæŒïŒŒćˆ™é€šèż‡errorCBèż”ć›žé”™èŻŻäżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + save(path ?: string, succesCB?: (result: PlusGalleryGallerySaveEvent) => void, errorCB?: (result: any) => void): void; +} + +/** + * JSONćŻčè±ĄïŒŒä»Žç›žć†Œäž­é€‰æ‹©æ–‡ä»¶çš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ +interface PlusGalleryGalleryOptions { + /** + * æ˜ŻćŠæ˜Ÿç€șçł»ç»Ÿç›žć†Œæ–‡ä»¶é€‰æ‹©ç•Œéąçš„ćŠšç”» + * ćŻć–ć€Œtrue、falseïŒŒé»˜èź€ć€Œäžștrue。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + animation?: boolean; + /** + * é€‰æ‹©æ–‡ä»¶äżć­˜çš„è·ŻćŸ„ + * 某äș›çł»ç»Ÿäžèƒœç›ŽæŽ„äœżç”šçł»ç»Ÿç›žć†Œçš„è·ŻćŸ„ïŒŒèż™æ—¶éœ€èŠć°†é€‰æ‹©çš„æ–‡ä»¶äżć­˜ćˆ°ćș”ç”šćŻèźżé—źçš„ç›źćœ•äž­ïŒŒćŻé€šèż‡æ­€ć‚æ•°èźŸçœźäżć­˜æ–‡ä»¶çš„è·ŻćŸ„ă€‚ + * ćŠ‚æžœè·ŻćŸ„äž­ćŒ…æ‹Źæ–‡ä»¶ćŽçŒ€ćç§°ïŒŒćˆ™èĄšæ˜ŽæŒ‡ćźšæ–‡ä»¶è·ŻćŸ„ćŠćç§°ïŒŒćŠćˆ™ä»…æŒ‡ćźšæ–‡ä»¶äżć­˜ç›źćœ•ïŒŒæ–‡ä»¶ćç§°è‡ȘćŠšç”Ÿæˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + filename?: string; + /** + * ç›žć†Œäž­é€‰æ‹©æ–‡ä»¶ç±»ćž‹èż‡æ»€ć™š + * çł»ç»Ÿç›žć†Œé€‰æ‹©ć™šäž­ćŻé€‰æ‹©çš„æ–‡ä»¶ç±»ćž‹ïŒŒćŻèźŸçœźäžșä»…é€‰æ‹©ć›Ÿç‰‡æ–‡ä»¶ïŒˆâ€œimageâ€ïŒ‰ă€è§†éą‘æ–‡ä»¶ïŒˆâ€œvideo”或所有文件“noneâ€ïŒ‰ïŒŒé»˜èź€ć€Œäžș“image”。 + * - image: ä»…ćŻé€‰æ‹©ć›Ÿç‰‡æ–‡ä»¶ + * - video: ä»…ćŻé€‰æ‹©è§†éą‘æ–‡ä»¶ + * - none: ćŻé€‰æ‹©ć›Ÿç‰‡æˆ–è§†éą‘æ–‡ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + filter?: 'image' | 'video' | 'none'; + /** + * æœ€ć€šé€‰æ‹©çš„ć›Ÿç‰‡æ•°é‡ + * ä»…ćœšæ”ŻæŒć€šé€‰æ—¶æœ‰æ•ˆïŒŒć–ć€ŒèŒƒć›Žäžș1戰InfinityïŒŒé»˜èź€ć€ŒäžșInfinityïŒŒćłäžé™ćˆ¶é€‰æ‹©çš„ć›Ÿç‰‡æ•°ă€‚ + * ćŠ‚æžœèźŸçœźçš„ć€Œéžæł•ćˆ™äœżç”šé»˜èź€ć€ŒInfinity。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + maximum?: number; + /** + * æ˜ŻćŠæ”ŻæŒć€šé€‰ć›Ÿç‰‡ + * ćŻä»Žçł»ç»Ÿç›žć†Œäž­é€‰æ‹©ć€šćŒ ć›Ÿç‰‡ïŒŒé€‰æ‹©ć›Ÿç‰‡ćŽé€šèż‡GalleryMultiplePickSuccessCallbackć›žè°ƒèż”ć›žé€‰æ‹©çš„ć›Ÿç‰‡ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + multiple?: boolean; + /** + * è¶…èż‡æœ€ć€šé€‰æ‹©ć›Ÿç‰‡æ•°é‡äș‹ä»¶ + * äœżç”šç›žć†Œć€šé€‰ć›Ÿç‰‡æ—¶ïŒŒćŻé€šèż‡maximumć±žæ€§èźŸçœźæœ€ć€šé€‰æ‹©çš„ć›Ÿç‰‡æ•°é‡ïŒŒćœ“ç”šæˆ·æ“äœœé€‰æ‹©çš„æ•°é‡ć€§äșŽæ­€æ—¶è§Šć‘æ­€äș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + onmaxed?: () => void; + /** + * ç›žć†Œé€‰æ‹©ç•ŒéąćŒčć‡ș指ç€șćŒș㟟 + * ćŻčäșŽć€§ć±ćč•èźŸć€‡ćŠ‚iPadïŒŒç›žć†Œé€‰æ‹©ç•ŒéąäžșćŒčć‡șçȘ—ćŁïŒŒæ­€æ—¶ćŻé€šèż‡æ­€ć‚æ•°èźŸçœźćŒčć‡șçȘ—ćŁäœçœźă€‚ + * ć…¶äžșJSONćŻčè±ĄïŒŒæ ŒćŒćŠ‚{top:"10px",left:"10px",width:"200px",height:"200px"}ïŒŒæ‰€æœ‰ć€ŒäžșćƒçŽ ć€ŒïŒŒć·ŠäžŠćæ ‡ç›žćŻčäșŽćźčć™šçš„äœçœźïŒŒé»˜èź€ćŒčć‡șäœçœźäžșć±ćč•汅䞭。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + popover?: PlusGalleryPopPosition; + /** + * ć·Čé€‰æ‹©çš„ć›Ÿç‰‡è·ŻćŸ„ćˆ—èĄš + * ä»…ćœšć€šć›Ÿç‰‡é€‰æ‹©æ—¶ç”Ÿæ•ˆïŒŒç›žć†Œé€‰æ‹©ç•Œéąć°†é€‰äž­æŒ‡ćźšçš„ć›Ÿç‰‡è·ŻćŸ„ćˆ—èĄšă€‚ + * ćŠ‚æžœæŒ‡ćźšçš„è·ŻćŸ„æ— æ•ˆïŒŒćˆ™ćżœç•„æ­€éĄčïŒ›ćŠ‚æžœæŒ‡ćźšçš„è·ŻćŸ„æ•°è¶…èż‡maximumć±žæ€§æŒ‡ćźšçš„æœ€ć€§é€‰æ‹©æ•°ç›źćˆ™è¶…ć‡șçš„ć›Ÿç‰‡äžé€‰äž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + selected?: any []; + /** + * æ˜ŻćŠäœżç”šçł»ç»Ÿç›žć†Œæ–‡ä»¶é€‰æ‹©ç•Œéą + * multipleć±žæ€§èźŸçœźäžștrueæ—¶ïŒŒćŠ‚æžœçł»ç»Ÿè‡ȘćžŠç›žć†Œé€‰æ‹©æŽ§ä»¶æ—¶ćˆ™äŒ˜ć…ˆäœżç”šïŒŒćŠćˆ™äœżç”š5+ç»Ÿäž€ç›žć†Œé€‰æ‹©æŽ§ä»¶ïŒ›èźŸçœźäžșfalsećˆ™äžäœżç”šçł»ç»Ÿè‡ȘćžŠç›žć†Œé€‰æ‹©æŽ§ä»¶ïŒŒç›ŽæŽ„äœżç”š5+ç»Ÿäž€ç›žć†Œé€‰æ‹©ç•Œéąă€‚ + * é»˜èź€ć€Œäžștrue。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + system?: boolean; +} + +/** + * ç›žć†Œé€‰æ‹©æ–‡ä»¶èż‡æ»€ç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ +interface PlusGalleryGalleryFilter { + /** + * ä»…ćŻé€‰æ‹©ć›Ÿç‰‡æ–‡ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + image?: string; + /** + * ä»…ćŻé€‰æ‹©è§†éą‘æ–‡ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + video?: string; + /** + * äžèż‡æ»€ïŒŒćŻé€‰æ‹©ć›Ÿç‰‡æˆ–è§†éą‘æ–‡ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + none?: string; +} + +/** + * äżć­˜ć›Ÿç‰‡ćˆ°ç›žć†ŒæˆćŠŸäș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ +interface PlusGalleryGallerySaveEvent { + /** + * äżć­˜ćˆ°ç›žć†Œçš„ć›Ÿç‰‡è·ŻćŸ„ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + path?: string; +} + +/** + * JSONćŻčè±ĄïŒŒćŒčć‡șæ‹ç…§æˆ–æ‘„ćƒç•ŒéąæŒ‡ç€șäœçœź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ +interface PlusGalleryPopPosition { + /** + * 指ç€șćŒșćŸŸè·çŠ»ćźčć™šéĄ¶éƒšçš„è·çŠ» + * ćŒčć‡șæ‹ç…§æˆ–æ‘„ćƒçȘ—ćŁæŒ‡ç€șćŒșćŸŸè·çŠ»ćźčć™šéĄ¶éƒšçš„è·çŠ»ïŒŒć•äœæ”ŻæŒćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ć’Œç™Ÿćˆ†æŻ”ïŒˆćŠ‚"50%"ïŒ‰ïŒŒćŠ‚äžć†™ć•äœćˆ™äžșćƒçŽ ć€Œć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + top?: string; + /** + * 指ç€șćŒșćŸŸè·çŠ»ćźčć™šć·ŠäŸ§çš„è·çŠ» + * ćŒčć‡șæ‹ç…§æˆ–æ‘„ćƒçȘ—ćŁæŒ‡ç€șćŒșćŸŸè·çŠ»ćźčć™šć·ŠäŸ§çš„è·çŠ»ïŒŒć•äœæ”ŻæŒćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ć’Œç™Ÿćˆ†æŻ”ïŒˆćŠ‚"50%"ïŒ‰ïŒŒćŠ‚äžć†™ć•äœćˆ™äžșćƒçŽ ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + left?: string; + /** + * 指ç€șćŒșćŸŸçš„ćźœćșŠ + * ćŒčć‡șæ‹ç…§æˆ–æ‘„ćƒçȘ—ćŁæŒ‡ç€șćŒșćŸŸçš„ćźœćșŠïŒŒć•äœæ”ŻæŒćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ć’Œç™Ÿćˆ†æŻ”ïŒˆćŠ‚"50%"ïŒ‰ïŒŒćŠ‚äžć†™ć•äœćˆ™äžșćƒçŽ ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + width?: string; + /** + * 指ç€șćŒșćŸŸçš„é«˜ćșŠ + * ćŒčć‡șæ‹ç…§æˆ–æ‘„ćƒçȘ—ćŁæŒ‡ç€șćŒșćŸŸçš„é«˜ćșŠïŒŒć•äœæ”ŻæŒćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ć’Œç™Ÿćˆ†æŻ”ïŒˆćŠ‚"50%"ïŒ‰ïŒŒćŠ‚äžć†™ć•äœćˆ™äžșćƒçŽ ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/gallery.html](http://www.html5plus.org/doc/zh_cn/gallery.html) + */ + height?: string; +} + +/** + * GeolocationæšĄć—çźĄç†èźŸć€‡äœçœźäżĄæŻïŒŒç”šäșŽèŽ·ć–ćœ°ç†äœçœźäżĄæŻïŒŒćŠ‚ç»ćșŠă€çșŹćșŠç­‰ă€‚é€šèż‡plus.geolocationćŻèŽ·ć–èźŸć€‡äœçœźçźĄç†ćŻčè±Ąă€‚è™œç„¶W3Cć·Čç»æäŸ›æ ‡ć‡†APIèŽ·ć–äœçœźäżĄæŻïŒŒäœ†ćœšæŸäș›ćčłć°ć­˜ćœšć·źćŒ‚或æœȘćźžçŽ°ïŒŒäžșäș†äżæŒć„ćčłć°çš„ç»Ÿäž€æ€§ïŒŒćźšä艿­€è§„èŒƒæŽ„ćŁèŽ·ć–äœçœźäżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ +interface PlusGeolocation { + /** + * JSONćŻčè±ĄïŒŒèźŸć€‡äœçœźäżĄæŻæ•°æź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + Position?: PlusGeolocationPosition; + /** + * JSONćŻčè±ĄïŒŒćœ°ć€äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + Address?: PlusGeolocationAddress; + /** + * JSONćŻčè±ĄïŒŒćœ°ç†ćæ ‡äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + Coordinates?: PlusGeolocationCoordinates; + /** + * JSONćŻčè±ĄïŒŒç›‘ćŹèźŸć€‡äœçœźäżĄæŻć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + PositionOptions?: PlusGeolocationPositionOptions; + /** + * JSONćŻčè±ĄïŒŒćźšäœé”™èŻŻäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + GeolocationError?: PlusGeolocationGeolocationError; + /** + * èŽ·ć–ćœ“ć‰èźŸć€‡äœçœźäżĄæŻ + * äœçœźäżĄæŻć°†é€šèż‡æ‰‹æœșGPSèźŸć€‡æˆ–ć…¶ćźƒäżĄæŻćŠ‚IPćœ°ć€ă€ç§»ćŠšçœ‘ç»œäżĄć·èŽ·ć–ïŒŒç”±äșŽèŽ·ć–äœçœźäżĄæŻćŻèƒœéœ€èŠèŸƒé•żçš„æ—¶é—ŽïŒŒćœ“æˆćŠŸèŽ·ć–äœçœźäżĄæŻćŽć°†é€šèż‡successCBć›žè°ƒć‡œæ•°èż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + getCurrentPosition(successCB?: (result: PlusGeolocationPosition) => void, errorCB?: (result: PlusGeolocationGeolocationError) => void, options?: PlusGeolocationPositionOptions): void; + /** + * ç›‘ćŹèźŸć€‡äœçœźć˜ćŒ–äżĄæŻ + * äœçœźäżĄæŻć°†é€šèż‡æ‰‹æœșGPSèźŸć€‡æˆ–ć…¶ćźƒäżĄæŻćŠ‚IPćœ°ć€ă€ç§»ćŠšçœ‘ç»œäżĄć·èŽ·ć–ă€‚ + * ćœ“äœçœźäżĄæŻæ›Žæ–°ćŽć°†é€šèż‡successCBć›žè°ƒć‡œæ•°èż”ć›žă€‚ + * äœçœźäżĄæŻèŽ·ć–ć€±èŽ„ćˆ™è°ƒç”šć›žè°ƒć‡œæ•°errorCB。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + watchPosition(successCB?: (result: PlusGeolocationPosition) => void, errorCB?: (result: PlusGeolocationGeolocationError) => void, option?: PlusGeolocationPositionOptions): number; + /** + * ć…łé—­ç›‘ćŹèźŸć€‡äœçœźäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + clearWatch(watchId?: number): void; +} + +/** + * JSONćŻčè±ĄïŒŒèźŸć€‡äœçœźäżĄæŻæ•°æź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ +interface PlusGeolocationPosition { + /** + * ćœ°ç†ćæ ‡äżĄæŻïŒŒćŒ…æ‹Źç»çșŹćșŠă€æ”·æ‹”ă€é€ŸćșŠç­‰äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + coords?: PlusGeolocationCoordinates; + /** + * èŽ·ć–ćˆ°ćœ°ç†ćæ ‡äżĄæŻçš„ćæ ‡çł»ç±»ćž‹ + * ćŻć–ä»„äž‹ćæ ‡çł»ç±»ćž‹ïŒš + * "gps"ïŒšèĄšç€șWGS-84ćæ ‡çł»ïŒ› + * "gcj02"ïŒšèĄšç€șć›œæ”‹ć±€ç»çșŹćșŠćæ ‡çł»ïŒ› + * "bd09"ïŒšèĄšç€ș癟ćșŠćąšćĄæ‰˜ćæ ‡çł»ïŒ› + * "bd09ll"ïŒšèĄšç€ș癟ćșŠç»çșŹćșŠćæ ‡çł»ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + coordsType?: string; + /** + * èŽ·ć–ćˆ°ćœ°ç†ćæ ‡çš„æ—¶é—ŽæˆłäżĄæŻ + * æ—¶é—Žæˆłć€Œäžș从1970ćčŽ1月1æ—„è‡łä»Šçš„æŻ«ç§’æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + timestamp?: number; + /** + * èŽ·ć–ćˆ°ćœ°ç†äœçœźćŻčćș”çš„ćœ°ć€äżĄæŻ + * èŽ·ć–ćœ°ć€äżĄæŻéœ€èŠèżžæŽ„ćˆ°æœćŠĄć™šèż›èĄŒè§ŁæžïŒŒæ‰€ä»„äŒšæ¶ˆè€—æ›Žć€šçš„è”„æșïŒŒćŠ‚æžœäžéœ€èŠèŽ·ć–ćœ°ć€äżĄæŻćŻé€šèż‡èźŸçœźPositionOptionsć‚æ•°çš„geocodeć±žæ€§ć€Œäžșfalseéżć…èŽ·ć–ćœ°ć€äżĄæŻă€‚ + * ćŠ‚æžœæČĄæœ‰èŽ·ć–ćˆ°ćœ°ć€äżĄæŻćˆ™èż”ć›žundefined。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + address?: PlusGeolocationAddress; + /** + * èŽ·ć–ćźŒæ•Žćœ°ć€æèż°äżĄæŻ + * ćŠ‚æžœæČĄæœ‰èŽ·ć–ćˆ°ćœ°ć€äżĄæŻćˆ™èż”ć›žundefined。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + addresses?: string; +} + +/** + * JSONćŻčè±ĄïŒŒćœ°ć€äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ +interface PlusGeolocationAddress { + /** + * ć›œćź¶ + * ćŠ‚â€œäž­ć›œâ€ïŒŒćŠ‚æžœæ— æł•èŽ·ć–æ­€äżĄæŻćˆ™èż”ć›žundefined。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + country?: string; + /** + * çœä»œćç§° + * 橂“挗äșŹćž‚â€ïŒŒćŠ‚æžœæ— æł•èŽ·ć–æ­€äżĄæŻćˆ™èż”ć›žundefined。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + province?: string; + /** + * 柎澂損称 + * 橂“挗äșŹćž‚â€ïŒŒćŠ‚æžœæ— æł•èŽ·ć–æ­€äżĄæŻćˆ™èż”ć›žundefined。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + city?: string; + /** + * ćŒșïŒˆćŽżïŒ‰ćç§° + * ćŠ‚â€œæœé˜łćŒșâ€ïŒŒćŠ‚æžœæ— æł•èŽ·ć–æ­€äżĄæŻćˆ™èż”ć›žundefined。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + district?: string; + /** + * èĄ—é“äżĄæŻ + * ćŠ‚â€œé…’ä»™æĄ„è·Żâ€ïŒŒćŠ‚æžœæ— æł•èŽ·ć–æ­€äżĄæŻćˆ™èż”ć›žundefined。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + street?: string; + /** + * èŽ·ć–èĄ—é“é—šç‰Œć·äżĄæŻ + * 橂“3ć·â€ïŒŒćŠ‚æžœæ— æł•èŽ·ć–æ­€äżĄæŻćˆ™èż”ć›žundefined。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + streetNum?: string; + /** + * POIäżĄæŻ + * ćŠ‚â€œç””ć­ćŸŽïŒŽć›œé™…ç””ć­æ€»éƒšâ€ïŒŒćŠ‚æžœæ— æł•èŽ·ć–æ­€äżĄæŻćˆ™èż”ć›žundefined。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + poiName?: string; + /** + * é‚źæ”żçŒ–ç  + * 橂“100016â€ïŒŒćŠ‚æžœæ— æł•èŽ·ć–æ­€äżĄæŻćˆ™èż”ć›žundefined。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + postalCode?: string; + /** + * ćŸŽćž‚ä»Łç  + * 橂“010â€ïŒŒćŠ‚æžœæ— æł•èŽ·ć–æ­€äżĄæŻćˆ™èż”ć›žundefined。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + cityCode?: string; +} + +/** + * JSONćŻčè±ĄïŒŒćœ°ç†ćæ ‡äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ +interface PlusGeolocationCoordinates { + /** + * ćæ ‡çșŹćșŠć€Œ + * æ•°æźç±»ćž‹ćŻčè±ĄïŒŒćœ°ç†ćæ ‡äž­çš„çșŹćșŠć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + latitude?: number; + /** + * ćæ ‡ç»ćșŠć€Œ + * æ•°æźç±»ćž‹ćŻčè±ĄïŒŒćœ°ç†ćæ ‡äž­çš„ç»ćșŠć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + longitude?: number; + /** + * æ”·æ‹”äżĄæŻ + * æ•°æźç±»ćž‹ćŻčè±ĄïŒŒćŠ‚æžœæ— æł•èŽ·ć–æ­€äżĄæŻïŒŒćˆ™æ­€ć€Œäžșç©șnullïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + altitude?: number; + /** + * ćœ°ç†ćæ ‡äżĄæŻçš„çČŸçĄźćșŠäżĄæŻ + * æ•°æźç±»ćž‹ćŻčè±ĄïŒŒć•äœäžșç±łïŒŒć…¶æœ‰æ•ˆć€Œćż…éĄ»ć€§äșŽ0。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + accuracy?: number; + /** + * 攷拔的çČŸçĄźćșŠäżĄæŻ + * æ•°æźç±»ćž‹ćŻčè±ĄïŒŒć•äœäžșç±łïŒŒć…¶æœ‰æ•ˆć€Œćż…éĄ»ć€§äșŽ0ă€‚ćŠ‚æžœæ— æł•èŽ·ć–æ”·æ‹”äżĄæŻïŒŒćˆ™æ­€ć€Œäžșç©șnullïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + altitudeAccuracy?: number; + /** + * èĄšç€șèźŸć€‡ç§»ćŠšçš„æ–č搑 + * æ•°æźç±»ćž‹ćŻčè±ĄïŒŒèŒƒć›Žäžș0戰360ïŒŒèĄšç€ș盾ćŻčäșŽæ­ŁćŒ—æ–čć‘çš„è§’ćșŠă€‚ćŠ‚æžœæ— æł•èŽ·ć–æ­€äżĄæŻïŒŒćˆ™æ­€ć€Œäžșç©șnullïŒ‰ă€‚ćŠ‚æžœèźŸć€‡æČĄæœ‰ç§»ćŠšćˆ™æ­€ć€ŒäžșNaN。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + heading?: number; + /** + * èĄšç€șèźŸć€‡ç§»ćŠšçš„é€ŸćșŠ + * æ•°æźç±»ćž‹ćŻčè±ĄïŒŒć•äœäžșç±łæŻç§’ïŒˆm/sïŒ‰ïŒŒć…¶æœ‰æ•ˆć€Œćż…éĄ»ć€§äșŽ0ă€‚ćŠ‚æžœæ— æł•èŽ·ć–é€ŸćșŠäżĄæŻïŒŒćˆ™æ­€ć€Œäžșç©șnullïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + speed?: number; +} + +/** + * JSONćŻčè±ĄïŒŒç›‘ćŹèźŸć€‡äœçœźäżĄæŻć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ +interface PlusGeolocationPositionOptions { + /** + * æ˜ŻćŠé«˜çČŸçĄźćșŠèŽ·ć–äœçœźäżĄæŻ + * 高çČŸćșŠèŽ·ć–èĄšç€șéœ€èŠäœżç”šæ›Žć€šçš„çł»ç»Ÿè”„æșïŒŒé»˜èź€ć€Œäžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + enableHighAccuracy?: boolean; + /** + * èŽ·ć–äœçœźäżĄæŻçš„è¶…æ—¶æ—¶é—Ž + * ć•äœäžșæŻ«ç§’ïŒˆmsïŒ‰ïŒŒé»˜èź€ć€Œäžșäžè¶…æ—¶ă€‚ćŠ‚æžœćœšæŒ‡ćźšçš„æ—¶é—Žć†…æČĄæœ‰èŽ·ć–ćˆ°äœçœźäżĄæŻćˆ™è§Šć‘é”™èŻŻć›žè°ƒć‡œæ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + timeout?: number; + /** + * èŽ·ć–äœçœźäżĄæŻçš„é—Žéš”æ—¶é—Ž + * ć•äœäžșæŻ«ç§’ïŒˆmsïŒ‰ïŒŒé»˜èź€ć€Œäžș5000ïŒˆćł5ç§’ïŒ‰ă€‚è°ƒç”šplus.geolocation.watchPosition时äžșæ›Žæ–°äœçœźäżĄæŻçš„é—Žéš”æ—¶é—Žă€‚ + * æłšæ„ïŒšćœšäžćŒćźšäœæšĄć—äž‹æ”ŻæŒèŒƒć›Žć€ŒćŻèƒœäžćŒïŒŒćŠ‚ç™ŸćșŠćźšäœæšĄć—çš„é—Žéš”èŒƒć›Žäžș性äșŽç­‰äșŽ1ç§’ïŒŒćŠ‚æžœèźŸçœźçš„ć€Œć°äșŽæœ€ć°ć€Œćˆ™äœżç”šæœ€ć°ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + maximumAge?: number; + /** + * äŒ˜ć…ˆäœżç”šçš„ćźšäœæšĄć— + * ćŻć–ä»„äž‹äŸ›ćș”者 + * "system"ïŒšèĄšç€șçł»ç»ŸćźšäœæšĄć—ïŒŒæ”ŻæŒwgs84ćæ ‡çł»ïŒ› + * "baidu"ïŒšèĄšç€ș癟ćșŠćźšäœæšĄć—ïŒŒæ”ŻæŒgcj02/bd09/bd09llćæ ‡çł»ïŒ› + * "amap"ïŒšèĄšç€șé«˜ćŸ·ćźšäœæšĄæżïŒŒæ”ŻæŒgcj02ćæ ‡çł»ă€‚ + * é»˜èź€ć€ŒæŒ‰ä»„äž‹äŒ˜ć…ˆéĄșćșèŽ·ć–ïŒˆamap>baidu>systemïŒ‰ïŒŒè‹„æŒ‡ćźšçš„provideräžć­˜ćœšæˆ–æ— æ•ˆćˆ™èż”ć›žé”™èŻŻć›žè°ƒă€‚ + * æłšæ„ïŒšç™ŸćșŠ/é«˜ćŸ·ćźšäœæšĄć—éœ€èŠé…çœźç™ŸćșŠ/é«˜ćŸ·ćœ°ć›Ÿç›žć…łć‚æ•°æ‰èƒœæ­Łćžžäœżç”šă€‚ + * - system: äŒ˜ć…ˆäœżç”šçł»ç»ŸćźšäœæšĄć— + * - baidu: äŒ˜ć…ˆäœżç”šç™ŸćșŠćźšäœæšĄć— + * - amap: äŒ˜ć…ˆäœżç”šé«˜ćŸ·ćźšäœæšĄć— + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + provider?: 'system' | 'baidu' | 'amap'; + /** + * æŒ‡ćźšèŽ·ć–çš„ćźšäœæ•°æźćæ ‡çł»ç±»ćž‹ + * ćŻć–ä»„äž‹ćæ ‡çł»ç±»ćž‹ïŒš + * "wgs84"ïŒšèĄšç€șWGS-84ćæ ‡çł»ïŒ› + * "gcj02"ïŒšèĄšç€șć›œæ”‹ć±€ç»çșŹćșŠćæ ‡çł»ïŒ› + * "bd09"ïŒšèĄšç€ș癟ćșŠćąšćĄæ‰˜ćæ ‡çł»ïŒ› + * "bd09ll"ïŒšèĄšç€ș癟ćșŠç»çșŹćșŠćæ ‡çł»ïŒ› + * provideräžș"system"æ—¶ïŒŒé»˜èź€äœżç”š"wgs84"ćæ ‡çł»ïŒ›provideräžș"baidu"æ—¶ïŒŒé»˜èź€äœżç”š"gcj02"ćæ ‡çł»ïŒ›provideräžș"amap"æ—¶ïŒŒé»˜èź€äœżç”š"gcj02"ćæ ‡çł»ă€‚ + * ćŠ‚æžœèźŸçœźçš„ćæ ‡çł»ç±»ćž‹provideräžæ”ŻæŒïŒŒćˆ™èż”ć›žé”™èŻŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + coordsType?: string; + /** + * æ˜ŻćŠè§Łæžćœ°ć€äżĄæŻ + * è§Łæžçš„ćœ°ć€äżĄæŻäżć­˜ćˆ°PositionćŻčè±Ąçš„address、addressesć±žæ€§äž­ïŒŒtrueèĄšç€șè§Łæžćœ°ć€äżĄæŻïŒŒfalseèĄšç€șäžè§Łæžćœ°ć€äżĄæŻïŒŒèż”ć›žçš„PositionćŻčè±Ąçš„address、addressesć±žæ€§ć€ŒäžșundefinedïŒŒé»˜èź€ć€Œäžștrue。 + * ćŠ‚æžœè§Łæžćœ°ć€äżĄæŻć€±èŽ„ćˆ™èż”ć›žçš„PositionćŻčè±Ąçš„address、addressesć±žæ€§ć€Œäžșnull。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + geocode?: boolean; +} + +/** + * JSONćŻčè±ĄïŒŒćźšäœé”™èŻŻäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ +interface PlusGeolocationGeolocationError { + /** + * èźżé—źæƒé™èą«æ‹’ç» + * çł»ç»Ÿäžć…èźžçš‹ćșèŽ·ć–ćźšäœćŠŸèƒœïŒŒé”™èŻŻä»Łç ćžžé‡ć€Œäžș1。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + PERMISSION_DENIED?: number; + /** + * äœçœźäżĄæŻäžćŻç”š + * æ— æł•èŽ·ć–æœ‰æ•ˆçš„äœçœźäżĄæŻïŒŒé”™èŻŻä»Łç ćžžé‡ć€Œäžș2。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + POSITION_UNAVAILABLE?: number; + /** + * èŽ·ć–äœçœźäżĄæŻè¶…æ—¶ + * æ— æł•ćœšæŒ‡ćźšçš„æ—¶é—Žć†…èŽ·ć–äœçœźäżĄæŻïŒŒé”™èŻŻä»Łç ćžžé‡ć€Œäžș3。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + TIMEOUT?: number; + /** + * æœȘçŸ„é”™èŻŻ + * ć…¶ćźƒæœȘçŸ„é”™èŻŻćŻŒè‡Žæ— æł•èŽ·ć–äœçœźäżĄæŻïŒŒé”™èŻŻä»Łç ćžžé‡ć€Œäžș4。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + UNKNOWN_ERROR?: number; + /** + * é”™èŻŻä»Łç  + * ć–ć€ŒèŒƒć›ŽäžșGeolocationErrorćŻčè±Ąçš„ćžžé‡ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + code?: number; + /** + * é”™èŻŻæèż°äżĄæŻ + * èŻŠç»†é”™èŻŻæèż°äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/geolocation.html](http://www.html5plus.org/doc/zh_cn/geolocation.html) + */ + message?: string; +} + +/** + * iBeaconæšĄć—ç”šäșŽæœçŽąé™„ä»¶çš„iBeaconèźŸć€‡ïŒˆ*èŻ·äœżç”šHBuilderXćč¶æ›Žæ–°ćˆ°æœ€æ–°ç‰ˆæœŹ*ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) + */ +interface PlusIbeacon { + /** + * iBeaconèźŸć€‡äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) + */ + IBeaconInfo?: PlusIbeaconIBeaconInfo; + /** + * ćŒ€ć§‹æœçŽąé™„èż‘çš„iBeaconèźŸć€‡ + * æœçŽąæˆćŠŸćŽè§Šć‘successCBć›žè°ƒïŒŒć€±èŽ„è§Šć‘errorCBć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) + */ + startBeaconDiscovery(uuids?: any [], ignoretoothAvailable?: boolean, success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + /** + * ćœæ­ąæœçŽąé™„èż‘çš„iBeaconèźŸć€‡ + * ć–æ¶ˆæˆćŠŸćŽè§Šć‘successCBć›žè°ƒïŒŒć€±èŽ„è§Šć‘errorCBć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) + */ + stopBeaconDiscovery(success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + /** + * èŽ·ć–ć·ČæœçŽąćˆ°çš„iBeaconèźŸć€‡ + * èŽ·ć–æˆćŠŸćŽè§Šć‘successCBć›žè°ƒïŒŒć€±èŽ„è§Šć‘errorCBć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) + */ + getBeacons(success?: (result: any) => void, fail?: (result: any) => void, complete?: (result: any) => void): void; + /** + * 监搬iBeaconèźŸć€‡æ›Žæ–° + * iBeaconèźŸć€‡æ›Žæ–°ćŽè§Šć‘updateCBć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) + */ + onBeaconUpdate(updateCB?: (result: any) => void): void; + /** + * 监搬iBeaconæœćŠĄçŠ¶æ€ć˜ćŒ– + * iBeaconæœćŠĄçŠ¶æ€ć˜ćŒ–æ—¶è§Šć‘changeCBć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) + */ + onBeaconServiceChange(changeCB?: (result: any) => void): void; +} + +/** + * iBeaconèźŸć€‡äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) + */ +interface PlusIbeaconIBeaconInfo { + /** + * iBeaconèźŸć€‡ćčżæ’­çš„uuid + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) + */ + uuid?: string; + /** + * iBeaconèźŸć€‡çš„äž»id + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) + */ + major?: string; + /** + * iBeaconèźŸć€‡çš„æŹĄid + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) + */ + minor?: string; + /** + * iBeaconèźŸć€‡çš„è·çŠ» + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) + */ + proximity?: number; + /** + * iBeaconèźŸć€‡çš„è·çŠ»çČŸćșŠäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) + */ + accuracy?: number; + /** + * iBeaconèźŸć€‡çš„äżĄć·ćŒșćșŠ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ibeacon.html](http://www.html5plus.org/doc/zh_cn/ibeacon.html) + */ + rssi?: string; +} + +/** + * IOæšĄć—çźĄç†æœŹćœ°æ–‡ä»¶çł»ç»ŸïŒŒç”šäșŽćŻčæ–‡ä»¶çł»ç»Ÿçš„ç›źćœ•æ”è§ˆă€æ–‡ä»¶çš„èŻ»ć–ă€æ–‡ä»¶çš„ć†™ć…„ç­‰æ“äœœă€‚é€šèż‡plus.ioćŻèŽ·ć–æ–‡ä»¶çł»ç»ŸçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ +interface PlusIo { + /** + * æ–‡ä»¶çł»ç»Ÿäž­çš„ç›źćœ•ćŻčè±ĄïŒŒç”šäșŽçźĄç†ç‰čćźšçš„æœŹćœ°ç›źćœ• + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + DirectoryEntry?: PlusIoDirectoryEntry; + /** + * èŻ»ć–ç›źćœ•äżĄæŻćŻčè±ĄïŒŒç”šäșŽèŽ·ć–ç›źćœ•äž­ćŒ…ć«çš„æ–‡ä»¶ćŠć­ç›źćœ• + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + DirectoryReader?: PlusIoDirectoryReader; + /** + * æ–‡ä»¶çł»ç»Ÿäž­çš„æ–‡ä»¶æ•°æźćŻčè±ĄïŒŒç”šäșŽèŽ·ć–æ–‡ä»¶çš„æ•°æź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + File?: PlusIoFile; + /** + * æ–‡ä»¶çł»ç»Ÿäž­çš„æ–‡ä»¶ćŻčè±ĄïŒŒç”šäșŽçźĄç†ç‰čćźšçš„æœŹćœ°æ–‡ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + FileEntry?: PlusIoFileEntry; + /** + * æ–‡ä»¶çł»ç»Ÿäž­çš„èŻ»ć–æ–‡ä»¶ćŻčè±ĄïŒŒç”šäșŽèŽ·ć–æ–‡ä»¶çš„ć†…ćźč + * FileReaderćŻčè±Ąæ˜Żä»ŽèźŸć€‡æ–‡ä»¶çł»ç»ŸèŻ»ć–æ–‡ä»¶FileReaderćŻčè±Ąæ˜Żä»ŽèźŸć€‡æ–‡ä»¶çł»ç»ŸèŻ»ć–æ–‡ä»¶çš„äž€ç§æ–čćŒïŒŒæ–‡ä»¶ä»„æ–‡æœŹæˆ–è€…Base64çŒ–ç çš„ć­—çŹŠäžČćœąćŒèŻ»ć‡șæ„ă€‚ + * ç”šæˆ·æłšć†Œè‡Ș深的äș‹ä»¶ç›‘ćŹć™šæ„掄收loadstart、progress、load、loadend、error撌abortäș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + FileReader?: PlusIoFileReader; + /** + * æ–‡ä»¶çł»ç»Ÿäž­çš„ć†™æ–‡ä»¶ćŻčè±ĄïŒŒç”šäșŽć†™ć…„æ–‡ä»¶ć†…ćźč + * FileWriterćŻčè±Ąæ˜Żä»ŽèźŸć€‡æ–‡ä»¶çł»ç»Ÿć†™ć…„æ–‡ä»¶FileWriterćŻčè±Ąæ˜Żä»ŽèźŸć€‡æ–‡ä»¶çł»ç»Ÿć†™ć…„æ–‡ä»¶çš„äž€ç§æ–čćŒïŒŒç”šæˆ·æłšć†Œè‡Ș深的äș‹ä»¶ç›‘ćŹć™šæ„掄收writestart、progress、write、writeend、error撌abortäș‹ä»¶ă€‚ + * 侀äžȘFileWriterćŻčè±Ąæ˜Żäžș捕äžȘæ–‡ä»¶çš„æ“äœœè€Œćˆ›ć»șă€‚äœ ćŻä»„äœżç”šèŻ„ćŻčè±Ąć€šæŹĄćŻč盾ćș”æ–‡ä»¶èż›èĄŒć†™ć…„æ“äœœă€‚FileWriterç»ŽæŠ€èŻ„æ–‡ä»¶çš„æŒ‡é’ˆäœçœźćŠé•żćșŠć±žæ€§ïŒŒèż™æ ·äœ ć°±ćŻä»„ćŻ»æ‰Ÿć’Œć†™ć…„æ–‡ä»¶çš„ä»»äœ•ćœ°æ–č。 + * é»˜èź€æƒ…ć†”äž‹ïŒŒFileWriterä»Žæ–‡ä»¶çš„ćŒ€ć€ŽćŒ€ć§‹ć†™ć…„ïŒˆć°†èŠ†ç›–çŽ°æœ‰æ•°æźïŒ‰ă€‚FileWriterćŻčè±Ąçš„seekæ–čæł•ćŻèźŸçœźæ–‡ä»¶æ“äœœæŒ‡ćźšäœçœźïŒŒćŠ‚fw.seek(fw.length-1)ć†™ć…„æ“äœœć°±äŒšä»Žæ–‡ä»¶çš„æœ«ć°ŸćŒ€ć§‹ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + FileWriter?: PlusIoFileWriter; + /** + * æ–‡ä»¶çł»ç»ŸćŻčè±ĄïŒŒç”šäșŽçźĄç†ç‰čćźšæœŹćœ°æ–‡ä»¶ç›źćœ• + * æ–‡ä»¶çł»ç»ŸćŻčè±ĄèĄšç€ș侀äžȘćș”ç”šćŻèźżé—źçš„æ čç›źćœ•ă€‚nameć±žæ€§ç”šäșŽæ ‡èŻ†æ­€æ čç›źćœ•çš„ćç§°ïŒŒäžŽLocalFileSystemäž­çš„æ–‡ä»¶çł»ç»Ÿç±»ćž‹äž€äž€ćŻčćș”。rootć±žæ€§äžșæ–‡ä»¶ç›źćœ•ćŻčè±ĄïŒŒç”šäșŽćźžé™…æ“äœœæ–‡ä»¶çł»ç»ŸïŒŒć‚è€ƒDirectoryEntry。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + FileSystem?: PlusIoFileSystem; + /** + * JSONćŻčè±ĄïŒŒèŽ·ć–æ–‡ä»¶æ“äœœçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + Flags?: PlusIoFlags; + /** + * JSONćŻčè±ĄïŒŒäżć­˜æ–‡ä»¶æˆ–ç›źćœ•çš„çŠ¶æ€äżĄæŻćŻčè±Ą + * ćŻé€šèż‡DirectoryEntry或FileEntryćŻčè±Ąçš„getMetaDataæ–čæł•èŽ·ć– + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + Metadata?: PlusIoMetadata; + /** + * æ–‡ä»¶æˆ–ç›źćœ•æ“äœœäș‹ä»¶ćŻčè±Ą + * æ‰€æœ‰æ–‡ä»¶æˆ–ç›źćœ•æ“äœœäș‹ä»¶ć›žè°ƒć‡œæ•°äž­éƒœćˆ›ć»șèŻ„ćŻčè±Ąçš„ćźžäŸ‹ă€‚ + * èŻ„ćŻčè±Ąä»ŽDOMEventç»§æ‰żè€Œæ„ïŒŒćŻé€šèż‡èŻ„ć…¶targetć±žæ€§èŽ·ć–äș‹ä»¶è§Šć‘çš„æ–‡ä»¶æˆ–ç›źćœ•æ“äœœćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + FileEvent?: PlusIoFileEvent; + /** + * æ–‡ä»¶è·ŻćŸ„ç±»ćž‹ + * ćœšæ–‡ä»¶çł»ç»Ÿäž­çš„æ–‡ä»¶è·ŻćŸ„éœ€èœŹæąæˆURLæ ŒćŒïŒŒć·Čæ–čäŸżruntimećż«é€ŸćŠ èœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + URLType?: PlusIoURLType; + /** + * 盾ćŻčè·ŻćŸ„URL + * ćȘèƒœćœšæ‰©ć±•APIäž­äœżç”šïŒŒç›žćŻčäșŽćŸșćș§æäŸ›çš„ç‰čćźšç›źćœ•ïŒŒä»„â€œ_â€ćŒ€ć€Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + RelativeURL?: PlusIoRelativeURL; + /** + * æœŹćœ°è·ŻćŸ„URL + * 揯朹htmléĄ”éąäž­ç›ŽæŽ„èźżé—źæœŹćœ°è”„æșïŒŒä»„“file:///â€ćŒ€ć€ŽïŒŒćŽéąè·Ÿéšçł»ç»Ÿçš„ç»ćŻčè·ŻćŸ„ă€‚ + * 橂ç€ș䟋“file:///D:/res/hello.html”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + LocalURL?: PlusIoLocalURL; + /** + * çœ‘ç»œè·ŻćŸ„URL + * 揯朹htmléĄ”éąäž­ä»„çœ‘ç»œè”„æșæšĄćŒèźżé—źæœŹćœ°è”„æșïŒŒä»„“http://â€ćŒ€ć€ŽïŒŒćŽéąè·Ÿéšç›žćŻčè·ŻćŸ„ă€‚ + * 橂ç€ș䟋“http://localhost:13131/_www/res/icon.pngâ€ïŒŒć…¶äž­â€œ_wwwâ€ć­—æź”ćŻæ”ŻæŒç±»ćž‹äžŽç›žćŻčè·ŻćŸ„URLäž€è‡Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + RemoteURL?: PlusIoRemoteURL; + /** + * ćș”ç”šèżèĄŒè”„æșç›źćœ•ćžžé‡ + * æœŹćœ°æ–‡ä»¶çł»ç»Ÿćžžé‡ïŒŒNumberç±»ćž‹ïŒŒć›șćźšć€Œ1。ćș”ç”šèżèĄŒè”„æșç›źćœ•ïŒŒä»…æœŹćș”ç”šćŻèźżé—źă€‚ + * äžșäș†çĄźäżćș”甚蔄æșçš„ćź‰ć…šæ€§ïŒŒæ­€ç›źćœ•ćȘćŻèŻ»ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + PRIVATE_WWW?: number; + /** + * ćș”ç”šç§æœ‰æ–‡æĄŁç›źćœ•ćžžé‡ + * æœŹćœ°æ–‡ä»¶çł»ç»Ÿćžžé‡ïŒŒNumberç±»ćž‹ïŒŒć›șćźšć€Œ2。ćș”ç”šç§æœ‰æ–‡æĄŁç›źćœ•ïŒŒä»…æœŹćș”ç”šćŻèŻ»ć†™ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + PRIVATE_DOC?: number; + /** + * 繋ćșć…Źç”šæ–‡æĄŁç›źćœ•ćžžé‡ + * æœŹćœ°æ–‡ä»¶çł»ç»Ÿćžžé‡ïŒŒNumberç±»ćž‹ïŒŒć›șćźšć€Œ3。繋ćșć…Źç”šæ–‡æĄŁç›źćœ•ïŒŒæ‰€æœ‰ćș”ç”šćŻèŻ»ć†™ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + PUBLIC_DOCUMENTS?: number; + /** + * 繋ćșć…Źç”šäž‹èœœç›źćœ•ćžžé‡ + * æœŹćœ°æ–‡ä»¶çł»ç»Ÿćžžé‡ïŒŒNumberç±»ćž‹ïŒŒć›șćźšć€Œ4。繋ćșć…Źç”šäž‹èœœç›źćœ•所有ćș”ç”šćŻèŻ»ć†™ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + PUBLIC_DOWNLOADS?: number; + /** + * èŻ·æ±‚æœŹćœ°æ–‡ä»¶çł»ç»ŸćŻčè±Ą + * èŽ·ć–æŒ‡ćźšçš„æ–‡ä»¶çł»ç»ŸïŒŒćŻé€šèż‡typeæŒ‡ćźšèŽ·ć–æ–‡ä»¶çł»ç»Ÿçš„ç±»ćž‹ă€‚ + * èŽ·ć–æŒ‡ćźšçš„æ–‡ä»¶çł»ç»ŸćŻčè±ĄæˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + requestFileSystem(type?: number, succesCB?: (result: PlusIoFileSystem) => void, errorCB?: (result: any) => void): void; + /** + * é€šèż‡URLć‚æ•°èŽ·ć–ç›źćœ•ćŻčè±Ąæˆ–æ–‡ä»¶ćŻčè±Ą + * ćż«é€ŸèŽ·ć–æŒ‡ćźšçš„ç›źćœ•æˆ–æ–‡ä»¶æ“äœœćŻčè±ĄïŒŒćŠ‚é€šèż‡URLć€Œâ€œ_www/test.htmlâ€ćŻç›ŽæŽ„èŽ·ć–æ–‡ä»¶æ“äœœćŻčè±Ąă€‚ + * urlć€ŒćŻæ”ŻæŒç›žćŻčè·ŻćŸ„URLă€æœŹćœ°è·ŻćŸ„URL。 + * èŽ·ć–æŒ‡ćźšçš„æ–‡ä»¶æˆ–ç›źćœ•æ“äœœćŻčè±ĄæˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒćŠ‚æžœæŒ‡ćźšURLè·ŻćŸ„æˆ–æ–‡ä»¶äžć­˜ćœšćˆ™ć€±èŽ„é€šèż‡errorCBć›žè°ƒèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + resolveLocalFileSystemURL(url ?: string, succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; + /** + * ć°†æœŹćœ°URLè·ŻćŸ„èœŹæąæˆćčłć°ç»ćŻčè·ŻćŸ„ + * 绝ćŻčè·ŻćŸ„çŹŠćˆć„ćčłć°æ–‡ä»¶è·ŻćŸ„æ ŒćŒïŒŒé€šćžžç”šäșŽNative.JSè°ƒç”šçł»ç»ŸćŽŸç”Ÿæ–‡ä»¶æ“äœœAPIäčŸćŻä»„ćœšć‰éąæ·»ćŠ â€œfile://”搎朹htmléĄ”éąäž­ç›ŽæŽ„äœżç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + convertLocalFileSystemURL(url?: string): string; + /** + * 氆ćčłć°ç»ćŻčè·ŻćŸ„èœŹæąæˆæœŹćœ°URLè·ŻćŸ„ + * 绝ćŻčè·ŻćŸ„çŹŠćˆć„ćčłć°æ–‡ä»¶è·ŻćŸ„æ ŒćŒïŒŒèœŹæąćŽć˜æˆRelativeURLç±»ćž‹æ ŒćŒă€‚ + * ćŠŸèƒœäžŽconvertLocalFileSystemURLæ–čæł•ç›žćïŒŒć°†ç»ćŻčè·ŻćŸ„èœŹæąæˆç›žćŻčè·ŻćŸ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + convertAbsoluteFileSystem(path?: string): string; +} + +/** + * æ–‡ä»¶çł»ç»Ÿäž­çš„ç›źćœ•ćŻčè±ĄïŒŒç”šäșŽçźĄç†ç‰čćźšçš„æœŹćœ°ç›źćœ• + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ +interface PlusIoDirectoryEntry { + /** + * 操䜜ćŻčè±Ąçš„æ˜ŻćŠäžș文件DirectoryEntryćŻčè±Ąć›șćźšć…¶ć€Œäžșfalse + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + isFile?: boolean; + /** + * 操䜜ćŻčè±Ąæ˜ŻćŠäžșç›źćœ•ïŒŒDirectoryEntryćŻčè±Ąć›șćźšć…¶ć€Œäžștrue + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + isDirectory?: boolean; + /** + * ç›źćœ•æ“äœœćŻčè±Ąçš„ćç§°ïŒŒäžćŒ…æ‹Źè·ŻćŸ„ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + name?: string; + /** + * ç›źćœ•æ“äœœćŻčè±Ąçš„ćźŒæ•Žè·ŻćŸ„ïŒŒæ–‡ä»¶çł»ç»Ÿçš„ç»ćŻčè·ŻćŸ„ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + fullPath?: string; + /** + * 文件操䜜ćŻčè±Ąæ‰€ć±žçš„æ–‡ä»¶çł»ç»ŸćŻčè±ĄïŒŒć‚è€ƒFileSystem + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + fileSystem?: PlusIoFileSystem; + /** + * èŽ·ć–ç›źćœ•çš„ć±žæ€§ + * 甹äșŽèŽ·ć–æ–‡ä»¶æˆ–ç›źćœ•çš„ć±žæ€§äżĄæŻă€‚ + * èŽ·ć–ć±žæ€§äżĄæŻæˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + getMetadata(succesCB?: (result: PlusIoMetadata) => void, errorCB?: (result: any) => void, recursive?: boolean): void; + /** + * ç§»ćŠšç›źćœ• + * ä»„äž‹æƒ…ć†”ç§»ćŠšç›źćœ•ć°†äŒšćŻŒè‡Žć€±èŽ„ïŒš + * ć°†çˆ¶ç›źćœ•ç§»ćŠšćˆ°ć­ç›źćœ•äž­ïŒ› + * èŠç§»ćŠšćˆ°çš„ç›źæ ‡ç›źćœ•æ— æ•ˆïŒ› + * èŠç§»ćŠšćˆ°çš„ç›źæ ‡è·ŻćŸ„èą«æ–‡ä»¶ć ç”šïŒ› + * èŠç§»ćŠšćˆ°çš„ç›źæ ‡ç›źćœ•ć·Čç»ć­˜ćœšćč¶äž”䞍äžșç©ș。 + * ç§»ćŠšç›źćœ•æˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + moveTo(parent?: PlusIoDirectoryEntry, newName?: string, succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; + /** + * æ‹·èŽç›źćœ• + * ä»„äž‹æƒ…ć†”æ‹·èŽç›źćœ•ć°†äŒšćŻŒè‡Žć€±èŽ„ïŒš + * ć°†çˆ¶ç›źćœ•æ‹·èŽćˆ°ć­ç›źćœ•äž­ïŒ› + * èŠæ‹·èŽćˆ°çš„ç›źæ ‡ç›źćœ•æ— æ•ˆïŒ› + * èŠæ‹·èŽćˆ°çš„ç›źæ ‡è·ŻćŸ„èą«æ–‡ä»¶ć ç”šïŒ› + * èŠæ‹·èŽćˆ°çš„ç›źæ ‡ç›źćœ•ć·Čç»ć­˜ćœšćč¶äž”䞍äžșç©ș。 + * æ‹·èŽç›źćœ•æˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + copyTo(parent?: PlusIoDirectoryEntry, newName?: string, succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; + /** + * èŽ·ć–ç›źćœ•è·ŻćŸ„èœŹæąäžșURL朰杀 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + toURL(): string; + /** + * èŽ·ć–ç›źćœ•è·ŻćŸ„èœŹæąäžșæœŹćœ°è·ŻćŸ„URL朰杀 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + toLocalURL(): string; + /** + * èŽ·ć–ç›źćœ•è·ŻćŸ„èœŹæąäžșçœ‘ç»œè·ŻćŸ„URL朰杀 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + toRemoteURL(): string; + /** + * ćˆ é™€ç›źćœ• + * ä»„äž‹æƒ…ć†”ćˆ é™€ç›źćœ•ć°†äŒšćŻŒè‡Žć€±èŽ„ïŒš + * ç›źćœ•äž­ć­˜ćœšæ–‡ä»¶ïŒ› + * ćˆ é™€æ čç›źćœ•ïŒ› + * ćˆ é™€ç›źćœ•æˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + remove(succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; + /** + * èŽ·ć–ç›źćœ•æ‰€ć±žçš„çˆ¶ç›źćœ• + * èŽ·ć–çˆ¶ç›źćœ•æˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + getParent(succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; + /** + * 戛ć»șç›źćœ•èŻ»ć–ćŻčè±Ą + * 戛ć»ș侀äžȘç›źćœ•èŻ»ć–ćŻčè±ĄïŒŒç”šæˆ·èŻ»ć–ç›źäž‹çš„æ–‡ä»¶ćŠć­ç›źćœ•ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + createReader(): PlusIoDirectoryReader; + /** + * 戛ć»șæˆ–æ‰“ćŒ€ć­ç›źćœ• + * 戛ć»șæˆ–æ‰“ćŒ€ćœ“ć‰ç›źćœ•æŒ‡ćźšçš„ç›źćœ•ă€‚ + * 戛ć»șæˆ–æ‰“ćŒ€ç›źćœ•æ“äœœæˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + getDirectory(path?: string, flag?: PlusIoFlags, succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; + /** + * 戛ć»șæˆ–æ‰“ćŒ€æ–‡ä»¶ + * 戛ć»șæˆ–æ‰“ćŒ€ćœ“ć‰ç›źćœ•äž‹æŒ‡ćźšçš„æ–‡ä»¶ă€‚ + * 戛ć»șæˆ–æ‰“ćŒ€æ–‡ä»¶æ“äœœćŻčè±ĄæˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + getFile(path?: string, flag?: PlusIoFlags, succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; + /** + * é€’ćœ’ćˆ é™€ç›źćœ• + * ćˆ é™€ç›źćœ•ć°†äŒšćˆ é™€ć…¶äž‹çš„æ‰€æœ‰æ–‡ä»¶ćŠć­ç›źćœ• + * äžèƒœćˆ é™€æ čç›źćœ•ïŒŒćŠ‚æžœæ“äœœćˆ é™€æ čç›źćœ•ć°†äŒšćˆ é™€ç›źćœ•äž‹çš„æ–‡ä»¶ćŠć­ç›źćœ•ïŒŒäžäŒšćˆ é™€æ čç›źćœ•è‡Șèș«ă€‚ + * ćˆ é™€ç›źćœ•æˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + removeRecursively(succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; +} + +/** + * èŻ»ć–ç›źćœ•äżĄæŻćŻčè±ĄïŒŒç”šäșŽèŽ·ć–ç›źćœ•äž­ćŒ…ć«çš„æ–‡ä»¶ćŠć­ç›źćœ• + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ +interface PlusIoDirectoryReader { + /** + * èŽ·ć–ćœ“ć‰ç›źćœ•äž­çš„æ‰€æœ‰æ–‡ä»¶ć’Œć­ç›źćœ• + * èŽ·ć–ćœ“ć‰ç›źćœ•äž‹çš„æ‰€æœ‰æ–‡ä»¶ć’Œć­ç›źćœ•ă€‚ + * èŽ·ć–æ“äœœæˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + readEntries(succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; +} + +/** + * æ–‡ä»¶çł»ç»Ÿäž­çš„æ–‡ä»¶æ•°æźćŻčè±ĄïŒŒç”šäșŽèŽ·ć–æ–‡ä»¶çš„æ•°æź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ +interface PlusIoFile { + /** + * æ–‡ä»¶æ•°æźćŻčè±Ąçš„æ•°æźć€§ć°ïŒŒć•äœäžșć­—èŠ‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + size?: number; + /** + * æ–‡ä»¶æ•°æźćŻčè±ĄMIME类枋 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + type?: string; + /** + * æ–‡ä»¶æ•°æźćŻčè±Ąçš„ćç§°ïŒŒäžćŒ…æ‹Źè·ŻćŸ„ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + name?: string; + /** + * 文件ćŻčè±Ąçš„æœ€ćŽäżźæ”čæ—¶é—Ž + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + lastModifiedDate?: Date; + /** + * èŽ·ć–æ–‡ä»¶æŒ‡ćźšçš„æ•°æźć†…ćźč + * èŽ·ć–æ–‡ä»¶æŒ‡ćźšçš„æ•°æźć†…ćźčïŒŒć…¶äž­end濅饻性äșŽstart。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + slice(start?: number, end?: number): PlusIoFile; + /** + * ć…łé—­æ–‡ä»¶æ•°æźćŻčè±Ą + * ćœ“æ–‡ä»¶æ•°æźćŻčè±Ąäžć†äœżç”šæ—¶ïŒŒćŻé€šèż‡æ­€æ–čæł•ć…łé—­ïŒŒé‡Šæ”Ÿçł»ç»Ÿè”„æșă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + close(): void; +} + +/** + * æ–‡ä»¶çł»ç»Ÿäž­çš„æ–‡ä»¶ćŻčè±ĄïŒŒç”šäșŽçźĄç†ç‰čćźšçš„æœŹćœ°æ–‡ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ +interface PlusIoFileEntry { + /** + * 文件操䜜ćŻčè±Ąçš„æ˜ŻćŠäžș文件FileEntryćŻčè±Ąć›șćźšć…¶ć€Œäžștrue + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + isFile?: boolean; + /** + * 文件操䜜ćŻčè±Ąæ˜ŻćŠäžșç›źćœ•ïŒŒFileEntryćŻčè±Ąć›șćźšć…¶ć€Œäžșfalse + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + isDirectory?: boolean; + /** + * 文件操䜜ćŻčè±Ąçš„ćç§°ïŒŒäžćŒ…æ‹Źè·ŻćŸ„ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + name?: string; + /** + * 文件操䜜ćŻčè±Ąçš„ćźŒæ•Žè·ŻćŸ„ïŒŒæ–‡ä»¶çł»ç»Ÿçš„ç»ćŻčè·ŻćŸ„ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + fullPath?: string; + /** + * 文件操䜜ćŻčè±Ąæ‰€ć±žçš„æ–‡ä»¶çł»ç»ŸćŻčè±ĄïŒŒć‚è€ƒFileSystem + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + fileSystem?: PlusIoFileSystem; + /** + * èŽ·ć–æ–‡ä»¶çš„ć±žæ€§äżĄæŻ + * 甹äșŽèŽ·ć–æ–‡ä»¶çš„ć±žæ€§äżĄæŻă€‚ + * èŽ·ć–ć±žæ€§äżĄæŻæˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + getMetadata(succesCB?: (result: PlusIoMetadata) => void, errorCB?: (result: any) => void): void; + /** + * ç§»ćŠšæ–‡ä»¶ + * ä»„äž‹æƒ…ć†”ç§»ćŠšç›źćœ•ć°†äŒšćŻŒè‡Žć€±èŽ„ïŒš + * èŠç§»ćŠšćˆ°çš„ç›źæ ‡ç›źćœ•æ— æ•ˆïŒ› + * èŠç§»ćŠšćˆ°çš„ç›źæ ‡è·ŻćŸ„èą«ć…¶ćźƒæ–‡ä»¶ć ç”šïŒ› + * ç§»ćŠšæ–‡ä»¶æˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + moveTo(parent?: PlusIoDirectoryEntry, newName?: string, succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; + /** + * 拷莝文件 + * ä»„äž‹æƒ…ć†”æ‹·èŽæ–‡ä»¶ć°†äŒšćŻŒè‡Žć€±èŽ„ïŒš + * èŠæ‹·èŽćˆ°çš„ç›źæ ‡ç›źćœ•æ— æ•ˆïŒ› + * èŠæ‹·èŽćˆ°çš„ç›źæ ‡è·ŻćŸ„èą«ć…¶ćźƒæ–‡ä»¶ć ç”šïŒ› + * æ‹·èŽæ–‡ä»¶æˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + copyTo(parent?: PlusIoDirectoryEntry, newName?: string, succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; + /** + * èŽ·ć–æ–‡ä»¶è·ŻćŸ„èœŹæąäžșURL朰杀 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + toURL(): string; + /** + * èŽ·ć–æ–‡ä»¶è·ŻćŸ„èœŹæąäžșæœŹćœ°è·ŻćŸ„URL朰杀 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + toLocalURL(): string; + /** + * èŽ·ć–æ–‡ä»¶è·ŻćŸ„èœŹæąäžșçœ‘ç»œè·ŻćŸ„URL朰杀 + * URLćœ°ć€æ ŒćŒäžș仄“http://localhost:13131/â€ćŒ€ć€Žçš„çœ‘ç»œè·ŻćŸ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + toRemoteURL(): string; + /** + * ćˆ é™€æ–‡ä»¶ + * ćˆ é™€æ–‡ä»¶æˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + remove(succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; + /** + * èŽ·ć–æ–‡ä»¶æ‰€ć±žçš„çˆ¶ç›źćœ• + * èŽ·ć–çˆ¶ç›źćœ•æˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + getParent(succesCB?: (result: PlusIoDirectoryEntry) => void, errorCB?: (result: any) => void): void; + /** + * èŽ·ć–æ–‡ä»¶ć…łè”çš„ć†™æ–‡ä»¶æ“äœœćŻčè±ĄFileWriter + * èŽ·ć–ć†™æ–‡ä»¶æ“äœœćŻčè±ĄæˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + createWriter(succesCB?: (result: PlusIoFileWriter) => void, errorCB?: (result: any) => void): void; + /** + * èŽ·ć–æ–‡ä»¶æ•°æźćŻčè±Ą + * èŽ·ć–æ–‡ä»¶æ•°æźćŻčè±ĄæˆćŠŸé€šèż‡succesCBć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + file(succesCB?: (result: PlusIoFile) => void, errorCB?: (result: any) => void): void; +} + +/** + * æ–‡ä»¶çł»ç»Ÿäž­çš„èŻ»ć–æ–‡ä»¶ćŻčè±ĄïŒŒç”šäșŽèŽ·ć–æ–‡ä»¶çš„ć†…ćźč + * FileReaderćŻčè±Ąæ˜Żä»ŽèźŸć€‡æ–‡ä»¶çł»ç»ŸèŻ»ć–æ–‡ä»¶FileReaderćŻčè±Ąæ˜Żä»ŽèźŸć€‡æ–‡ä»¶çł»ç»ŸèŻ»ć–æ–‡ä»¶çš„äž€ç§æ–čćŒïŒŒæ–‡ä»¶ä»„æ–‡æœŹæˆ–è€…Base64çŒ–ç çš„ć­—çŹŠäžČćœąćŒèŻ»ć‡șæ„ă€‚ + * ç”šæˆ·æłšć†Œè‡Ș深的äș‹ä»¶ç›‘ćŹć™šæ„掄收loadstart、progress、load、loadend、error撌abortäș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ +interface PlusIoFileReader { + /** + * ć€Œäžș0ïŒŒćŒ€ć§‹èŻ»ć–æ–‡ä»¶çŠ¶æ€ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + EMPTY?: number; + /** + * ć€Œäžș1ïŒŒæ­ŁćœšèŻ»ć–æ–‡ä»¶çŠ¶æ€ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + LOADING?: number; + /** + * ć€Œäžș2ïŒŒèŻ»æ–‡ä»¶æ“äœœćźŒæˆçŠ¶æ€ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + DONE?: number; + /** + * ćœ“ć‰èŻ»ć–æ–‡ä»¶æ‰€ć€„çš„çŠ¶æ€ + * 揯揖侊靱漚äč‰çš„ćžžé‡ć€ŒïŒŒEMPTY0ïŒ‰ă€LOADING1ïŒ‰ă€DONE2ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + readyState?: number; + /** + * ć·ČèŻ»ć–æ–‡ä»¶çš„ć†…ćźč + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + result?: string; + /** + * æ–‡ä»¶æ“äœœé”™èŻŻä»Łç  + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + error?: number; + /** + * èŻ»ć–æ–‡ä»¶ćŒ€ć§‹æ—¶çš„ć›žè°ƒć‡œæ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + onloadstart?: (result: PlusIoFileEvent) => void; + /** + * èŻ»ć–æ–‡ä»¶èż‡çš‹äž­çš„ć›žè°ƒć‡œæ•° + * 甹äșŽèŽ·ć–æ–‡ä»¶èŻ»ć–èż›ćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + onprogress?: (result: PlusIoFileEvent) => void; + /** + * èŻ»ć–æ–‡ä»¶æˆćŠŸćźŒæˆçš„ć›žè°ƒć‡œæ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + onload?: (result: PlusIoFileEvent) => void; + /** + * ć–æ¶ˆèŻ»ć–æ–‡ä»¶æ—¶çš„ć›žè°ƒć‡œæ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + onabort?: (result: PlusIoFileEvent) => void; + /** + * æ–‡ä»¶èŻ»ć–æ“äœœć€±èŽ„æ—¶è°ƒç”šçš„ć›žè°ƒć‡œæ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + onerror?: (result: PlusIoFileEvent) => void; + /** + * æ–‡ä»¶èŻ»ć–æ“äœœćźŒæˆæ—¶çš„ć›žè°ƒć‡œæ•° + * äžçźĄæˆćŠŸæˆ–ć€±èŽ„éƒœäŒšè§Šć‘ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + onloadend?: (result: PlusIoFileEvent) => void; + /** + * ç»ˆæ­ąæ–‡ä»¶èŻ»ć–æ“äœœ + * èŻ»ć–æ–‡ä»¶æ“äœœćŒ€ć§‹ćŽïŒŒćŻé€šèż‡æ­€æ–čæł•ć–æ¶ˆèŻ»ć–æ–‡ä»¶ă€‚ + * 调甚歀æ–čæł•ćŽć°†è§Šć‘æ–‡ä»¶èŻ»ć–ćŻčè±Ąçš„onabortäș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + abort(): void; + /** + * 仄URLçŒ–ç æ ŒćŒèŻ»ć–æ–‡ä»¶æ•°æźć†…ćźč + * èŻ»ć–æ–‡ä»¶çš„æ•°æźć†…ćźčćč¶ć°†æ•°æźć†…ćźčèż›èĄŒURLçŒ–ç ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + readAsDataURL(file?: PlusIoFile, encoding ?: string): void; + /** + * ä»„æ–‡æœŹæ ŒćŒèŻ»ć–æ–‡ä»¶æ•°æźć†…ćźč + * èŻ»ć–æ–‡ä»¶çš„æ•°æźć†…ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + readAsText(file?: PlusIoFile, encoding ?: string): void; +} + +/** + * æ–‡ä»¶çł»ç»Ÿäž­çš„ć†™æ–‡ä»¶ćŻčè±ĄïŒŒç”šäșŽć†™ć…„æ–‡ä»¶ć†…ćźč + * FileWriterćŻčè±Ąæ˜Żä»ŽèźŸć€‡æ–‡ä»¶çł»ç»Ÿć†™ć…„æ–‡ä»¶FileWriterćŻčè±Ąæ˜Żä»ŽèźŸć€‡æ–‡ä»¶çł»ç»Ÿć†™ć…„æ–‡ä»¶çš„äž€ç§æ–čćŒïŒŒç”šæˆ·æłšć†Œè‡Ș深的äș‹ä»¶ç›‘ćŹć™šæ„掄收writestart、progress、write、writeend、error撌abortäș‹ä»¶ă€‚ + * 侀äžȘFileWriterćŻčè±Ąæ˜Żäžș捕äžȘæ–‡ä»¶çš„æ“äœœè€Œćˆ›ć»șă€‚äœ ćŻä»„äœżç”šèŻ„ćŻčè±Ąć€šæŹĄćŻč盾ćș”æ–‡ä»¶èż›èĄŒć†™ć…„æ“äœœă€‚FileWriterç»ŽæŠ€èŻ„æ–‡ä»¶çš„æŒ‡é’ˆäœçœźćŠé•żćșŠć±žæ€§ïŒŒèż™æ ·äœ ć°±ćŻä»„ćŻ»æ‰Ÿć’Œć†™ć…„æ–‡ä»¶çš„ä»»äœ•ćœ°æ–č。 + * é»˜èź€æƒ…ć†”äž‹ïŒŒFileWriterä»Žæ–‡ä»¶çš„ćŒ€ć€ŽćŒ€ć§‹ć†™ć…„ïŒˆć°†èŠ†ç›–çŽ°æœ‰æ•°æźïŒ‰ă€‚FileWriterćŻčè±Ąçš„seekæ–čæł•ćŻèźŸçœźæ–‡ä»¶æ“äœœæŒ‡ćźšäœçœźïŒŒćŠ‚fw.seek(fw.length-1)ć†™ć…„æ“äœœć°±äŒšä»Žæ–‡ä»¶çš„æœ«ć°ŸćŒ€ć§‹ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ +interface PlusIoFileWriter { + /** + * ć€Œäžș0ïŒŒć†™æ–‡ä»¶ćˆć§‹ćŒ–çŠ¶æ€ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + INIT?: number; + /** + * ć€Œäžș1ïŒŒæ­Łćœšć†™ć…„æ–‡ä»¶çŠ¶æ€ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + WRITING?: number; + /** + * ć€Œäžș2ïŒŒć†™æ–‡ä»¶æ“äœœćźŒæˆçŠ¶æ€ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + DONE?: number; + /** + * ćœ“ć‰ć†™ć…„æ–‡ä»¶æ‰€ć€„çš„çŠ¶æ€ + * 揯揖侊靱漚äč‰çš„ćžžé‡ć€ŒïŒŒINIT(0)、WRITING1ïŒ‰ă€DONE2ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + readyState?: number; + /** + * æ–‡ä»¶ćœ“ć‰çš„é•żćșŠïŒŒć•䜍äžșć­—èŠ‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + length?: number; + /** + * æ–‡ä»¶ćœ“ć‰æ“äœœçš„æŒ‡é’ˆäœçœź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + position?: number; + /** + * æ–‡ä»¶ć†™ć…„æ“äœœé”™èŻŻä»Łç  + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + error?: number; + /** + * ć†™ć…„æ–‡ä»¶ćŒ€ć§‹æ—¶çš„ć›žè°ƒć‡œæ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + onwritestart?: (result: PlusIoFileEvent) => void; + /** + * ć†™ć…„æ–‡ä»¶èż‡çš‹äž­çš„ć›žè°ƒć‡œæ•° + * 甹äșŽèŽ·ć–æ–‡ä»¶èŻ»ć–èż›ćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + onprogress?: (result: PlusIoFileEvent) => void; + /** + * ć†™ć…„æ–‡ä»¶æˆćŠŸćźŒæˆçš„ć›žè°ƒć‡œæ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + onwrite?: (result: PlusIoFileEvent) => void; + /** + * ć–æ¶ˆć†™ć…„æ–‡ä»¶æ—¶çš„ć›žè°ƒć‡œæ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + onabort?: (result: PlusIoFileEvent) => void; + /** + * æ–‡ä»¶ć†™ć…„æ“äœœć€±èŽ„æ—¶è°ƒç”šçš„ć›žè°ƒć‡œæ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + onerror?: (result: PlusIoFileEvent) => void; + /** + * æ–‡ä»¶ć†™ć…„æ“äœœćźŒæˆæ—¶çš„ć›žè°ƒć‡œæ•° + * äžçźĄæˆćŠŸæˆ–ć€±èŽ„éƒœäŒšè§Šć‘ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + onwriteend?: (result: PlusIoFileEvent) => void; + /** + * ç»ˆæ­ąæ–‡ä»¶ć†™ć…„æ“äœœ + * ć†™ć…„æ–‡ä»¶æ•°æźæ“äœœćŒ€ć§‹ćŽïŒŒćŻé€šèż‡æ­€æ–čæł•ć–æ¶ˆć†™ć…„æ–‡ä»¶æ•°æźæ“äœœă€‚ + * 调甚歀æ–čæł•ćŽć°†è§Šć‘æ–‡ä»¶ć†™ć…„ćŻčè±Ąçš„onabortäș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + abort(): void; + /** + * ćźšäœæ–‡ä»¶æ“äœœäœçœź + * ćźšäœæ–‡ä»¶çš„æ“äœœäœçœźïŒŒæœ‰æ•ˆć€Œäžș0ćˆ°æ–‡ä»¶çš„æ€»é•żćșŠć‡1。 + * 0èĄšç€șæ–‡ä»¶çš„è”·ć§‹äœçœźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + seek(position?: number): void; + /** + * æŒ‰ç…§æŒ‡ćźšé•żćșŠæˆȘ断文件 + * ä»Žæ–‡ä»¶ćœ“ć‰ćźšäœçš„äœçœźćŒ€ć§‹ïŒŒæŒ‰ç…§æŒ‡ćźšé•żćșŠæˆȘæ–­æ–‡ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + truncate(length ?: number): void; + /** + * ć‘æ–‡ä»¶äž­ć†™ć…„æ•°æź + * ä»Žæ–‡ä»¶ćœ“ć‰ćźšäœçš„äœçœźćŒ€ć§‹ïŒŒć†™ć…„æ•°æźćˆ°æ–‡ä»¶äž­ă€‚ + * ćŠ‚æžœæ–‡ä»¶äž­ć·Čç»ć­˜ćœšæ•°æźïŒŒæ–°ć†™ć…„çš„æ•°æźć°†èŠ†ç›–ć·Čæœ‰æ•°æźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + write(data ?: string): void; +} + +/** + * æ–‡ä»¶çł»ç»ŸćŻčè±ĄïŒŒç”šäșŽçźĄç†ç‰čćźšæœŹćœ°æ–‡ä»¶ç›źćœ• + * æ–‡ä»¶çł»ç»ŸćŻčè±ĄèĄšç€ș侀äžȘćș”ç”šćŻèźżé—źçš„æ čç›źćœ•ă€‚nameć±žæ€§ç”šäșŽæ ‡èŻ†æ­€æ čç›źćœ•çš„ćç§°ïŒŒäžŽLocalFileSystemäž­çš„æ–‡ä»¶çł»ç»Ÿç±»ćž‹äž€äž€ćŻčćș”。rootć±žæ€§äžșæ–‡ä»¶ç›źćœ•ćŻčè±ĄïŒŒç”šäșŽćźžé™…æ“äœœæ–‡ä»¶çł»ç»ŸïŒŒć‚è€ƒDirectoryEntry。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ +interface PlusIoFileSystem { + /** + * æ–‡ä»¶çł»ç»Ÿçš„ćç§° + * ć€Œäžșæ–‡ä»¶çł»ç»Ÿç±»ćž‹ćžžé‡ć€Œć­—çŹŠäžČïŒŒćŠ‚â€œPRIVATE_WWW”、“PRIVATE_DOCUMENTS”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + name?: string; + /** + * æ–‡ä»¶çł»ç»Ÿçš„æ čç›źćœ• + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + root?: PlusIoDirectoryEntry; +} + +/** + * JSONćŻčè±ĄïŒŒèŽ·ć–æ–‡ä»¶æ“äœœçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ +interface PlusIoFlags { + /** + * æ˜ŻćŠćˆ›ć»șćŻčè±Ąæ ‡èź° + * 指ç€șćŠ‚æžœæ–‡ä»¶æˆ–ç›źćœ•äžć­˜ćœšæ—¶æ˜ŻćŠèż›èĄŒćˆ›ć»șïŒŒé»˜èź€ć€Œäžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + create?: boolean; + /** + * ćć‘æ“äœœæ ‡èź° + * ć…¶æœŹèș«æČĄæœ‰ä»»äœ•效果需䞎createć±žæ€§ć€ŒèźŸçœźäžștrueæ—¶äž€è”·äœżç”šïŒŒćŠ‚æžœç›źæ ‡æ–‡ä»¶æˆ–ç›źćœ•ć·Čç»ć­˜ćœšćˆ™äŒšćŻŒè‡Žæ–‡ä»¶æˆ–ç›źćœ•æ‰“ćŒ€ć€±èŽ„ïŒŒé»˜èź€ć€Œäžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + exclusive?: boolean; +} + +/** + * JSONćŻčè±ĄïŒŒäżć­˜æ–‡ä»¶æˆ–ç›źćœ•çš„çŠ¶æ€äżĄæŻćŻčè±Ą + * ćŻé€šèż‡DirectoryEntry或FileEntryćŻčè±Ąçš„getMetaDataæ–čæł•èŽ·ć– + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ +interface PlusIoMetadata { + /** + * æ–‡ä»¶æˆ–ç›źćœ•çš„æœ€ćŽäżźæ”čæ—¶é—Ž + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + modificationTime?: Date; + /** + * æ–‡ä»¶çš„ć€§ć° + * è‹„èŽ·ć–çš„æ˜Żç›źćœ•ćŻčè±Ąçš„ć±žæ€§ćˆ™ć€Œäžș0。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + size?: number; + /** + * ćŒ…ć«çš„ć­ç›źćœ•æ•° + * è‹„è‡Șèș«æ˜Żæ–‡ä»¶ćˆ™ć…¶ć€Œäžș0。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + directoryCount?: number; + /** + * ç›źćœ•çš„æ–‡ä»¶æ•° + * è‹„è‡Șèș«æ˜Żæ–‡ä»¶ćˆ™ć…¶ć€Œäžș0。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + fileCount?: number; +} + +/** + * æ–‡ä»¶æˆ–ç›źćœ•æ“äœœäș‹ä»¶ćŻčè±Ą + * æ‰€æœ‰æ–‡ä»¶æˆ–ç›źćœ•æ“äœœäș‹ä»¶ć›žè°ƒć‡œæ•°äž­éƒœćˆ›ć»șèŻ„ćŻčè±Ąçš„ćźžäŸ‹ă€‚ + * èŻ„ćŻčè±Ąä»ŽDOMEventç»§æ‰żè€Œæ„ïŒŒćŻé€šèż‡èŻ„ć…¶targetć±žæ€§èŽ·ć–äș‹ä»¶è§Šć‘çš„æ–‡ä»¶æˆ–ç›źćœ•æ“äœœćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ +interface PlusIoFileEvent { + /** + * æ–‡ä»¶æˆ–ç›źćœ•æ“äœœćŻčè±Ą + * ćœšäžćŒçš„ć›žè°ƒäž­æŒ‡ć‘çš„ćŻčè±ĄäžćŒïŒŒćŻæŒ‡ć‘çš„ćŻčè±ĄćŒ…æ‹ŹïŒšFileEntry、DirectoryEntry、FileReader、FileWriter。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + target?: PlusIoDirectoryEntry; +} + +/** + * æ–‡ä»¶è·ŻćŸ„ç±»ćž‹ + * ćœšæ–‡ä»¶çł»ç»Ÿäž­çš„æ–‡ä»¶è·ŻćŸ„éœ€èœŹæąæˆURLæ ŒćŒïŒŒć·Čæ–čäŸżruntimećż«é€ŸćŠ èœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ +interface PlusIoURLType { + /** + * 盾ćŻčè·ŻćŸ„URL + * ćȘèƒœćœšæ‰©ć±•APIäž­äœżç”šïŒŒç›žćŻčäșŽćŸșćș§æäŸ›çš„ç‰čćźšç›źćœ•ïŒŒä»„â€œ_â€ćŒ€ć€Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + RelativeURL?: PlusIoRelativeURL; + /** + * æœŹćœ°è·ŻćŸ„URL + * 揯朹htmléĄ”éąäž­ç›ŽæŽ„èźżé—źæœŹćœ°è”„æșïŒŒä»„“file:///â€ćŒ€ć€ŽïŒŒćŽéąè·Ÿéšçł»ç»Ÿçš„ç»ćŻčè·ŻćŸ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + LocalURL?: PlusIoLocalURL; + /** + * çœ‘ç»œè·ŻćŸ„URL + * 揯朹htmléĄ”éąäž­ä»„çœ‘ç»œè”„æșæšĄćŒèźżé—źæœŹćœ°è”„æșïŒŒä»„“http://â€ćŒ€ć€ŽïŒŒćŽéąè·Ÿéšç›žćŻčè·ŻćŸ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + RomoteURL?: string; +} + +/** + * 盾ćŻčè·ŻćŸ„URL + * ćȘèƒœćœšæ‰©ć±•APIäž­äœżç”šïŒŒç›žćŻčäșŽćŸșćș§æäŸ›çš„ç‰čćźšç›źćœ•ïŒŒä»„â€œ_â€ćŒ€ć€Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ +interface PlusIoRelativeURL { + /** + * ćș”甚蔄æșç›źćœ• + * 保歘ćș”甚的所有html、css、js等蔄æșæ–‡ä»¶ïŒŒäžŽæ–‡ä»¶çł»ç»Ÿäž­æ čç›źćœ•PRIVATE_WWWäž€è‡ŽïŒŒćŽéąćŠ ç›žćŻčè·ŻćŸ„ćŠ‚â€œ_www/res/icon.png”。 + * æłšæ„ïŒšćș”甚蔄æșç›źćœ•æ˜ŻćȘèŻ»ç›źćœ•ïŒŒćȘèƒœèŻ»ć–æŹĄç›źćœ•äž‹çš„æ–‡ä»¶ïŒŒäžèƒœäżźæ”č或新ć»ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + _www?: string; + /** + * ćș”ç”šç§æœ‰æ–‡æĄŁç›źćœ• + * 甹äșŽäżć­˜ćș”ç”šèżèĄŒæœŸäžšćŠĄé€»èŸ‘æ•°æźïŒŒäžŽæ–‡ä»¶çł»ç»Ÿäž­æ čç›źćœ•PRIVATE_DOCUMENTSïŒŒćŠ‚â€œ_doc/userdata.xml”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + _doc?: string; + /** + * 繋ćșć…Źç”šæ–‡æĄŁç›źćœ• + * 甹äșŽäżć­˜çš‹ćșäž­ć„ćș”ç”šé—ŽćŻć…±äș«æ–‡ä»¶çš„ç›źćœ•ïŒŒäžŽæ–‡ä»¶çł»ç»Ÿäž­æ čç›źćœ•PUBLIC_DOCUMENTSïŒŒćŠ‚â€œ_document/share.doc”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + _documents?: string; + /** + * 繋ćșć…Źç”šäž‹èœœç›źćœ• + * 甹äșŽäżć­˜çš‹ćșäž‹èœœæ–‡ä»¶çš„ç›źćœ•ïŒŒäžŽæ–‡ä»¶çł»ç»Ÿäž­æ čç›źćœ•PUBLIC_DOWNLOADSïŒŒćŠ‚â€œ_download/mydoc.doc”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ + _downloads?: string; +} + +/** + * æœŹćœ°è·ŻćŸ„URL + * 揯朹htmléĄ”éąäž­ç›ŽæŽ„èźżé—źæœŹćœ°è”„æșïŒŒä»„“file:///â€ćŒ€ć€ŽïŒŒćŽéąè·Ÿéšçł»ç»Ÿçš„ç»ćŻčè·ŻćŸ„ă€‚ + * 橂ç€ș䟋“file:///D:/res/hello.html”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ +type PlusIoLocalURL = any; +/** + * çœ‘ç»œè·ŻćŸ„URL + * 揯朹htmléĄ”éąäž­ä»„çœ‘ç»œè”„æșæšĄćŒèźżé—źæœŹćœ°è”„æșïŒŒä»„“http://â€ćŒ€ć€ŽïŒŒćŽéąè·Ÿéšç›žćŻčè·ŻćŸ„ă€‚ + * 橂ç€ș䟋“http://localhost:13131/_www/res/icon.pngâ€ïŒŒć…¶äž­â€œ_wwwâ€ć­—æź”ćŻæ”ŻæŒç±»ćž‹äžŽç›žćŻčè·ŻćŸ„URLäž€è‡Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/io.html](http://www.html5plus.org/doc/zh_cn/io.html) + */ +type PlusIoRemoteURL = any; + +/** + * Native.js for iOSć°èŁ…äž€æĄé€šèż‡JSèŻ­æł•ç›ŽæŽ„è°ƒç”šNative Objective-CæŽ„ćŁé€šé“ïŒŒé€šèż‡plus.iosćŻè°ƒç”šć‡ äčŽæ‰€æœ‰çš„çł»ç»ŸAPI。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ios.html](http://www.html5plus.org/doc/zh_cn/ios.html) + */ +interface PlusIos { + /** + * Objective-Cç±»ćŻčè±Ą + * Objective-Cç±»ćŻčè±ĄïŒŒćŻé€šèż‡ć…¶ć±žæ€§èŽ·ć–ç±»çš„ćžžé‡ïŒŒćŻé€šèż‡æ–čæł•杄操䜜类的静态æ–čæł•äčŸé€šèż‡newæ–čæł•æ„ćˆ›ć»șç±»çš„ćźžäŸ‹ćŻčè±Ąă€‚ + * ćŻčäșŽç±»çš„静态æ–čæł•ïŒŒćˆ™ç›ŽæŽ„é€šèż‡.ćŽéąè·Ÿéšæ–čæł•ćç§°è°ƒç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ios.html](http://www.html5plus.org/doc/zh_cn/ios.html) + */ + ClassObject?: PlusIosClassObject; + /** + * Objective-CćźžäŸ‹ćŻčè±Ą + * Objective-CćźžäŸ‹ćŻčè±ĄïŒŒćŻé€šèż‡ć…¶æ–čæł•杄操䜜ç€șäŸ‹çš„ć˜é‡ć’Œæ–čæł•。 + * æłšæ„ïŒšćż…éĄ»é€šèż‡plusGetAttribute()æ–čæł•èŻ»ć–ç€ș䟋ćŻčè±Ąçš„ć±žæ€§ć€ŒïŒŒé€šèż‡plusSetAttribute()æ–čæł•èźŸçœźç€ș䟋ćŻčè±Ąçš„ć±žæ€§ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ios.html](http://www.html5plus.org/doc/zh_cn/ios.html) + */ + InstanceObject?: PlusIosInstanceObject; + /** + * ćŻŒć…„Objective-Cç±»ćŻčè±Ą + * ćŻŒć…„ç±»ćŻčè±ĄćŽïŒŒć°±ćŻä»„é€šèż‡.æ“äœœçŹŠç›ŽæŽ„è°ƒç”šćŻčè±ĄïŒˆç±»ćŻčè±Ą/ćźžäŸ‹ćŻčè±ĄïŒ‰çš„æ–čæł•。 + * é€šèż‡.æ“äœœçŹŠć·è°ƒç”šæ–čæł•æ—¶ïŒŒäžéœ€èŠäœżç”š":"æ„ćˆ†ć‰Čć‚æ•°ă€‚ + * æłšæ„ïŒšćŻŒć…„ç±»ćŻčè±Ąć°†äŒšæ¶ˆè€—èŸƒć€šçš„çł»ç»Ÿè”„æșïŒŒäžćș”èŻ„ćŻŒć…„èż‡ć€šçš„ç±»ćŻčè±ĄïŒŒćŻä»„äœżç”šplus.ios.invoke()杄调甚æœȘćŻŒć…„ç±»ćźžäŸ‹ćŻčè±Ąçš„æ–čæł•。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ios.html](http://www.html5plus.org/doc/zh_cn/ios.html) + */ + importClass(classname?: string): PlusIosClassObject; + /** + * 戛ć»șćźžäŸ‹ćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ios.html](http://www.html5plus.org/doc/zh_cn/ios.html) + */ + newObject(classname?: string, args?: any): PlusIosInstanceObject; + /** + * é”€æŻćźžäŸ‹ćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ios.html](http://www.html5plus.org/doc/zh_cn/ios.html) + */ + deleteObject(obj?: any): void; + /** + * 调甚ćŻčè±ĄïŒˆç±»ćŻčè±Ą/ç€ș䟋ćŻčè±ĄïŒ‰çš„æ–čæł• + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ios.html](http://www.html5plus.org/doc/zh_cn/ios.html) + */ + invoke(obj?: PlusIosInstanceObject, name?: string, args?: any): any; + /** + * 柞现代理的æ–čæł• + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ios.html](http://www.html5plus.org/doc/zh_cn/ios.html) + */ + implements(name?: string, obj?: any): PlusIosInstanceObject; + /** + * èŽ·ć–ćœ“ć‰WebviewçȘ—揣ćŻčè±Ąçš„native求UIWebviewćźžäŸ‹ćŻčè±Ą + * UIWebviewćŻčè±Ąçš„APIèŻ·ć‚è€ƒApplećŒ€ć‘æ–‡æĄŁ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ios.html](http://www.html5plus.org/doc/zh_cn/ios.html) + */ + currentWebview(): PlusIosInstanceObject; +} + +/** + * Objective-Cç±»ćŻčè±Ą + * Objective-Cç±»ćŻčè±ĄïŒŒćŻé€šèż‡ć…¶ć±žæ€§èŽ·ć–ç±»çš„ćžžé‡ïŒŒćŻé€šèż‡æ–čæł•杄操䜜类的静态æ–čæł•äčŸé€šèż‡newæ–čæł•æ„ćˆ›ć»șç±»çš„ćźžäŸ‹ćŻčè±Ąă€‚ + * ćŻčäșŽç±»çš„静态æ–čæł•ïŒŒćˆ™ç›ŽæŽ„é€šèż‡.ćŽéąè·Ÿéšæ–čæł•ćç§°è°ƒç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ios.html](http://www.html5plus.org/doc/zh_cn/ios.html) + */ +type PlusIosClassObject = any; + +/** + * Objective-CćźžäŸ‹ćŻčè±Ą + * Objective-CćźžäŸ‹ćŻčè±ĄïŒŒćŻé€šèż‡ć…¶æ–čæł•杄操䜜ç€șäŸ‹çš„ć˜é‡ć’Œæ–čæł•。 + * æłšæ„ïŒšćż…éĄ»é€šèż‡plusGetAttribute()æ–čæł•èŻ»ć–ç€ș䟋ćŻčè±Ąçš„ć±žæ€§ć€ŒïŒŒé€šèż‡plusSetAttribute()æ–čæł•èźŸçœźç€ș䟋ćŻčè±Ąçš„ć±žæ€§ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ios.html](http://www.html5plus.org/doc/zh_cn/ios.html) + */ +interface PlusIosInstanceObject { + /** + * èŽ·ć–Objective-CćźžäŸ‹ćŻčè±Ąçš„ć±žæ€§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ios.html](http://www.html5plus.org/doc/zh_cn/ios.html) + */ + plusGetAttribute(name?: string): any; + /** + * èźŸçœźObjective-Cç€ș䟋ćŻčè±Ąçš„ć±žæ€§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/ios.html](http://www.html5plus.org/doc/zh_cn/ios.html) + */ + plusSetAttribute(name?: string, value?: any): void; +} + +/** + * KeyçźĄç†èźŸć€‡æŒ‰é”źäș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ +interface PlusKey { + /** + * æŒ‰é”źç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ + KeyType?: PlusKeyKeyType; + /** + * æŒ‰é”źäș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ + KeyEvent?: PlusKeyKeyEvent; + /** + * æ·»ćŠ æŒ‰é”źäș‹ä»¶ç›‘搏晚 + * æ·»ćŠ æŒ‰é”źäș‹ä»¶ç›‘ćŹć™šïŒŒćœ“æŒ‡ćźšçš„æŒ‰é”źäș‹ä»¶ć‘ç”Ÿæ—¶ïŒŒć›žè°ƒć‡œæ•°ć°†è§Šć‘ă€‚ + * ćș”ç”šäž­ć­˜ćœšć€šäžȘWebviewçȘ—ćŁæ—¶ïŒŒæŒ‰ç…§çȘ—ćŁçš„æ˜Ÿç€ș栈éĄșćșä»ŽćŽćŸ€ć‰æŸ„æ‰ŸïŒŒæŸ„æ‰Ÿćˆ°æ·»ćŠ æŒ‰é”źäș‹ä»¶ç›‘搏晚的çȘ—ćŁćŽćœæ­ąïŒˆäž­æ–­ć‰éąWebviewçȘ—揣ćŻčæŒ‰é”źäș‹ä»¶çš„ç›‘ćŹïŒ‰ïŒŒćč¶ć‘çȘ—ćŁè§Šć‘æ‰§èĄŒæŒ‰é”źć›žè°ƒäș‹ä»¶ă€‚ + * 朹搌侀WebviewçȘ—ćŁäž­ćŻć€šæŹĄè°ƒç”šæ­€æ–čæł•ćŻč搌侀äș‹ä»¶æ·»ćŠ ć€šäžȘç›‘ćŹć™šïŒŒè§Šć‘æ—¶æŒ‰ç…§æ·»ćŠ çš„éĄșćșć…ˆćŽè°ƒç”šă€‚ + * æłšæ„ïŒšæ­€æ–čæł•æ— æł•ç›‘ćŹèœŻé”źç›˜çš„æŒ‰é”źäș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ + addEventListener(event?: PlusKeyKeyType, listener?: (result: PlusKeyKeyEvent) => void, capture?: boolean): void; + /** + * éšè—èœŻé”źç›˜ + * 隐藏ć·Č经星ç€șçš„èœŻé”źç›˜ïŒŒćŠ‚æžœèœŻé”źç›˜æČĄæœ‰æ˜Ÿç€șćˆ™äžćšä»»äœ•æ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ + hideSoftKeybord(): void; + /** + * èźŸçœźèŸ…ćŠ©èŸ“ć…„ç±»ćž‹ + * input的type类枋äžștextèŽ·ć–ç„Šç‚čæ—¶ïŒŒćœšèœŻé”źç›˜äžŠæ–č星ç€șèŸ…ćŠ©èŸ“ć…„æĄæ–čäŸżç”šæˆ·ćż«é€ŸèŸ“ć…„ă€‚ + * ćœšéĄ”éąäž­inputçŒ–èŸ‘æĄ†typeç±»ćž‹äžäžș"tel"、"email"时生效typeäžștelç±»ćž‹æ—¶äž€ćźšæ˜Ÿç€ștelçš„èŸ…ćŠ©èŸ“ć…„æĄïŒŒtypeäžșemailæ—¶äž€ćźšæ˜Ÿç€șemailçš„èŸ…ćŠ©èŸ“ć…„æĄïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ + setAssistantType(type?: string): void; + /** + * 星ç€șèœŻé”źç›˜ + * ćŒșćˆ¶æ˜Ÿç€șçł»ç»ŸèœŻé”źç›˜ïŒŒćŠ‚æžœèœŻé”źç›˜ć·Č经星ç€șćˆ™äžćšä»»äœ•æ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ + showSoftKeybord(): void; + /** + * ç§»é™€æŒ‰é”źäș‹ä»¶ç›‘搏晚 + * 从çȘ—ćŁç§»é™€æŒ‡ćźšçš„äș‹ä»¶ç›‘ćŹć™šă€‚è‹„æČĄæœ‰æŸ„æ‰Ÿćˆ°ćŻčćș”çš„äș‹ä»¶ç›‘ćŹć™šïŒŒćˆ™æ— ä»»äœ•äœœç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ + removeEventListener(event?: PlusKeyKeyType, listener?: (result: PlusKeyKeyEvent) => void): void; +} + +/** + * æŒ‰é”źç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ +interface PlusKeyKeyType { + /** + * èźŸć€‡â€œèż”ć›žâ€æŒ‰é’źæŒ‰é”źäș‹ä»¶ + * ćŠ‚æžœéœ€èŠæ”čć˜é»˜èź€â€œèż”ć›žâ€æŒ‰é’źçš„ć€„ç†é€»èŸ‘ïŒŒćˆ™ćŻé€šèż‡plus.key.addEventListeneræ„æłšć†Œç›‘ćŹ"backbutton"äș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ + backbutton?: string; + /** + * é”źæŒ‰äž‹äș‹ä»¶ + * ćŠ‚æžœéœ€èŠæ”čć˜é»˜èź€é”źæŒ‰äž‹çš„ć€„ç†é€»èŸ‘ïŒŒćˆ™ćŻé€šèż‡plus.key.addEventListeneræ„æłšć†Œç›‘ćŹ"keydown"äș‹ä»¶ă€‚ + * ćŻé€šèż‡ć›žè°ƒć‡œæ•°äž­KeyEventćŻčè±Ąçš„keyCodeæ„èŽ·ć–æŒ‰äž‹çš„é”źć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ + keydown?: string; + /** + * é”źæŸćŒ€äș‹ä»¶ + * ćŠ‚æžœéœ€èŠæ”čć˜é»˜èź€é”źæŸćŒ€çš„ć€„ç†é€»èŸ‘ïŒŒćˆ™ćŻé€šèż‡plus.key.addEventListeneræ„æłšć†Œç›‘ćŹ"keyup"äș‹ä»¶ă€‚ + * ćŻé€šèż‡ć›žè°ƒć‡œæ•°äž­KeyEventćŻčè±Ąçš„keyCodeæ„èŽ·ć–æŸćŒ€çš„é”źć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ + keyup?: string; + /** + * é•żæŒ‰é”źäș‹ä»¶ + * ćŠ‚æžœéœ€èŠæ”čć˜é»˜èź€é•żæŒ‰é”źçš„ć€„ç†é€»èŸ‘ïŒŒćˆ™ćŻé€šèż‡plus.key.addEventListeneræ„æłšć†Œç›‘ćŹ"longpressed"äș‹ä»¶ă€‚ + * é•żæŒ‰é”źæ—¶äŒšć€šæŹĄè§Šć‘ć›žè°ƒć‡œæ•°ïŒŒé€šèż‡ć›žè°ƒć‡œæ•°äž­KeyEventćŻčè±Ąçš„keyCodeæ„èŽ·ć–é•żæŒ‰çš„é”źć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ + longpressed?: string; + /** + * èźŸć€‡â€œèœć•â€æŒ‰é’źæŒ‰é”źäș‹ä»¶ + * ćŠ‚æžœéœ€èŠæ”čć˜é»˜èź€â€œèœć•â€æŒ‰é’źçš„ć€„ç†é€»èŸ‘ïŒŒćˆ™ćŻé€šèż‡plus.key.addEventListeneræ„æłšć†Œç›‘ćŹ"menubutton"äș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ + menubutton?: string; + /** + * èźŸć€‡â€œæœçŽąâ€æŒ‰é’źæŒ‰é”źäș‹ä»¶ + * ćŠ‚æžœéœ€èŠæ”čć˜é»˜èź€â€œæœçŽąâ€æŒ‰é’źçš„ć€„ç†é€»èŸ‘ïŒŒćˆ™ćŻé€šèż‡plus.key.addEventListeneræ„æłšć†Œç›‘ćŹ"searchbutton"äș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ + searchbutton?: string; + /** + * èźŸć€‡â€œéŸłé‡+â€æŒ‰é’źæŒ‰é”źäș‹ä»¶ + * ćŠ‚æžœéœ€èŠæ”čć˜é»˜èź€â€œéŸłé‡+â€æŒ‰é’źçš„ć€„ç†é€»èŸ‘ïŒŒćˆ™ćŻé€šèż‡plus.key.addEventListeneræ„æłšć†Œç›‘ćŹ"volumeupbutton"äș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ + volumeupbutton?: string; + /** + * èźŸć€‡â€œéŸłé‡-â€æŒ‰é’źæŒ‰é”źäș‹ä»¶ + * ćŠ‚æžœéœ€èŠæ”čć˜é»˜èź€â€œéŸłé‡-â€æŒ‰é’źçš„ć€„ç†é€»èŸ‘ïŒŒćˆ™ćŻé€šèż‡plus.key.addEventListeneræ„æłšć†Œç›‘ćŹ"volumedownbutton"äș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ + volumedownbutton?: string; +} + +/** + * æŒ‰é”źäș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ +interface PlusKeyKeyEvent { + /** + * è§Šć‘æŒ‰é”źäș‹ä»¶çš„é”źć€Œ + * é”źć€Œç”±ć„çł»ç»Ÿćčłć°ćźšäč‰ïŒŒäž€äș›ç‰čæźŠæŒ‰é”źćœšäžćŒçš„èźŸć€‡äžŠćŻèƒœć­˜ćœšć·źćŒ‚ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ + keyCode?: number; + /** + * æŒ‰é”źäș‹ä»¶ç±»ćž‹ + * 甹äșŽèĄšæ˜Žè§Šć‘æ­€æŒ‰é”źäș‹ä»¶çš„ç±»ćž‹ïŒŒć€ŒäžșKeyType侭漚äč‰çš„ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/key.html](http://www.html5plus.org/doc/zh_cn/key.html) + */ + keyType?: PlusKeyKeyType; +} + +/** + * MessagingæšĄć—çźĄç†èźŸć€‡é€šèźŻćŠŸèƒœïŒŒćŻç”šäșŽçŸ­äżĄă€ćœ©äżĄă€é‚źä»¶ć‘é€ç­‰ă€‚é€šèż‡plus.messagingćŻèŽ·ć–èźŸć€‡é€šèźŻçźĄç†ćŻčè±Ąă€‚ćŠć€–äčŸćŻä»„ç›ŽæŽ„é€šèż‡html侭的hrefç›ŽæŽ„ćż«é€Ÿć‘é€çŸ­äżĄă€æ‹šæ‰“ç””èŻă€ć‘é€é‚źä»¶ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ +interface PlusMessaging { + /** + * æ¶ˆæŻćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + Message?: PlusMessagingMessage; + /** + * æ¶ˆæŻäœ“ć†…ćźč类枋 + * 甹äșŽèźŸćꚿ¶ˆæŻçš„æ¶ˆæŻäœ“憅ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + BodyType?: PlusMessagingBodyType; + /** + * çź€ć•çŸ­äżĄç±»ćž‹ćžžé‡ + * æ¶ˆæŻç±»ćž‹ćžžé‡ïŒŒNumberç±»ćž‹ïŒŒć›șćźšć€Œäžș1甚äșŽćˆ›ć»șćč¶ć‘é€çŸ­äżĄă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + TYPE_SMS?: number; + /** + * ćœ©äżĄç±»ćž‹ćžžé‡ + * æ¶ˆæŻç±»ćž‹ćžžé‡ïŒŒNumberç±»ćž‹ïŒŒć›șćźšć€Œäžș2甚äșŽćˆ›ć»șćč¶ć‘送怚ćȘ’äœ“çŸ­äżĄïŒˆćœ©äżĄïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + TYPE_MMS?: number; + /** + * é‚źä»¶ç±»ćž‹ćžžé‡ + * æ¶ˆæŻç±»ćž‹ćžžé‡ïŒŒNumberç±»ćž‹ïŒŒć›șćźšć€Œäžș3甚äșŽćˆ›ć»șćč¶ć‘送邟件。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + TYPE_EMAIL?: number; + /** + * 戛ć»șæ¶ˆæŻćŻčè±Ą + * 戛ć»șæŒ‡ćźšç±»ćž‹çš„æ¶ˆæŻïŒŒæ¶ˆæŻç±»ćž‹ćŻć–plus.messaging.TYPE_SMS、plus.messaging.TYPE_MMS、plus.messaging.TYPE_EMAIL。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + createMessage(type ?: number): PlusMessagingMessage; + /** + * ć‘é€æ¶ˆæŻ + * ć‘é€æ¶ˆæŻïŒŒć‘é€æˆćŠŸć›žè°ƒsuccessCBć‡œæ•°ïŒŒć‘é€ć€±èŽ„ć›žè°ƒerrorCBć‡œæ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + sendMessage(msg?: PlusMessagingMessage, successCB?: () => void, errorCB?: (result: any) => void): void; +} + +/** + * æ¶ˆæŻćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ +interface PlusMessagingMessage { + /** + * 收件äșșäżĄæŻ + * 歗笩äžČæ•°ç»„ç±»ćž‹ïŒŒèŸ“ć…„çš„ćœ°ć€æ”¶ä»¶äșșäżĄæŻćż…éĄ»çŹŠćˆæ¶ˆæŻç±»ćž‹æ ŒćŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + to?: any []; + /** + * 抄送äșșäżĄæŻ + * 歗笩äžČæ•°ç»„ç±»ćž‹ïŒŒä»…ć‘é€é‚źä»¶æ—¶æœ‰æ•ˆïŒŒèŸ“ć…„çš„ćœ°ć€æ”¶ä»¶äșșäżĄæŻćż…éĄ»çŹŠćˆæ¶ˆæŻç±»ćž‹æ ŒćŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + cc?: any []; + /** + * 暗送äșșäżĄæŻ + * 歗笩äžČæ•°ç»„ç±»ćž‹ïŒŒä»…ć‘é€é‚źä»¶æ—¶æœ‰æ•ˆïŒŒèŸ“ć…„çš„ćœ°ć€æ”¶ä»¶äșșäżĄæŻćż…éĄ»çŹŠćˆæ¶ˆæŻç±»ćž‹æ ŒćŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + bcc?: any []; + /** + * ć‘ä»¶äșșäżĄæŻ + * ä»…ćœšç›‘ćŹæŽ„æ”¶ćˆ°çš„äżĄæŻæ—¶æœ‰æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + from?: string; + /** + * ć‘é€æ¶ˆæŻäž»éą˜ + * 歗笩äžČç±»ćž‹ïŒŒä»…ć‘é€é‚źä»¶æ—¶æœ‰æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + subject?: string; + /** + * ć‘é€æ¶ˆæŻć†…ćźč + * 歗笩äžČç±»ćž‹ïŒŒèŠć‘é€çš„æ¶ˆæŻäœ“ć†…ćźčïŒŒć…¶æ ŒćŒćż…éĄ»äžŽbodyTypeæŒ‡ćźšçš„äž€è‡Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + body?: string; + /** + * ć‘é€æ¶ˆæŻć†…ćźč类枋 + * èŠć‘é€æ¶ˆæŻäœ“ć†…ćźčçš„ç±»ćž‹ïŒŒćŻć–ć€Œ"text"èĄšç€șæ–‡æœŹć†…ćźč"html"èĄšç€șäžșhtmléĄ”éąïŒŒé»˜èź€ć€Œäžș"text"。 + * - text/plain: çșŻæ–‡æœŹç±»ćž‹æ¶ˆæŻäœ“憅ćźč + * - text/html: çœ‘éĄ”æ•°æźç±»ćž‹æ¶ˆæŻäœ“ć†…ćźč(甹äșŽć‘送邟件) + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + bodyType?: 'text/plain' | 'text/html'; + /** + * æ˜ŻćŠé‡‡ç”šé™é»˜æ–čćŒć‘é€æ¶ˆæŻ + * ćžƒć°”ç±»ćž‹ïŒŒćŻć–ć€Œäžștrue或falsetrueèĄšç€ș静默æ–čćŒć‘é€ïŒŒäžćŒčć‡șç•ŒéąïŒ›falseèĄšç€ș非静默æ–čćŒć‘é€ă€‚é»˜èź€é‡‡ç”šéžé™é»˜æ–čćŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + silent?: boolean; + /** + * æ·»ćŠ é™„ä»¶ + * ć‘æ¶ˆæŻäž­æ·»ćŠ é™„ä»¶ïŒŒä»…é‚źä»¶ç±»ćž‹æ¶ˆæŻæ”ŻæŒïŒŒć…¶ćźƒç±»ćž‹æ¶ˆæŻäžæ”ŻæŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + addAttachment(url?: string): void; +} + +/** + * æ¶ˆæŻäœ“ć†…ćźč类枋 + * 甹äșŽèźŸćꚿ¶ˆæŻçš„æ¶ˆæŻäœ“憅ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ +interface PlusMessagingBodyType { + /** + * æ–‡æœŹç±»ćž‹ + * çșŻæ–‡æœŹç±»ćž‹æ¶ˆæŻäœ“憅ćźčïŒŒé»˜èź€æ¶ˆæŻäœ“ć†…ćźč类枋。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + 'text/plain'?: string; + /** + * Html类枋 + * çœ‘éĄ”æ•°æźç±»ćž‹æ¶ˆæŻäœ“ć†…ćźčïŒŒćŻç”šäșŽć‘送邟件。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/messaging.html](http://www.html5plus.org/doc/zh_cn/messaging.html) + */ + 'text/html'?: string; +} + +/** + * nativeObjçźĄç†çł»ç»ŸćŽŸç”ŸćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObj { + /** + * ćŽŸç”ŸćŠšç”»ć‚æ•° + * æŒ‡ćźšćŠšç”»çš„ç±»ćž‹ă€æŒç»­æ—¶é—Žç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + AnimationOptions?: PlusNativeObjAnimationOptions; + /** + * ćŽŸç”ŸćŠšç”»çȘ—ćŁæ ·ćŒ + * æŒ‡ćźšćŠšç”»çȘ—ćŁçš„æ ·ćŒïŒŒćŠ‚èƒŒæ™Żć›Ÿç‰‡ïŒŒç»˜ćˆ¶çš„æ–‡ć­—ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + AnimationViewStyles?: PlusNativeObjAnimationViewStyles; + /** + * ćŽŸç”Ÿć›Ÿç‰‡ćŻčè±Ą + * ćŽŸç”Ÿć›Ÿç‰‡ćŻčè±ĄäŒšć ç”šèŸƒć€§çš„ć†…ć­˜è”„æșïŒŒćœšäœżç”šæ—¶éœ€è°šæ…ŽçźĄç†ïŒŒćœ“ć›Ÿç‰‡äžć†äœżç”šæ—¶ćș”èŻ„ćŠæ—¶è°ƒç”šclearæ–čæł•èż›èĄŒé”€æŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + Bitmap?: PlusNativeObjBitmap; + /** + * JSONćŻčè±ĄïŒŒäżć­˜ć›Ÿç‰‡çš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + BitmapSaveOptions?: PlusNativeObjBitmapSaveOptions; + /** + * ćŽŸç”Ÿć›Ÿç‰‡èœźæ’­æŽ§ä»¶ćŻčè±Ą + * ćŽŸç”Ÿć›Ÿç‰‡èœźæ’­æŽ§ä»¶ćŻčè±Ąä»ŽćŽŸç”ŸView控件plus.nativeObj.ViewïŒ‰ç»§æ‰żè€Œæ„ïŒŒç”šäșŽç»˜ćˆ¶ć›Ÿç‰‡èœźæ’­ć†…ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + ImageSlider?: PlusNativeObjImageSlider; + /** + * ć›Ÿç‰‡èœźæ’­æŽ§ä»¶æ ·ćŒ + * 从ViewStylesç»§æ‰żè€Œæ„ïŒŒæ‰©ć±•æ”ŻæŒèœźæ’­ć›Ÿç‰‡ç­‰é…çœźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + ImageSliderStyles?: PlusNativeObjImageSliderStyles; + /** + * ć›Ÿç‰‡èœźæ’­æŽ§ä»¶äž­ć›Ÿç‰‡éĄčé…çœźć‚æ•° + * 甹äșŽæŒ‡ćźšć›Ÿç‰‡ćœ°ć€ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + ImageSliderImageStyles?: PlusNativeObjImageSliderImageStyles; + /** + * èŸ“ć…„æĄ†æ ·ćŒ + * 甹äșŽćźšäč‰èŸ“ć…„æĄ†çš„æ˜Ÿç€șæ ·ćŒïŒŒćŠ‚ć­—äœ“ć€§ć°ïŒŒæç€ș憅ćźčç­‰äżĄæŻă€‚ + * èŸ“ć…„æ–‡æœŹć†…ćźčćœšæŒ‡ćźšćŒșćŸŸæ°Žćčłć±…ć·ŠïŒŒćž‚ç›Žć±…äž­æ˜Ÿç€ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + InputStyles?: PlusNativeObjInputStyles; + /** + * ćŒșćŸŸäżĄæŻćŻčè±Ą + * ćŒ…æ‹Źäœçœźă€ć€§ć°ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + Rect?: PlusNativeObjRect; + /** + * 绘戶ćŒșćŸŸæ ·ćŒćŻčè±Ą + * 甹äșŽćźšäč‰çŸ©ćœąćŒșćŸŸçš„æ˜Ÿç€șæ ·ćŒïŒŒćŠ‚ç©ș濃/ćźžćżƒæ ·ćŒă€ćœ†è§’ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + RectStyles?: PlusNativeObjRectStyles; + /** + * ćŻŒæ–‡æœŹæ ·ćŒ + * 甹äșŽćźšäč‰ćŻŒæ–‡æœŹäœżç”šçš„é»˜èź€äœżç”šçš„ć­—äœ“ćç§°ă€ć­—äœ“æ–‡ä»¶è·ŻćŸ„ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + RichTextStyles?: PlusNativeObjRichTextStyles; + /** + * ćŒșćŸŸäżĄæŻćŻčè±Ą + * ćŒ…æ‹Źäœçœźă€ć€§ć°ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + Position?: PlusNativeObjPosition; + /** + * ç»˜ćˆ¶æ–‡æœŹæ ·ćŒćŻčè±Ą + * 甹äșŽćźšä艿–‡æœŹçš„æ˜Ÿç€șæ ·ćŒïŒŒćŠ‚ć­—äœ“ć€§ć°ă€ć­—äœ“éąœè‰Čă€ć­—äœ“çČ—ç»†ă€ć­—äœ“æ ·ćŒă€ć­—äœ“ćç§°ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + TextStyles?: PlusNativeObjTextStyles; + /** + * ćŽŸç”ŸæŽ§ä»¶ćŻčè±Ą + * ćŽŸç”ŸæŽ§ä»¶ćŻčè±ĄćŻç”šäșŽćœšć±ćč•äžŠç»˜ćˆ¶ć›Ÿç‰‡æˆ–æ–‡æœŹć†…ćźčïŒŒćœ“æŽ§ä»¶äžć†äœżç”šæ—¶éœ€èŠè°ƒç”šcloseæ–čæł•é”€æŻæŽ§ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + View?: PlusNativeObjView; + /** + * ViewæŽ§ä»¶ćŠšç”»ć‚æ•° + * æŒ‡ćźšćŠšç”»çš„ç±»ćž‹ă€æŒç»­æ—¶é—Žç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + ViewAnimationOptions?: PlusNativeObjViewAnimationOptions; + /** + * ViewæŽ§ä»¶ç»˜ćˆ¶ć…ƒçŽ ć‚æ•° + * æŒ‡ćźšç»˜ćˆ¶ć›Ÿç‰‡ă€çŸ©ćœąćŒșćŸŸă€æ–‡æœŹć†…ćźčç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + ViewDrawTagStyles?: PlusNativeObjViewDrawTagStyles; + /** + * View控件äș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + ViewEvents?: PlusNativeObjViewEvents; + /** + * JSONćŻčè±ĄïŒŒViewæŽ§ä»¶çš„çł»ç»ŸçŠ¶æ€æ ćŒșćŸŸæ ·ćŒ + * ä»…ćœšćș”ç”šèźŸçœźäžșæČ‰æ”žćŒçŠ¶æ€æ æ ·ćŒäž‹æœ‰æ•ˆïŒŒéžæČ‰æ”žćŒçŠ¶æ€æ æ ·ćŒäž‹ćżœç•„æ­€ć±žæ€§ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + ViewStatusbarStyles?: PlusNativeObjViewStatusbarStyles; + /** + * ViewæŽ§ä»¶æ ·ćŒ + * ćŒ…æ‹Źäœçœźă€ć€§ć°ç­‰äżĄæŻç­‰ïŒŒć…¶äž­äœçœźäżĄæŻç›žćŻčäșŽçˆ¶ćźčć™šæŽ§ä»¶èż›èĄŒèźĄçź—ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + ViewStyles?: PlusNativeObjViewStyles; +} + +/** + * ćŽŸç”ŸćŠšç”»ć‚æ•° + * æŒ‡ćźšćŠšç”»çš„ç±»ćž‹ă€æŒç»­æ—¶é—Žç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjAnimationOptions { + /** + * 抚画类枋 + * ćŻć–ć€ŒïŒš + * "pop-in" - ä»ŽćłäŸ§ćčłç§»ć…„æ ˆćŠšç”»æ•ˆæžœïŒˆć‰ŻçȘ—ćŁä»ŽćłäŸ§ć‘ć·Šćčłç§»æ»‘ć‡ș星ç€ș䞻çȘ—ćŁä»Žćœ“ć‰ć±ćč•ćŒșćŸŸć‘ć·ŠäŸ§ćčłç§»æ»‘ć‡șèą«éźç›–ïŒ‰ïŒŒćŠ‚æžœä»…äŒ ć…„äž€äžȘView控件ćŻčè±Ąćˆ™è‡Ș抹降çș§äžșslide-in-rightćŠšç”»ïŒ› + * "pop-out" - ä»ŽćłäŸ§ćčłç§»ć‡șæ ˆćŠšç”»æ•ˆæžœïŒˆć‰ŻçȘ—ćŁä»Žćœ“ć‰ć±ćč•ćŒșćŸŸć‘ćłäŸ§ćčłç§»ć‡șćŻè§†ćŒșćŸŸïŒŒäž»çȘ—ćŁä»Žć·ŠäŸ§ć‘ćłćčłç§»æ»‘ć‡ș星ç€șïŒ‰ïŒŒćŠ‚æžœä»…ć‡ș慄䞀äžȘView控件ćŻčè±Ąćˆ™è‡Ș抹降çș§äžșslide-out-rightćŠšç”»ïŒ› + * "slide-in-right" - ä»ŽćłäŸ§æšȘć‘æ»‘ćŠšæ•ˆæžœïŒˆäž»çȘ—ćŁä»Žćœ“ć‰ć±ćč•ćłäŸ§ć€–ć‘ć†…æšȘć‘æ»‘ćŠšæ˜Ÿç€ș + * "slide-out-right - æšȘć‘ć‘ćłäŸ§æ»‘ć‡șć±ćč•ćŠšç”»ïŒˆäž»çȘ—ćŁä»Žć±ćč•äž­æšȘć‘ć‘ćłäŸ§æ»‘ćŠšćˆ°ć±ćč•ć€–ïŒ‰ă€‚ + * - pop-in: + * ä»ŽćłäŸ§ćčłç§»ć…„æ ˆćŠšç”»æ•ˆæžœïŒˆć‰ŻçȘ—ćŁä»ŽćłäŸ§ć‘ć·Šćčłç§»æ»‘ć‡ș星ç€ș䞻çȘ—ćŁä»Žćœ“ć‰ć±ćč•ćŒșćŸŸć‘ć·ŠäŸ§ćčłç§»æ»‘ć‡șèą«éźç›–ïŒ‰ă€‚ + * + * - pop-out: + * ä»ŽćłäŸ§ćčłç§»ć‡șæ ˆćŠšç”»æ•ˆæžœïŒˆć‰ŻçȘ—ćŁä»Žćœ“ć‰ć±ćč•ćŒșćŸŸć‘ćłäŸ§ćčłç§»ć‡șćŻè§†ćŒșćŸŸïŒŒäž»çȘ—ćŁä»Žć·ŠäŸ§ć‘ćłćčłç§»æ»‘ć‡ș星ç€șïŒ‰ă€‚ + * + * - slide-in-right: + * ä»ŽćłäŸ§æšȘć‘æ»‘ćŠšæ•ˆæžœïŒˆäž»çȘ—ćŁä»Žćœ“ć‰ć±ćč•ćłäŸ§ć€–ć‘ć†…æšȘć‘æ»‘ćŠšæ˜Ÿç€șïŒ‰ă€‚ + * + * - slide-out-right: + * æšȘć‘ć‘ćłäŸ§æ»‘ć‡șć±ćč•ćŠšç”»ïŒˆäž»çȘ—ćŁä»Žć±ćč•äž­æšȘć‘ć‘ćłäŸ§æ»‘ćŠšćˆ°ć±ćč•ć€–ïŒ‰ă€‚ + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + type?: 'pop-in' | 'pop-out' | 'slide-in-right' | 'slide-out-right'; + /** + * ćŠšç”»æŒç»­æ—¶é—Ž + * ć•äœäžșæŻ«ç§’ïŒŒé»˜èź€ć€Œäžș200ms。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + duration?: number; +} + +/** + * ćŽŸç”ŸćŠšç”»çȘ—ćŁæ ·ćŒ + * æŒ‡ćźšćŠšç”»çȘ—ćŁçš„æ ·ćŒïŒŒćŠ‚èƒŒæ™Żć›Ÿç‰‡ïŒŒç»˜ćˆ¶çš„æ–‡ć­—ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjAnimationViewStyles { + /** + * 抚画çȘ—ćŁäžŠç»˜ćˆ¶çš„èƒŒæ™Żć›Ÿç‰‡ + * ć›Ÿç‰‡ćŻä»„é€šèż‡WebviewćŻčè±Ąçš„drawæ–čæł•æˆȘć›ŸïŒŒäčŸćŻä»„é€šèż‡Bitmap的APIä»ŽæœŹćœ°æ–‡ä»¶äž­ćŠ èœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + bitmap?: PlusNativeObjBitmap; + /** + * 抚画çȘ—ćŁäžŠç»˜ćˆ¶çš„æ–‡æœŹć†…ćźč + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + text?: string; + /** + * 抚画çȘ—ćŁäžŠç»˜ćˆ¶çš„æ–‡æœŹæ ·ćŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + textStyles?: PlusNativeObjTextStyles; + /** + * 抚画çȘ—ćŁäžŠç»˜ćˆ¶çš„æ–‡æœŹćŒș㟟 + * é»˜èź€ć€Œäžș{top:'0px',left:'0px',width:'100%',height:'44px'}。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + textRect?: PlusNativeObjRect; +} + +/** + * ćŽŸç”Ÿć›Ÿç‰‡ćŻčè±Ą + * ćŽŸç”Ÿć›Ÿç‰‡ćŻčè±ĄäŒšć ç”šèŸƒć€§çš„ć†…ć­˜è”„æșïŒŒćœšäœżç”šæ—¶éœ€è°šæ…ŽçźĄç†ïŒŒćœ“ć›Ÿç‰‡äžć†äœżç”šæ—¶ćș”èŻ„ćŠæ—¶è°ƒç”šclearæ–čæł•èż›èĄŒé”€æŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjBitmap { + /** + * BitmapćŻčè±Ąçš„æ ‡èŻ† + * 朹戛ć»șBitmapćŻčè±Ąæ—¶èźŸçœźïŒŒćŠ‚æžœæČĄæœ‰èźŸçœźæ ‡èŻ†ïŒŒæ­€ć±žæ€§ć€Œäžșnull。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + id?: string; + /** + * 静态æ–čæł•ïŒŒèŽ·ć–æ‰€æœ‰Bitmapć›Ÿç‰‡ćŻčè±Ą + * èŽ·ć–ćș”ç”šèżèĄŒæœŸćˆ›ć»ș的所有Bitmapć›Ÿç‰‡ćŻčè±ĄïŒŒćŒ…ć«æ‰€æœ‰ç©șBitmapćŻčè±ĄïŒŒäžćŒ…ć«ć·Čç»é”€æŻçš„BitmapćŻčè±Ąă€‚èż”ć›žçš„BitmapćŻčè±Ąćœšæ•°ç»„äž­æŒ‰ćˆ›ć»șçš„ć±žæ€§æŽ’ćˆ—ïŒŒćŠæ•°ç»„äž­çŹŹäž€äžȘæ˜Żæœ€ć…ˆćˆ›ć»ș的BitmapćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + getItems(): PlusNativeObj []; + /** + * 静态æ–čæł•ïŒŒèŽ·ć–æŒ‡ćźšæ ‡èŻ†çš„Bitmapć›Ÿç‰‡ćŻčè±Ą + * 朹ćș”甚䞭ć·Č戛ć»șçš„ć›Ÿç‰‡ćŻčè±Ąäž­æŸ„æ‰ŸæŒ‡ćźšæ ‡èŻ†çš„BitmapćŻčè±Ąćč¶èż”曞。 + * è‹„ć­˜ćœšć€šäžȘç›žćŒæ ‡èŻ†çš„Bitmapć›Ÿç‰‡ïŒŒćˆ™èż”ć›žçŹŹäž€äžȘ戛ć»ș的Bitmapć›Ÿç‰‡ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + getBitmapById(id?: string): PlusNativeObjBitmap; + /** + * é”€æŻBitmapć›Ÿç‰‡ + * 释攟Bitmapć›Ÿç‰‡ć ç”šçš„ć†…ć­˜è”„æșïŒŒé”€æŻćŽć›Ÿç‰‡ćŻčè±Ąć°†äžćŻäœżç”šïŒŒć…¶idć±žæ€§ć€ŒäžșundefinedïŒŒè°ƒç”šć…¶æ‰€æœ‰æ–čæł•æ“äœœéƒœäŒšć€±èŽ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + clear(): void; + /** + * ćŠ èœœBitmapć›Ÿç‰‡ + * ä»ŽæŒ‡ćźšçš„è·ŻćŸ„ïŒˆä»…æ”ŻæŒæœŹćœ°æ–‡ä»¶çł»ç»ŸïŒ‰äž­ćŠ èœœć›Ÿç‰‡ïŒŒæ­€æ“äœœć°†èŠ†ç›–äč‹ć‰çš„ć›Ÿç‰‡ć†…ćźč + * ćŠ‚æžœćŠ èœœć›Ÿç‰‡ć€±èŽ„ćˆ™äżç•™äč‹ć‰çš„ć›Ÿç‰‡ć†…ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + load(path?: string, successCallback?: () => void, errorCallback?: (result: any) => void): void; + /** + * ćŠ èœœBase64çŒ–ç æ ŒćŒć›Ÿç‰‡ćˆ°BitmapćŻčè±Ą + * 从Base64çŒ–ç æ ŒćŒć›Ÿç‰‡æ•°æźäž­ćŠ èœœć›Ÿç‰‡ïŒŒæ­€æ“äœœć°†èŠ†ç›–äč‹ć‰çš„ć›Ÿç‰‡ć†…ćźč + * ćŠ‚æžœćŠ èœœć›Ÿç‰‡ć€±èŽ„ćˆ™äżç•™äč‹ć‰çš„ć›Ÿç‰‡ć†…ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + loadBase64Data(data?: string, successCallback?: () => void, errorCallback?: (result: any) => void): void; + /** + * ć›žæ”¶Bitmapć›Ÿç‰‡ć†…ć­˜ + * 释攟Bitmapć›Ÿç‰‡ć ç”šçš„ć†…ć­˜è”„æșïŒŒäœ†äžé”€æŻć›Ÿç‰‡ćŻčè±ĄïŒŒäŸç„¶ćŻä»„ç»§ç»­äœżç”šć›Ÿç‰‡ćŻčè±Ąă€‚ + * ćœ“ć›Ÿç‰‡ćŻčè±Ąć†æŹĄèą«äœżç”šæ—¶äŒšè‡ȘćŠšä»ŽèźŸçœźçš„è·ŻćŸ„ïŒˆæž„é€ ć‡œæ•°æˆ–load/saveæ–čæł•èźŸçœźïŒ‰ćŠ èœœćˆ°ć†…ć­˜äž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + recycle(): void; + /** + * äżć­˜ć›Ÿç‰‡ + * ć°†ć›Ÿç‰‡äżć­˜ćˆ°æŒ‡ćźšçš„è·ŻćŸ„ïŒˆä»…æ”ŻæŒæœŹćœ°æ–‡ä»¶çł»ç»ŸïŒ‰ïŒŒćŠ‚æžœć›Ÿç‰‡äžșç©șæˆ–è€…æŒ‡ćźšçš„è·ŻćŸ„æ–‡ä»¶ć·Čç»ć­˜ćœšćˆ™èż”ć›žć€±èŽ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + save(path?: string, options?: PlusNativeObjBitmapSaveOptions, successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; + /** + * èŽ·ć–ć›Ÿç‰‡çš„Base64çŒ–ç æ•°æź + * èŻ»ć–ć›Ÿç‰‡çš„æ•°æźć†…ćźčćč¶èœŹæąäžșBase64çŒ–ç æ ŒćŒć­—çŹŠäžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + toBase64Data(): string; +} + +/** + * JSONćŻčè±ĄïŒŒäżć­˜ć›Ÿç‰‡çš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjBitmapSaveOptions { + /** + * èŠ†ç›–äżć­˜ć›Ÿç‰‡æ–‡ä»¶ + * ä»…ćœšäżć­˜çš„ć›Ÿç‰‡è·ŻćŸ„æ–‡ä»¶ć­˜ćœšæ—¶æœ‰æ•ˆïŒš + * trueèĄšç€șèŠ†ç›–ć­˜ćœšçš„æ–‡ä»¶ïŒ› + * falseèĄšç€șäžèŠ†ç›–ïŒŒćŠ‚æžœæ–‡ä»¶ć­˜ćœšïŒŒćˆ™èż”ć›žć€±èŽ„ă€‚ + * é»˜èź€ć€Œäžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + overwrite?: boolean; + /** + * äżć­˜ć›Ÿç‰‡çš„æ ŒćŒ + * æ”ŻæŒ"jpg"、"png"ïŒŒćŠ‚æžœæœȘæŒ‡ćźšćˆ™é»˜èź€äœżç”šæŒ‡ćźšçš„äżć­˜è·ŻćŸ„ćŽçŒ€ćŻčćș”çš„æ–‡ä»¶æ ŒćŒïŒŒćŠ‚æžœćŽçŒ€æ–‡ä»¶æ ŒćŒæ— æ•ˆćˆ™äœżç”šjpgæ ŒćŒă€‚ + * - jpg: JPGæ ŒćŒć›Ÿç‰‡ + * - png: PNGæ ŒćŒć›Ÿç‰‡ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + format?: 'jpg' | 'png'; + /** + * äżć­˜ć›Ÿç‰‡çš„èŽšé‡ + * ć–ć€ŒèŒƒć›Žäžș1-1001èĄšç€șäœżç”šæœ€äœŽçš„ć›Ÿç‰‡èŽšé‡ïŒˆäżć­˜ćŽçš„ć›Ÿç‰‡æ–‡ä»¶æœ€ć°ïŒ‰ă€100èĄšç€șäœżç”šæœ€é«˜çš„ć›Ÿç‰‡èŽšé‡ïŒˆäżć­˜ćŽçš„ć›Ÿç‰‡æ–‡ä»¶æœ€ć€§ïŒ‰ïŒ› + * é»˜èź€ć€Œäžș50。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + quality?: number; + /** + * æŒ‡ćźšèŁć‰ȘćŒșćŸŸäżć­˜ć›Ÿç‰‡ + * 盾ćŻčäșŽć›Ÿç‰‡çš„ćŒșćŸŸäżĄæŻïŒŒé»˜èź€ć€Œäžș{top:'0px',left:'0px',width:'100%',height:'100%'}。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + clip?: PlusNativeObjRect; +} + +/** + * ćŽŸç”Ÿć›Ÿç‰‡èœźæ’­æŽ§ä»¶ćŻčè±Ą + * ćŽŸç”Ÿć›Ÿç‰‡èœźæ’­æŽ§ä»¶ćŻčè±Ąä»ŽćŽŸç”ŸView控件plus.nativeObj.ViewïŒ‰ç»§æ‰żè€Œæ„ïŒŒç”šäșŽç»˜ćˆ¶ć›Ÿç‰‡èœźæ’­ć†…ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjImageSlider { + /** + * æ·»ćŠ ć›Ÿç‰‡èœźæ’­æŽ§ä»¶çš„ć›Ÿç‰‡ + * ćŠšæ€æ·»ćŠ ć›Ÿç‰‡èœźæ’­æŽ§ä»¶æ˜Ÿç€șçš„ć›Ÿç‰‡ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + addImages(images?: PlusNativeObj []): void; + /** + * èŽ·ć–ćœ“ć‰ć›Ÿç‰‡èœźæ’­æŽ§ä»¶æ˜Ÿç€șçš„ć›Ÿç‰‡çŽąćŒ•ć€Œ + * çŽąćŒ•ć€Œä»Ž0ćŒ€ć§‹ïŒŒćł0èĄšç€șć›Ÿç‰‡èœźæ’­æŽ§ä»¶ćœ“ć‰æ˜Ÿç€șçŹŹäž€ćŒ ć›Ÿç‰‡ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + currentImageIndex(): number; + /** + * èźŸçœźć›Ÿç‰‡èœźæ’­æŽ§ä»¶çš„ć›Ÿç‰‡ + * ćŠšæ€æ›Žæ–°ć›Ÿç‰‡èœźæ’­æŽ§ä»¶æ˜Ÿç€șçš„ć›Ÿç‰‡ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + setImages(images?: PlusNativeObj []): void; +} + +/** + * ć›Ÿç‰‡èœźæ’­æŽ§ä»¶æ ·ćŒ + * 从ViewStylesç»§æ‰żè€Œæ„ïŒŒæ‰©ć±•æ”ŻæŒèœźæ’­ć›Ÿç‰‡ç­‰é…çœźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjImageSliderStyles { + /** + * æ˜ŻćŠè‡ȘćŠšæ’­æ”Ÿ + * ćŻć–ć€ŒïŒš + * "true" - è‡ȘćŠšæ’­æ”ŸïŒ› + * "false" - 䞍è‡ȘćŠšæ’­æ”Ÿă€‚ + * é»˜èź€ć€Œäžș"false"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + autoplay?: boolean; + /** + * æ˜ŻćŠćŻć…šć±æ˜Ÿç€ș + * ćŻć–ć€ŒïŒš + * "true" - èĄšç€șćŻć…šć±æ˜Ÿç€ș甚户ç‚čć‡»èœźæ’­ć›Ÿç‰‡æ—¶ć…šć±æ˜Ÿç€ș + * "false" - èĄšç€șäžćŻć…šć±æ˜Ÿç€ș甚户ç‚čć‡»èœźæ’­ć›Ÿç‰‡æ—¶æ— ć“ćș”。 + * é»˜èź€ć€Œäžș"true"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + fullscreen?: boolean; + /** + * æ˜ŻćŠćŻćŸȘçŽŻèœźæ’­ + * ćŻć–ć€ŒïŒš + * "true" - æ”ŻæŒćŸȘçŽŻèœźæ’­ïŒ› + * "false" - äžæ”ŻæŒćŸȘçŽŻèœźæ’­ă€‚ + * é»˜èź€ć€Œäžș"false"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + loop?: boolean; + /** + * èœźæ’­çš„ć›Ÿç‰‡ + * è‡łć°‘ćż…éĄ»èźŸçœźäž€ćŒ ć›Ÿç‰‡çš„ćœ°ć€äżĄæŻïŒŒćŠćˆ™ćŻèƒœćŻŒè‡Žć›Ÿç‰‡èœźæ’­æŽ§ä»¶æ˜Ÿç€șäžæ­Łćžžă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + images?: PlusNativeObj []; + /** + * è‡ȘćŠšæ’­æ”Ÿćˆ‡æąæ—¶é—Ž + * ćœ“autoplayć±žæ€§ć€Œäžștrueæ—¶ç”Ÿæ•ˆïŒŒć•äœäžșæŻ«ç§’ă€‚é»˜èź€ć€Œäžș30003ç§’ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + interval?: number; +} + +/** + * ć›Ÿç‰‡èœźæ’­æŽ§ä»¶äž­ć›Ÿç‰‡éĄčé…çœźć‚æ•° + * 甹äșŽæŒ‡ćźšć›Ÿç‰‡ćœ°ć€ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjImageSliderImageStyles { + /** + * ć›Ÿç‰‡ćœ°ć€ + * æ”ŻæŒæœŹćœ°ćœ°ć€ïŒˆç›žćŻčćœ°ć€ă€ç»ćŻčè·ŻćŸ„ă€RelativeURLă€æœŹćœ°è·ŻćŸ„URL + * ä蟿”ŻæŒçœ‘ç»œćœ°ć€ïŒˆhttp://或https://ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + src?: string; + /** + * ć›Ÿç‰‡æ°ŽćčłćŻč霐æ–čćŒ + * ä»…ćœšć›Ÿç‰‡æ˜Ÿç€șçš„ćźœćșŠäžŽć›Ÿç‰‡èœźæ’­æŽ§ä»¶ćźœćșŠäžäž€è‡Žæ—¶æœ‰æ•ˆïŒŒćŻć–ć€ŒïŒš + * "left" - ć›Ÿç‰‡ćœšèœźæ’­æŽ§ä»¶äž­æ°Žćčłć±…ć·ŠćŻč霐 + * "center" - ć›Ÿç‰‡ćœšèœźæ’­æŽ§ä»¶äž­æ°Žćčłć±…äž­ćŻč霐 + * "right" - ć›Ÿç‰‡ćœšèœźæ’­æŽ§ä»¶äž­æ°Žćčłć±…揳ćŻčéœă€‚ + * é»˜èź€ć€Œäžș"center"。 + * - left: ć›Ÿç‰‡ćœšèœźæ’­æŽ§ä»¶äž­æ°Žćčłć±…ć·ŠćŻč霐 + * - center: ć›Ÿç‰‡ćœšèœźæ’­æŽ§ä»¶äž­æ°Žćčłć±…äž­ćŻč霐 + * - right: ć›Ÿç‰‡ćœšèœźæ’­æŽ§ä»¶äž­æ°Žćčłć±…揳ćŻč霐 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + align?: 'left' | 'center' | 'right'; + /** + * ć›Ÿç‰‡æ˜Ÿç€ș的高ćșŠ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"现ćŻčäșŽć›Ÿç‰‡èœźæ’­æŽ§ä»¶çš„高ćșŠïŒ› + * è‡ȘćŠšèźĄçź—"auto"ïŒŒćŠ‚æžœæŒ‡ćźšć›Ÿç‰‡ćźœćșŠïŒˆwidthïŒ‰ïŒŒćˆ™æŒ‰ć›Ÿç‰‡ćźžé™…ć€§ć°ç­‰æŻ”çŒ©æ”Ÿć›Ÿç‰‡é«˜ćșŠć€ŒïŒŒćŠ‚æžœæČĄæœ‰æŒ‡ćźšćźœćșŠïŒˆwidthć€Œäžș"auto"ïŒ‰ćˆ™è‡ȘćŠšçŒ©æ”Ÿć›Ÿç‰‡è‡łćŻćźŒæ•Žæ˜Ÿç€ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + height?: string; + /** + * ć›Ÿç‰‡æ˜Ÿç€șçš„ćźœćșŠ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽć›Ÿç‰‡èœźæ’­æŽ§ä»¶çš„ćźœćșŠïŒ› + * è‡ȘćŠšèźĄçź—"auto"ïŒŒćŠ‚æžœæŒ‡ćźšć›Ÿç‰‡é«˜ćșŠïŒˆheightïŒ‰ïŒŒćˆ™æŒ‰ć›Ÿç‰‡ćźžé™…ć€§ć°ç­‰æŻ”çŒ©æ”Ÿć›Ÿç‰‡ćźœćșŠć€ŒïŒŒćŠ‚æžœæČĄæœ‰æŒ‡ćźšé«˜ćșŠïŒˆheightć€Œäžș"auto"ïŒ‰ćˆ™è‡ȘćŠšçŒ©æ”Ÿć›Ÿç‰‡è‡łćŻćźŒæ•Žæ˜Ÿç€ș。 + * é»˜èź€ć€Œäžș"auto"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + width?: string; + /** + * ć›Ÿç‰‡ćž‚ç›ŽćŻč霐æ–čćŒ + * ä»…ćœšć›Ÿç‰‡æ˜Ÿç€ș的高ćșŠäžŽć›Ÿç‰‡èœźæ’­æŽ§ä»¶ćźœćșŠäžäž€è‡Žæ—¶æœ‰æ•ˆïŒŒćŻć–ć€ŒïŒš + * "top" - ć›Ÿç‰‡ćœšèœźæ’­æŽ§ä»¶äž­ćž‚ç›Žć±…éĄ¶ćŻč霐 + * "middle" - ć›Ÿç‰‡ćœšèœźæ’­æŽ§ä»¶äž­ćž‚ç›Žć±…äž­ćŻč霐 + * "bottom" - ć›Ÿç‰‡ćœšèœźæ’­æŽ§ä»¶äž­ćž‚ç›Žć±…ćș•ćŻčéœă€‚ + * é»˜èź€ć€Œäžș"middle"。 + * - top: ć›Ÿç‰‡ćœšèœźæ’­æŽ§ä»¶äž­ćž‚ç›Žć±…éĄ¶ćŻč霐 + * - middle: ć›Ÿç‰‡ćœšèœźæ’­æŽ§ä»¶äž­ćž‚ç›Žć±…äž­ćŻč霐 + * - bottom: ć›Ÿç‰‡ćœšèœźæ’­æŽ§ä»¶äž­ćž‚ç›Žć±…ćș•ćŻč霐 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + verticalAlign?: 'top' | 'middle' | 'bottom'; +} + +/** + * èŸ“ć…„æĄ†æ ·ćŒ + * 甹äșŽćźšäč‰èŸ“ć…„æĄ†çš„æ˜Ÿç€șæ ·ćŒïŒŒćŠ‚ć­—äœ“ć€§ć°ïŒŒæç€ș憅ćźčç­‰äżĄæŻă€‚ + * èŸ“ć…„æ–‡æœŹć†…ćźčćœšæŒ‡ćźšćŒșćŸŸæ°Žćčłć±…ć·ŠïŒŒćž‚ç›Žć±…äž­æ˜Ÿç€ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjInputStyles { + /** + * èŸ“ć…„æĄ†ç±»ćž‹ + * ćŻć–ć€ŒïŒš + * "email" - é‚źçź±ćœ°ć€èŸ“ć…„æĄ†ïŒ› + * "number" - æ•°ć­—èŸ“ć…„æĄ†ïŒ› + * "search" - æœçŽąæ–‡æœŹèŸ“ć…„æĄ†ïŒ› + * "tel" - ç””èŻć·ç èŸ“ć…„æĄ†ïŒ› + * "text" - æ™źé€šæ–‡æœŹèŸ“ć…„æĄ†ïŒ› + * "url" - URLćœ°ć€èŸ“ć…„æĄ†ă€‚ + * é»˜èź€äžștextïŒˆćłæ™źé€šæ–‡æœŹèŸ“ć…„æĄ†ïŒ‰ă€‚ + * - email: é‚źçź±ćœ°ć€èŸ“ć…„æĄ† + * - number: æ•°ć­—èŸ“ć…„æĄ† + * - search: æœçŽąæ–‡æœŹèŸ“ć…„æĄ† + * - tel: ç””èŻć·ç èŸ“ć…„æĄ† + * - text: æ™źé€šæ–‡æœŹèŸ“ć…„æĄ† + * - url: URLćœ°ć€èŸ“ć…„æĄ† + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + type?: 'email' | 'number' | 'search' | 'tel' | 'text' | 'url'; + /** + * èŸ“ć…„æĄ†çš„æç€șæ–‡æœŹ + * ćœ“ç”šæˆ·æœȘèŸ“ć…„ć†…ćźč时星ç€șćœšçŒ–èŸ‘æĄ†äž­ïŒˆç°è‰Čæ–‡ć­—ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + placeholder?: string; + /** + * èŸ“ć…„æĄ†çš„ć­—äœ“ć€§ć° + * ćŻć–ć€ŒïŒšć­—äœ“é«˜ćșŠćƒçŽ ć€ŒïŒŒæ•°ć­—ćŠ "px"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"12px"。 + * é»˜èź€ć€Œäžș"16px"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + fontSize?: string; + /** + * èŸ“ć…„æĄ†çš„èŸčæĄ†éąœè‰Č + * ćŻć–ć€ŒïŒš "#RRGGBB"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"#FF0000"èĄšç€șçșąè‰ČèŸčæĄ†ă€‚é»˜èź€ć€Œäžș"#000000"黑è‰ČïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + borderColor?: string; + /** + * èŸ“ć…„æĄ†èŸčæĄ†ćœ†è§’ćŠćŸ„ + * ćŻć–ć€ŒïŒšćœ†è§’ćŠćŸ„ćƒçŽ ć€ŒïŒŒæ•°ć­—ćŠ "px"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"6px"。 + * é»˜èź€ć€Œäžș"0px"èŸčæĄ†æ— ćœ†è§’ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + borderRadius?: string; + /** + * èŸ“ć…„æĄ†çš„èŸčæĄ†ćźœćșŠ + * ćŻć–ć€ŒïŒšćƒçŽ ć€ŒïŒŒæ•°ć­—ćŠ "px"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"2px"。 é»˜èź€ć€Œäžș"1px"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + borderWidth?: string; + /** + * èŸ“ć…„æĄ†ćźŒæˆèŸ“ć…„äș‹ä»¶ + * ćŒčć‡șèœŻé”źç›˜ćźŒæˆèŸ“ć…„ćŽïŒŒç‚čć‡»èœŻé”źç›˜äžŠçš„â€œćźŒæˆâ€ă€â€œć‰ćŸ€â€æŒ‰é’źæ—¶è§Šć‘ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + onComplete?: (result: any) => void; + /** + * èŸ“ć…„æĄ†èŽ·ć–ç„Šç‚čäș‹ä»¶ + * ćœ“çŒ–èŸ‘æĄ†èŽ·ć–ç„Šç‚čæ—¶è§Šć‘。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + onFocus?: (result: any) => void; + /** + * èŸ“ć…„æĄ†ć€±ćŽ»ç„Šç‚čäș‹ä»¶ + * ćœ“çŒ–èŸ‘æĄ†ć€±ćŽ»ç„Šç‚čæ—¶è§Šć‘。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + onBlur?: (result: any) => void; +} + +/** + * ćŒșćŸŸäżĄæŻćŻčè±Ą + * ćŒ…æ‹Źäœçœźă€ć€§ć°ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjRect { + /** + * ćŒșćŸŸć·ŠäžŠè§’çš„ćž‚ç›Žćç§»é‡ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽäœœç”šćŻčè±Ąçš„é«˜ćșŠïŒ› + * è‡ȘćŠšèźĄçź—ïŒŒćŠ‚"auto",æ čæźheightć€Œè‡ȘćŠšèźĄçź—ïŒŒç›žćŻčäșŽäœœç”šćŻčè±Ąćž‚ç›Žć±…äž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + top?: string; + /** + * ćŒșćŸŸć·ŠäžŠè§’çš„æ°Žćčłćç§»é‡ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽäœœç”šćŻčè±Ąçš„ćźœćșŠïŒ› + * è‡ȘćŠšèźĄçź—ïŒŒćŠ‚"auto",æ čæźwidthć€Œè‡ȘćŠšèźĄçź—ïŒŒç›žćŻčäșŽäœœç”šćŻčè±Ąæ°Žćčłć±…䞭。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + left?: string; + /** + * ćŒșćŸŸçš„ćźœćșŠ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽäœœç”šćŻčè±Ąçš„ćźœćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + width?: string; + /** + * ćŒșćŸŸçš„é«˜ćșŠ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽäœœç”šćŻčè±Ąçš„é«˜ćșŠă€‚ + * 憅ćźčè‡Ș适ćș”ïŒŒćŠ‚"wrap_content"æ čæźć†…ćźčèźĄçź—é«˜ćșŠïŒˆćŠ‚è°ƒç”šdrawTextç»˜ćˆ¶æ–‡æœŹæ—¶æ”ŻæŒïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + height?: string; +} + +/** + * 绘戶ćŒșćŸŸæ ·ćŒćŻčè±Ą + * 甹äșŽćźšäč‰çŸ©ćœąćŒșćŸŸçš„æ˜Ÿç€șæ ·ćŒïŒŒćŠ‚ç©ș濃/ćźžćżƒæ ·ćŒă€ćœ†è§’ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjRectStyles { + /** + * ç»˜ćˆ¶éąœè‰Č + * çŸ©ćœąćĄ«ć……ćŒș柟的鱜è‰ČïŒŒćŻć–ć€ŒïŒš + * "#RRGGBB"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"#FF0000"èĄšç€ș绘戶çșąè‰ČćŒșćŸŸïŒ› + * "rgba(R,G,B,A)"ïŒŒć…¶äž­R/G/Bćˆ†ćˆ«ä»ŁèĄšçșąè‰Čć€Œ/绿è‰Čć€Œ/蓝è‰Čć€ŒïŒŒæ­Łæ•Žæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-255Aäžș透明ćșŠïŒŒæ”źç‚čæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-10äžșć…šé€æ˜ŽïŒŒ1äžșäžé€æ˜ŽïŒ‰ïŒŒćŠ‚"rgba(255,0,0,0.5)"ïŒŒèĄšç€șçșąè‰ČćŠé€æ˜Žă€‚ + * é»˜èź€ć€Œäžș"#FFFFFF"癜è‰ČïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + color?: string; + /** + * çŸ©ćœąćŒșćŸŸçš„ćœ†è§’ćŠćŸ„ + * ćŻć–ć€ŒïŒšćœ†è§’ćŠćŸ„ćƒçŽ ć€ŒïŒŒæ•°ć­—ćŠ "px"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"6px"。 + * é»˜èź€ć€Œäžș"0px"ïŒˆçŸ©ćœąæ— ćœ†è§’ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + radius?: string; + /** + * çŸ©ćœąèŸčæĄ†éąœè‰Č + * ç»˜ćˆ¶çŸ©ćœąèŸčæĄ†çš„éąœè‰ČïŒŒćŻć–ć€ŒïŒš + * "#RRGGBB"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"#FF0000"èĄšç€ș绘戶çșąè‰ČćŒșćŸŸïŒ› + * "rgba(R,G,B,A)"ïŒŒć…¶äž­R/G/Bćˆ†ćˆ«ä»ŁèĄšçșąè‰Čć€Œ/绿è‰Čć€Œ/蓝è‰Čć€ŒïŒŒæ­Łæ•Žæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-255Aäžș透明ćșŠïŒŒæ”źç‚čæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-10äžșć…šé€æ˜ŽïŒŒ1äžșäžé€æ˜ŽïŒ‰ïŒŒćŠ‚"rgba(255,0,0,0.5)"ïŒŒèĄšç€șçșąè‰ČćŠé€æ˜Žă€‚ + * é»˜èź€ć€ŒäžșçŸ©ćœąćĄ«ć……ćŒș柟鱜è‰Čcolorć±žæ€§ć€ŒïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + borderColor?: string; + /** + * çŸ©ćœąèŸčæĄ†ćźœćșŠ + * ćŻć–ć€ŒïŒšćƒçŽ ć€ŒïŒŒæ•°ć­—ćŠ "px"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"2px"。 + * é»˜èź€ć€Œäžș"0px"无èŸčæĄ†ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + borderWidth?: string; +} + +/** + * ćŻŒæ–‡æœŹæ ·ćŒ + * 甹äșŽćźšäč‰ćŻŒæ–‡æœŹäœżç”šçš„é»˜èź€äœżç”šçš„ć­—äœ“ćç§°ă€ć­—äœ“æ–‡ä»¶è·ŻćŸ„ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjRichTextStyles { + /** + * ćŻŒæ–‡æœŹć†…ćźč的氎ćčłćŻč霐æ–čćŒ + * ćŻčæ•Žäœ“ć†…ćźčæœ‰æ•ˆïŒŒæ— æł•ć•ç‹ŹæŽ§ćˆ¶æŻèĄŒçš„ć†…ćźč。 + * ćŻć–ć€ŒïŒš + * "left"-ć­—äœ“ćœšæŒ‡ćźšçš„ćŒșćŸŸäž­æ°Žćčłć±…ć·ŠćŻč霐 + * "center"-ć­—äœ“ćœšæŒ‡ćźšçš„ćŒșćŸŸäž­æ°Žćčłć±…äž­ćŻč霐 + * "right"-ć­—äœ“ćœšæŒ‡ćźšçš„ćŒșćŸŸäž­æ°Žćčłć±…揳ćŻčéœă€‚ + * é»˜èź€ć€Œäžș"left"。 + * - left: ćŻŒæ–‡æœŹć†…ćźčæ°Žćčłć±…ć·ŠćŻč霐 + * - center: ćŻŒæ–‡æœŹć†…ćźčæ°Žćčłć±…äž­ćŻč霐 + * - right: ćŻŒæ–‡æœŹć†…ćźčæ°Žćčłć±…揳ćŻč霐 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + align?: 'left' | 'center' | 'right'; + /** + * ćŻŒæ–‡æœŹé»˜èź€äœżç”šçš„ć­—äœ“ćç§° + * äŸ‹ćŠ‚"Times New Roman" ćŠ‚æžœæŒ‡ćźšćç§°çš„ć­—äœ“äžć­˜ćœšïŒŒćˆ™äœżç”šçł»ç»Ÿé»˜èź€ć­—äœ“ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + family?: string; + /** + * ćŻŒæ–‡æœŹé»˜èź€äœżç”šçš„ć­—äœ“æ–‡ä»¶è·ŻćŸ„ + * ćŠ èœœć­—äœ“æ–‡ä»¶è·ŻćŸ„ïŒŒćż…éĄ»äžșæœŹćœ°è·ŻćŸ„ïŒŒćŠ‚æžœæŒ‡ćźšçš„æ–‡ä»¶è·ŻćŸ„æ— æ•ˆïŒŒćˆ™äœżç”šçł»ç»Ÿé»˜èź€ć­—äœ“ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + fontSrc?: string; + /** + * ç‚č懻äș‹ä»¶ć›žè°ƒć‡œæ•° + * ćŠ‚æžœèźŸçœźæ­€ć±žæ€§ïŒŒćˆ™èĄšç€ș拊æˆȘ所有RichText侊的ç‚č懻äș‹ä»¶ïŒˆäžé€äŒ äș‹ä»¶ïŒ‰ă€‚ + * ćŠ‚æžœæČĄæœ‰èźŸçœźæ­€ć±žæ€§ïŒŒćˆ™ä»…拊æˆȘæ“äœœćŒ…ć«onclickć±žæ€§çš„a/img标筟的ç‚č懻äș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + onClick?: (result: any) => void; +} + +/** + * ćŒșćŸŸäżĄæŻćŻčè±Ą + * ćŒ…æ‹Źäœçœźă€ć€§ć°ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjPosition { + /** + * ćŒșćŸŸéĄ¶éƒšç›žćŻčäșŽäœœç”šćŻčè±ĄïŒˆæˆ–ćźčć™šïŒ‰ć‘äž‹çš„ćç§»é‡ + * ćŻć–ć€ŒïŒšćƒçŽ ć€ŒïŒŒćŠ‚"100px"ïŒ›ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽäœœç”šćŻčè±ĄïŒˆæˆ–ćźčć™šïŒ‰çš„é«˜ćșŠïŒ› + * è‡ȘćŠšèźĄçź—ïŒŒćŠ‚"auto",æ čæźheightć€Œè‡ȘćŠšèźĄçź—ïŒŒç›žćŻčäșŽäœœç”šćŻčè±ĄïŒˆæˆ–ćźčć™šïŒ‰ćž‚ç›Žć±…äž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + top?: string; + /** + * ćŒșćŸŸć·ŠäŸ§ç›žćŻčäșŽäœœç”šćŻčè±ĄïŒˆæˆ–ćźčć™šïŒ‰ć‘ćłçš„ćç§»é‡ + * ćŻć–ć€ŒïŒšćƒçŽ ć€ŒïŒŒćŠ‚"100px"ïŒ›ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽäœœç”šćŻčè±ĄïŒˆæˆ–ćźčć™šïŒ‰çš„ćźœćșŠïŒ› + * è‡ȘćŠšèźĄçź—ïŒŒćŠ‚"auto",æ čæźwidthć€Œè‡ȘćŠšèźĄçź—ïŒŒç›žćŻčäșŽäœœç”šćŻčè±ĄïŒˆæˆ–ćźčć™šïŒ‰æ°Žćčłć±…䞭。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + left?: string; + /** + * ćŒșćŸŸçš„ćźœćșŠ + * ćŻć–ć€ŒïŒšćƒçŽ ć€ŒïŒŒćŠ‚"100px";ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽäœœç”šćŻčè±ĄïŒˆæˆ–ćźčć™šïŒ‰çš„ćźœćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + width?: string; + /** + * ćŒșćŸŸçš„é«˜ćșŠ + * ćŻć–ć€ŒïŒšćƒçŽ ć€ŒïŒŒćŠ‚"100px";ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽäœœç”šćŻčè±ĄïŒˆæˆ–ćźčć™šïŒ‰çš„é«˜ćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + height?: string; + /** + * ćŒș㟟ćș•郚盞ćŻčäșŽäœœç”šćŻčè±ĄïŒˆæˆ–ćźčć™šïŒ‰ć‘äžŠçš„ćç§»é‡ + * ćŻć–ć€ŒïŒšćƒçŽ ć€ŒïŒŒćŠ‚"100px";ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽäœœç”šćŻčè±ĄïŒˆæˆ–ćźčć™šïŒ‰çš„é«˜ćșŠă€‚ + * ćœ“èźŸçœźäș†top撌heightć€Œæ—¶ïŒŒćżœç•„æ­€ć±žæ€§ć€ŒïŒ› + * ćœ“æœȘèźŸçœźtopć€Œæ—¶ïŒŒćŻé€šèż‡bottomć±žæ€§ć€Œæ„çĄźćźšćŒșćŸŸçš„ćž‚ç›ŽäœçœźïŒ› + * ćœ“æœȘèźŸçœźheightć€Œæ—¶ïŒŒćŻé€šèż‡top撌bottomć±žæ€§ć€Œæ„çĄźćźšćŒșćŸŸçš„é«˜ćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + bottom?: string; + /** + * ćŒșćŸŸćłäŸ§ç›žćŻčäșŽäœœç”šćŻčè±ĄïŒˆæˆ–ćźčć™šïŒ‰ć‘ć·Šçš„ćç§»é‡ + * ćŻć–ć€ŒïŒšćƒçŽ ć€ŒïŒŒćŠ‚"100px";ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽäœœç”šćŻčè±ĄïŒˆæˆ–ćźčć™šïŒ‰çš„ćźœćșŠă€‚ + * ćœ“èźŸçœźäș†left撌widthć€Œæ—¶ïŒŒćżœç•„æ­€ć±žæ€§ć€ŒïŒ› + * ćœ“æœȘèźŸçœźleftć€Œæ—¶ïŒŒćŻé€šèż‡rightć±žæ€§ć€Œæ„çĄźćźšćŒșćŸŸçš„æ°ŽćčłäœçœźïŒ› + * ćœ“æœȘèźŸçœźwidthć€Œæ—¶ïŒŒćŻé€šèż‡left撌rightć±žæ€§ć€Œæ„çĄźćźšćŒșćŸŸçš„ćźœćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + right?: string; +} + +/** + * ç»˜ćˆ¶æ–‡æœŹæ ·ćŒćŻčè±Ą + * 甹äșŽćźšä艿–‡æœŹçš„æ˜Ÿç€șæ ·ćŒïŒŒćŠ‚ć­—äœ“ć€§ć°ă€ć­—äœ“éąœè‰Čă€ć­—äœ“çČ—ç»†ă€ć­—äœ“æ ·ćŒă€ć­—äœ“ćç§°ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjTextStyles { + /** + * æ°ŽćčłćŻč霐æ–čćŒ + * ćŻć–ć€ŒïŒš + * "left"-ć­—äœ“ćœšæŒ‡ćźšçš„ćŒșćŸŸäž­æ°Žćčłć±…ć·ŠćŻč霐 + * "center"-ć­—äœ“ćœšæŒ‡ćźšçš„ćŒșćŸŸäž­æ°Žćčłć±…äž­ćŻč霐 + * "right"-ć­—äœ“ćœšæŒ‡ćźšçš„ćŒșćŸŸäž­æ°Žćčłć±…揳ćŻčéœă€‚ + * é»˜èź€ć€Œäžș"center"。 + * - left: ć­—äœ“ćœšæŒ‡ćźšçš„ćŒșćŸŸäž­æ°Žćčłć±…ć·ŠćŻč霐 + * - center: ć­—äœ“ćœšæŒ‡ćźšçš„ćŒșćŸŸäž­æ°Žćčłć±…äž­ćŻč霐 + * - right: ć­—äœ“ćœšæŒ‡ćźšçš„ćŒșćŸŸäž­æ°Žćčłć±…揳ćŻč霐 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + align?: 'left' | 'center' | 'right'; + /** + * ć­—äœ“éąœè‰Č + * ćŻć–ć€ŒïŒš + * "#RRGGBB"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"#FF0000"èĄšç€ș绘戶çșąè‰ČćŒșćŸŸïŒ› + * "rgba(R,G,B,A)"ïŒŒć…¶äž­R/G/Bćˆ†ćˆ«ä»ŁèĄšçșąè‰Čć€Œ/绿è‰Čć€Œ/蓝è‰Čć€ŒïŒŒæ­Łæ•Žæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-255Aäžș透明ćșŠïŒŒæ”źç‚čæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-10äžșć…šé€æ˜ŽïŒŒ1äžșäžé€æ˜ŽïŒ‰ïŒŒćŠ‚"rgba(255,0,0,0.5)"ïŒŒèĄšç€șçșąè‰ČćŠé€æ˜Žă€‚ + * é»˜èź€ć€Œäžș"#000000"黑è‰ČïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + color?: string; + /** + * æ–‡æœŹèŁ…é„° + * ćŻć–ć€ŒïŒš + * "none" - æ— èŁ…é„°æ•ˆæžœïŒ› + * "underline" - æ–‡æœŹćžŠäž‹ćˆ’çșżæ•ˆæžœïŒ› + * "line-through" - æ–‡æœŹćžŠèŽŻç©żçșżïŒˆćˆ é™€çșżïŒ‰æ•ˆæžœă€‚ + * é»˜èź€ć€Œäžș"none"。 + * - none: + * æ— èŁ…é„°æ•ˆæžœ + * + * - underline: + * æ–‡æœŹćžŠäž‹ćˆ’çșżæ•ˆæžœ + * + * - line-through: + * æ–‡æœŹćžŠèŽŻç©żçșżïŒˆćˆ é™€çșżïŒ‰æ•ˆæžœ + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + decoration?: 'none' | 'underline' | 'line-through'; + /** + * ć­—äœ“ćç§° + * äŸ‹ćŠ‚"Times New Roman" ćŠ‚æžœæŒ‡ćźšćç§°çš„ć­—äœ“äžć­˜ćœšïŒŒćˆ™äœżç”šé»˜èź€ć­—äœ“ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + family?: string; + /** + * ć­—äœ“æ–‡ä»¶è·ŻćŸ„ + * ćŠ èœœć­—äœ“æ–‡ä»¶è·ŻćŸ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + fontSrc?: string; + /** + * æ–‡æœŹçš„èĄŒé—Žè· + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px"ïŒ›ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽć­—䜓的高ćșŠïŒˆsizeć±žæ€§ïŒ‰ïŒ› + * é»˜èź€ć€Œäžș"20%"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + lineSpacing?: string; + /** + * ć­—äœ“çš„èŸč距 + * 甹äșŽèźŸçœźć­—äœ“ćœšç»˜ćˆ¶ç›źæ ‡ćŒș柟曛äžȘæ–čć‘ïŒˆtop/right/bottom/left的èŸčè·ïŒŒćŻć–ć€ŒïŒšćƒçŽ ć€ŒïŒŒćŠ‚"10px"ïŒ›ç™Ÿćˆ†æŻ”ïŒŒç›žćŻčäșŽç»˜ćˆ¶ç›źæ ‡ćŒșćŸŸïŒŒćŠ‚"5%" + * é»˜èź€ć€Œäžș"0px"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + margin?: string; + /** + * æ–‡æœŹć†…ćźč超ć‡ș星ç€șćŒșćŸŸæ—¶ć€„ç†æ–čćŒ + * ćŻć–ć€ŒïŒš + * "clip" - 超ć‡ș星ç€șćŒșćŸŸæ—¶ć†…ćźčèŁć‰Ș + * "ellipsis" - 超ć‡ș星ç€șćŒșćŸŸæ—¶ć°Ÿéƒšæ˜Ÿç€șçœç•„æ ‡èź°ïŒˆ...ïŒ‰ă€‚ + * é»˜èź€ć€Œäžș"clip"。 + * - clip: + * + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + overflow?: 'clip'; + /** + * ć­—äœ“ć€§ć° + * ćŻć–ć€ŒïŒšć­—äœ“é«˜ćșŠćƒçŽ ć€ŒïŒŒæ•°ć­—ćŠ "px"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"12px"。 + * é»˜èź€ć€Œäžș"16px"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + size?: string; + /** + * ć­—äœ“æ ·ćŒ + * ćŻć–ć€ŒïŒš"normal" - æ­Łćžžć­—äœ“æ ·ćŒïŒ›"italic" - æ–œäœ“æ ·ćŒă€‚é»˜èź€ć€Œäžș"normal"。 + * - normal: æ­Łćžžć­—äœ“æ ·ćŒ + * - italic: æ–œäœ“æ ·ćŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + style?: 'normal' | 'italic'; + /** + * 枂目ćŻč霐æ–čćŒ + * æ–‡æœŹć†…ćźčćœšæŒ‡ćźšç»˜ćˆ¶ćŒș柟侭的枂目ćŻč霐æ–čćŒïŒŒćŻć–ć€ŒïŒš + * "top" - 枂盎汅饶ćŻč霐 + * "middle" - 枂盎汅䞭ćŻč霐 + * "bottom" - 枂盎汅ćș•ćŻčéœă€‚ + * é»˜èź€ć€Œäžș"middle"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + verticalAlign?: string; + /** + * ć­—äœ“çȗ细 + * ćŻć–ć€ŒïŒš"normal" - æ™źé€šć­—äœ“ïŒ›"bold" - çČ—ć­—äœ“ă€‚é»˜èź€ć€Œäžș"normal"。 + * - normal: æ™źé€šć­—äœ“ + * - bold: çČ—ć­—äœ“ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + weight?: 'normal' | 'bold'; + /** + * æ–‡æœŹæąèĄŒæšĄćŒ + * ćŻć–ć€ŒïŒš + * "nowrap" - äžæąèĄŒïŒŒć°†æ‰€æœ‰æ–‡æœŹćœšäž€èĄŒäž­ç»˜ćˆ¶ïŒŒćżœç•„æąèĄŒçŹŠ("\n") + * "normal" - è‡ȘćŠšæąèĄŒïŒŒćœ“æŒ‡ćźšçš„ćźœćșŠæ— æł•ç»˜ćˆ¶æ‰€æœ‰æ–‡æœŹæ—¶è‡ȘćŠšæąèĄŒç»˜ćˆ¶ïŒŒçą°ćˆ°'\n'ć­—çŹŠæ—¶ćŒșćˆ¶æąèĄŒă€‚ + * é»˜èź€ć€Œäžș"nowrap"。 + * - nowrap: + * äžæąèĄŒïŒŒć°†æ‰€æœ‰æ–‡æœŹćœšäž€èĄŒäž­ç»˜ćˆ¶ïŒŒćżœç•„æąèĄŒçŹŠ("\n") + * + * - normal: + * è‡ȘćŠšæąèĄŒïŒŒćœ“æŒ‡ćźšçš„ćźœćșŠæ— æł•ç»˜ćˆ¶æ‰€æœ‰æ–‡æœŹæ—¶è‡ȘćŠšæąèĄŒç»˜ćˆ¶ïŒŒçą°ćˆ°'\n'ć­—çŹŠæ—¶ćŒșćˆ¶æąèĄŒ + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + whiteSpace?: 'nowrap' | 'normal'; +} + +/** + * ćŽŸç”ŸæŽ§ä»¶ćŻčè±Ą + * ćŽŸç”ŸæŽ§ä»¶ćŻčè±ĄćŻç”šäșŽćœšć±ćč•äžŠç»˜ćˆ¶ć›Ÿç‰‡æˆ–æ–‡æœŹć†…ćźčïŒŒćœ“æŽ§ä»¶äžć†äœżç”šæ—¶éœ€èŠè°ƒç”šcloseæ–čæł•é”€æŻæŽ§ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjView { + /** + * ViewćŻčè±Ąçš„æ ‡èŻ† + * 朹戛ć»șćŽŸç”ŸæŽ§ä»¶ViewćŻčè±Ąæ—¶èźŸçœźïŒŒćŠ‚æžœæČĄæœ‰èźŸçœźæ ‡èŻ†ïŒŒæ­€ć±žæ€§ć€Œäžșnull。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + id?: string; + /** + * 静态æ–čæł•ïŒŒćŒ€ć§‹ćŽŸç”ŸćŠšç”» + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + startAnimation(options?: PlusNativeObjAnimationOptions, view?: PlusNativeObjAnimationViewStyles, otherview?: PlusNativeObjAnimationViewStyles, callback?: () => void): void; + /** + * 静态æ–čæł•ïŒŒć…łé—­ćŽŸç”ŸćŠšç”»çȘ—揣 + * é€šèż‡plus.nativeObj.View.startAnimationæ–čæł•ćŒ€ć§‹ćŽŸç”ŸćŠšç”»ćŽïŒŒäžäŒšè‡ȘćŠšć…łé—­ćŽŸç”ŸćŠšç”»çȘ—揣ćŻčè±ĄïŒŒéœ€èŠè°ƒç”šæ­€æ–čæł•ć…łé—­ćŽŸç”ŸćŠšç”»ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + clearAnimation(type?: string): void; + /** + * 静态æ–čæł•ïŒŒèŽ·ć–æŒ‡ćźšæ ‡èŻ†çš„View控件ćŻčè±Ą + * ćŠ‚æžœć­˜ćœšć€šäžȘæŒ‡ćźšidæ ‡èŻ†çš„ViewćŻčè±ĄïŒŒćˆ™èż”ć›žçŹŹäž€äžȘ戛ć»ș的View控件ćŻčè±Ąă€‚ + * ćŠ‚æžœäžć­˜ćœšæŒ‡ćźšidæ ‡èŻ†çš„ViewćŻčè±ĄïŒŒćˆ™èż”ć›žnull。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + getViewById(id?: string): PlusNativeObjView; + /** + * æ·»ćŠ äș‹ä»¶ç›‘搏晚 + * 搑ViewæŽ§ä»¶æ·»ćŠ äș‹ä»¶ç›‘ćŹć™šïŒŒćœ“æŒ‡ćźšçš„äș‹ä»¶ć‘ç”Ÿæ—¶ïŒŒć°†è§Šć‘listenerć‡œæ•°çš„æ‰§èĄŒă€‚ + * ćŻć€šæŹĄè°ƒç”šæ­€æ–čæł•搑Webviewæ·»ćŠ ć€šäžȘç›‘ćŹć™šïŒŒćœ“ç›‘ćŹçš„äș‹ä»¶ć‘ç”Ÿæ—¶ïŒŒć°†æŒ‰ç…§æ·»ćŠ çš„ć…ˆćŽéĄșćșæ‰§èĄŒă€‚ + * ćŻé€šèż‡setTouchEventRectæ–čæł•æŒ‡ćźšç›‘ćŹè§Šć±æ“äœœçš„ćŒș柟。 + * æłšæ„ïŒšé»˜èź€View控件拊æˆȘć€„ç†è§Šć±äș‹ä»¶ïŒŒćŻè°ƒç”šview.interceptTouchEvent(false)æ”č揘äžș䞍拊æˆȘć€„ç†è§Šć±äș‹ä»¶ïŒˆé€äŒ ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + addEventListener(event?: PlusNativeObjViewEvents, listener?: (result: any) => void, capture?: boolean): void; + /** + * ViewæŽ§ä»¶ć†…ćźč抚画 + * ćŠšç”»ćŽćŻèƒœäŒšćŻŒè‡ŽView控件星ç€ș憅ćźčæ”čć˜ïŒŒćŻé€šèż‡è°ƒç”šrestoreæ–čæł•æąć€ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + animate(options?: PlusNativeObjViewAnimationOptions, callback?: () => void): void; + /** + * 慳闭View控件 + * 释攟View控件蔄æșïŒŒViewćŻčè±ĄäžćŻć†æ“äœœïŒŒćŠ‚æžœView控件ć·Č经星ç€ș戙è‡ȘćŠšéšè—ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + close(): void; + /** + * æž…ç©șçŸ©ćœąćŒș㟟 + * æž…é™€æŒ‡ćźšçŸ©ćœąćŒș柟憅ćźč透明星ç€șć…¶ćŽéąçš„ć†…ćźč。 + * ćŻć€šæŹĄè°ƒç”šèźŸçœźć€šäžȘćŒșćŸŸé€æ˜Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + clearRect(position?: PlusNativeObjPosition, id?: string): void; + /** + * ç»˜ćˆ¶ć†…ćźč + * ćœšćœ“ć‰View控件äč‹äžŠç»˜ćˆ¶æŒ‡ćźšçš„憅ćźčïŒŒćŻäž€æŹĄæŒ‡ćźšç»˜ćˆ¶ć€šäžȘć…ƒçŽ ïŒŒç»˜ćˆ¶ć…ƒçŽ ćŻä»„æ˜Żć›Ÿç‰‡/çŸ©ćœąćŒș㟟/æ–‡æœŹïŒŒ + * ćłć°†ć€šæŹĄè°ƒç”šdrawBitmap/drawRect/drawTextæ–čæł•ćˆćč¶è°ƒç”šäž€æŹĄdrawæ–čæł•æ„ćźžçŽ°ïŒŒ + * æŽšèäœżç”šdrawæ–čæł•æ„æ›żæąć€šæŹĄè°ƒç”šdrawBitmap/drawRect/drawText。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + draw(tags?: PlusNativeObj []): void; + /** + * ç»˜ćˆ¶ć›Ÿç‰‡ + * ćœšćœ“ć‰View控件äč‹äžŠç»˜ćˆ¶æŒ‡ćźšçš„ć›Ÿç‰‡ïŒŒćŠ‚æžœć›Ÿç‰‡æ— æ•ˆćˆ™äžćšä»»äœ•æ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + drawBitmap(src?: string, sprite?: PlusNativeObjPosition, position?: PlusNativeObjPosition, id?: string): void; + /** + * ç»˜ćˆ¶çŸ©ćœąćŒș㟟 + * ćœšćœ“ć‰View控件äč‹äžŠç»˜ćˆ¶æŒ‡ćźšéąœè‰Čçš„çŸ©ćœąćŒș柟。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + drawRect(styles?: PlusNativeObjRectStyles, position?: PlusNativeObjPosition, id?: string): void; + /** + * ç»˜ćˆ¶æ–‡æœŹ + * ćœšćœ“ć‰View控件äč‹äžŠç»˜ćˆ¶æŒ‡ćźšçš„æ–‡æœŹć†…ćźčïŒŒćŠ‚æžœæ–‡æœŹäžșç©șćˆ™äžćšä»»äœ•æ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + drawText(text?: string, position?: PlusNativeObjPosition, styles?: PlusNativeObjTextStyles, id?: string): void; + /** + * ç»˜ćˆ¶ćŻŒæ–‡æœŹ + * ćœšćœ“ć‰View控件äč‹äžŠç»˜ćˆ¶æŒ‡ćźšçš„æ–‡æœŹć†…ćźčïŒŒćŠ‚æžœæ–‡æœŹäžșç©șćˆ™äžćšä»»äœ•æ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + drawRichText(text?: string, position?: PlusNativeObjPosition, styles?: PlusNativeObjRichTextStyles, id?: string): void; + /** + * ç»˜ćˆ¶èŸ“ć…„æĄ† + * ćœšćœ“ć‰View控件äč‹äžŠç»˜ćˆ¶èŸ“ć…„æĄ†ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + drawInput(position?: PlusNativeObjPosition, styles?: PlusNativeObjInputStyles, id?: string): void; + /** + * èŽ·ć–çŒ–èŸ‘æĄ†çš„ç„Šç‚č状态 + * é€šèż‡idæŸ„æ‰Ÿćˆ°æŒ‡ćźšçš„çŒ–èŸ‘æĄ†ïŒŒèŽ·ć–ć…¶ç„Šç‚čçŠ¶æ€ă€‚ + * ćŠ‚æžœæŒ‡ćźšçš„idæ— æ•ˆćˆ™èż”ć›žnull。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + getInputFocusById(id?: string): boolean; + /** + * èŽ·ć–çŒ–èŸ‘æĄ†çš„ć†…ćźč + * é€šèż‡idæŸ„æ‰Ÿćˆ°æŒ‡ćźšçš„çŒ–èŸ‘æĄ†ïŒŒèŽ·ć–ć…¶èŸ“ć…„çš„ć­—çŹŠäžČ。 + * ćŠ‚æžœæŒ‡ćźšçš„idæ— æ•ˆćˆ™èż”ć›žnull。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + getInputValueById(id?: string): string; + /** + * é‡çœźview控件星ç€ș憅ćźč + * 枅陀调甚drawBitmap、drawTextæ–čæł•ç»˜ćˆ¶çš„ć†…ćźčïŒŒć°†ViewæŽ§ä»¶é‡çœźäžșç©ș憅ćźčïŒˆé€æ˜ŽäžćŻè§ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + reset(): void; + /** + * æąć€View控件星ç€ș憅ćźč + * æąć€è°ƒç”šanimateæ–čæł•æ”č揘ViewæŽ§ä»¶çš„ć†…ćźčïŒŒæ›Žæ–°è‡łćŠšç”»ć‰çš„ć†…ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + restore(): void; + /** + * 星ç€șView控件 + * 氆View控件星ç€șćˆ°ć±ćč•星ç€șćœšæ‰€æœ‰WebviewçȘ—揣äč‹äžŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + show(): void; + /** + * èźŸçœźçŒ–èŸ‘æĄ†çš„ç„Šç‚č状态 + * é€šèż‡idæŸ„æ‰Ÿćˆ°æŒ‡ćźšçš„çŒ–èŸ‘æĄ†ïŒŒćč¶èźŸçœźçŒ–èŸ‘æĄ†çš„ç„Šç‚čçŠ¶æ€ă€‚ + * ćŠ‚æžœæŒ‡ćźšçš„idæ— æ•ˆćˆ™æ“äœœæ— æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + setInputFocusById(id?: string, focusable?: boolean): string; + /** + * èźŸçœźViewæŽ§ä»¶çš„æ ·ćŒ + * ćŠšæ€æ›Žæ–°ViewæŽ§ä»¶æ ·ćŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + setStyle(styles?: PlusNativeObjViewStyles): void; + /** + * æŒ‡ćźšç›‘ćŹè§Šć±äș‹ä»¶ćŒș㟟 + * ćœ“è°ƒç”šaddEventListener监搬View控件äș‹ä»¶æ—¶ïŒŒćŻè°ƒç”šæ­€æ–čæł•限柚监搏äș‹ä»¶çš„ćŒșćŸŸïŒŒä»…ćœ“ç”šæˆ·è§Šć±æ“äœœćœšæŒ‡ćźšćŒșćŸŸæ—¶æ‰è§Šć‘ç›‘ćŹäș‹ä»¶ă€‚ + * 非限漚监搬äș‹ä»¶çš„ćŒșćŸŸćˆ™äžæ‹ŠæˆȘïŒŒé€äŒ ç»™ć…¶ćźƒçȘ—ćŁć€„ç†ă€‚ + * æłšæ„ïŒšæ­€æ“äœœèŠ†ç›–äč‹ć‰èźŸçœźçš„ćŒș柟。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + setTouchEventRect(rect?: PlusNativeObj []): void; + /** + * 隐藏View控件 + * 氆ViewæŽ§ä»¶ä»Žć±ćč•éšè—ïŒŒćŠ‚æžœView控件æœȘ星ç€șćˆ™äžćšä»»äœ•æ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + hide(): void; + /** + * æ˜ŻćŠæ‹ŠæˆȘViewæŽ§ä»¶çš„è§Šć±äș‹ä»¶ + * èźŸçœźäžș拊æˆȘ搎ViewæŽ§ä»¶äžŠçš„è§Šć±äș‹ä»¶äžć†äŒ é€’ïŒˆćłäžé€äŒ ïŒ‰ïŒŒćŠćˆ™è§Šć±äș‹ä»¶ć°†ç»§ç»­äŒ é€’ç»™ViewæŽ§ä»¶äž‹çš„ć…¶ćźƒçȘ—ćŁć€„ç†ïŒˆćłé€äŒ ïŒ‰ă€‚ + * æłšæ„ïŒšViewæŽ§ä»¶é»˜èź€æ‹ŠæˆȘè§Šć±äș‹ä»¶ïŒˆäžé€äŒ ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + interceptTouchEvent(intercept?: boolean): void; + /** + * èŽ·ć–View控件的星ç€ș状态 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + isVisible(): boolean; +} + +/** + * ViewæŽ§ä»¶ćŠšç”»ć‚æ•° + * æŒ‡ćźšćŠšç”»çš„ç±»ćž‹ă€æŒç»­æ—¶é—Žç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjViewAnimationOptions { + /** + * 抚画类枋 + * ćŻć–ć€ŒïŒš"shrink" - ä»ŽäžŠćˆ°äž‹ćˆ†ć—æ”¶çŒ©æž…é™€çȘ—ćŁćŠšç”»ă€‚ + * - shrink: ä»ŽäžŠćˆ°äž‹ćˆ†ć—æž…é™€ćŠšç”» + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + type?: 'shrink'; + /** + * ćŠšç”»æŒç»­æ—¶é—Ž + * ć•äœäžșæŻ«ç§’ïŒŒé»˜èź€ć€Œäžș200ms。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + duration?: number; + /** + * ćŠšç”»ćž§æ•° + * 濅饻äžș性äșŽ0çš„æ•Žæ•°ïŒŒé»˜èź€ć€Œäžș12。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + frames?: number; + /** + * ćŠšç”»äœœç”šćŒș㟟 + * æ”ŻæŒä»„äž‹ć±žæ€§ïŒš + * top - ćŒșćŸŸè·çŠ»æŽ§ä»¶éĄ¶éƒšçš„ćç§»é‡ïŒŒć±žæ€§ć€ŒćŻć–ćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ïŒŒç™Ÿćˆ†æŻ”ïŒˆćŠ‚"10%"盞ćŻčäșŽæŽ§ä»¶çš„é«˜ćșŠïŒ‰,é»˜èź€ć€Œäžș'0px' + * bottom - ćŒșćŸŸè·çŠ»æŽ§ä»¶ćș•éƒšçš„ćç§»é‡ïŒŒć±žæ€§ć€ŒćŻć–ćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ïŒŒç™Ÿćˆ†æŻ”ïŒˆćŠ‚"10%"盞ćŻčäșŽæŽ§ä»¶çš„é«˜ćșŠïŒ‰,é»˜èź€ć€Œäžș'0px' + * left - ćŒșćŸŸè·çŠ»æŽ§ä»¶ć·ŠäŸ§çš„ćç§»é‡ïŒŒć±žæ€§ć€ŒćŻć–ćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ïŒŒç™Ÿćˆ†æŻ”ïŒˆćŠ‚"10%"盞ćŻčäșŽæŽ§ä»¶çš„ćźœćșŠïŒ‰,é»˜èź€ć€Œäžș'0px' + * right - ćŒșćŸŸè·çŠ»æŽ§ä»¶ćłäŸ§çš„ćç§»é‡ïŒŒć±žæ€§ć€ŒćŻć–ćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ïŒŒç™Ÿćˆ†æŻ”ïŒˆćŠ‚"10%"盞ćŻčäșŽæŽ§ä»¶çš„ćźœćșŠïŒ‰,é»˜èź€ć€Œäžș'0px'。 + * 橂“{top:'44px',bottom:'48px'}”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + region?: PlusNativeObjRect; +} + +/** + * ViewæŽ§ä»¶ç»˜ćˆ¶ć…ƒçŽ ć‚æ•° + * æŒ‡ćźšç»˜ćˆ¶ć›Ÿç‰‡ă€çŸ©ćœąćŒșćŸŸă€æ–‡æœŹć†…ćźčç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjViewDrawTagStyles { + /** + * ç»˜ćˆ¶æ“äœœæ ‡èŻ† + * ćŻé€šèż‡viewćŻčè±Ąçš„drawBitmap/drawRect/drawText/clearRectæ–čæł•èż›èĄŒæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + id?: string; + /** + * ç»˜ćˆ¶æ“äœœç±»ćž‹ + * ćŻć–ć€ŒïŒš + * "img" - ç»˜ćˆ¶ć›Ÿç‰‡ïŒŒäžŽdrawBitmap操䜜䞀臎歀时id、src、position、spriteć±žæ€§ć€Œæœ‰æ•ˆïŒ› + * "rect" - ç»˜ćˆ¶çŸ©ćœąćŒșćŸŸïŒŒäžŽdrawRect操䜜䞀臎歀时id、color、position、rectStylesć±žæ€§ć€Œæœ‰æ•ˆïŒ› + * "font" - ç»˜ćˆ¶æ–‡æœŹć†…ćźč䞎drawText操䜜䞀臎歀时id、position、text、textStylesć±žæ€§ć€Œæœ‰æ•ˆïŒ› + * "richtext" - ç»˜ćˆ¶ćŻŒæ–‡æœŹć†…ćźč䞎drawRichText操䜜䞀臎歀时id、position、text、richTextStylesć±žæ€§ć€Œæœ‰æ•ˆïŒ› + * "input" - ç»˜ćˆ¶èŸ“ć…„æĄ†ć†…ćźč歀时id、position、inputStylesć±žæ€§ć€Œæœ‰æ•ˆă€‚ + * - img: ç»˜ćˆ¶ć›Ÿç‰‡ + * - rect: ç»˜ćˆ¶çŸ©ćœąćŒș㟟 + * - font: ç»˜ćˆ¶æ–‡æœŹć†…ćźč + * - richtext: ç»˜ćˆ¶ćŻŒæ–‡æœŹć†…ćźč + * - input: ç»˜ćˆ¶èŸ“ć…„æĄ†ć†…ćźč + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + tag?: 'img' | 'rect' | 'font' | 'richtext' | 'input'; + /** + * çŸ©ćœąćŒș柟鱜è‰Č + * äžæŽšèäœżç”šïŒˆæŽšèäœżç”šrectStylesïŒ‰ïŒŒćŻć–ć€ŒïŒš + * "#RRGGBB"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚çșąè‰Čäžș"#FF0000"。 + * "rgba(R,G,B,A)"ïŒŒć…¶äž­R/G/Bćˆ†ćˆ«ä»ŁèĄšçșąè‰Čć€Œ/绿è‰Čć€Œ/蓝è‰Čć€ŒïŒŒæ­Łæ•Žæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-255Aäžș透明ćșŠïŒŒæ”źç‚čæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-10äžșć…šé€æ˜ŽïŒŒ1äžșäžé€æ˜ŽïŒ‰ïŒŒćŠ‚"rgba(255,0,0,0.5)"ïŒŒèĄšç€șçșąè‰ČćŠé€æ˜Žă€‚ + * ćœ“tagć±žæ€§ć€Œäžș"rect"时有效甚äșŽæŒ‡ćźšçŸ©ćœąćŒș柟鱜è‰ČïŒŒé»˜èź€ć€Œäžș"#FFFFFF"癜è‰ČïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + color?: string; + /** + * ç»˜ćˆ¶èŸ“ć…„æĄ†çš„æ ·ćŒ + * ćœ“tagć±žæ€§ć€Œäžș"input"时有效甚äșŽæŒ‡ćźšç»˜ćˆ¶èŸ“ć…„æĄ†çš„æ ·ćŒă€ć€§ć°äœçœźç­‰äżĄæŻă€‚ïŒŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + inputStyles?: PlusNativeObjInputStyles; + /** + * ç»˜ćˆ¶ć†…ćźčćŒș㟟 + * ćœ“tagć±žæ€§ć€Œäžș"img"时甚äșŽæŒ‡ćźšç»˜ćˆ¶ć›Ÿç‰‡çš„ç›źæ ‡ćŒșćŸŸïŒ› + * ćœ“tagć±žæ€§ć€Œäžș"rect"时甚äșŽæŒ‡ćźšç»˜ćˆ¶çš„çŸ©ćœąćŒșćŸŸïŒ› + * ćœ“tagć±žæ€§ć€Œäžș"font"时甚äșŽæŒ‡ćźšç»˜ćˆ¶æ–‡æœŹçš„ç›źæ ‡ćŒșćŸŸïŒŒæ­€æ—¶heightć±žæ€§ć€Œæ”ŻæŒèźŸçœźäžș"wrap_content"ïŒŒèĄšç€șæ–‡æœŹé«˜ćșŠæ čæźć†…ćźčè‡ȘćŠšèźĄçź—ïŒŒæ­€æ—¶é€šèż‡topæ„ćźšäœæ–‡æœŹç»˜ćˆ¶çš„è”·ć§‹äœçœźă€‚ + * 盾ćŻčäșŽView控件的ćŒșćŸŸäżĄæŻïŒŒé»˜èź€ć€Œäžș{top:'0px',left:'0px',width:'100%',height:'100%'}。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + position?: PlusNativeObjPosition; + /** + * 绘戶ćŒșćŸŸçš„æ ·ćŒ + * ćœ“tagć±žæ€§ć€Œäžș"rect"时有效甚äșŽæŒ‡ćźšç»˜ćˆ¶ćŒșćŸŸçš„æ ·ćŒă€ćĄ«ć……éąœè‰Čă€ćœ†è§’ć€§ć°ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + rectStyles?: PlusNativeObjRectStyles; + /** + * ç»˜ćˆ¶çš„ć›Ÿç‰‡è”„æș + * ćœ“tagć±žæ€§ć€Œäžș"img"æ—¶æœ‰æ•ˆïŒŒćŻä»„æ˜Żć›Ÿç‰‡è”„æșè·ŻćŸ„ïŒˆć­—çŹŠäžČç±»ćž‹ïŒ‰æˆ–è€…ć›Ÿç‰‡ćŻčè±ĄïŒˆplus.nativeObj.BitmapćŻčè±ĄïŒ‰ă€‚ + * srcè·ŻćŸ„æ”ŻæŒgifć›Ÿç‰‡ïŒŒäœ†èźŸçœźçš„ć›Ÿç‰‡è·ŻćŸ„æ–‡ä»¶äœżç”š".gif"ćŽçŒ€æ—¶ćˆ™èź€äžșæ˜Żgifć›Ÿç‰‡ïŒŒćŠ‚"_www/loading.gif"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + src?: string; + /** + * ć›Ÿç‰‡æșçš„ç»˜ćˆ¶ćŒș㟟 + * ćœ“tagć±žæ€§ć€Œäžș"img"时有效甚äșŽæŒ‡ćźšć›Ÿç‰‡æșçš„ç»˜ćˆ¶ćŒșćŸŸïŒŒç›žćŻčäșŽć›Ÿç‰‡çš„ćŒșćŸŸäżĄæŻïŒŒé»˜èź€ć€Œäžș{top:'0px',left:'0px',width:'100%',height:'100%'}。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + sprite?: PlusNativeObjPosition; + /** + * ç»˜ćˆ¶çš„æ–‡æœŹć†…ćźč + * ćœ“tagć±žæ€§ć€Œäžș"font"时有效甚äșŽäżć­˜ç»˜ćˆ¶çš„æ–‡æœŹć†…ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + text?: string; + /** + * ç»˜ćˆ¶æ–‡æœŹçš„æ ·ćŒ + * ćœ“tagć±žæ€§ć€Œäžș"font"时有效甚äșŽæŒ‡ćźšç»˜ćˆ¶æ–‡æœŹć†…ćźčçš„ć­—äœ“ć€§ć°ă€ć­—äœ“éąœè‰Čă€ć­—äœ“ç±»ćž‹ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + textStyles?: PlusNativeObjTextStyles; + /** + * ç»˜ćˆ¶ćŻŒæ–‡æœŹçš„æ ·ćŒ + * ćœ“tagć±žæ€§ć€Œäžș"richtext"时有效甚äșŽæŒ‡ćźšç»˜ćˆ¶ćŻŒæ–‡æœŹć†…ćźčçš„é»˜èź€ć­—äœ“éąœè‰Čă€ć­—äœ“ç±»ćž‹ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + richTextStyles?: PlusNativeObjRichTextStyles; +} + +/** + * View控件äș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjViewEvents { + /** + * ćŒć‡»äș‹ä»¶ + * ćŒć‡»ć±ć蕿—¶è§Šć‘。 + * æłšæ„ïŒšćŠ‚æžœć°†ViewæŽ§ä»¶èźŸçœźäžș䞍拊æˆȘè§Šć±äș‹ä»¶ïŒˆview.interceptTouchEvent(false)ïŒ‰ćˆ™äžäŒšè§Šć‘æ­€äș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + doubleclick?: string; + /** + * ç‚č懻äș‹ä»¶ + * ćœ“æ‰‹æŒ‡ç‚čć‡»ć±ć蕿—¶è§Šć‘。 + * æłšæ„ïŒšćŠ‚æžœć°†ViewæŽ§ä»¶èźŸçœźäžș䞍拊æˆȘè§Šć±äș‹ä»¶ïŒˆview.interceptTouchEvent(false)ïŒ‰ćˆ™äžäŒšè§Šć‘æ­€äș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + click?: string; + /** + * ćŒ€ć§‹è§Šć±äș‹ä»¶ + * ćœ“æ‰‹æŒ‡è§Šæ‘žć±ć蕿—¶ć€™è§Šć‘。 + * æłšæ„ïŒšćŠ‚æžœć°†ViewæŽ§ä»¶èźŸçœźäžș䞍拊æˆȘè§Šć±äș‹ä»¶ïŒˆview.interceptTouchEvent(false)ïŒ‰ćˆ™äžäŒšè§Šć‘æ­€äș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + touchstart?: string; + /** + * è§Šæ‘žæ»‘ć±äș‹ä»¶ + * ćœ“æ‰‹æŒ‡ćœšć±ćč•äžŠæ»‘ćŠšçš„æ—¶ć€™èżžç»­ćœ°è§Šć‘ă€‚ + * æłšæ„ïŒšćŠ‚æžœć°†ViewæŽ§ä»¶èźŸçœźäžș䞍拊æˆȘè§Šć±äș‹ä»¶ïŒˆview.interceptTouchEvent(false)ïŒ‰ćˆ™äžäŒšè§Šć‘æ­€äș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + touchmove?: string; + /** + * ç»“æŸè§Šć±äș‹ä»¶ + * ćœ“æ‰‹æŒ‡ä»Žć±ćč•äžŠçŠ»ćŒ€çš„æ—¶ć€™è§Šć‘ă€‚ + * æłšæ„ïŒšćŠ‚æžœć°†ViewæŽ§ä»¶èźŸçœźäžș䞍拊æˆȘè§Šć±äș‹ä»¶ïŒˆview.interceptTouchEvent(false)ïŒ‰ćˆ™äžäŒšè§Šć‘æ­€äș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + touchend?: string; +} + +/** + * JSONćŻčè±ĄïŒŒViewæŽ§ä»¶çš„çł»ç»ŸçŠ¶æ€æ ćŒșćŸŸæ ·ćŒ + * ä»…ćœšćș”ç”šèźŸçœźäžșæČ‰æ”žćŒçŠ¶æ€æ æ ·ćŒäž‹æœ‰æ•ˆïŒŒéžæČ‰æ”žćŒçŠ¶æ€æ æ ·ćŒäž‹ćżœç•„æ­€ć±žæ€§ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjViewStatusbarStyles { + /** + * çł»ç»ŸçŠ¶æ€æ ćŒșćŸŸèƒŒæ™Żéąœè‰Č + * 鱜è‰Čć€Œæ ŒćŒäžș"#RRGGBB"ïŒŒćŠ‚"#FF0000"èĄšç€șäžșçșąè‰ČèƒŒæ™ŻïŒŒé»˜èź€ć€Œäžșćș”甚manifest.jsonäž­plus->statusbar->backgroundć±žæ€§é…çœźçš„ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + background?: string; +} + +/** + * ViewæŽ§ä»¶æ ·ćŒ + * ćŒ…æ‹Źäœçœźă€ć€§ć°ç­‰äżĄæŻç­‰ïŒŒć…¶äž­äœçœźäżĄæŻç›žćŻčäșŽçˆ¶ćźčć™šæŽ§ä»¶èż›èĄŒèźĄçź—ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ +interface PlusNativeObjViewStyles { + /** + * ćŒșćŸŸèƒŒæ™Żéąœè‰Č + * ćŻć–ć€ŒïŒš + * #RRGGBB"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"#FF0000"èĄšç€ș绘戶çșąè‰ČćŒșćŸŸïŒ› + * "rgba(R,G,B,A)"ïŒŒć…¶äž­R/G/Bćˆ†ćˆ«ä»ŁèĄšçșąè‰Čć€Œ/绿è‰Čć€Œ/蓝è‰Čć€ŒïŒŒæ­Łæ•Žæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-255Aäžș透明ćșŠïŒŒæ”źç‚čæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-10äžșć…šé€æ˜ŽïŒŒ1äžșäžé€æ˜ŽïŒ‰ïŒŒćŠ‚"rgba(255,0,0,0.5)"ïŒŒèĄšç€șçșąè‰ČćŠé€æ˜Žă€‚ é»˜èź€ć€Œäžș"#FFFFFF"癜è‰ČïŒ‰ă€‚ "rgba(R,G,B,A)"ïŒŒć…¶äž­R/G/Bćˆ†ćˆ«ä»ŁèĄšçșąè‰Čć€Œ/绿è‰Čć€Œ/蓝è‰Čć€ŒïŒŒæ­Łæ•Žæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-255Aäžș透明ćșŠïŒŒæ”źç‚čæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-10äžșć…šé€æ˜ŽïŒŒ1äžșäžé€æ˜ŽïŒ‰ïŒŒćŠ‚"rgba(255,0,0,0.5)"ïŒŒèĄšç€șçșąè‰ČćŠé€æ˜Žă€‚ é»˜èź€ć€Œäžș"#FFFFFF"癜è‰ČïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + backgroundColor?: string; + /** + * ViewæŽ§ä»¶ćž‚ç›Žć‘äžŠçš„ćç§»é‡ + * 现ćŻčäșŽçˆ¶ćźč晹ćș•éƒšçš„è·çŠ»ïŒŒćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶ćźčć™šçš„é«˜ćșŠïŒŒćŠ‚æžœæČĄæœ‰çˆ¶ćźč晹戙盾ćŻčäșŽć±ćč•高ćșŠă€‚ + * ćœ“èźŸçœźäș†top撌heightć€Œæ—¶ïŒŒćżœç•„æ­€ć±žæ€§ć€ŒïŒ› + * æœȘèźŸçœźheightć€Œæ—¶ïŒŒćŻé€šèż‡top撌bottomć±žæ€§ć€Œæ„çĄźćźšView控件的高ćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + bottom?: string; + /** + * ViewæŽ§ä»¶çš„ćœé æ–čćŒ + * ä»…ćœ“ViewæŽ§ä»¶æ·»ćŠ ćˆ°WebviewçȘ—揣ćŻčè±Ąäž­ćč¶äž”positionć±žæ€§ć€ŒèźŸçœźäžș"dock"时才生效歀时ViewæŽ§ä»¶æŒ€ćŽ‹WebviewçȘ—ćŁçš„ć€§ć°ă€‚ + * ćŻć–ć€ŒïŒš + * "top"ïŒŒæŽ§ä»¶ćœé ćˆ™éĄ”éąéĄ¶éƒšïŒ› + * "bottom"ïŒŒæŽ§ä»¶ćœé ćœšéĄ”éąćș•郚 + * "right"ïŒŒæŽ§ä»¶ćœé ćœšéĄ”éąćłäŸ§ïŒ› + * "left"ïŒŒæŽ§ä»¶ćœé ćœšéĄ”éąć·ŠäŸ§ă€‚ + * é»˜èź€ć€Œäžș"top"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + dock?: string; + /** + * ćŒșćŸŸçš„é«˜ćșŠ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶ćźčć™šçš„é«˜ćșŠïŒŒćŠ‚æžœæČĄæœ‰çˆ¶ćźč晹戙盾ćŻčäșŽć±ćč•高ćșŠïŒ› + * 憅ćźčè‡Ș适ćș”ïŒŒćŠ‚"wrap_content"æ čæźć†…ćźčèźĄçź—æŽ§ä»¶çš„é«˜ćșŠă€‚ + * é»˜èź€ć€Œäžș"100%"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + height?: string; + /** + * ćŒșćŸŸć·ŠäžŠè§’çš„æ°Žćčłćç§»é‡ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶æŽ§ä»¶çš„ćźœćșŠïŒ› + * è‡ȘćŠšèźĄçź—ïŒŒćŠ‚"auto"æ čæźwidthć€Œè‡ȘćŠšèźĄçź—ïŒŒç›žćŻčäșŽçˆ¶æŽ§ä»¶æ°Žćčłć±…䞭。 + * é»˜èź€ć€Œäžș"0px"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + left?: string; + /** + * View控件的䞍透明ćșŠ + * ć–ć€ŒèŒƒć›Žäžș0-10äžșć…šé€æ˜ŽïŒŒ1äžșäžé€æ˜ŽïŒŒé»˜èź€ć€Œäžș1ïŒŒćłäžé€æ˜Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + opacity?: number; + /** + * View控件的排版æ–čćŒ + * ä»…ćœ“ViewæŽ§ä»¶æ·»ćŠ ćˆ°WebviewçȘ—揣ćŻčè±Ąäž­æ—¶æ‰ç”Ÿæ•ˆă€‚ + * ćŻć–ć€ŒïŒš + * "static"ViewæŽ§ä»¶ćœšéĄ”éąäž­æ­ŁćžžćźšäœïŒŒćŠ‚æžœéĄ”éąć­˜ćœšæ»šćŠšæĄćˆ™éšçȘ—ćŁć†…ćźčæ»šćŠšïŒ› + * "absolute"VeiwæŽ§ä»¶ćœšéĄ”éąäž­ç»ćŻčćźšäœïŒŒćŠ‚æžœéĄ”éąć­˜ćœšæ»šćŠšæĄäžéšçȘ—ćŁć†…ćźčæ»šćŠšïŒ› + * "dock"ViewæŽ§ä»¶ćœšéĄ”éąäž­ćœé ïŒŒćœé çš„äœçœźç”±dockć±žæ€§ć€Œć†łćźšă€‚ + * é»˜èź€ć€Œäžș"absolute"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + position?: string; + /** + * ViewæŽ§ä»¶çš„çŠ¶æ€æ æ ·ćŒ + * ä»…ćœšćș”ç”šèźŸçœźäžșæČ‰æ”žćŒçŠ¶æ€æ æ ·ćŒäž‹æœ‰æ•ˆïŒŒèźŸçœźæ­€ć±žæ€§ćŽć°†è‡ȘćŠšäżç•™çł»ç»ŸçŠ¶æ€æ ćŒșćŸŸäžèą«ViewæŽ§ä»¶ć ç”šïŒˆćłView控件非æČ‰æ”žćŒæ ·ćŒæ˜Ÿç€șïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + statusbar?: PlusNativeObjViewStatusbarStyles; + /** + * ViewæŽ§ä»¶ć·ŠäžŠè§’çš„ćž‚ç›Žćç§»é‡ + * ćŻć–ć€ŒïŒšćƒçŽ ć€ŒïŒŒćŠ‚"100px"ïŒ›ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶æŽ§ä»¶çš„高ćșŠïŒ›è‡ȘćŠšèźĄçź—ïŒŒćŠ‚"auto",æ čæźheightć€Œè‡ȘćŠšèźĄçź—ïŒŒç›žćŻčäșŽçˆ¶æŽ§ä»¶ćž‚盎汅䞭。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + top?: string; + /** + * ćŒșćŸŸçš„ćźœćșŠ + * ćŻć–ć€ŒïŒšćƒçŽ ć€ŒïŒŒćŠ‚"100px";ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶æŽ§ä»¶çš„ćźœćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeobj.html](http://www.html5plus.org/doc/zh_cn/nativeobj.html) + */ + width?: string; +} + +/** + * nativeUIçźĄç†çł»ç»ŸćŽŸç”Ÿç•ŒéąïŒŒćŻç”šäșŽćŒčć‡șçł»ç»ŸćŽŸç”Ÿæç€șćŻčèŻæĄ†çȘ—ćŁă€æ—¶é—Žæ—„期选择ćŻčèŻæĄ†ă€ç­‰ćŸ…ćŻčèŻæĄ†ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ +interface PlusNativeUI { + /** + * JSONćŻčè±ĄïŒŒćŽŸç”Ÿé€‰æ‹©æŒ‰é’źæĄ†äžŠæŒ‰é’źçš„æ ·ćŒć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + ActionButtonStyles?: PlusNativeUIActionButtonStyles; + /** + * JSONćŻčè±ĄïŒŒćŽŸç”Ÿé€‰æ‹©æŒ‰é’źæĄ†çš„æ ·ćŒć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + ActionSheetStyles?: PlusNativeUIActionSheetStyles; + /** + * çĄźèź€ćŻčèŻæĄ†çš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + ConfirmOptions?: PlusNativeUIConfirmOptions; + /** + * JSONćŻčè±ĄïŒŒć›Ÿç‰‡éą„è§ˆçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + PreviewImageOptions?: PlusNativeUIPreviewImageOptions; + /** + * 旄期选择ćŻčèŻæĄ†çš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + PickDateOption?: PlusNativeUIPickDateOption; + /** + * JSONćŻčè±ĄïŒŒæ—¶é—Žé€‰æ‹©ćŻčèŻæĄ†çš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + PickTimeOption?: PlusNativeUIPickTimeOption; + /** + * çł»ç»ŸćŽŸç”Ÿç•ŒéąćŸșç±»ćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + NativeUIObj?: PlusNativeUINativeUIObj; + /** + * çł»ç»Ÿç­‰ćŸ…ćŻčèŻæĄ†ćŻčè±Ą + * 从NativeUIObjćŻčè±Ąç»§æ‰żè€Œæ„ïŒŒé€šèż‡plus.nativeUI.showWaitingæ–čæł•ćˆ›ć»șæ—¶èż”ć›žă€‚ + * 甹äșŽæŽ§ćˆ¶çł»ç»Ÿæ ·ćŒç­‰ćŸ…ćŻčèŻæĄ†çš„æ“äœœïŒŒćŠ‚ć…łé—­ă€èźŸçœźæ ‡éą˜ć†…ćźč等。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + WaitingObj?: PlusNativeUIWaitingObj; + /** + * JSONćŻčè±ĄïŒŒćŽŸç”Ÿç­‰ćŸ…ćŻčèŻæĄ†çš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + WaitingOptions?: PlusNativeUIWaitingOptions; + /** + * JSONćŻčè±ĄïŒŒćŽŸç”Ÿç­‰ćŸ…ćŻčèŻæĄ†äžŠloadingć›Ÿæ ‡è‡Ș漚ä艿 ·ćŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + WaitingLoadingOptions?: PlusNativeUIWaitingLoadingOptions; + /** + * JSONćŻčè±ĄïŒŒçł»ç»Ÿæç€șæ¶ˆæŻæĄ†èŠèźŸçœźçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + ToastOptions?: PlusNativeUIToastOptions; + /** + * ćŒčć‡șçł»ç»Ÿé€‰æ‹©æŒ‰é’źæĄ† + * 从ćș•éƒšćŠšç”»ćŒčć‡șçł»ç»Ÿæ ·ćŒé€‰æ‹©æŒ‰é’źæĄ†ïŒŒćŻèźŸçœźé€‰æ‹©æĄ†çš„æ ‡éą˜ă€æŒ‰é’źæ–‡ć­—ç­‰ă€‚ + * ćŒčć‡ș的提ç€șæĄ†äžșéžé˜»ćĄžæšĄćŒïŒŒç”šæˆ·ç‚čć‡»é€‰æ‹©æĄ†äžŠçš„æŒ‰é’źćŽć…łé—­ïŒŒćč¶é€šèż‡actionsheetCallbackć›žè°ƒć‡œæ•°é€šçŸ„ç”šæˆ·é€‰æ‹©çš„æŒ‰é’źă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + actionSheet(actionsheetStyle?: PlusNativeUIActionSheetStyles, actionsheetCallback?: (result: any) => void): PlusNativeUINativeUIObj; + /** + * ćŒčć‡șçł»ç»Ÿæç€șćŻčèŻæĄ† + * 戛ć»șćč¶æ˜Ÿç€șçł»ç»Ÿæ ·ćŒæç€șćŻčèŻæĄ†ïŒŒćŻèźŸçœźæç€șćŻčèŻæĄ†çš„æ ‡éą˜ă€ć†…ćźčă€æŒ‰é’źæ–‡ć­—ç­‰ă€‚ + * ćŒčć‡ș的提ç€șćŻčèŻæĄ†äžșéžé˜»ćĄžæšĄćŒïŒŒç”šæˆ·ç‚čć‡»æç€șćŻčèŻæĄ†äžŠçš„æŒ‰é’źćŽć…łé—­ïŒŒćč¶é€šèż‡alertCBć›žè°ƒć‡œæ•°é€šçŸ„ćŻčèŻæĄ†ć·Č慳闭。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + alert(message?: string, alertCB?: (result: any) => void, title?: string, buttonCapture?: string): void; + /** + * ćŒčć‡șçł»ç»ŸçĄźèź€ćŻčèŻæĄ† + * 戛ć»șćč¶æ˜Ÿç€șçł»ç»Ÿæ ·ćŒçĄźèź€ćŻčèŻæĄ†ïŒŒćŻèźŸçœźçĄźèź€ćŻčèŻæĄ†çš„æ ‡éą˜ă€ć†…ćźčă€æŒ‰é’źæ•°ç›źćŠć…¶æ–‡ć­—ă€‚ + * ćŒčć‡șçš„çĄźèź€ćŻčèŻæĄ†äžșéžé˜»ćĄžæšĄćŒïŒŒç”šæˆ·ç‚čć‡»çĄźèź€ćŻčèŻæĄ†äžŠçš„æŒ‰é’źćŽć…łé—­ïŒŒćč¶é€šèż‡confirmCBć›žè°ƒć‡œæ•°é€šçŸ„ç”šæˆ·ç‚čć‡»çš„æŒ‰é’źçŽąćŒ•ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + confirm(message?: string, confirmCB?: (result: any) => void, options?: PlusNativeUIConfirmOptions, buttons?: any []): void; + /** + * ć…łé—­çł»ç»Ÿç­‰ćŸ…ćŻčèŻæĄ† + * 慳闭ć·Č经星ç€șçš„æ‰€æœ‰çł»ç»Ÿæ ·ćŒç­‰ćŸ…ćŻčèŻæĄ†ïŒŒè§Šć‘WaitingćŻčè±Ąçš„oncloseäș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + closeWaiting(): void; + /** + * 慳闭è‡ȘćŠšæ¶ˆć€±çš„æç€șæ¶ˆæŻ + * 慳闭ć·Č经星ç€ș的所有è‡ȘćŠšæ¶ˆć€±çš„æç€șæĄ†ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + closeToast(): void; + /** + * éą„è§ˆć›Ÿç‰‡ + * 戛ć»șćč¶æ˜Ÿç€șć…šć±ć›Ÿç‰‡éą„è§ˆç•ŒéąïŒŒç”šæˆ·ç‚čć‡»ć›Ÿç‰‡æˆ–èż”ć›žé”źé€€ć‡șéą„è§ˆç•Œéąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + previewImage(urls?: any [], options?: PlusNativeUIPreviewImageOptions): void; + /** + * 星ç€șçł»ç»Ÿç­‰ćŸ…ćŻčèŻæĄ† + * 戛ć»șćč¶æ˜Ÿç€șçł»ç»Ÿæ ·ćŒç­‰ćŸ…ćŻčèŻæĄ†ïŒŒćč¶èż”ć›žç­‰ćŸ…ćŻčèŻæĄ†ćŻčè±ĄWaiting星ç€șćŽéœ€è°ƒç”šć…¶closeæ–čæł•èż›èĄŒć…łé—­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + showWaiting(title?: string, options?: PlusNativeUIWaitingOptions): PlusNativeUIWaitingObj; + /** + * ćŒčć‡șçł»ç»Ÿæ—„æœŸé€‰æ‹©ćŻčèŻæĄ† + * 戛ć»șćč¶æ˜Ÿç€șçł»ç»Ÿæ ·ćŒæ—„æœŸé€‰æ‹©ćŻčèŻæĄ†ïŒŒćŻèż›èĄŒæ—„æœŸçš„é€‰æ‹©ă€‚ + * ç”šæˆ·æ“äœœçĄźèź€ćŽé€šèż‡successCBć›žè°ƒć‡œæ•°èż”ć›žç”šæˆ·é€‰æ‹©çš„æ—„æœŸïŒŒè‹„ç”šæˆ·ć–æ¶ˆé€‰æ‹©ćˆ™é€šèż‡errorCBć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + pickDate(successCB?: (result: any) => void, errorCB?: (result: any) => void, options?: PlusNativeUIPickDateOption): void; + /** + * ćŒčć‡șçł»ç»Ÿæ—¶é—Žé€‰æ‹©ćŻčèŻæĄ† + * 戛ć»șćč¶ćŒčć‡șçł»ç»Ÿæ ·ćŒæ—¶é—Žé€‰æ‹©ćŻčèŻæĄ†ïŒŒćŻèż›èĄŒæ—¶é—Žçš„é€‰æ‹©ă€‚ + * ç”šæˆ·æ“äœœçĄźèź€ćŽé€šèż‡successCBć›žè°ƒć‡œæ•°èż”ć›žç”šæˆ·é€‰æ‹©çš„æ—¶é—ŽïŒŒè‹„ç”šæˆ·ć–æ¶ˆé€‰æ‹©ćˆ™é€šèż‡errorCBć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + pickTime(successCB?: (result: any) => void, errorCB?: (result: any) => void, options?: PlusNativeUIPickTimeOption): void; + /** + * ćŒčć‡șçł»ç»ŸèŸ“ć…„ćŻčèŻæĄ† + * 戛ć»șćč¶æ˜Ÿç€șçł»ç»Ÿæ ·ćŒèŸ“ć…„ćŻčèŻæĄ†ïŒŒćŻèźŸçœźèŸ“ć…„ćŻčèŻæĄ†çš„æ ‡éą˜ă€ć†…ćźčă€æç€șèŸ“ć…„äżĄæŻă€æŒ‰é’źæ•°ç›źćŠć…¶æ–‡ć­—ă€‚ + * ćŒčć‡șçš„èŸ“ć…„ćŻčèŻæĄ†äžșéžé˜»ćĄžæšĄćŒïŒŒć…¶äž­ćŒ…ć«çŒ–èŸ‘æĄ†äŸ›ç”šæˆ·èŸ“ć…„ć†…ćźč甚户ç‚čć‡»èŸ“ć…„ćŻčèŻæĄ†äžŠçš„æŒ‰é’źćŽè‡ȘćŠšć…łé—­ïŒŒćč¶é€šèż‡promptCBć›žè°ƒć‡œæ•°èż”ć›žç”šæˆ·ç‚čć‡»çš„æŒ‰é’źćŠèŸ“ć…„çš„ć†…ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + prompt(message?: string, promptCB?: (result: any) => void, title?: string, tip?: string, buttons?: any []): void; + /** + * 星ç€șè‡ȘćŠšæ¶ˆć€±çš„æç€șæ¶ˆæŻ + * 戛ć»șćč¶æ˜Ÿç€șçł»ç»Ÿæ ·ćŒæç€șæ¶ˆæŻïŒŒćŒčć‡ș的提ç€șæ¶ˆæŻäžșéžé˜»ćĄžæšĄćŒïŒŒæ˜Ÿç€șæŒ‡ćźšæ—¶é—ŽćŽè‡ȘćŠšæ¶ˆć€±ă€‚ + * 提ç€șæ¶ˆæŻæ˜Ÿç€șæ—¶é—ŽćŻé€šèż‡options的durationć±žæ€§æŽ§ćˆ¶ïŒŒé•żæ—¶é—Žæç€șæ¶ˆæŻæ˜Ÿç€șæ—¶é—ŽçșŠäžș3.5s短时闎提ç€șæ¶ˆæŻæ˜Ÿç€șæ—¶é—ŽçșŠäžș2s。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + toast(message?: string, options?: PlusNativeUIToastOptions): void; +} + +/** + * JSONćŻčè±ĄïŒŒćŽŸç”Ÿé€‰æ‹©æŒ‰é’źæĄ†äžŠæŒ‰é’źçš„æ ·ćŒć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ +interface PlusNativeUIActionButtonStyles { + /** + * æŒ‰é’źäžŠæ˜Ÿç€șçš„æ–‡ć­—éąœè‰Č + * ćŻć–ć€ŒïŒš + * "#RRGGBB"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"#FF0000"èĄšç€șæ–‡ć­—éąœè‰Čäžșçșąè‰Č + * "rgba(R,G,B,A)"ïŒŒć…¶äž­R/G/Bćˆ†ćˆ«ä»ŁèĄšçșąè‰Čć€Œ/绿è‰Čć€Œ/蓝è‰Čć€ŒïŒŒæ­Łæ•Žæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-255Aäžș透明ćșŠïŒŒæ”źç‚čæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-10äžșć…šé€æ˜ŽïŒŒ1äžșäžé€æ˜ŽïŒ‰ïŒŒćŠ‚"rgba(255,0,0,0.5)"ïŒŒèĄšç€șçșąè‰ČćŠé€æ˜Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + color?: string; + /** + * æŒ‰é’źäžŠæ˜Ÿç€șçš„æ–‡ć­—ć†…ćźč + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + title?: string; + /** + * æŒ‰é’źçš„æ ·ćŒ + * ćŻć–ć€ŒïŒš + * "destructive" - èĄšç€șè­Šç€șæŒ‰é’źæ ·ćŒïŒŒé»˜èź€æ–‡ć­—éąœè‰Čäžșçșąè‰Č + * "default" - èĄšç€șé»˜èź€æŒ‰é’źæ ·ćŒă€‚ + * é»˜èź€ć€Œäžș"default"。 + * - destructive: + * è­Šç€șæŒ‰é’źæ ·ćŒă€‚ + * + * - default: + * é»˜èź€æŒ‰é’źæ ·ćŒă€‚ + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + style?: 'destructive' | 'default'; +} + +/** + * JSONćŻčè±ĄïŒŒćŽŸç”Ÿé€‰æ‹©æŒ‰é’źæĄ†çš„æ ·ćŒć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ +interface PlusNativeUIActionSheetStyles { + /** + * é€‰æ‹©æŒ‰é’źæĄ†çš„æ ‡éą˜ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + title?: string; + /** + * ć–æ¶ˆæŒ‰é’źäžŠæ˜Ÿç€șçš„æ–‡ć­—ć†…ćźč + * äžèźŸçœźæ­€ć±žæ€§ïŒŒćˆ™äžæ˜Ÿç€șć–æ¶ˆæŒ‰é’źă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + cancel?: string; + /** + * é€‰æ‹©æĄ†äžŠçš„æŒ‰é’źïŒŒActionButtonStylesćŻčè±Ąæ•°ç»„ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + buttons?: PlusNativeUI []; +} + +/** + * çĄźèź€ćŻčèŻæĄ†çš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ +interface PlusNativeUIConfirmOptions { + /** + * çĄźèź€ćŻčèŻæĄ†æ˜Ÿç€șçš„æ ‡éą˜ + * ćŠ‚æžœäžèźŸçœźæ­€ć±žæ€§ć€ŒïŒŒćˆ™äžæ˜Ÿç€șæ ‡éą˜ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + title?: string; + /** + * çĄźèź€ćŻčèŻæĄ†äžŠæ˜Ÿç€șçš„æŒ‰é’ź + * 歗笩äžČæ•°ç»„ïŒŒæŻéĄčćŻčćș”ćœšçĄźèź€ćŻčèŻæĄ†äžŠæ˜Ÿç€ș侀äžȘæŒ‰é’źïŒŒç”šæˆ·ç‚čć‡»ćŽé€šèż‡confirmCBèż”ć›žç”šæˆ·ç‚čć‡»æŒ‰é’źçš„ćœšæ•°ç»„äž­çš„çŽąćŒ•ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + buttons?: any []; + /** + * ćŻčèŻæĄ†ćœšć±ćč•äž­çš„ćž‚ç›Žćˆ†äș«ćŻč霐æ–čćŒ + * ćŻć–ć€ŒïŒš + * "top" - èĄšç€ș枂盎汅饶ćŻč霐 + * "center" - èĄšç€ș枂盎汅䞭ćŻč霐 + * "bottom" - èĄšç€ș枂盎汅ćș•ćŻčéœă€‚ + * é»˜èź€ć€Œäžș"center"ïŒˆćž‚ç›Žć±…äž­ćŻčéœïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + verticalAlign?: string; +} + +/** + * JSONćŻčè±ĄïŒŒć›Ÿç‰‡éą„è§ˆçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ +interface PlusNativeUIPreviewImageOptions { + /** + * ć›Ÿç‰‡éą„è§ˆçš„èƒŒæ™Żéąœè‰Č + * 鱜è‰Čć€Œæ ŒćŒäžș"#RRGGBB"ïŒŒćŠ‚"#FF0000"èĄšç€șäžșçșąè‰ČèƒŒæ™Żă€‚ + * é»˜èź€ć€Œäžș黑è‰Č"#000000"ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + background?: string; + /** + * é»˜èź€æ˜Ÿç€șć›Ÿç‰‡çš„çŽąćŒ•ć€Œ + * çŽąćŒ•ć€Œä»Ž0ćŒ€ć§‹ïŒŒé»˜èź€ć€Œäžș0。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + current?: number; + /** + * ć›Ÿç‰‡æŒ‡ç€șć™šæ ·ćŒ + * ćŻć–ć€ŒïŒš + * "default" - é»˜èź€æŒ‡ç€șć™šïŒˆćș•éƒšćœ†ç‚čæ ·ćŒïŒ‰ïŒ› + * "number" - éĄ¶éƒšæ•°ć­—æŒ‡ç€șć™šïŒˆéĄ¶éƒšć±…äž­æ˜Ÿç€șïŒŒæ–‡ć­—äžș%ćœ“ć‰ć›Ÿç‰‡çŽąćŒ•ć€ŒïŒˆä»Ž1ćŒ€ć§‹ïŒ‰%/%ć›Ÿç‰‡æ€»æ•°% + * "none" - 䞍星ç€ș指ç€ș晹。 + * é»˜èź€ć€Œäžș"default"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + indicator?: string; + /** + * æ˜ŻćŠćŻćŸȘçŽŻéą„è§ˆ + * ćŻć–ć€ŒïŒš + * "true" - æ”ŻæŒćŸȘçŽŻéą„è§ˆïŒ› + * "false" - äžæ”ŻæŒćŸȘçŽŻéą„è§ˆă€‚ + * é»˜èź€ć€Œäžș"false"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + loop?: boolean; +} + +/** + * 旄期选择ćŻčèŻæĄ†çš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ +interface PlusNativeUIPickDateOption { + /** + * 旄期选择ćŻčèŻæĄ†æ˜Ÿç€șçš„æ ‡éą˜ + * ćŠ‚æžœæœȘèźŸçœźæ ‡éą˜ïŒŒćˆ™é»˜èź€æ˜Ÿç€șæ ‡éą˜äžșćœ“ć‰é€‰æ‹©çš„æ—„æœŸă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + title?: string; + /** + * 旄期选择ćŻčèŻæĄ†é»˜èź€æ˜Ÿç€ș的旄期 + * ćŠ‚æžœæœȘèźŸçœźé»˜èź€æ˜Ÿç€șçš„æ—„æœŸïŒŒćˆ™æ˜Ÿç€șćœ“ć‰çš„æ—„æœŸă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + date?: Date; + /** + * 旄期选择ćŻčèŻæĄ†ćŻé€‰æ‹©çš„æœ€ć°æ—„æœŸ + * Date类枋ćŻčè±ĄïŒŒćŠ‚æžœæœȘèźŸçœźćŻé€‰æ‹©çš„æœ€ć°æ—„æœŸïŒŒćˆ™äœżç”šçł»ç»Ÿé»˜èź€ćŻé€‰æ‹©çš„æœ€ć°æ—„æœŸć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + minDate?: Date; + /** + * 旄期选择ćŻčèŻæĄ†ćŻé€‰æ‹©çš„æœ€ć€§æ—„æœŸ + * Date类枋ćŻčè±ĄïŒŒćŠ‚æžœæœȘèźŸçœźćŻé€‰æ‹©çš„æœ€ć€§æ—„æœŸïŒŒćˆ™äœżç”šçł»ç»Ÿé»˜èź€ćŻé€‰æ‹©çš„æœ€ć€§æ—„æœŸć€Œă€‚ + * ć…¶ć€Œćż…éĄ»ć€§äșŽminDateèźŸçœźçš„ć€ŒïŒŒćŠćˆ™äœżç”šçł»ç»Ÿé»˜èź€ćŻé€‰æ‹©çš„æœ€ć€§æ—„æœŸć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + maxDate?: Date; + /** + * 时闎选择ćŻčèŻæĄ†ćŒčć‡ș指ç€șćŒș㟟 + * JSON类枋ćŻčè±ĄïŒŒæ ŒćŒćŠ‚{top:10;left:10;width:200;height:200;}ïŒŒæ‰€æœ‰ć€ŒäžșćƒçŽ ć€ŒïŒŒć…¶ć€Œäžș盾ćŻčäșŽćźč晹Webviewçš„äœçœźă€‚ + * 橂æœȘèźŸçœźæ­€ć€ŒïŒŒé»˜èź€ćœšć±ćč•ć±…äž­æ˜Ÿç€șă€‚ä»…ćœšiPadäžŠæœ‰æ•ˆïŒŒć…¶ćźƒèźŸć€‡ćżœç•„æ­€ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + popover?: any; +} + +/** + * JSONćŻčè±ĄïŒŒæ—¶é—Žé€‰æ‹©ćŻčèŻæĄ†çš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ +interface PlusNativeUIPickTimeOption { + /** + * 时闎选择ćŻčèŻæĄ†é»˜èź€æ˜Ÿç€ș的时闎 + * ćŠ‚æžœæœȘèźŸçœźæ ‡éą˜ïŒŒćˆ™é»˜èź€æ˜Ÿç€șæ ‡éą˜äžșćœ“ć‰é€‰æ‹©çš„æ—¶é—Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + time?: Date; + /** + * 时闎选择ćŻčèŻæĄ†æ˜Ÿç€șçš„æ ‡éą˜ + * ćŠ‚æžœæœȘèźŸçœźæ ‡éą˜ïŒŒćˆ™é»˜èź€æ˜Ÿç€șæ ‡éą˜äžșćœ“ć‰é€‰æ‹©çš„æ—¶é—Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + title?: string; + /** + * æ˜ŻćŠ24ć°æ—¶ćˆ¶æšĄćŒ + * trueèĄšç€șäœżç”š24ć°æ—¶ćˆ¶æšĄćŒæ˜Ÿç€șfaleèĄšç€șäœżç”š12ć°æ—¶ćˆ¶æšĄćŒæ˜Ÿç€șïŒŒé»˜èź€ć€Œäžștrue。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + is24Hour?: boolean; + /** + * 旄期选择ćŻčèŻæĄ†ćŒčć‡ș指ç€șćŒș㟟 + * JSON类枋ćŻčè±ĄïŒŒæ ŒćŒćŠ‚{top:10;left:10;width:200;height:200;}ïŒŒæ‰€æœ‰ć€ŒäžșćƒçŽ ć€ŒïŒŒć…¶ć€Œç›žćŻčäșŽćźč晹webviewçš„äœçœźă€‚ + * 橂æœȘèźŸçœźæ­€ć€ŒïŒŒé»˜èź€ćœšć±ćč•ć±…äž­æ˜Ÿç€șă€‚ä»…ćœšiPadäžŠæœ‰æ•ˆïŒŒć…¶ćźƒèźŸć€‡ćżœç•„æ­€ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + popover?: any; +} + +/** + * çł»ç»ŸćŽŸç”Ÿç•ŒéąćŸșç±»ćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ +interface PlusNativeUINativeUIObj { + /** + * ć…łé—­æ˜Ÿç€șçš„çł»ç»ŸćŽŸç”Ÿç•Œéą + * 调甚plus.nativeUI.actionSheetæ–čæł•ćˆ›ć»șćč¶æ˜Ÿç€șçł»ç»Ÿç•ŒéąćŽïŒŒćŻé€šèż‡ć…¶closeæ–čæł•ć°†ćŽŸç”Ÿç•Œéąć…łé—­ă€‚ + * æ­€æƒ…ć†”äž‹è§Šć‘ç•Œéąć…łé—­ć›žè°ƒć‡œæ•°ć‚æ•°çš„indexć±žæ€§ć€Œäžș-1。 + * æłšæ„ïŒšäž€äžȘçł»ç»ŸćŽŸç”Ÿç•ŒéąćȘèƒœć…łé—­äž€æŹĄïŒŒć€šæŹĄè°ƒç”šć°†æ— ä»»äœ•äœœç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + close(): void; +} + +/** + * çł»ç»Ÿç­‰ćŸ…ćŻčèŻæĄ†ćŻčè±Ą + * 从NativeUIObjćŻčè±Ąç»§æ‰żè€Œæ„ïŒŒé€šèż‡plus.nativeUI.showWaitingæ–čæł•ćˆ›ć»șæ—¶èż”ć›žă€‚ + * 甹äșŽæŽ§ćˆ¶çł»ç»Ÿæ ·ćŒç­‰ćŸ…ćŻčèŻæĄ†çš„æ“äœœïŒŒćŠ‚ć…łé—­ă€èźŸçœźæ ‡éą˜ć†…ćźč等。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ +interface PlusNativeUIWaitingObj { + /** + * ç­‰ćŸ…ćŻčèŻæĄ†ć…łé—­äș‹ä»¶ + * ç­‰ćŸ…æĄ†ć…łé—­æ—¶è§Šć‘ïŒŒćœ“è°ƒç”šcloseæ–čæł•或甚户ç‚čć‡»èż”ć›žæŒ‰é’źćŻŒè‡Žç­‰ćŸ…æĄ†ć…łé—­æ—¶è§Šć‘ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + onclose?: () => void; + /** + * èźŸçœźç­‰ćŸ…ćŻčèŻæĄ†äžŠæ˜Ÿç€șçš„æ–‡ć­—ć†…ćźč + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + setTitle(title?: string): void; + /** + * ć…łé—­æ˜Ÿç€șçš„çł»ç»Ÿç­‰ćŸ…ćŻčèŻæĄ† + * 调甚plus.nativeUI.showWaitingæ–čæł•ćˆ›ć»șćč¶æ˜Ÿç€șçł»ç»Ÿç­‰ćŸ…ç•ŒćŽïŒŒćŻé€šèż‡ć…¶closeæ–čæł•ć°†ćŽŸç”Ÿç­‰ćŸ…æŽ§ä»¶ć…łé—­ă€‚ + * 侀äžȘçł»ç»Ÿç­‰ćŸ…ćŻčèŻæĄ†ćȘèƒœć…łé—­äž€æŹĄïŒŒć€šæŹĄè°ƒç”šć°†æ— ä»»äœ•äœœç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + close(): void; +} + +/** + * JSONćŻčè±ĄïŒŒćŽŸç”Ÿç­‰ćŸ…ćŻčèŻæĄ†çš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ +interface PlusNativeUIWaitingOptions { + /** + * ç­‰ćŸ…æĄ†èƒŒæ™ŻćŒșćŸŸçš„ćźœćșŠ + * ć€Œæ”ŻæŒćƒçŽ ć€ŒïŒˆ"500px"ïŒ‰æˆ–ç™Ÿćˆ†æŻ”ïŒˆ"50%"ïŒ‰ïŒŒç™Ÿćˆ†æŻ”ç›žćŻčäșŽć±ćč•çš„ćźœèźĄçź—ïŒŒćŠ‚æžœäžèźŸçœźćˆ™æ čæźć†…ćźčè‡ȘćŠšèźĄçź—ćˆé€‚çš„ćźœćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + width?: string; + /** + * ç­‰ćŸ…æĄ†èƒŒæ™ŻćŒșćŸŸçš„é«˜ćșŠ + * ć€Œæ”ŻæŒćƒçŽ ç»ćŻčć€ŒïŒˆ"500px"ïŒ‰æˆ–ç™Ÿćˆ†æŻ”ïŒˆ"50%"ïŒ‰ïŒŒćŠ‚æžœäžèźŸçœźćˆ™æ čæźć†…ćźčè‡ȘćŠšèźĄçź—ćˆé€‚çš„é«˜ćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + height?: string; + /** + * ç­‰ćŸ…æĄ†äž­æ–‡ć­—çš„éąœè‰Č + * 鱜è‰Čć€Œæ”ŻæŒ(ć‚è€ƒCSS鱜è‰Č规范)ïŒšéąœè‰Č損称(ć‚è€ƒCSS Color Names)/ćć…­èż›ćˆ¶ć€Œ/rgbć€Œ/rgbać€ŒïŒŒé»˜èź€ć€Œäžș癜è‰Č。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + color?: string; + /** + * ç­‰ćŸ…æĄ†äž­æ–‡ć­—çš„ć­—äœ“ć€§ć° + * 橂"14px"èĄšç€șäœżç”š14ćƒçŽ é«˜çš„æ–‡ć­—ïŒŒæœȘèźŸçœźćˆ™äœżç”šçł»ç»Ÿé»˜èź€ć­—äœ“ć€§ć°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + size?: string; + /** + * ç­‰ćŸ…ćŻčèŻæĄ†äž­æ ‡éą˜æ–‡ć­—çš„æ°ŽćčłćŻč霐æ–čćŒ + * ćŻč霐æ–čćŒćŻé€‰ć€ŒćŒ…æ‹ŹïŒš"left"氎ćčłć±…ć·ŠćŻč霐星ç€ș"center"氎ćčłć±…äž­ćŻč霐星ç€ș"right"氎ćčłć±…揳ćŻč霐星ç€șă€‚é»˜èź€ć€Œäžșæ°Žćčłć±…äž­ćŻč霐星ç€șïŒŒćł"center"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + textalign?: string; + /** + * ç­‰ćŸ…ćŻčèŻæĄ†çš„ć†…èŸč距 + * ć€Œæ”ŻæŒćƒçŽ ć€ŒïŒˆ"10px"ïŒ‰ć’Œç™Ÿćˆ†æŻ”ïŒˆ"5%"ïŒ‰ïŒŒç™Ÿćˆ†æŻ”ç›žćŻčäșŽć±ćč•çš„ćźœèźĄçź—ïŒŒé»˜èź€ć€Œäžș"3%"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + padding?: string; + /** + * ç­‰ćŸ…ćŻčèŻæĄ†æ˜Ÿç€șćŒșćŸŸçš„èƒŒæ™Żè‰Č + * èƒŒæ™Żè‰Čçš„ć€Œæ”ŻæŒ(ć‚è€ƒCSS鱜è‰Č规范)ïŒšéąœè‰Č損称(ć‚è€ƒCSS Color Names)/ćć…­èż›ćˆ¶ć€Œ/rgbć€Œ/rgbać€ŒïŒŒé»˜èź€ć€Œäžșrgba(0,0,0,0.8)。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + background?: string; + /** + * ç­‰ćŸ…ćŻčèŻæĄ†æ ·ćŒ + * ćŻć–ć€Œ"black"、"white"blackèĄšç€șç­‰ćŸ…æĄ†äžș黑è‰Čé›ȘèŠ±æ ·ćŒïŒŒé€šćžžćœšèƒŒæ™Żäž»è‰Čäžșæ”…è‰Čæ—¶äœżç”šïŒ›whiteèĄšç€șç­‰ćŸ…æĄ†äžș癜è‰Čé›ȘèŠ±æ ·ćŒïŒŒé€šćžžćœšèƒŒæ™Żäž»è‰Čäžșæ·±è‰Čæ—¶äœżç”šă€‚ + * ä»…ćœšiOSćčłć°æœ‰æ•ˆïŒŒć…¶ćźƒćčłć°ćżœç•„æ­€ć€ŒïŒŒæœȘèźŸçœźæ—¶é»˜èź€ć€Œäžșwhite。 + * - black: 黑è‰Čé›ȘèŠ±æ ·ćŒïŒŒé€‚ćˆæ”…è‰Čç•Œéąäœżç”š + * - white: 癜è‰Čé›ȘèŠ±æ ·ćŒïŒŒé€‚ćˆæ·±è‰Čç•Œéąäœżç”š + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + style?: 'black' | 'white'; + /** + * ç­‰ćŸ…æĄ†æ˜ŻćŠæšĄæ€æ˜Ÿç€ș + * æšĄæ€æ˜Ÿç€șæ—¶ç”šæˆ·äžćŻæ“äœœç›Žćˆ°ç­‰ćŸ…ćŻčèŻæĄ†ć…łé—­ïŒŒćŠćˆ™ç”šæˆ·ćœšç­‰ćŸ…ćŻčèŻæĄ†æ˜Ÿç€ș时äčŸćŻæ“äœœäž‹éąçš„憅ćźčæœȘèźŸçœźæ—¶é»˜èź€äžștrue。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + modal?: boolean; + /** + * ç­‰ćŸ…æĄ†æ˜Ÿç€șćŒșćŸŸçš„ćœ†è§’ + * ć€Œæ”ŻæŒćƒçŽ ć€ŒïŒˆ"10px"æœȘèźŸçœźæ—¶äœżç”šé»˜èź€ć€Œ"10px"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + round?: number; + /** + * ç‚čć‡»ç­‰ćŸ…æ˜Ÿç€șćŒșćŸŸæ˜ŻćŠè‡Ș抹慳闭 + * trueèĄšç€șç‚čć‡»ç­‰ćŸ…ćŻčèŻæĄ†æ˜Ÿç€șćŒșćŸŸæ—¶è‡ȘćŠšć…łé—­ïŒŒfalsećˆ™äžć…łé—­ïŒŒæœȘèźŸçœźæ—¶é»˜èź€ć€Œäžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + padlock?: boolean; + /** + * èż”ć›žé”źć€„ç†æ–čćŒ + * ćŻć–ć€Œ"none"èĄšç€șæˆȘèŽ·ć€„ç†èż”ć›žé”źïŒŒäœ†äžćšä»»äœ•ć“ćș”"close"èĄšç€șæˆȘèŽ·ć€„ç†èż”ć›žé”źćč¶ć…łé—­ç­‰ćŸ…æĄ†ïŒ›"transmit"èĄšç€ș䞍æˆȘèŽ·èż”ć›žé”źïŒŒć‘ćŽäŒ é€’ç»™WebviewçȘ—ćŁç»§ç»­ć€„ç†ïŒˆäžŽæœȘ星ç€șç­‰ćŸ…æĄ†çš„æƒ…ć†”äž€è‡ŽïŒ‰ă€‚ + * - none: æˆȘèŽ·èż”ć›žé”źïŒŒäžćšä»»äœ•ć“ćș” + * - close: æˆȘèŽ·èż”ć›žé”źćč¶ć…łé—­ç­‰ćŸ…æĄ† + * - transmit: 䞍æˆȘèŽ·èż”ć›žé”źïŒŒç»§ç»­äŒ é€’ç»™WebviewçȘ—揣 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + back?: 'none' | 'close' | 'transmit'; + /** + * è‡Ș漚äč‰ç­‰ćŸ…æĄ†äžŠloadingć›Ÿæ ‡æ ·ćŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + loading?: PlusNativeUIWaitingLoadingOptions; +} + +/** + * JSONćŻčè±ĄïŒŒćŽŸç”Ÿç­‰ćŸ…ćŻčèŻæĄ†äžŠloadingć›Ÿæ ‡è‡Ș漚ä艿 ·ćŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ +interface PlusNativeUIWaitingLoadingOptions { + /** + * loadingć›Ÿæ ‡æ˜Ÿç€șæ ·ćŒ + * ćŻć–ć€ŒïŒš + * "block"èĄšç€șć›Ÿæ ‡äžŽæ–‡ć­—ćˆ†ćŒ€äž€èĄŒæ˜Ÿç€șïŒŒäžŠéąæ˜Ÿç€șloadingć›Ÿæ ‡ïŒŒäž‹éąæ˜Ÿç€șæ–‡ć­—ïŒ› + * "inline"èĄšç€șloadingć›Ÿæ ‡äžŽæ–‡ć­—ćœšćŒäž€èĄŒæ˜Ÿç€șïŒŒć·ŠèŸč星ç€șloadingć›Ÿæ ‡ïŒŒćłèŸč星ç€șæ–‡ć­—ïŒ› + * "none"èĄšç€ș䞍星ç€șloadingć›Ÿæ ‡ïŒ› + * - block: + * loadingć›Ÿæ ‡äžŽæ–‡ć­—ćˆ†ćŒ€äž€èĄŒæ˜Ÿç€șïŒŒäžŠéąæ˜Ÿç€șloadingć›Ÿæ ‡ïŒŒäž‹éąæ˜Ÿç€șæ–‡ć­—ă€‚ + * + * - inline: + * loadingć›Ÿæ ‡äžŽæ–‡ć­—ćœšćŒäž€èĄŒæ˜Ÿç€șïŒŒć·ŠèŸč星ç€șloadingć›Ÿæ ‡ïŒŒćłèŸč星ç€șæ–‡ć­—ă€‚ + * + * - none: + * 䞍星ç€șloadingć›Ÿæ ‡ă€‚ + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + display?: 'block' | 'inline' | 'none'; + /** + * loadingć›Ÿæ ‡é«˜ćșŠ + * èźŸçœźloadingć›Ÿæ ‡çš„é«˜ćșŠïŒˆćźœćșŠç­‰æŻ”çŽ‡çŒ©æ”ŸïŒ‰ïŒŒć–ć€Œç±»ćž‹ïŒšćƒçŽ ć€ŒïŒŒćŠ‚"14px"èĄšç€ș14ćƒçŽ é«˜ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + height?: string; + /** + * loadingć›Ÿæ ‡è·ŻćŸ„ + * è‡Ș漚äč‰loadingć›Ÿæ ‡çš„è·ŻćŸ„ïŒŒpngæ ŒćŒïŒŒćč¶äž”ćż…éĄ»æ˜ŻæœŹćœ°è”„æșćœ°ć€ïŒ› + * loadingć›ŸèŠæ±‚ćźœæ˜Żé«˜çš„æ•Žæ•°ć€ïŒŒæ˜Ÿç€șç­‰ćŸ…æĄ†æ—¶æŒ‰ç…§ć›Ÿç‰‡çš„é«˜æšȘ搑æˆȘć–æŻćž§ćˆ·æ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + icon?: string; + /** + * loadingć›ŸæŻćž§ćˆ·æ–°é—Žéš” + * ć•äœäžșmsïŒˆæŻ«ç§’ïŒ‰ïŒŒé»˜èź€ć€Œäžș100ms。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + interval?: number; +} + +/** + * JSONćŻčè±ĄïŒŒçł»ç»Ÿæç€șæ¶ˆæŻæĄ†èŠèźŸçœźçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ +interface PlusNativeUIToastOptions { + /** + * 提ç€șæ¶ˆæŻæĄ†ćœšć±ćč•䞭的氎ćčłäœçœź + * ćŻé€‰ć€Œäžș"left"、"center"、"right"ïŒŒćˆ†ćˆ«äžșæ°Žćčłć±…ć·Šă€ć±…äž­ă€ć±…ćłïŒŒæœȘèźŸçœźæ—¶é»˜èź€ć€Œäžș"center"。 + * - left: æ°Žćčłć±…ć·ŠćŻč霐 + * - center: æ°Žćčłć±…äž­ćŻč霐 + * - right: æ°Žćčłć±…ć·ŠćŻč霐 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + align?: 'left' | 'center' | 'right'; + /** + * 提ç€șæ¶ˆæŻæĄ†æ˜Ÿç€ș的时闎 + * ćŻé€‰ć€Œäžș"long"、"short"ïŒŒć€Œäžș"long"时星ç€șæ—¶é—ŽçșŠäžș3.5sïŒŒć€Œäžș"short"时星ç€șæ—¶é—ŽçșŠäžș2sæœȘèźŸçœźæ—¶é»˜èź€ć€Œäžș"short"。 + * - long: é•żæ˜Ÿç€șæ—¶é—Ž + * - short: 短星ç€șæ—¶é—Ž + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + duration?: 'long' | 'short'; + /** + * 提ç€șæ¶ˆæŻæĄ†äžŠæ˜Ÿç€șçš„ć›Ÿæ ‡ + * ä»…æ”ŻæŒæœŹćœ°ć›Ÿç‰‡è·ŻćŸ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + icon?: string; + /** + * ć›Ÿæ ‡çš„ćźœćșŠ + * ć•äœäžșpxïŒˆé€»èŸ‘ćƒçŽ ć€ŒïŒ‰ïŒŒé»˜èź€ć€Œäžșć›Ÿç‰‡çš„ćźœćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + iconWidth?: string; + /** + * ć›Ÿæ ‡çš„é«˜ćșŠ + * ć•äœäžșpxïŒˆé€»èŸ‘ćƒçŽ ć€ŒïŒ‰ïŒŒé»˜èź€ć€Œäžșć›Ÿç‰‡çš„é«˜ćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + iconHeight?: string; + /** + * 提ç€șæ¶ˆæŻæĄ†äžŠæ˜Ÿç€șçš„æ ·ćŒ + * ćŻć–ć€ŒïŒš + * "block"èĄšç€șć›Ÿæ ‡äžŽæ–‡ć­—ćˆ†äž€èĄŒæ˜Ÿç€șïŒŒäžŠéąæ˜Ÿç€șć›Ÿæ ‡ïŒŒäž‹éąæ˜Ÿç€șæ–‡ć­—ïŒ› + * "inline"èĄšç€șć›Ÿæ ‡äžŽæ–‡ć­—ćœšćŒäž€èĄŒæ˜Ÿç€șïŒŒć·ŠèŸč星ç€șć›Ÿæ ‡ïŒŒćłèŸč星ç€șæ–‡ć­—ă€‚ + * é»˜èź€ć€Œäžș"block"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + style?: string; + /** + * 提ç€șæ¶ˆæŻæĄ†äžŠæ˜Ÿç€șçš„æ–‡æœŹç±»ćž‹ + * ćŻć–ć€ŒïŒš + * "text" - 星ç€șçš„æ¶ˆæŻć†…ćźčäžșæ–‡æœŹć­—çŹŠäžČ + * "richtext" - 星ç€șçš„æ¶ˆæŻć†…ćźčäžșćŻŒæ–‡æœŹć†…ćźč。 + * é»˜èź€ć€Œäžș"text"。 + * ćœ“typeäžș"text"æ—¶ïŒŒćŻŒæ–‡æœŹäœżç”šhtmlçš„éƒšćˆ†æ ‡ç­ŸïŒŒć…·äœ“æ ‡ç­ŸćŠ‚äž‹ïŒš + * ć›Ÿç‰‡æ ‡ç­Ÿ<img src="ć›Ÿç‰‡è”„æșurl朰杀" width="ć›Ÿç‰‡æ˜Ÿç€șçš„ćźœćșŠ" height="ć›Ÿç‰‡æ˜Ÿç€ș的高ćșŠ" onclick="console.log('clicked img')"></img> + * ć­—äœ“æ ‡ç­Ÿ<font color="ć­—äœ“éąœè‰Č"></font>ïŒŒć†…ćźčćœšäž€èĄŒæ˜Ÿç€ș䞍䞋时è‡ȘćŠšæąèĄŒïŒŒèĄŒé«˜é»˜èź€äžșć­—äœ“çš„1.2ć€ïŒ› + * æąèĄŒæ ‡ç­Ÿ<br/> + * 铟掄标筟<a onclick="console.log('clicked a')">é“ŸæŽ„ćœ°ć€</a>。 + * 橂ç€ș䟋“<img onclick="console.log('clicked img')" src="http://img-cdn-qiniu.dcloud.net.cn/icon2.png"/><a onclick="console.log(clicked a)">é“ŸæŽ„ćœ°ć€</a>”。 + * - text: æ–‡æœŹć­—çŹŠäžČ + * - richtext: ćŻŒæ–‡æœŹć†…ćźč + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + type?: 'text' | 'richtext'; + /** + * ćŻŒæ–‡æœŹæ ·ćŒ + * ćœ“typeć±žæ€§ć€Œäžș"richtext"时有效甚äșŽćźšäč‰ćŻŒæ–‡æœŹçš„æ ·ćŒïŒŒćŠ‚ć…¶æ–‡æœŹćŻč霐æ–čćŒă€äœżç”šçš„ć­—äœ“ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + richTextStyle?: PlusNativeObjRichTextStyles; + /** + * 提ç€șæ¶ˆæŻćœšć±ćč•äž­çš„ćž‚ç›Žäœçœź + * ćŻé€‰ć€Œäžș"top"、"center"、"bottom"ïŒŒćˆ†ćˆ«äžș枂盎汅饶、汅䞭、汅ćș•æœȘèźŸçœźæ—¶é»˜èź€ć€Œäžș"bottom"。 + * - top: 枂盎汅饶ćŻč霐 + * - center: 枂盎汅䞭ćŻč霐 + * - bottom: 枂盎汅ćș•ćŻč霐 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/nativeui.html](http://www.html5plus.org/doc/zh_cn/nativeui.html) + */ + verticalAlign?: 'top' | 'center' | 'bottom'; +} + +/** + * navigator甹äșŽçźĄç†æ”è§ˆć™šèżèĄŒçŽŻćąƒäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ +interface PlusNavigator { + /** + * 戛ć»șćș”ç”šćż«æ·æ–čćŒèŠèźŸçœźçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + ShortcutOptions?: PlusNavigatorShortcutOptions; + /** + * 曎新ćș”ç”šćŻćŠšç•ŒéąèŠèźŸçœźçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + SplashscreenOptions?: PlusNavigatorSplashscreenOptions; + /** + * èżèĄŒçŽŻćąƒæƒé™ç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + PermissionNames?: PlusNavigatorPermissionNames; + /** + * æŁ€æŸ„èżèĄŒçŽŻćąƒçš„æƒé™ + * ć‘çł»ç»ŸæŁ€æŸ„ćœ“ć‰çš‹ćșçš„æƒé™çŠ¶æ€ïŒŒäžè§Šć‘æƒé™ç›žćŻčćș”çš„ćŠŸèƒœAPIçš„è°ƒç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + checkPermission(permission?: PlusNavigatorPermissionNames): string; + /** + * 慳闭ćș”ç”šćŻćŠšç•Œéą + * ćŸˆć€šæƒ…ć†”äž‹ïŒŒćș”ç”šćŻćŠšćŽéœ€èŠäž€æź”æ—¶é—ŽćŠ èœœæ•°æźïŒŒäžșäș†éżć…ç•Œéąæ˜Ÿç€șç©șç™œć†…ćźč提高甚户䜓éȘŒæ•ˆæžœïŒŒèż™æ—¶ćŻæ˜Ÿç€ș搯抹界靱。 + * ç­‰æ•°æźćŠ èœœćźŒæˆćŽć†ć…łé—­ćŻćŠšç•Œéąèż›ć…„ćș”ç”šïŒŒé€šćžžćŻćœšćș”ç”šéŠ–ç•ŒéąćŠ èœœæ•°æźćźŒæˆćč¶æ›Žæ–°æ˜Ÿç€ș憅ćźčćŽè°ƒç”šæ­€æ–čæł•。 + * æłšæ„ïŒšHBuilder7.1ç‰ˆæœŹćŽćŻćŠšç•Œéąäžè°ƒç”šæ­€æ–čæł•è¶…èż‡6ç§’ćŽäŒšè‡Ș抹慳闭。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + closeSplashscreen(): void; + /** + * æŸ„èŻąèźŸć€‡æ˜ŻćŠäžșćˆ˜æ”·ć± + * ćˆ˜æ”·ć±èż”ć›žtrueïŒŒćŠćˆ™èż”ć›žfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + hasNotchInScreen(): boolean; + /** + * æŸ„èŻąćș”ç”šćŻćŠšç•Œéąæ˜ŻćŠć·Č慳闭 + * ćŠ‚æžœćŻćŠšç•Œéąæ˜Ÿç€șèż”ć›žtrueïŒŒćŠćˆ™èż”ć›žfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + hasSplashscreen(): boolean; + /** + * 曎新皋ćșćŻćŠšç•Œéą + * ćŻèźŸçœźćŻćŠšç•Œéąæ˜Ÿç€șçš„ć›Ÿç‰‡ïŒˆä»…æ”ŻæŒæœŹćœ°æ–‡ä»¶è·ŻćŸ„ïŒŒćŠ‚æžœæ˜Żçœ‘ç»œè”„æșćŻć…ˆé€šèż‡plus.downloader.*äž‹èœœćˆ°æœŹćœ°ïŒ‰ïŒŒ + * æ›Žæ–°ćŻćŠšç•ŒéąćŽçš‹ćșäž‹æŹĄćŻćŠšæ—¶ç”Ÿæ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + updateSplashscreen(options?: PlusNavigatorSplashscreenOptions): void; + /** + * 戛ć»șćș”ç”šćż«æ·æ–čćŒ + * ćœšçł»ç»ŸæĄŒéąćˆ›ć»șćș”ç”šçš„ćż«æ·æ–čćŒïŒŒç‚čć‡»ćŽćŻç›ŽæŽ„ćŻćŠšćș”甚。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + createShortcut(options?: PlusNavigatorShortcutOptions, successCallback?: (result: any) => void): void; + /** + * æŸ„èŻąæ˜ŻćŠć­˜ćœšćș”ç”šćż«æ·æ–čćŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + hasShortcut(options?: PlusNavigatorShortcutOptions, successCallback?: (result: any) => void): void; + /** + * ćˆ€æ–­ćœ“ć‰ćș”ç”šæ˜ŻćŠćˆ‡æąćˆ°ćŽć° + * ćœšć€šćș”ç”šèżèĄŒçŽŻćąƒïŒˆćŠ‚æ”ćș”ç”šïŒ‰äž­ïŒŒćŻćŠšäž€äžȘ新ćș”甚时äč‹ć‰èżèĄŒçš„ćș”ç”šć°†äŒšè‡ȘćŠšćˆ‡æąćˆ°ćŽć°èżèĄŒïŒŒæ­€æ—¶plus.navigator.isBackground()èż”ć›žçŠ¶æ€ćȘäžștrue。 + * æłšæ„ïŒšæ­€çŠ¶æ€äžæ˜Ż5+ćș”ç”šćˆ‡æąćˆ°çł»ç»ŸćŽć°çš„çŠ¶æ€ïŒŒè€Œæ˜ŻćœšćŒäž€apkäž­ćŒæ—¶èżèĄŒć€šäžȘćș”ç”šæ—¶èą«ćˆ‡æąćˆ°ćŽć°çš„çŠ¶æ€ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + isBackground(): boolean; + /** + * ćˆ€æ–­ćș”ç”šćœ“ć‰æ˜ŻćŠć…šć±æšĄćŒæ˜Ÿç€ș + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + isFullscreen(): boolean; + /** + * ćˆ€æ–­ćș”ç”šćœ“ć‰æ˜ŻćŠèŸ“ć‡șæ—„ćż— + * æ—„ćż—ćŒ…æ‹Źćș”ç”šćŽŸç”Ÿć±‚ć†…éƒšè·ŸèžȘæ—„ćż—ïŒˆADB、LogCatć·„ć…·ćŻèŽ·ć–çš„æ—„ćż—ïŒ‰ćŠJSć±‚è·ŸèžȘæ—„ćż—ïŒˆconsole.log蟓ć‡șçš„æ—„ćż—ïŒ‰ă€‚ + * ćŒ€ćŻæ—„ćż—ćœšäž€ćźšçš‹ćșŠäžŠäŒšé™äœŽçš‹ćșçš„æ€§èƒœïŒŒé€šćžžć»șèźźćœšæ­ŁćŒć‘ćžƒæ—¶ć…łé—­æ—„ćż—èŸ“ć‡șïŒŒćœšè°ƒèŻ•æ—¶ćŒ€ćŻæ—„ćż—èŸ“ć‡șïŒˆæ­€æ—¶ćŻä»„é€šèż‡ć·„ć…·ADB、LogCatèŽ·ć–ćˆ†æžæ—„ćż—ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + isLogs(): boolean; + /** + * èźŸçœźćș”ç”šæ˜ŻćŠć…šć±æ˜Ÿç€ș + * èźŸçœźćș”ç”šćœšć…šć±æšĄćŒæ˜Ÿç€șæ—¶ïŒŒć°†éšè—çł»ç»ŸçŠ¶æ€æ ïŒŒé€šćžžæžžæˆç±»ćș”ç”šæ‰äŒšèźŸçœźäžșć…šć±æšĄćŒæ˜Ÿç€ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + setFullscreen(fullscreen?: boolean): void; + /** + * èźŸçœźćș”ç”šæ˜ŻćŠèŸ“ć‡șæ—„ćż— + * èźŸçœźćș”ç”šæ˜ŻćŠèŸ“ć‡șæ—„ćż—äżĄæŻïŒŒé»˜èź€ć…łé—­èŸ“ć‡șæ—„ćż—ćŠŸèƒœă€‚ + * æ—„ćż—ćŒ…æ‹Źćș”ç”šćŽŸç”Ÿć±‚ć†…éƒšè·ŸèžȘæ—„ćż—ïŒˆADB、LogCatć·„ć…·ćŻèŽ·ć–çš„æ—„ćż—ïŒ‰ćŠJSć±‚è·ŸèžȘæ—„ćż—ïŒˆconsole.log蟓ć‡șçš„æ—„ćż—ïŒ‰ă€‚ + * ćŒ€ćŻæ—„ćż—ćœšäž€ćźšçš‹ćșŠäžŠäŒšé™äœŽçš‹ćșçš„æ€§èƒœïŒŒé€šćžžć»șèźźćœšæ­ŁćŒć‘ćžƒæ—¶ć…łé—­æ—„ćż—èŸ“ć‡șïŒŒćœšè°ƒèŻ•æ—¶ćŒ€ćŻæ—„ćż—èŸ“ć‡șïŒˆæ­€æ—¶ćŻä»„é€šèż‡ć·„ć…·ADB、LogCatèŽ·ć–ćˆ†æžæ—„ćż—ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + setLogs(log?: boolean): void; + /** + * èźŸçœźçł»ç»ŸçŠ¶æ€æ èƒŒæ™Żéąœè‰Č + * èźŸçœźćș”ç”šćœšć‰ć°èżèĄŒæ—¶çł»ç»ŸçŠ¶æ€æ çš„èƒŒæ™Żéąœè‰ČïŒŒé»˜èź€äœżç”šçł»ç»ŸçŠ¶æ€æ é»˜èź€èƒŒæ™Żè‰ČïŒˆæœ‰çł»ç»ŸçŠ¶æ€æ æ ·ćŒć†łćźšïŒ‰ă€‚ + * æłšæ„ïŒšäžșäș†æœ‰æ›Žć„œçš„ć…Œćźčæ€§ïŒŒéżć…èźŸçœźæŽ„èż‘ç™œè‰Č或黑è‰Č的鱜è‰Čć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + setStatusBarBackground(color?: string): void; + /** + * èŽ·ć–çł»ç»ŸçŠ¶æ€æ èƒŒæ™Żéąœè‰Č + * èŽ·ć–ćș”ç”šćœšć‰ć°èżèĄŒæ—¶çł»ç»ŸçŠ¶æ€æ çš„èƒŒæ™Żéąœè‰Č。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + getStatusBarBackground(): string; + /** + * èźŸçœźçł»ç»ŸçŠ¶æ€æ æ ·ćŒ + * èźŸçœźćș”ç”šćœšć‰ć°èżèĄŒæ—¶çł»ç»ŸçŠ¶æ€æ çš„æ ·ćŒïŒŒé»˜èź€ć€ŒćŻé€šèż‡manifest.json文件的plus->statusbar->styleé…çœźă€‚ + * æłšæ„ïŒšæ­€æ“äœœæ˜Żćș”ç”šć…šć±€é…çœźïŒŒè°ƒç”šçš„WebviewçȘ—ćŁć…łé—­ćŽä»ç„¶ç”Ÿæ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + setStatusBarStyle(style?: string): void; + /** + * èŽ·ć–çł»ç»ŸçŠ¶æ€æ æ ·ćŒ + * èŽ·ć–ćș”ç”šèżèĄŒæ—¶çł»ç»ŸçŠ¶æ€æ çš„æ ·ćŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + getStatusBarStyle(): string; + /** + * èŽ·ć–çł»ç»ŸçŠ¶æ€æ é«˜ćșŠ + * ć•äœäžșćƒçŽ ïŒˆpxïŒ‰ïŒŒć€ŒäžșWebview䞭的逻蟑高ćșŠć•äœïŒŒćŠ‚æžœèŠèŽ·ć–çœŸćźžé«˜ćșŠćˆ™ćż…饻äč˜ä»„plus.screen.scale。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + getStatusbarHeight(): number; + /** + * ćˆ€æ–­ćœ“ć‰æ˜ŻćŠäžșæČ‰æ”žćŒçŠ¶æ€æ æšĄćŒ + * ćŠ‚æžœćœ“ć‰ćș”甚采甚æČ‰æ”žćŒçŠ¶æ€æ ćˆ™èż”ć›žtrueïŒŒćŠćˆ™èż”ć›žfalse。 + * æłšæ„ïŒšćŠ‚æžœćœ“ć‰çł»ç»Ÿç‰ˆæœŹäžæ”ŻæŒæČ‰æ”žćŒçŠ¶æ€æ äčŸèż”曞false。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + isImmersedStatusbar(): boolean; + /** + * èźŸçœźuserAgentć€Œ + * èźŸçœźćș”ç”šé€šèż‡navigator.userAgentèŽ·ć–çš„ć€ŒïŒŒćŠæ‰€æœ‰ć‘è”·HttpèŻ·æ±‚æ—¶æäș€çš„userAgentć€Œă€‚ + * ćŠ‚æžœèŠèźŸçœźćŻćŠšéĄ”éąçš„userAgentć€Œćˆ™éœ€èŠćœšmanifest.jsonäž­èż›èĄŒé…çœźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + setUserAgent(useragent?: string, checkplus?: boolean): void; + /** + * èŽ·ć–userAgentć€Œ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + getUserAgent(): string; + /** + * èźŸçœźCookieć€Œ + * èźŸçœźćș”ç”šć‘è”·HttpèŻ·æ±‚æ—¶æäș€çš„cookieć€ŒïŒŒè°ƒç”šæ­€æŽ„ćŁćŽæ‰€æœ‰çš„èŻ·æ±‚éƒœç”Ÿæ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + setCookie(url?: string, value?: string): void; + /** + * èŽ·ć–Cookieć€Œ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + getCookie(url?: string): string; + /** + * ćˆ é™€ćș”甚所有Cookieć€Œ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + removeAllCookie(): void; + /** + * ćˆ é™€ćș”甚Cookie + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + removeCookie(url?: string): void; + /** + * ćˆ é™€ćș”ç”šæ‰€æœ‰äŒšèŻæœŸCookieć€Œ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + removeSessionCookie(): void; +} + +/** + * 戛ć»șćș”ç”šćż«æ·æ–čćŒèŠèźŸçœźçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ +interface PlusNavigatorShortcutOptions { + /** + * ćż«æ·æ–čćŒćç§° + * ćŠ‚æžœæœȘèźŸçœźćˆ™äœżç”šćș”ç”šçš„ćç§°ïŒŒmanifest.jsonäž­nameć±žæ€§ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + name?: string; + /** + * ćż«æ·æ–čćŒçš„ć›Ÿæ ‡ + * ćŠ‚æžœæœȘèźŸçœźćˆ™äŒ˜ć…ˆäœżç”šćș”ç”šäž­æŒ‡ćźšçš„ć›Ÿæ ‡ïŒˆmanifest.jsonäž­icon节ç‚č例ćŻčćș”ćˆ†èŸšçŽ‡çš„ć›Ÿæ ‡ïŒ‰ïŒŒćŠ‚æœȘćŒșé…ćˆ™äœżç”šćș”ç”šçš„ć›Ÿæ ‡ïŒˆä»…ćœšç‹Źç«‹æ‰“ćŒ…æ—¶ïŒ‰ïŒŒćŠćˆ™äœżç”šruntimeæäŸ›çš„é»˜èź€ć›Ÿæ ‡ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + icon?: string; + /** + * 戛ć»șćż«æ·æ–čćŒćŽçš„æç€șäżĄæŻ + * ćż«æ·æ–čćŒćˆ›ć»șæˆćŠŸćŽæ˜Ÿç€șïŒŒé»˜èź€æç€ș憅ćźčäžș“"XXXX"ć·Č戛ć»șæĄŒéąćż«æ·æ–čćŒâ€ïŒŒć…¶äž­"XXXX"äžș繋ćșçš„ćç§°ïŒŒćŠ‚æžœäžéœ€èŠæç€șćˆ™èźŸçœźæ­€ć€Œäžșç©ș歗笩äžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + toast?: string; + /** + * ćż«æ·æ–čćŒçš„æ‰©ć±•ć‚æ•° + * ć…¶äž­key撌valueć€Œéƒœćż…éĄ»æ˜Żć­—çŹŠäžČ类枋。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + extra?: any; + /** + * èŠćŻćŠšActivityç±»ć + * é€šćžžæƒ…ć†”äž‹äžéœ€èŠæŒ‡ćźšæ­€ć€ŒïŒŒä»…ćœš5+SDK集成时è‡Ș漚äč‰Activityæ‰ç”šćˆ°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + classname?: string; + /** + * æ˜ŻćŠéœ€èŠćŒșćˆ¶ćˆ›ć»șćż«æ·æ–čćŒ + * trueèĄšç€șćŒșćˆ¶ćˆ›ć»șfalseèĄšç€ș䞍ćŒșćˆ¶ćˆ›ć»șïŒŒé»˜èź€ć€Œäžștrue。 + * ćŒșćˆ¶ćˆ›ć»șćŻèƒœäŒšćŻŒè‡Žćœšæ— æł•ćˆ€æ–­ćż«æ·æ–čćŒæ˜ŻćŠć­˜ćœšçš„èźŸć€‡äžŠé‡ć€ćˆ›ć»șïŒŒćŠ‚æžœéœ€èŠć°œćŻèƒœéżć…ć‡șçŽ°é‡ć€ćˆ›ć»șæĄŒéąćż«æ·æ–čćŒćˆ™ćș”èŻ„èźŸçœźforceć±žæ€§ć€Œäžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + force?: boolean; +} + +/** + * 曎新ćș”ç”šćŻćŠšç•ŒéąèŠèźŸçœźçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ +interface PlusNavigatorSplashscreenOptions { + /** + * ćŻćŠšç•Œéąçš„ć›Ÿç‰‡è·ŻćŸ„ + * ä»…æ”ŻæŒæœŹćœ°æ–‡ä»¶è·ŻćŸ„ïŒŒć›Ÿç‰‡ćż…éĄ»äžșpngæ ŒćŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + image?: string; + /** + * æ˜ŻćŠè‡Ș抹慳闭搯抹界靱 + * trueèĄšç€șćș”甚搯抚搎è‡ȘćŠšć…łé—­ćŻćŠšç•ŒéąïŒŒfalseèĄšç€șćș”ç”šćŻćŠšćŽäžè‡ȘćŠšć…łé—­ćŻćŠšç•ŒéąïŒŒéœ€èŠćœšćș”甚调甚plus.navigator.closeSplashscreen()æ–čæł•慳闭。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + autoclose?: boolean; + /** + * æ˜ŻćŠè‡ȘćŠšć…łé—­ćŻćŠšç•ŒéąïŒˆWAP2APPćș”甚 + * 侎autocloseć±žæ€§ć€Œäœœç”šäž€è‡ŽïŒŒä»…ćœšWAP2APPćș”ç”šäž­æœ‰æ•ˆă€‚ + * äžæŽšèèźŸçœźæ­€ć€ŒïŒŒćŠ‚æžœæœȘèźŸçœźäŒšè‡ȘćŠšäœżç”šautocloseć±žæ€§ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + autoclose_w2a?: boolean; + /** + * ćŻćŠšç•Œéąć»¶æ—¶ć…łé—­æ—¶é—Ž + * ä»…ćœšèźŸçœźäžșè‡ȘćŠšć…łé—­ćŻćŠšç•Œéąæ—¶æœ‰æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + delay?: number; + /** + * ćŻćŠšç•Œéąć»¶æ—¶ć…łé—­æ—¶é—ŽïŒˆWAP2APPćș”甚 + * 侎delayć±žæ€§ć€Œäœœç”šäž€è‡ŽïŒŒä»…ćœšWAP2APPćș”ç”šäž­æœ‰æ•ˆă€‚ + * äžæŽšèèźŸçœźæ­€ć€ŒïŒŒćŠ‚æžœæœȘèźŸçœźäŒšè‡ȘćŠšäœżç”šdelayć±žæ€§ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + delay_w2a?: number; +} + +/** + * èżèĄŒçŽŻćąƒæƒé™ç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ +interface PlusNavigatorPermissionNames { + /** + * èźżé—źæ‘„ćƒć€Žæƒé™ + * 甹äșŽè°ƒç”šæ‘„ćƒć€ŽïŒˆplus.camera.*、plus.barcode.*ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + CAMERA?: string; + /** + * èźżé—źçł»ç»Ÿè”çł»äșș权限 + * 甹äșŽèźżé—źïŒˆèŻ»ă€ć†™ïŒ‰çł»ç»Ÿé€šèźŻćœ•ïŒˆplus.gallery.*ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + CONTACTS?: string; + /** + * èźżé—źçł»ç»Ÿç›žć†Œæƒé™ + * 甹äșŽèźżé—źïŒˆèŻ»ă€ć†™ïŒ‰çł»ç»Ÿç›žć†ŒïŒˆplus.gallery.*ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + GALLERY?: string; + /** + * ćźšäœæƒé™ + * 甹äșŽèŽ·ć–ćœ“ć‰ç”šæˆ·äœçœźäżĄæŻïŒˆplus.geolocation.*ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + LOCATION?: string; + /** + * æ¶ˆæŻé€šçŸ„æƒé™ + * 甹äșŽæŽ„æ”¶çł»ç»Ÿæ¶ˆæŻé€šçŸ„ïŒˆplus.push.*ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + NOTIFITION?: string; + /** + * ćœ•éŸłæƒé™ + * 甹äșŽèż›èĄŒæœŹćœ°ćœ•éŸłæ“äœœïŒˆplus.audio.AudioRecorderïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + RECORD?: string; + /** + * 戛ć»șæĄŒéąćż«æ·æ–čćŒæƒé™ + * 甹äșŽćœšçł»ç»ŸæĄŒéąćˆ›ć»șćż«æ·æ–čćŒć›Ÿæ ‡ïŒˆplus.navigator.createShortcutïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/navigator.html](http://www.html5plus.org/doc/zh_cn/navigator.html) + */ + SHORTCUT?: string; +} + +/** + * OrientationæšĄć—çźĄç†èźŸć€‡çš„æ–čć‘äżĄæŻïŒŒćŒ…æ‹Źalpha、beta、gamma侉äžȘæ–čć‘äżĄæŻïŒŒé€šèż‡plus.orientationćŻèŽ·ć–èźŸć€‡æ–č搑缡理ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/orientation.html](http://www.html5plus.org/doc/zh_cn/orientation.html) + */ +interface PlusOrientation { + /** + * JSONćŻčè±ĄïŒŒç›‘ćŹèźŸć€‡æ–čć‘æ„Ÿćș”ć™šć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/orientation.html](http://www.html5plus.org/doc/zh_cn/orientation.html) + */ + OrientationOption?: PlusOrientationOrientationOption; + /** + * JSONćŻčè±ĄïŒŒèźŸć€‡æ–čć‘äżĄæŻæ•°æź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/orientation.html](http://www.html5plus.org/doc/zh_cn/orientation.html) + */ + Rotation?: PlusOrientationRotation; + /** + * èŽ·ć–ćœ“ć‰èźŸć€‡çš„æ–čć‘äżĄæŻïŒŒćŒ…æ‹Źalpha、beta、gamma侉äžȘæ–čć‘äżĄæŻ + * æ–čć‘äżĄæŻæ˜ŻèźŸć€‡ç›žćŻčäșŽæ°Žćčłćˆć§‹æ–čć‘ćˆ†ćˆ«ä»„z、x、y蜎äžșèœŽćżƒæ—‹èœŹçš„è§’ćșŠïŒŒćŻčćș”ć€Œäžșalpha、beta、gamma侉äžȘæ–čć‘çš„äżĄæŻă€‚ æ–čć‘äżĄæŻćŻé€šèż‡successCBć›žè°ƒć‡œæ•°èż”ć›žă€‚æ–čć‘äżĄæŻèŽ·ć–ć€±èŽ„ćˆ™è°ƒç”šć›žè°ƒć‡œæ•°errorCB + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/orientation.html](http://www.html5plus.org/doc/zh_cn/orientation.html) + */ + getCurrentOrientation(successCB?: (result: string) => void, errorCB?: (result: any) => void): void; + /** + * ç›‘ćŹèźŸć€‡æ–čć‘äżĄæŻçš„ć˜ćŒ– + * æ–čć‘äżĄæŻæ˜ŻèźŸć€‡ç›žćŻčäșŽæ°Žćčłćˆć§‹æ–čć‘ćˆ†ćˆ«ä»„z、x、y蜎äžșèœŽćżƒæ—‹èœŹçš„è§’ćșŠïŒŒćŻčćș”ć€Œäžșalpha、beta、gamma侉äžȘæ–čć‘çš„äżĄæŻă€‚watchOrientationæŻéš”ć›șćźšæ—¶é—Žć°±èŽ·ć–äž€æŹĄèźŸć€‡çš„æ–čć‘äżĄæŻïŒŒé€šèż‡successCBć›žè°ƒć‡œæ•°èż”ć›žă€‚ćŻé€šèż‡option的frequencyć‚æ•°èźŸćźšèŽ·ć–èźŸć€‡æ–čć‘äżĄæŻçš„æ—¶é—Žé—Žéš”ă€‚æ–čć‘äżĄæŻèŽ·ć–ć€±èŽ„ćˆ™è°ƒç”šć›žè°ƒć‡œæ•°errorCB。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/orientation.html](http://www.html5plus.org/doc/zh_cn/orientation.html) + */ + watchOrientation(successCB?: (result: string) => void, errorCB?: (result: any) => void, option?: PlusOrientationOrientationOption): number; + /** + * ć…łé—­ç›‘ćŹèźŸć€‡æ–čć‘äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/orientation.html](http://www.html5plus.org/doc/zh_cn/orientation.html) + */ + clearWatch(watchId?: number): void; +} + +/** + * JSONćŻčè±ĄïŒŒç›‘ćŹèźŸć€‡æ–čć‘æ„Ÿćș”ć™šć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/orientation.html](http://www.html5plus.org/doc/zh_cn/orientation.html) + */ +interface PlusOrientationOrientationOption { + /** + * 曎新æ–čć‘äżĄæŻçš„æ—¶é—Žé—Žéš” + * æ•°ć€Œç±»ćž‹ïŒŒć•äœäžșmsïŒŒé»˜èź€ć€Œäžș500ms。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/orientation.html](http://www.html5plus.org/doc/zh_cn/orientation.html) + */ + frequency?: number; +} + +/** + * JSONćŻčè±ĄïŒŒèźŸć€‡æ–čć‘äżĄæŻæ•°æź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/orientation.html](http://www.html5plus.org/doc/zh_cn/orientation.html) + */ +interface PlusOrientationRotation { + /** + * 仄zæ–č搑äžșèœŽćżƒçš„æ—‹èœŹè§’ćșŠ + * æ”źç‚čæ•°ç±»ćž‹ïŒŒćȘèŻ»ć±žæ€§ïŒŒć–ć€ŒèŒƒć›Žäžș0戰360䞍等äșŽ360ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/orientation.html](http://www.html5plus.org/doc/zh_cn/orientation.html) + */ + alpha?: number; + /** + * 仄xæ–č搑äžșèœŽćżƒçš„æ—‹èœŹè§’ćșŠ + * æ”źç‚čæ•°ç±»ćž‹ïŒŒćȘèŻ»ć±žæ€§ïŒŒć–ć€ŒèŒƒć›Žäžș-180戰180䞍等äșŽ180ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/orientation.html](http://www.html5plus.org/doc/zh_cn/orientation.html) + */ + beta?: number; + /** + * 仄yæ–č搑äžșèœŽćżƒçš„æ—‹èœŹè§’ćșŠ + * æ”źç‚čæ•°ç±»ćž‹ïŒŒćȘèŻ»ć±žæ€§ïŒŒć–ć€ŒèŒƒć›Žäžș-180戰180䞍等äșŽ180ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/orientation.html](http://www.html5plus.org/doc/zh_cn/orientation.html) + */ + gamma?: number; + /** + * èźŸć€‡æ–č搑侎朰球磁ćœșćŒ—æžæ–čć‘çš„è§’ćșŠ + * æ”źç‚čæ•°ç±»ćž‹ïŒŒćȘèŻ»ć±žæ€§ïŒŒć–ć€ŒèŒƒć›Žäžș0戰360䞍等äșŽ360ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/orientation.html](http://www.html5plus.org/doc/zh_cn/orientation.html) + */ + magneticHeading?: number; + /** + * èźŸć€‡æ–čć‘äžŽćœ°çƒçœŸćźžćŒ—æžæ–čć‘çš„è§’ćșŠ + * æ”źç‚čæ•°ç±»ćž‹ïŒŒćȘèŻ»ć±žæ€§ïŒŒć–ć€ŒèŒƒć›Žäžș0戰360䞍等äșŽ360ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/orientation.html](http://www.html5plus.org/doc/zh_cn/orientation.html) + */ + trueHeading?: number; + /** + * èźŸć€‡æ–čć‘ć€Œçš„èŻŻć·źć€Œ + * æ”źç‚čæ•°ç±»ćž‹ïŒŒćȘèŻ»ć±žæ€§ïŒŒć–ć€ŒèŒƒć›Žäžș0戰360䞍等äșŽ360ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/orientation.html](http://www.html5plus.org/doc/zh_cn/orientation.html) + */ + headingAccuracy?: number; +} + +/** + * ProximityæšĄć—çźĄç†èźŸć€‡è·çŠ»äŒ æ„Ÿć™šïŒŒćŻèŽ·ć–ćœ“ć‰èźŸć€‡çš„æŽ„èż‘è·çŠ»äżĄæŻïŒŒé€šèż‡plus.proximityćŻèŽ·ć–èźŸć€‡è·çŠ»äŒ æ„ŸçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/proximity.html](http://www.html5plus.org/doc/zh_cn/proximity.html) + */ +interface PlusProximity { + /** + * èŽ·ć–ćœ“ć‰èźŸć€‡çš„æŽ„èż‘è·çŠ»äżĄæŻ + * èŽ·ć–ćœ“ć‰æŽ„èż‘èźŸć€‡çš„è·çŠ»äżĄæŻïŒŒè·çŠ»ć€Œć•äœäžșćŽ˜ç±łă€‚ćŠ‚æžœæ„Ÿćș”ć™šæ— æł•èŽ·ć–ć‡†çĄźçš„è·çŠ»ć€ŒïŒŒćˆ™ćœšæŽ„èż‘èźŸć€‡æ—¶èż”ć›ž0ïŒŒćŠćˆ™èż”ć›žInfinity。 èŽ·ć–æˆćŠŸćˆ™è°ƒç”šsuccessCBć›žè°ƒć‡œæ•°èż”æŽ„èż‘ć›žè·çŠ»ć€Œă€‚èŽ·ć–ć€±èŽ„ćˆ™è°ƒç”šerrorCBć›žè°ƒć‡œæ•°é”™èŻŻäżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/proximity.html](http://www.html5plus.org/doc/zh_cn/proximity.html) + */ + getCurrentProximity(successCB?: (result: number) => void, errorCB?: (result: any) => void): void; + /** + * ç›‘ćŹèźŸć€‡æŽ„èż‘è·çŠ»çš„ć˜ćŒ– + * watchProximityć°†ç›‘ćŹèźŸć€‡çš„æŽ„èż‘è·çŠ»äżĄæŻć˜ćŒ–äș‹ä»¶ïŒŒćœ“æŽ„èż‘è·çŠ»ć‘ç”Ÿć˜ćŒ–æ—¶é€šèż‡changeCBć›žè°ƒć‡œæ•°èż”ć›žè·çŠ»ć€Œă€‚ç›‘ćŹè·çŠ»ć˜ćŒ–äș‹ä»¶ć€±èŽ„ćˆ™é€šèż‡errorCBć›žè°ƒć‡œæ•°èż”ć›žé”™èŻŻäżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/proximity.html](http://www.html5plus.org/doc/zh_cn/proximity.html) + */ + watchProximity(changeCB?: (result: number) => void, errorCB?: (result: any) => void): number; + /** + * ć…łé—­ç›‘ćŹèźŸć€‡æŽ„èż‘è·çŠ»ć˜ćŒ– + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/proximity.html](http://www.html5plus.org/doc/zh_cn/proximity.html) + */ + clearWatch(watchId?: number): void; +} + +/** + * RuntimeæšĄć—çźĄç†èżèĄŒçŽŻćąƒïŒŒćŻç”šäșŽèŽ·ć–ćœ“ć‰èżèĄŒçŽŻćąƒäżĄæŻă€äžŽć…¶ćźƒçš‹ćșèż›èĄŒé€šèźŻç­‰ă€‚é€šèż‡plus.runtimećŻèŽ·ć–èżèĄŒçŽŻćąƒçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ +interface PlusRuntime { + /** + * JSONćŻčè±ĄïŒŒæ‰“ćŒ€çŹŹäž‰æ–č繋ćșć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + ApplicationInf?: PlusRuntimeApplicationInf; + /** + * JSONćŻčè±ĄïŒŒćș”甚角标星ç€șéœ€èŠçš„é€šçŸ„æ æ¶ˆæŻçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + BadgeOptions?: PlusRuntimeBadgeOptions; + /** + * JSONćŻčè±ĄïŒŒæ‰“ćŒ€æ–‡ä»¶ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + OpenFileOptions?: PlusRuntimeOpenFileOptions; + /** + * JSONćŻčè±ĄïŒŒćș”ç”šäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + WidgetInfo?: PlusRuntimeWidgetInfo; + /** + * JSONćŻčè±ĄïŒŒćș”ç”šćź‰èŁ…ć‚æ•° + * ćŻé€šèż‡ćŻčè±ĄèźŸçœźćź‰èŁ…çš„ćș”ç”šæ˜ŻćŠèż›èĄŒappidæ ĄéȘŒă€ç‰ˆæœŹć·æ ĄéȘŒç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + WidgetOptions?: PlusRuntimeWidgetOptions; + /** + * ćœ“ć‰ćș”甚的APPID + * ćœ“ć‰ćș”甚的APPIDïŒŒć­—çŹŠäžČç±»ćž‹ă€‚æłšæ„ïŒŒćŠ‚æžœæ˜ŻćœšHBuilder真æœșèżèĄŒèŽ·ć–çš„æ˜Żć›șćźšć€Œ"HBuilder"需芁提äș€Appäș‘ç«Żæ‰“ćŒ…ćŽèżèĄŒæ‰èƒœèŽ·ć–çœŸćźžçš„APPIDć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + appid?: string; + /** + * 第侉æ–č繋ćșè°ƒç”šæ—¶äŒ é€’ç»™çš‹ćșçš„ć‚æ•° + * 第侉æ–č繋ćșäŒ é€’èż‡æ„çš„ć‚æ•°ïŒŒć­—çŹŠäžČæ ŒćŒç±»ćž‹æ•°æźă€‚ + * äžæ˜Żç”±çŹŹäž‰æ–č繋ćșè°ƒç”šćŻćŠšïŒŒćˆ™èż”ć›žç©ș歗笩äžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + arguments?: string; + /** + * ćș”甚的枂ćœș掚ćčżæž é“æ ‡è݆ + * "qihoo:browser"æ ‡èŻ†360æ”è§ˆć™šæ”ćș”甚"qihoo:appstore "èĄšç€ș360手æœșćŠ©æ‰‹æ”ćș”甚"dcloud:streamapps"èĄšç€șDCloud攁ćș”甚ćŸșćș§ă€‚ + * æłšæ„ïŒšä»…æ”ćș”ç”šçŽŻćąƒäž­ćŻç”šïŒˆćŠ‚æžœæČĄæœ‰ç‰čæźŠé…çœźé»˜èź€èż”ć›žèżèĄŒçŽŻćąƒçš„ćŒ…ćïŒ‰ïŒŒéžæ”ćș”ç”šçŽŻćąƒäž­èż”ć›žç©ș歗笩äžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + channel?: string; + /** + * ćș”ç”šćŻćŠšæ„æș + * 5+ APPćŻćŠšç±»ćž‹ïŒŒćŻć–ä»„äž‹ć€ŒïŒš + * "default"ïŒšé»˜èź€ćŻćŠšæ–čćŒïŒŒé€šćžžèĄšç€șćș”ç”šćˆ—èĄšćŻćŠšïŒˆ360æ‰‹ćŠ©äž­æœçŽąćŻćŠšïŒ‰ïŒ› + * "scheme"ïŒšé€šèż‡urlschemeæ–čćŒè§Šć‘ćŻćŠšïŒ› + * "push"ïŒšé€šèż‡ç‚čć‡»çł»ç»Ÿé€šçŸ„æ–čćŒè§Šć‘ćŻćŠšïŒ› + * "stream"ïŒšé€šèż‡æ”ćș”甚apiplus.stream.openïŒ‰ćŻćŠšïŒ› + * "shortcut"ïŒšé€šèż‡ćż«æ·æ–čćŒćŻćŠšïŒŒiOSćčłć°èĄšç€șé€šèż‡3D Touchćż«æ·æ–čćŒïŒŒAndroidćčłć°èĄšç€șé€šèż‡æĄŒéąćż«æ·æ–čćŒćŻćŠšïŒ› + * "barcode"ïŒšé€šèż‡äșŒç»Žç æ‰«æćŻćŠšïŒ› + * "myapp"ïŒšé€šèż‡æ”ćș”甚"我的"ćș”ç”šćˆ—èĄšæˆ–ćŽ†ćČćˆ—èĄšäž­è§Šć‘ćŻćŠšïŒ› + * "favorite"ïŒšé€šèż‡æ”ćș”甚的"收藏"ćș”ç”šćˆ—èĄšćŻćŠšïŒ› + * "browser"ïŒšé€šèż‡æ”ćș”ç”šçš„ć†…çœźæ”è§ˆć™šćŻŒæ”ćŻćŠšçš„æ”ćș”ç”šïŒˆćœ°ć€æ èŸ“ć…„url搯抹ćș”甚、ç‚č懻wapéĄ”éąé“ŸæŽ„ćŻćŠšćș”甚 + * "engines"ïŒšé€šèż‡æ”ćș”ç”šçš„æ”è§ˆć™šç•ŒéąäœœäžșæœçŽąćŒ•æ“ŽćŻćŠšïŒ› + * "search"ïŒšé€šèż‡æ”ćș”甚的ćș”ç”šæœçŽąćŻćŠšćș”ç”šïŒˆćŠ‚iOSćčłć°çš„T9é”źç›˜æœçŽąïŒ‰ïŒ› + * "speech"ïŒšé€šèż‡æ”ćș”ç”šçš„èŻ­éŸłèŻ†ćˆ«ćŻćŠšćș”甚 + * "miniProgram"ïŒšé€šèż‡ćŸźäżĄć°çš‹ćșćŻćŠšćș”甚。 + * - default: + * é»˜èź€ćŻćŠšæ–čćŒïŒŒé€šćžžèĄšç€șä»Žçł»ç»ŸæĄŒéąć›Ÿæ ‡ćŻćŠš + * + * - scheme: + * é€šèż‡urlschemeæ–čćŒè§Šć‘ćŻćŠš + * + * - push: + * é€šèż‡ç‚čć‡»çł»ç»Ÿé€šçŸ„æ–čćŒè§Šć‘ćŻćŠš + * + * - stream: + * é€šèż‡æ”ćș”甚apiplus.stream.openïŒ‰ćŻćŠš + * + * - shortcut: + * iOSćčłć°èĄšç€șé€šèż‡3D Touchćż«æ·æ–čćŒïŒŒAndroidćčłć°èĄšç€șé€šèż‡æĄŒéąćż«æ·æ–čćŒćŻćŠš + * + * - barcode: + * é€šèż‡äșŒç»Žç æ‰«æćŻćŠš + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + launcher?: 'default' | 'scheme' | 'push' | 'stream' | 'shortcut' | 'barcode'; + /** + * ćș”ç”šćź‰èŁ…æ„æș + * 5+ćș”ç”šćź‰èŁ…æ„æșïŒŒćŻć–ä»„äž‹ć€ŒïŒš + * "default"ïŒšé»˜èź€ćź‰èŁ…æ„æșïŒŒapk/ipaćź‰èŁ…ćŒ…ć†…çœźćź‰èŁ…ïŒ› + * "stream"ïŒšé€šèż‡æ”ćș”甚apiplus.stream.openïŒ‰ćź‰èŁ…ïŒŒä»…æ”ćș”ç”šçŽŻćąƒäž‹æ”ŻæŒïŒ› + * "push"ïŒšé€šèż‡ç‚čć‡»çł»ç»Ÿé€šçŸ„æ–čćŒè§Šć‘ćź‰èŁ…ïŒŒä»…æ”ćș”ç”šçŽŻćąƒäž‹æ”ŻæŒïŒ› + * "scheme"ïŒšé€šèż‡urlschemeæ–čćŒè§Šć‘ćź‰èŁ…ïŒŒä»…æ”ćș”ç”šçŽŻćąƒäž‹æ”ŻæŒïŒ› + * "barcode"ïŒšé€šèż‡äșŒç»Žç æ‰«æè§Šć‘ćź‰èŁ…ïŒŒä»…æ”ćș”ç”šçŽŻćąƒäž‹æ”ŻæŒïŒ› + * "silent"ïŒšé€šèż‡ćŽć°é™é»˜æ–čćŒćź‰èŁ…ïŒŒä»…æ”ćș”ç”šçŽŻćąƒäž‹æ”ŻæŒïŒ› + * "speech"ïŒšé€šèż‡èŻ­éŸłèŻ†ćˆ«æ–čćŒè§Šć‘ćź‰èŁ…ïŒŒä»…æ”ćș”ç”šçŽŻćąƒäž‹æ”ŻæŒïŒ› + * "favorite"ïŒšé€šèż‡æ”¶è—ç•ŒéąćŻćŠšè§Šć‘ćź‰èŁ…ïŒŒä»…æ”ćș”ç”šçŽŻćąƒäž‹æ”ŻæŒă€‚ + * - default: + * é»˜èź€ćź‰èŁ…æ„æșïŒŒapk/ipaćź‰èŁ…ćŒ…ć†…çœźćź‰èŁ… + * + * - stream: + * é€šèż‡æ”ćș”甚apiplus.stream.openïŒ‰ćź‰èŁ… + * + * - push: + * é€šèż‡ç‚čć‡»çł»ç»Ÿé€šçŸ„æ–čćŒè§Šć‘ćź‰èŁ… + * + * - scheme: + * é€šèż‡urlschemeæ–čćŒè§Šć‘ćź‰èŁ… + * + * - barcode: + * é€šèż‡äșŒç»Žç æ‰«æè§Šć‘ćź‰èŁ… + * + * - silent: + * é€šèż‡ćŽć°é™é»˜æ–čćŒćź‰èŁ… + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + origin?: 'default' | 'stream' | 'push' | 'scheme' | 'barcode' | 'silent'; + /** + * ćźąæˆ·ç«Żçš„ç‰ˆæœŹć· + * 歗笩äžČç±»ćž‹ïŒŒćœšçŒ–èŻ‘çŽŻćąƒäž­èźŸçœźçš„apk/ipaç‰ˆæœŹć·ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + version?: string; + /** + * ćźąæˆ·ç«Ż5+èżèĄŒçŽŻćąƒçš„ç‰ˆæœŹć· + * 5+èżèĄŒçŽŻćąƒç‰ˆæœŹć·ïŒŒæ ŒćŒäžș[äž»ç‰ˆæœŹć·].[æŹĄç‰ˆæœŹć·].[äżźèźąç‰ˆæœŹć·].[çŒ–èŻ‘ä»Łć·]。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + innerVersion?: string; + /** + * èŽ·ć–ćœ“ć‰ćș”ç”šéŠ–éĄ”ćŠ èœœçš„æ—¶é—Ž + * ćș”ç”šćŠ èœœéŠ–éĄ”éąçš„æ€»æ—¶é—ŽïŒŒä»ŽćŒ€ć§‹ćŠ èœœéŠ–éĄ”éąćˆ°éŠ–éĄ”éąćŠ èœœćźŒæˆïŒŒć•äœäžșms。 + * æłšæ„ïŒŒćș”甚銖饔äžșçœ‘ç»œćœ°ć€ćˆ™ćŒ…æ‹Źçœ‘ç»œäŒ èŸ“æ—¶é—Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + launchLoadedTime?: number; + /** + * èŽ·ć–ćœ“ć‰ćș”ç”šçš„èż›çš‹æ ‡è݆ + * ćœ“ć‰ćș”ç”šæ‰€ć±žçł»ç»Ÿèż›çš‹æ ‡èŻ†ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + processId?: string; + /** + * èŽ·ć–ćœ“ć‰ćș”ç”šçš„ćŻćŠšæ—¶é—Ž + * ćș”ç”šćŻćŠšæ—¶é—ŽæˆłïŒŒè·1970ćčŽ1月1æ—„äč‹é—Žçš„æŻ«ç§’æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + startupTime?: number; + /** + * èŽ·ć–æŒ‡ćźšAPPIDćŻčćș”çš„ćș”ç”šäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + getProperty(appid?: string, getPropertyCB?: (result: PlusRuntimeWidgetInfo) => void): void; + /** + * ćź‰èŁ…ćș”甚 + * æ”ŻæŒä»„äž‹ç±»ćž‹ćź‰èŁ…ćŒ…ïŒš + * 1. ćș”甚蔄æșćź‰èŁ…ćŒ…ïŒˆwgtïŒ‰ïŒŒæ‰©ć±•ćäžș'.wgt' + * 2. ćș”甚蔄æșć·źé‡ć‡çș§ćŒ…wgtuïŒ‰ïŒŒæ‰©ć±•ćäžș'.wgtu' + * 3. çł»ç»Ÿçš‹ćșćź‰èŁ…ćŒ…ïŒˆapkïŒ‰ïŒŒèŠæ±‚äœżç”šćœ“ć‰ćčłć°æ”ŻæŒçš„ćź‰èŁ…ćŒ…æ ŒćŒă€‚ + * æłšæ„ïŒšä»…æ”ŻæŒæœŹćœ°ćœ°ć€ïŒŒè°ƒç”šæ­€æ–čæł•ć‰éœ€æŠŠćź‰èŁ…ćŒ…ä»Žçœ‘ç»œćœ°ć€æˆ–ć…¶ä»–äœçœźæ”Ÿçœźćˆ°èżèĄŒæ—¶çŽŻćąƒćŻä»„èźżé—źçš„æœŹćœ°ç›źćœ•ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + install(filePath?: string, options?: PlusRuntimeWidgetOptions, installSuccessCB?: (result: PlusRuntimeWidgetInfo) => void, installErrorCB?: (result: any) => void): void; + /** + * 退ć‡șćźąæˆ·ç«Żçš‹ćș + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + quit(): void; + /** + * é‡ćŻćœ“ć‰çš„ćș”甚 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + restart(): void; + /** + * èźŸçœźçš‹ćșćż«æ·æ–čćŒć›Ÿæ ‡äžŠæ˜Ÿç€șçš„è§’æ ‡æ•°ć­— + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + setBadgeNumber(number?: number, options?: PlusRuntimeBadgeOptions): void; + /** + * è°ƒç”šçŹŹäž‰æ–č繋ćșæ‰“ćŒ€æŒ‡ćźšçš„URL + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + openURL(url?: string, errorCB?: (result: any) => void, identity?: string): void; + /** + * äœżç”šć†…çœźWebviewçȘ—ćŁæ‰“ćŒ€URL + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + openWeb(url?: string): void; + /** + * è°ƒç”šçŹŹäž‰æ–č繋ćșæ‰“ćŒ€æŒ‡ćźšçš„æ–‡ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + openFile(filepath?: string, options?: PlusRuntimeOpenFileOptions, errorCB?: (result: any) => void): void; + /** + * ć€„ç†ç›ŽèŸŸéĄ”éąé“ŸæŽ„ć‚æ•° + * é€šèż‡URL SchemećŻćŠšæ—¶ïŒŒćŻä»„ćœš?ćŽéąæ·»ćŠ __direct_pageć‚æ•°è‡Ș漚äč‰ç›ŽèŸŸéĄ”éąćœ°ć€ïŒŒ + * 橂“streamapp://m3w.cn/s/HelloH5?__direct_page=http%3a%2f%2fm.weibo.cn%2fu%2f3196963860” + * ćœšæ”ćș”甚SDK集成时äčŸćŻä»„é€šèż‡direct_pageć‚æ•°ïŒˆćŽŸç”Ÿè°ƒç”šIntentïŒ‰èźŸçœźă€‚ + * æłšæ„ïŒšä»…çŹŹäž€æŹĄè°ƒç”šæ­€APIæ—¶èż”ć›žç›ŽèŸŸéĄ”éąé“ŸæŽ„ćœ°ć€ïŒŒć†æŹĄè°ƒç”šć°†èż”ć›žç©ș歗笩äžČïŒ›ćŠ‚æžœćș”ç”šé‡æ–°èą«ćžŠç›ŽèŸŸéĄ”éąé“ŸæŽ„ć‚æ•°çš„URL Scheme搯抹/æż€æŽ»æ—¶ïŒŒćŻć†æŹĄè°ƒç”šæ­€æ–čæł•èŽ·ć–ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + processDirectPage(): string; + /** + * è°ƒç”šçŹŹäž‰æ–č繋ćș + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + launchApplication(appInf?: PlusRuntimeApplicationInf, errorCB?: (result: any) => void): void; + /** + * ćˆ€æ–­çŹŹäž‰æ–č繋ćșæ˜ŻćŠć·Č歘朹 + * ćŠ‚æžœçŹŹäž‰æ–č繋ćșć·Čćź‰èŁ…ćˆ™èż”ć›žtrueæœȘćź‰èŁ…ćˆ™èż”ć›žfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + isApplicationExist(appInf?: PlusRuntimeApplicationInf): boolean; + /** + * ćˆ€æ–­æ˜ŻćŠè‡Ș漚äč‰ćș”ç”šćŻćŠšéĄ”éąćŠ èœœćœ°ć€ + * é€šèż‡URL SchemećŻćŠšæ—¶ïŒŒćŻä»„ćœš?ćŽéąæ·»ćŠ __launch_pathć‚æ•°è‡Ș漚äč‰ćș”ç”šćŻćŠšéŠ–éĄ”ćŠ èœœçš„éĄ”éąćœ°ć€ïŒŒ + * 橂“streamapp://m3w.cn/s/HelloH5?__launch_path=http%3a%2f%2fm.weibo.cn%2fu%2f3196963860” + * ćœšæ”SDK集成时äčŸćŻä»„é€šèż‡launch_pathć‚æ•°ïŒˆćŽŸç”Ÿè°ƒç”šIntentïŒ‰èźŸçœźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + isCustomLaunchPath(): boolean; +} + +/** + * JSONćŻčè±ĄïŒŒæ‰“ćŒ€çŹŹäž‰æ–č繋ćșć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ +interface PlusRuntimeApplicationInf { + /** + * 第侉æ–č繋ćșćŒ…損 + * 仅Androidćčłć°æ”ŻæŒïŒŒèĄšç€ș繋ćșçš„ćŒ…ćïŒŒć…¶ćźƒćčłć°ćżœç•„æ­€ć±žæ€§ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + pname?: string; + /** + * 繋ćșçš„æ“äœœèĄŒäžș + * Androidćčłć°äžŠäžŽçł»ç»Ÿçš„actionć€Œäž€è‡ŽïŒ›iOSćčłć°äžș芁调甚皋ćșçš„URLSchemeæ ŒćŒć­—çŹŠäžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + action?: string; + /** + * æ–°ä»»ćŠĄæšĄćŒæ ‡èź° + * ćŻć–ć€ŒïŒš + * true-äœżç”šæ–°ä»»ćŠĄæšĄćŒæ ‡èź°ïŒˆFLAG_ACTIVITY_NEW_TASKïŒ‰ćŻćŠšćș”甚 + * false-äžäœżç”šæ–°ä»»ćŠĄæšĄćŒæ ‡èź°ïŒˆFLAG_ACTIVITY_NEW_TASKïŒ‰ćŻćŠšćș”甚。 + * é»˜èź€ć€Œäžștrue。 + * æłšæ„ïŒšç”±äșŽ5+ćș”ç”šé…çœźçš„launchModeäžșsingleTaskïŒŒæ‰€ä»„ćŠäž€äžȘ5+ćș”ç”šé€šèż‡plus.runtime.launchApplicationćŻćŠšæ—¶ćŠ‚æžœćș”甚ć·Čç»ćœšćŽć°èżèĄŒćˆ™äžäŒšè§Šć‘newintentäș‹ä»¶ïŒŒäžșäș†éżć…æ­€é—źéą˜éœ€èЁ㰆newTaskć‚æ•°ć€ŒèźŸçœźäžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + newTask?: boolean; + /** + * 调甚皋ćșçš„ć‚æ•° + * 仅Androidćčłć°æ”ŻæŒïŒŒäžșJSONæ ŒćŒïŒŒç”šäșŽäŒ é€’给芁调甚皋ćșçš„ć‚æ•°ïŒŒćŠ‚extra:{url:"http://www.html5plus.org"}。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + extra?: any; +} + +/** + * JSONćŻčè±ĄïŒŒćș”甚角标星ç€șéœ€èŠçš„é€šçŸ„æ æ¶ˆæŻçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ +interface PlusRuntimeBadgeOptions { + /** + * æ¶ˆæŻçš„æ ‡éą˜ + * é»˜èź€ć€Œäžșćș”ç”šçš„ćç§°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + title?: string; + /** + * æ¶ˆæŻçš„ć†…ćźč + * é»˜èź€ć€Œäžș“悚有xæĄæœȘèŻ»æ¶ˆæŻ"â€ïŒŒć…¶äž­xæœȘèźŸçœźçš„è§’æ ‡æ•°ć­—ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + content?: string; +} + +/** + * JSONćŻčè±ĄïŒŒæ‰“ćŒ€æ–‡ä»¶ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ +interface PlusRuntimeOpenFileOptions { + /** + * äŒ˜ć…ˆäœżç”šçš„çš‹ćșćŒ…損 + * ćŠ‚æžœæŒ‡ćźšćŒ…ćçš„çš‹ćșć·Čç»ćź‰èŁ…ïŒŒćˆ™è°ƒç”šć…¶æ‰“ćŒ€æ–‡ä»¶ïŒŒè‹„çš‹ćșäžæ”ŻæŒæ‰“ćŒ€æ–‡ä»¶ćˆ™è§Šć‘é”™èŻŻć›žè°ƒă€‚ + * ćŠ‚æžœæŒ‡ćźšćŒ…ćçš„çš‹ćșæœȘćź‰èŁ…ïŒŒćˆ™ćŒčć‡șçł»ç»Ÿæ”ŻæŒæ‰“ćŒ€æ­€æ–‡ä»¶çš„ćˆ—èĄšïŒŒç”±ç”šæˆ·é€‰æ‹©çš‹ćșæ‰“ćŒ€ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + pname?: string; + /** + * ćŒčć‡șçł»ç»Ÿé€‰æ‹©çš‹ćșç•ŒéąæŒ‡ç€șćŒș㟟 + * JSONćŻčè±ĄïŒŒæ ŒćŒćŠ‚{top:10;left:10;width:200;height:200;}ïŒŒæ‰€æœ‰ć€ŒäžșćƒçŽ ć€ŒïŒŒć·ŠäžŠćæ ‡ç›žćŻčäșŽćźč晹webviewçš„äœçœźă€‚ä»…ćœšiPadèźŸć€‡ćčłć°æœ‰æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + popover?: any; +} + +/** + * JSONćŻčè±ĄïŒŒćș”ç”šäżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ +interface PlusRuntimeWidgetInfo { + /** + * ćș”甚的APPID + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + appid?: string; + /** + * ćș”ç”šçš„ç‰ˆæœŹć· + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + version?: string; + /** + * ćș”ç”šçš„ćç§° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + name?: string; + /** + * ćș”ç”šæèż°äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + description?: string; + /** + * ćș”ç”šæèż°äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + author?: string; + /** + * ćŒ€ć‘è€…é‚źçź±ćœ°ć€ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + email?: string; + /** + * ćș”ç”šæŽˆæƒæèż°äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + license?: string; + /** + * ćș”ç”šæŽˆæƒèŻŽæ˜Žé“ŸæŽ„ćœ°ć€ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + licensehref?: string; + /** + * ćș”ç”šèźžćŻç‰čæ€§ćˆ—èĄš + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + features?: string []; +} + +/** + * JSONćŻčè±ĄïŒŒćș”ç”šćź‰èŁ…ć‚æ•° + * ćŻé€šèż‡ćŻčè±ĄèźŸçœźćź‰èŁ…çš„ćș”ç”šæ˜ŻćŠèż›èĄŒappidæ ĄéȘŒă€ç‰ˆæœŹć·æ ĄéȘŒç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ +interface PlusRuntimeWidgetOptions { + /** + * æ˜ŻćŠćŒșćˆ¶ćź‰èŁ… + * trueèĄšç€șćŒșćˆ¶ćź‰èŁ…ïŒŒäžèż›èĄŒç‰ˆæœŹć·çš„æ ĄéȘŒïŒ›falsećˆ™éœ€èŠç‰ˆæœŹć·æ ĄéȘŒïŒŒćŠ‚æžœć°†èŠćź‰èŁ…ćș”ç”šçš„ç‰ˆæœŹć·äžé«˜äșŽçŽ°æœ‰ćș”ç”šçš„ç‰ˆæœŹć·ćˆ™ç»ˆæ­ąćź‰èŁ…ïŒŒćč¶èż”ć›žćź‰èŁ…ć€±èŽ„ă€‚ + * ä»…ćź‰èŁ…wgt撌wgtuæ—¶ç”Ÿæ•ˆïŒŒé»˜èź€ć€Œ false。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/runtime.html](http://www.html5plus.org/doc/zh_cn/runtime.html) + */ + force?: boolean; +} + +/** + * StorageæšĄć—çźĄç†ćș”ç”šæœŹćœ°æ•°æźć­˜ć‚šćŒș甚äșŽćș”ç”šæ•°æźçš„äżć­˜ć’ŒèŻ»ć–ă€‚ćș”ç”šæœŹćœ°æ•°æźäžŽlocalStorage、sessionStorage的ćŒșćˆ«ćœšäșŽæ•°æźæœ‰æ•ˆćŸŸäžćŒïŒŒć‰è€…ćŻćœšćș”ç”šć†…è·šćŸŸæ“äœœïŒŒæ•°æźć­˜ć‚šæœŸæ˜ŻæŒäč…ćŒ–çš„ïŒŒćč¶äž”æČĄæœ‰ćźčé‡é™ćˆ¶ă€‚é€šèż‡plus.storagećŻèŽ·ć–ćș”ç”šæœŹćœ°æ•°æźçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/storage.html](http://www.html5plus.org/doc/zh_cn/storage.html) + */ +interface PlusStorage { + /** + * èŽ·ć–ćș”ç”šć­˜ć‚šćŒșäž­äżć­˜çš„é”źć€ŒćŻč的äžȘ数 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/storage.html](http://www.html5plus.org/doc/zh_cn/storage.html) + */ + getLength(): number; + /** + * é€šèż‡é”ź(key)æŁ€çŽąèŽ·ć–ćș”ç”šć­˜ć‚šçš„ć€Œ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/storage.html](http://www.html5plus.org/doc/zh_cn/storage.html) + */ + getItem(key?: string): string; + /** + * äżźæ”čæˆ–æ·»ćŠ é”źć€Œ(key-value)ćŻčæ•°æźćˆ°ćș”ç”šæ•°æźć­˜ć‚šäž­ + * ćŠ‚æžœèźŸçœźçš„é”źćœšćș”ç”šæ•°æźć­˜ć‚šäž­ć·Čç»ć­˜ćœšïŒŒæ›Žæ–°ć­˜ć‚šçš„é”źć€Œă€‚ + * ć­˜ć‚šçš„é”źć’Œć€ŒæČĄæœ‰ćźčé‡é™ćˆ¶ïŒŒäœ†èż‡ć€šçš„æ•°æźé‡äŒšćŻŒè‡Žæ•ˆçŽ‡é™äœŽïŒŒć»șèźźć•äžȘé”źć€Œæ•°æźäžèŠè¶…èż‡10Kb。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/storage.html](http://www.html5plus.org/doc/zh_cn/storage.html) + */ + setItem(key?: string, value?: string): void; + /** + * é€šèż‡keyć€Œćˆ é™€é”źć€ŒćŻčć­˜ć‚šçš„æ•°æź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/storage.html](http://www.html5plus.org/doc/zh_cn/storage.html) + */ + removeItem(key?: string): void; + /** + * 枅陀ćș”ç”šæ‰€æœ‰çš„é”źć€ŒćŻčć­˜ć‚šæ•°æź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/storage.html](http://www.html5plus.org/doc/zh_cn/storage.html) + */ + clear(): void; + /** + * èŽ·ć–é”źć€ŒćŻčäž­æŒ‡ćźšçŽąćŒ•ć€Œçš„keyć€Œ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/storage.html](http://www.html5plus.org/doc/zh_cn/storage.html) + */ + key(index?: number): void; +} + +/** + * StreamæšĄć—æ“äœœæ”ćș”甚。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ +interface PlusStream { + /** + * JSONćŻčè±ĄïŒŒćŻćŠšæ”ćș”ç”šć‚æ•° + * æŒ‡ćźšèŠćŻćŠšçš„æ”ćș”ç”šæ ‡èŻ†ă€ćç§°ă€ć›Ÿæ ‡ă€ć‚æ•°ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + StreamOptions?: PlusStreamStreamOptions; + /** + * JSONćŻčè±ĄïŒŒæ”ćș”ç”šæąć€èżèĄŒçš„ć‚æ•° + * èźŸçœźæ”ćș”ç”šæąć€èżèĄŒæ—¶çš„ć‚æ•°ă€splashă€éŠ–éĄ”ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + StreamRestoreOptions?: PlusStreamStreamRestoreOptions; + /** + * 攁ćș”ç”šæąć€èżèĄŒæ—¶ćŻćŠšç•Œéąé…çœźć‚æ•° + * èźŸçœźæ”ćș”ç”šæąć€èżèĄŒæ—¶ćŻćŠšç•ŒéąïŒŒćŠ‚æ˜ŻćŠè‡ȘćŠšć…łé—­ă€ć»¶æ—¶ć…łé—­æ—¶é—Žă€è¶…æ—¶æ—¶é—Žç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + StreamRestoreSplashscreenOptions?: PlusStreamStreamRestoreSplashscreenOptions; + /** + * JSONćŻčè±ĄïŒŒćŻćŠšæ”ćș”甚的銖饔çȘ—ćŁć±žæ€§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + LaunchWebviewStyles?: PlusStreamLaunchWebviewStyles; + /** + * JSONćŻčè±ĄïŒŒæ”ćș”ç”šäżĄæŻ + * 攁ćș”ç”šæ ‡èŻ†ă€ć›Ÿæ ‡ă€æ˜ŻćŠäž‹èœœćźŒæˆç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + StreamInfo?: PlusStreamStreamInfo; + /** + * JSONćŻčè±ĄïŒŒć…æ”é‡æ“äœœć‚æ•° + * ćŒ…ć«ç””èŻć·ç ă€éȘŒèŻç ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + FreetrafficOptions?: PlusStreamFreetrafficOptions; + /** + * ć…æ”é‡çŠ¶æ€ć˜ćŒ–äș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + onfreetrafficStateChange?: any; + /** + * ćŻćŠšæ”ćș”甚 + * æ‰“ćŒ€æŒ‡ćźšçš„æ”ćș”ç”šïŒŒćœšæ”ćș”ç”šäž­é€šèż‡plus.runtime.launcherèŽ·ć–çš„ć€Œäžș"stream"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + open(options?: PlusStreamStreamOptions, successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; + /** + * 攁ćș”ç”šæż€æŽ»ç»ŸèźĄ + * 提äș€ç»ŸèźĄæ•°æźćˆ°æ”ćș”ç”šæœćŠĄć™šïŒŒèĄšæ˜ŽäžšćŠĄçł»ç»Ÿæż€æŽ»æˆćŠŸă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + activate(): void; + /** + * ć·Č䞋蜜攁ćș”ç”šćˆ—èĄš + * èŽ·ć–ćœ“ć‰èźŸć€‡äžŠć·Čćź‰èŁ…çš„æ‰€æœ‰æ”ćș”甚。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + list(options?: any, successCallback?: any, errorCallback?: any): void; + /** + * éą„ćŠ èœœæ”ćș”甚 + * éą„ćŠ èœœæŒ‡ćźšçš„æ”ćș”甚蔄æșïŒŒäž‹èœœćș”甚蔄æșç­‰ïŒŒćč¶äžèżèĄŒæ”ćș”甚。 + * ćŠ‚æžœćș”甚蔄æșć·Čç»äž‹èœœïŒŒćˆ™äžćšä»»äœ•æ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + preload(appid?: string): void; + /** + * ćˆ é™€æ”ćș”甚 + * ćˆ é™€ć·Č䞋蜜的攁ćș”甚枅ç©șćș”ç”šç›žć…łèżèĄŒæœŸäżć­˜çš„è”„æșïŒˆćŠ‚çŒ“ć­˜ă€é…çœźæ–‡ä»¶ç­‰ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + remove(appid?: string): void; + /** + * èźŸçœźæ”ćș”ç”šæąć€èżèĄŒçš„ć‚æ•° + * ćœ“æ”ćș”ç”šèżèĄŒæ•°ç›źè¶…èż‡é™ćˆ¶ïŒˆé€šćžžæœ€ć€šèżèĄŒ2äžȘ攁ćș”甚䌚è‡Ș抹慳闭äč‹ć‰ćˆ‡æąćˆ°ćŽć°èżèĄŒçš„ćș”甚。 + * ćŻé€šèż‡æ­€æ–čæł•èźŸçœźćș”ç”šèą«è‡ȘćŠšć…łé—­ćŽć†æŹĄèą«ć”€é†’æąć€èżèĄŒæ—¶çš„ć‚æ•°ïŒŒæ”ćș”ç”šæąć€èżèĄŒæ”çš‹äžŽçŹŹäž€æŹĄćŻćŠšäž€è‡ŽïŒˆć·źćˆ«æ˜ŻäŒšäœżç”šStreamRestoreOptionsäž­é…çœźçš„ć‚æ•°ïŒ‰ă€‚ + * ćŠ‚æžœæČĄæœ‰è°ƒç”šsetRestoreStateæ–čæł•ïŒŒćˆ™æąć€èżèĄŒæ—¶äœżç”šćŻćŠšæ—¶ïŒˆè°ƒç”šplus.stream.openæ–čæł•ïŒ‰äŒ ć…„çš„ć‚æ•°ă€‚ + * æłšæ„ïŒšćŠ‚æžœé€šèż‡plus.stream.openæ–čæł•搯抚ćș”ç”šïŒŒćˆ™ćżœç•„æ­€æ–čæł•èźŸçœźçš„ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + setRestoreState(options?: PlusStreamStreamRestoreOptions): void; + /** + * èŻ·æ±‚ć…æ”é‡éȘŒèŻç  + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + freetrafficRequest(options?: PlusStreamFreetrafficOptions, successCallback?: () => void, errorCallback?: (result: any) => void): void; + /** + * ć…æ”é‡ç»‘ćźšæ‰‹æœșć· + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + freetrafficBind(options?: PlusStreamFreetrafficOptions, successCallback?: () => void, errorCallback?: (result: any) => void): void; + /** + * è§Łé™€ć…æ”é‡ç»‘ćźš + * è§Łé™€ćœ“ć‰èźŸć€‡ç»‘ćźšçš„æ‰‹æœșć·ïŒŒćŠ‚æžœèźŸć€‡æœȘç»‘ćźšćˆ™äžæ‰§èĄŒæ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + freetrafficRelease(): void; + /** + * èŽ·ć–ć…æ”é‡çŠ¶æ€äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + freetrafficInfo(successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; + /** + * ć…æ”é‡æ˜ŻćŠç”Ÿæ•ˆ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + freetrafficIsValid(): boolean; +} + +/** + * JSONćŻčè±ĄïŒŒćŻćŠšæ”ćș”ç”šć‚æ•° + * æŒ‡ćźšèŠćŻćŠšçš„æ”ćș”ç”šæ ‡èŻ†ă€ćç§°ă€ć›Ÿæ ‡ă€ć‚æ•°ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ +interface PlusStreamStreamOptions { + /** + * 攁ćș”ç”šèżèĄŒæšĄćŒ + * ćŻć–ć€ŒïŒš"test"èĄšç€șæ”‹èŻ•ç‰ˆæšĄćŒèżèĄŒïŒŒć…¶ćźƒć€Œćˆ™äžșæ­ŁćŒç‰ˆæœŹæšĄćŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + appmode?: string; + /** + * 攁ćș”甚标è݆ + * 攁ćș”甚支䞀歗珊äžČæ ‡èŻ†ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + appid?: string; + /** + * ćŻćŠšæ”ćș”ç”šçš„ç›ŽèŸŸéĄ”éąé“ŸæŽ„ćœ°ć€ + * 揯朹ćș”ç”šäž­é€šèż‡plus.runtime.processDirectPage()æ–čæł•èŽ·ć–ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + direct_page?: string; + /** + * 攁ćș”ç”šèżèĄŒć‚æ•° + * ćŻćŠšæ”ćș”ç”šçš„æ‰©ć±•ć‚æ•°ïŒŒćŻćœšæ”ćș”ç”šäž­é€šèż‡plus.runtime.argumentsèŽ·ć–ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + extras?: any; + /** + * 攁ćș”ç”šć›Ÿæ ‡ + * 攁ćș”甚星ç€șçš„ć›Ÿæ ‡è·ŻćŸ„ïŒˆä»…æ”ŻæŒæœŹćœ°è·ŻćŸ„ïŒ‰ïŒŒćœšćŻćŠšæç€șç•Œéąäž­æ˜Ÿç€ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + icon?: string; + /** + * 攁ćș”甚搯抚类枋 + * 攁ćș”ç”šçš„ćŻćŠšç±»ćž‹ïŒŒćŻćœšæ”ćș”ç”šäž­é€šèż‡plus.runtime.launcherèŽ·ć–ïŒŒé»˜èź€ć€Œäžș“stream”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + launcher?: string; + /** + * ćș”ç”šćŻćŠšç•Œéąæ ·ćŒ + * ćŻć–ć€ŒïŒš + * "auto"è‡ȘćŠšé€‰æ‹©ćŻćŠšç•ŒéąïŒŒćŠ‚æžœsplashć›Ÿç‰‡ć·Čç»äž‹èœœćˆ™æ˜Ÿç€șsplashć›Ÿç‰‡ïŒŒćŠćˆ™äœżç”šé»˜èź€ćŠ èœœæ”ćș”ç”šç•ŒéąïŒ› + * "default"ïŒšäœżç”šé»˜èź€ćŠ èœœæ”ćș”ç”šç•ŒéąïŒˆćŠ‚ćœš360æ”è§ˆć™šçŽŻćąƒäž­ćœšæ ‡éą˜æ äž‹æ˜Ÿç€șćŠ èœœèż›ćșŠæĄïŒ‰ă€‚ + * é»˜èź€ć€Œäžș"auto"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + splash?: string; + /** + * 攁ćș”甚銖饔çȘ—揣ćŻčè±Ąæ ·ćŒ + * ćŠ‚æžœæ”ćș”甚ć·Čç»èżèĄŒïŒŒä»ŽćŽć°æż€æŽ»ćˆ°ć‰ć°æ—¶ćżœç•„æ­€ć±žæ€§ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + styles?: PlusStreamLaunchWebviewStyles; + /** + * 攁ćș”ç”šćç§° + * 攁ćș”甚星ç€șçš„æ ‡éą˜ïŒŒćœšćŻćŠšæç€șç•Œéąäž­æ˜Ÿç€ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + title?: string; + /** + * ćŻćŠšæ”ćș”ç”šçš„ćż«æ·æ–čćŒé€»èŸ‘ + * ćŻć–ć€ŒïŒš + * "auto" - æŁ€æŸ„ćč¶ćŒ•ćŻŒç”šæˆ·æ‰“ćŒ€ćż«æ·æ–čćŒæƒé™ïŒŒè‡Ș抹戛ć»șæĄŒéąćż«æ·æ–čćŒïŒŒćœšäžæ”ŻæŒćż«æ·æ–čćŒæ»€é‡çš„çł»ç»ŸäžŠä»…ćˆ›ć»șäž€æŹĄïŒ› + * "force" - æŁ€æŸ„ćč¶ćŒ•ćŻŒç”šæˆ·æ‰“ćŒ€ćż«æ·æ–čćŒæƒé™ïŒŒè‡Ș抹戛ć»șæĄŒéąćż«æ·æ–čćŒïŒŒćœšäžæ”ŻæŒćż«æ·æ–čćŒæ»€é‡çš„çł»ç»ŸäžŠæŻæŹĄéƒœć°èŻ•ćˆ›ć»ș + * "none" - äžæŁ€æŸ„ćż«æ·æ–čćŒæƒé™ïŒŒäžćˆ›ć»șæĄŒéąćż«æ·æ–čćŒïŒˆäžŽä»ŽæĄŒéąćż«æ·æ–čćŒćŻćŠšçš„æ”çš‹äž€è‡ŽïŒ‰ïŒ› + * "query" - ćŒčć‡șèŻąé—źæç€șæĄ†ïŒˆćș•郚星ç€ș甚户ç‚čć‡»çĄźćźšćŽćˆ›ć»șæĄŒéąćż«æ·æ–čćŒïŒˆæŁ€æŸ„ćč¶ćŒ•ćŻŒç”šæˆ·æ‰“ćŒ€ćż«æ·æ–čćŒæƒé™ïŒ‰ïŒ› + * "tipOnce" - äžšćŠĄé€»èŸ‘äžŽ"auto"ç±»äŒŒïŒŒć·źćˆ«æ˜ŻćȘäŒšćŒ•ćŻŒç”šæˆ·æ‰“ćŒ€ćż«æ·æ–čćŒæƒé™äž€æŹĄă€toast提ç€șäž€æŹĄă€‚ + * é»˜èź€ć€Œäžș"force"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + shortcut?: string; + /** + * 退ć‡ș攁ćș”ç”šçš„ćż«æ·æ–čćŒé€»èŸ‘ + * ćŻć–ć€ŒïŒš + * "query" - ćș”甚退ć‡șæ—¶æŁ€æŸ„æ˜ŻćŠćˆ›ć»șæĄŒéąćż«æ·æ–čćŒïŒŒćŠ‚æžœæŸ„èŻąćˆ°æČĄæœ‰ćˆ›ć»ș戙ćŒčć‡șèŻąé—źæĄ†ïŒŒç”šæˆ·ç‚čć‡»çĄźćźšćŽćˆ›ć»șæĄŒéąćż«æ·æ–čćŒïŒˆæŁ€æŸ„ćč¶ćŒ•ćŻŒç”šæˆ·æ‰“ćŒ€ćż«æ·æ–čćŒæƒé™ïŒ‰ïŒ› + * "queryOnce" - 仅ćș”ç”šçŹŹäž€æŹĄé€€ć‡șæŁ€æŸ„ïŒŒæŁ€æŸ„é€»èŸ‘ćŒquery + * "none" - ćș”甚退ć‡șæ—¶äžæŁ€æŸ„æ˜ŻćŠćˆ›ć»șæĄŒéąćż«æ·æ–čćŒă€‚ + * é»˜èź€ć€Œäžș"none"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + shortcutQuit?: string; +} + +/** + * JSONćŻčè±ĄïŒŒæ”ćș”ç”šæąć€èżèĄŒçš„ć‚æ•° + * èźŸçœźæ”ćș”ç”šæąć€èżèĄŒæ—¶çš„ć‚æ•°ă€splashă€éŠ–éĄ”ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ +interface PlusStreamStreamRestoreOptions { + /** + * 攁ćș”ç”šèżèĄŒć‚æ•° + * ćŻćŠšæ”ćș”ç”šçš„æ‰©ć±•ć‚æ•°ïŒŒćŻćœšæ”ćș”ç”šäž­é€šèż‡plus.runtime.argumentsèŽ·ć–ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + extras?: any; + /** + * ćș”ç”šćŻćŠšç•Œéąæ ·ćŒ + * ćŻć–ć€ŒïŒš + * "auto"è‡ȘćŠšé€‰æ‹©ćŻćŠšç•ŒéąïŒŒćŠ‚æžœæ”ćș”甚è‡ȘćŠšć…łé—­æ—¶æˆȘć›ŸæˆćŠŸćˆ™äœżç”šæˆȘć›ŸïŒŒćŠ‚æžœsplashć›Ÿç‰‡ć·Čç»äž‹èœœćˆ™æ˜Ÿç€șsplashć›Ÿç‰‡ïŒŒćŠćˆ™äœżç”šé»˜èź€ćŠ èœœæ”ćș”ç”šç•ŒéąïŒ› + * "default"ïŒšäœżç”šé»˜èź€ćŠ èœœæ”ćș”ç”šç•ŒéąïŒˆćŠ‚ćœš360æ”è§ˆć™šçŽŻćąƒäž­ćœšæ ‡éą˜æ äž‹æ˜Ÿç€șćŠ èœœèż›ćșŠæĄïŒ‰ă€‚ + * é»˜èź€ć€Œäžș"auto"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + splash?: string; + /** + * 攁ćș”甚銖饔çȘ—揣ćŻčè±Ąæ ·ćŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + styles?: PlusStreamLaunchWebviewStyles; + /** + * 攁ćș”ç”šæąć€èżèĄŒæ—¶ćŻćŠšç•Œéąé…çœźć‚æ•° + * 甹äșŽæ”ćș”甚è‡ȘćŠšć…łé—­ćŽæąć€èżèĄŒæ—¶è°ƒæ•ŽćŻćŠšç•Œéąé…çœźć‚æ•°ïŒŒćŠ‚ć°†è‡Ș抹慳闭splash调敎äžșæ‰‹ćŠšć…łé—­ïŒŒä»„äŸżæąć€äžŠæŹĄèżèĄŒçŠ¶æ€ćŽć†èż›ć…„ćș”甚。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + splashscreen?: PlusStreamStreamRestoreSplashscreenOptions; +} + +/** + * 攁ćș”ç”šæąć€èżèĄŒæ—¶ćŻćŠšç•Œéąé…çœźć‚æ•° + * èźŸçœźæ”ćș”ç”šæąć€èżèĄŒæ—¶ćŻćŠšç•ŒéąïŒŒćŠ‚æ˜ŻćŠè‡ȘćŠšć…łé—­ă€ć»¶æ—¶ć…łé—­æ—¶é—Žă€è¶…æ—¶æ—¶é—Žç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ +interface PlusStreamStreamRestoreSplashscreenOptions { + /** + * æ˜ŻćŠè‡Ș抹慳闭搯抹界靱 + * trueèĄšç€șćș”甚搯抚搎è‡ȘćŠšć…łé—­ćŻćŠšç•ŒéąïŒŒfalseèĄšç€șćș”ç”šćŻćŠšćŽäžè‡ȘćŠšć…łé—­ćŻćŠšç•ŒéąïŒŒéœ€èŠćœšćș”甚调甚plus.navigator.closeSplashscreen()æ–čæł•慳闭。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + autoclose?: boolean; + /** + * ćŻćŠšç•Œéąè¶…æ—¶æ—¶é—Ž + * ć•äœäžșæŻ«ç§’ïŒˆmsïŒ‰ïŒŒćœ“ćŻćŠšç•Œéąè¶…èż‡æ­€æ—¶é—Žä»ç„¶æœȘć…łé—­æ—¶ïŒˆäžçźĄautocloseć€ŒèźŸçœźtrueèż˜æ˜Żfalsećș”甚氆è‡Ș抹慳闭搯抹界靱。 + * é»˜èź€ć€Œäžș6000ïŒˆćł6ç§’ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + timeout?: number; +} + +/** + * JSONćŻčè±ĄïŒŒćŻćŠšæ”ćș”甚的銖饔çȘ—ćŁć±žæ€§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ +interface PlusStreamLaunchWebviewStyles { + /** + * 攁ćș”ç”šéŠ–éĄ”æ˜ŻćŠé˜»ćĄžçœ‘ç»œć›Ÿç‰‡çš„ćŠ èœœ + * trueèĄšç€șé˜»ćĄžçœ‘ç»œć›Ÿç‰‡çš„ćŠ èœœïŒŒfalseèĄšç€șäžé˜»ćĄžçœ‘ç»œć›Ÿç‰‡çš„ćŠ èœœă€‚é»˜èź€ć€Œäžșfalse。 + * èźŸçœźćŽćŻé€šèż‡WebviewçȘ—揣ćŻčè±Ąçš„setBlockNetworkImage(false)æ–čæł•äżźæ”čèźŸçœźæ„ç»§ç»­ćŠ èœœçœ‘ç»œć›Ÿç‰‡ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + blockNetworkImage?: boolean; + /** + * æŒ‡ćźšæ”ćș”ç”šéŠ–éĄ”ćœ°ć€ + * ćŻäœżç”šçœ‘ç»œćœ°ć€ïŒˆhttp://或https://ćŒ€ć€ŽïŒ‰ïŒŒäčŸćŻäœżç”šæœŹćœ°ćœ°ć€ïŒˆç›žćŻčćș”甚蔄æșè·ŻćŸ„ïŒ‰ă€‚ + * äčŸćŻäœżç”šç‰čćźšćœ°ć€ïŒš + * about:blank - äœżç”šç©șç™œéŠ–éĄ”ïŒŒä»…ćŠ èœœć†…çœźæłšć…„çš„è„šæœŹïŒˆćŠ‚all.js、wap2app.js、config.jsç­‰ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + launch_path?: string; + /** + * æŒ‡ćźšéŠ–éĄ”Webview的id + * ćŠ‚æžœæœȘæŒ‡ćźšidïŒŒćˆ™äœżç”šćș”甚的appid䜜äžș銖饔Webview的id。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + id?: string; + /** + * 攁ćș”ç”šéŠ–éĄ”æ˜ŻćŠæ˜Ÿç€ș + * trueèĄšç€ș星ç€șfalseèĄšç€ș䞍星ç€șă€‚é»˜èź€ć€Œäžștrue。 + * æłšæ„ïŒšæ”ćș”ç”šéŠ–éĄ”éšè—ćŽïŒŒéœ€èŠè°ƒç”šéŠ–éĄ”çš„setVisibleæ–čæł•星ç€șïŒŒćŠ‚plus.webview.getLaunchWebview().setVisible(true)。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + visible?: boolean; +} + +/** + * JSONćŻčè±ĄïŒŒæ”ćș”ç”šäżĄæŻ + * 攁ćș”ç”šæ ‡èŻ†ă€ć›Ÿæ ‡ă€æ˜ŻćŠäž‹èœœćźŒæˆç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ +interface PlusStreamStreamInfo { + /** + * 攁ćș”甚标è݆ + * 攁ćș”甚支䞀歗珊äžČæ ‡èŻ†ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + id?: string; + /** + * 攁ćș”ç”šçš„ć›Ÿæ ‡ + * 攁ćș”ç”šäž‹èœœçš„ć›Ÿæ ‡è·ŻćŸ„ïŒˆæœŹćœ°è·ŻćŸ„ïŒ‰ïŒŒćŠ‚æžœæœȘäž‹èœœćźŒæˆćˆ™èż”ć›žç©ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + icon?: string; + /** + * 攁ćș”ç”šæ˜ŻćŠäž‹èœœćꌿˆ + * trueèĄšç€ș攁ćș”甚䞋蜜ćꌿˆïŒŒfalseèĄšç€ș攁ćș”甚æœȘäž‹èœœćźŒæˆă€‚ + * æłšæ„ïŒŒæ”ćș”甚æœȘäž‹èœœćźŒæˆä»„èź©ćŻä»„æ­ŁćžžćŻćŠšèżèĄŒïŒŒćŻćŠšćŽäŒšè‡ȘćŠšäž‹èœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + complete?: boolean; +} + +/** + * JSONćŻčè±ĄïŒŒć…æ”é‡æ“äœœć‚æ•° + * ćŒ…ć«ç””èŻć·ç ă€éȘŒèŻç ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ +interface PlusStreamFreetrafficOptions { + /** + * ç””èŻć·ç  + * ć…æ”é‡èŻ·æ±‚éȘŒèŻç ă€ç»‘ćźšèźŸć€‡äœżç”šçš„ç””èŻć·ç ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + phone?: string; + /** + * éȘŒèŻç  + * ć…æ”é‡ç»‘ćźšèźŸć€‡äœżç”šçš„éȘŒèŻç ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/stream.html](http://www.html5plus.org/doc/zh_cn/stream.html) + */ + code?: string; +} + +/** + * UploaderæšĄć—çźĄç†çœ‘ç»œäžŠäŒ ä»»ćŠĄïŒŒç”šäșŽä»ŽæœŹćœ°äžŠäŒ ć„ç§æ–‡ä»¶ćˆ°æœćŠĄć™šïŒŒćč¶æ”ŻæŒè·šćŸŸèźżé—źæ“äœœă€‚é€šèż‡plus.uploaderćŻèŽ·ć–äžŠäŒ çźĄç†ćŻčè±Ąă€‚UploaderäžŠäŒ äœżç”šHTTP的POSTæ–čćŒæäș€æ•°æźïŒŒæ•°æźæ ŒćŒçŹŠćˆMultipart/form-dataè§„èŒƒïŒŒćłrfc1867Form-based File Upload in HTMLïŒ‰ćèźźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ +interface PlusUploader { + /** + * UploadćŻčè±ĄçźĄç†äž€äžȘäžŠäŒ ä»»ćŠĄ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + Upload?: PlusUploaderUpload; + /** + * äžŠäŒ ä»»ćŠĄäș‹ä»¶ç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + UploadEvent?: PlusUploaderUploadEvent; + /** + * äžŠäŒ ä»»ćŠĄçš„çŠ¶æ€ïŒŒNumber类枋 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + UploadState?: PlusUploaderUploadState; + /** + * JSONćŻčè±ĄïŒŒćˆ›ć»șäžŠäŒ ä»»ćŠĄçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + UploadOptions?: PlusUploaderUploadOptions; + /** + * JSONćŻčè±ĄïŒŒæ·»ćŠ äžŠäŒ æ–‡ä»¶çš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + UploadFileOptions?: PlusUploaderUploadFileOptions; + /** + * 新ć»șäžŠäŒ ä»»ćŠĄ + * èŻ·æ±‚äžŠäŒ çźĄç†ćˆ›ć»șæ–°çš„äžŠäŒ ä»»ćŠĄïŒŒćˆ›ć»șæˆćŠŸćˆ™èż”ć›žUploadćŻčè±ĄïŒŒç”šäșŽçźĄç†äžŠäŒ ä»»ćŠĄă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + createUpload(url?: string, options?: PlusUploaderUploadOptions, completedCB?: (result0: PlusUploaderUpload, result1: number) => void): PlusUploaderUpload; + /** + * æžšäžŸäžŠäŒ ä»»ćŠĄ + * æžšäžŸæŒ‡ćźšçŠ¶æ€çš„äžŠäŒ ä»»ćŠĄćˆ—èĄšïŒŒé€šèż‡enumCBć›žè°ƒć‡œæ•°èż”ć›žç»“æžœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + enumerate(enumCB?: (result: PlusUploader []) => void, state?: PlusUploaderUploadState): void; + /** + * æž…é™€äžŠäŒ ä»»ćŠĄ + * æž…é™€æŒ‡ćźšçŠ¶æ€çš„äžŠäŒ ä»»ćŠĄă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + clear(state?: PlusUploaderUploadState): void; + /** + * ćŒ€ć§‹æ‰€æœ‰äžŠäŒ ä»»ćŠĄ + * ćŒ€ć§‹æ‰€æœ‰ć€„äșŽæœȘćŒ€ć§‹è°ƒćșŠæˆ–æš‚ćœçŠ¶æ€çš„äžŠäŒ ä»»ćŠĄă€‚ + * è‹„äžŠäŒ ä»»ćŠĄæ•°è¶…èż‡ćŻćč¶ć‘ć€„ç†çš„æ€»æ•°ïŒŒè¶…ć‡ș的任报怄äșŽè°ƒćșŠçŠ¶æ€ïŒˆç­‰ćŸ…äžŠäŒ ïŒ‰ïŒŒćœ“æœ‰ä»»ćŠĄćꌿˆæ—¶æ čæźè°ƒćșŠçŠ¶æ€ä»»ćŠĄçš„äŒ˜ć…ˆçș§é€‰æ‹©ä»»ćŠĄćŒ€ć§‹äžŠäŒ ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + startAll(): void; +} + +/** + * UploadćŻčè±ĄçźĄç†äž€äžȘäžŠäŒ ä»»ćŠĄ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ +interface PlusUploaderUpload { + /** + * äžŠäŒ ä»»ćŠĄçš„æ ‡èŻ† + * 朹戛ć»șä»»ćŠĄæ—¶çł»ç»Ÿè‡ȘćŠšćˆ†é…ïŒŒç”šäșŽæ ‡èŻ†äžŠäŒ ä»»ćŠĄçš„ć”Żäž€æ€§ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + id?: string; + /** + * äžŠäŒ æ–‡ä»¶çš„æœćŠĄć™šćœ°ć€ + * 调甚plus.uploader.createUpload()æ–čæł•ćˆ›ć»șäžŠäŒ ä»»ćŠĄæ—¶èźŸçœźçš„ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + url?: string; + /** + * ä»»ćŠĄçš„çŠ¶æ€ + * äžŠäŒ ä»»ćŠĄçš„çŠ¶æ€ïŒŒć‚è€ƒUploadStateïŒŒćœšUploadCompleteCallbackäș‹ä»¶ć’ŒUploadStateChangedCallbackäș‹ä»¶è§Šć‘æ—¶æ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + state?: number; + /** + * äžŠäŒ ä»»ćŠĄçš„ć‚æ•° + * äžŠäŒ ä»»ćŠĄé…çœźçš„ć‚æ•°ïŒŒć‚è€ƒUploadOptions。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + options?: PlusUploaderUploadOptions; + /** + * äžŠäŒ ä»»ćŠĄćźŒæˆćŽæœćŠĄć™šèż”ć›žçš„æ•°æź + * èĄšç€șćœ“ć‰äžŠäŒ ä»»ćŠĄçš„çŠ¶æ€ïŒŒćŻé€šèż‡addEventListener()æ–čæł•监搏statechangedäș‹ä»¶ç›‘ćŹä»»ćŠĄçŠ¶æ€çš„ć˜ćŒ–ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + responseText?: string; + /** + * ć·ČćźŒæˆäžŠäŒ æ•°æźçš„ć€§ć°ïŒ‰ + * æ•Žæ•°ç±»ćž‹ïŒŒć•äœäžșć­—èŠ‚ïŒˆbyteïŒ‰ïŒŒäžŠäŒ ä»»ćŠĄćŒ€ć§‹äŒ èŸ“æ•°æźæ—¶ïŒŒæŻæŹĄè§Šć‘statechangedäș‹ä»¶æˆ–äžŠäŒ ä»»ćŠĄćꌿˆæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + uploadedSize?: number; + /** + * äžŠäŒ æ•°æźçš„æ€»ć€§ć° + * æ•Žæ•°ç±»ćž‹ïŒŒć•äœäžșć­—èŠ‚ïŒˆbyteïŒ‰ïŒŒäžŠäŒ ä»»ćŠĄćŒ€ć§‹äŒ èŸ“æ•°æźæ—¶æ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + totalSize?: number; + /** + * æ·»ćŠ äžŠäŒ æ–‡ä»¶ + * ć‘äžŠäŒ ä»»ćŠĄäž­æ·»ćŠ æ–‡ä»¶ïŒŒćż…éĄ»ćœšä»»ćŠĄćŒ€ć§‹äžŠäŒ ć‰è°ƒç”šă€‚ + * ä»„äž‹æƒ…ć†”äŒšćŻŒè‡Žæ·»ćŠ äžŠäŒ æ–‡ä»¶ć€±èŽ„ïŒš + * 1. optionsć‚æ•°äž­æŒ‡ćźšçš„keyćœšä»»ćŠĄäž­ć·Čç»ć­˜ćœšïŒŒćˆ™æ·»ćŠ ć€±èŽ„èż”ć›žfalse + * 2. pathć‚æ•°æŒ‡ćźšçš„æ–‡ä»¶è·ŻćŸ„äžćˆæł•æˆ–æ–‡ä»¶äžć­˜ćœšïŒŒćˆ™æ·»ćŠ ć€±èŽ„èż”ć›žfalse + * 3. äžŠäŒ ä»»ćŠĄć·Čç»ćŒ€ć§‹è°ƒćșŠïŒŒè°ƒç”šæ­€æ–čæł•ćˆ™æ·»ćŠ ć€±èŽ„èż”ć›žfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + addFile(path?: string, options?: PlusUploaderUploadFileOptions): boolean; + /** + * æ·»ćŠ äžŠäŒ æ•°æź + * ć‘äžŠäŒ ä»»ćŠĄäž­æ·»ćŠ æ•°æźïŒŒćż…éĄ»ćœšä»»ćŠĄćŒ€ć§‹äžŠäŒ ć‰è°ƒç”šă€‚ + * ä»„äž‹æƒ…ć†”äŒšćŻŒè‡Žæ·»ćŠ äžŠäŒ æ–‡ä»¶ć€±èŽ„ïŒš + * 1. keyć‚æ•°äž­æŒ‡ćźšçš„é”źććœšä»»ćŠĄäž­ć·Čç»ć­˜ćœšïŒŒćˆ™æ·»ćŠ ć€±èŽ„èż”ć›žfalse + * 2. äžŠäŒ ä»»ćŠĄć·Čç»ćŒ€ć§‹è°ƒćșŠïŒŒè°ƒç”šæ­€æ–čæł•ćˆ™æ·»ćŠ ć€±èŽ„èż”ć›žfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + addData(key?: string, value?: string): boolean; + /** + * ćŒ€ć§‹äžŠäŒ ä»»ćŠĄ + * ćŒ€ć§‹è°ƒćșŠäžŠäŒ ä»»ćŠĄïŒŒćŠ‚æžœä»»ćŠĄć·Čç»ć€„äșŽćŒ€ć§‹çŠ¶æ€ćˆ™æ— ä»»äœ•ć“ćș”。 + * 朹戛ć»șä»»ćŠĄæˆ–ä»»ćŠĄäžŠäŒ ć€±èŽ„ćŽè°ƒç”šćŻé‡æ–°ćŒ€ć§‹äžŠäŒ ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + start(): void; + /** + * æš‚ćœäžŠäŒ ä»»ćŠĄ + * æš‚ćœäžŠäŒ ä»»ćŠĄïŒŒćŠ‚æžœä»»ćŠĄć·Čç»ć€„äșŽćˆć§‹çŠ¶æ€æˆ–æš‚ćœçŠ¶æ€ćˆ™æ— ä»»äœ•ć“ćș”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + pause(): void; + /** + * æąć€æš‚ćœçš„äžŠäŒ ä»»ćŠĄ + * ç»§ç»­æš‚ćœçš„äžŠäŒ ä»»ćŠĄïŒŒćŠ‚æžœä»»ćŠĄć€„äșŽéžæš‚ćœçŠ¶æ€ćˆ™æ— ä»»äœ•ć“ćș”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + resume(): void; + /** + * ć–æ¶ˆäžŠäŒ ä»»ćŠĄ + * ćŠ‚æžœä»»ćŠĄæœȘćźŒæˆïŒŒćˆ™ç»ˆæ­ąäžŠäŒ ïŒŒćč¶ä»Žä»»ćŠĄćˆ—èĄšäž­ćˆ é™€ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + abort(): void; + /** + * æ·»ćŠ äžŠäŒ ä»»ćŠĄäș‹ä»¶ç›‘搏晚 + * äžŠäŒ ä»»ćŠĄæ·»ćŠ äș‹ä»¶ç›‘ćŹć™šćŽïŒŒćœ“ç›‘ćŹçš„äș‹ä»¶ć‘ç”Ÿæ—¶è§Šć‘listenerć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + addEventListener(type?: string, listener?: (result0: PlusUploaderUpload, result1: number) => void, capture?: boolean): void; + /** + * èŽ·ć–äžŠäŒ èŻ·æ±‚HTTP操ćș”ć€ŽéƒšäżĄæŻ + * HTTP操ćș”ć€Žéƒšć…šéƒšć†…ćźč䜜äžșæœȘè§Łæžçš„ć­—çŹŠäžČèż”ć›žïŒŒćŠ‚æžœæČĄæœ‰æŽ„æ”¶ćˆ°èż™äžȘHTTP操ćș”ć€Žæ•°æźæˆ–è€…äžŠäŒ èŻ·æ±‚æœȘćźŒæˆćˆ™äžșç©ș歗笩äžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + getAllResponseHeaders(): string; + /** + * èŽ·ć–äžŠäŒ èŻ·æ±‚æŒ‡ćźšçš„HTTP操ćș”ć€Žéƒšçš„ć€Œ + * ć…¶ć‚æ•°æ˜ŻèŠèż”ć›žçš„HTTP操ćș”ć€Žéƒšçš„ćç§°ïŒŒćŻä»„äœżç”šä»»äœ•ć€§ć°ć†™æ„ćˆ¶ćźšèż™äžȘć€Žéƒšćć­—ïŒŒć’Œć“ćș”ć€Žéƒšçš„æŻ”èŸƒæ˜ŻäžćŒșćˆ†ć€§ć°ć†™çš„ă€‚ + * ćŠ‚æžœæČĄæœ‰æŽ„æ”¶ćˆ°èż™äžȘć€Žéƒšæˆ–è€…äŒ€ć€„èŻ·æ±‚æœȘćźŒæˆćˆ™äžșç©ș歗笩äžČïŒ›ćŠ‚æžœæŽ„æ”¶ćˆ°ć€šäžȘæœ‰æŒ‡ćźšćç§°çš„ć€ŽéƒšïŒŒèż™äžȘć€Žéƒšçš„ć€Œèą«èżžæŽ„è”·æ„ćč¶èż”ć›žïŒŒäœżç”šé€—ć·ć’Œç©șæ Œćˆ†éš”ćŒ€ć„äžȘć€Žéƒšçš„ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + getResponseHeader(headerName?: string): string; + /** + * èźŸçœźäžŠäŒ èŻ·æ±‚çš„HTTPć€Žæ•°æź + * Http的Headerćș”èŻ„ćŒ…ć«ćœšé€šèż‡ćŽç»­start()è°ƒç”šè€Œć‘è”·çš„èŻ·æ±‚äž­ïŒŒæ­€æ–čæł•ćż…éœ€ćœšè°ƒç”šstart()äč‹ć‰èźŸçœźæ‰èƒœç”Ÿæ•ˆă€‚ + * ćŠ‚æžœćžŠæœ‰æŒ‡ćźšćç§°çš„ć€Žéƒšć·Čç»èą«æŒ‡ćźšäș†ïŒŒèż™äžȘć€Žéƒšçš„æ–°ć€Œć°±æ˜ŻïŒšäč‹ć‰æŒ‡ćźšçš„ć€ŒïŒŒćŠ äžŠé€—ć·ă€ä»„ćŠèż™äžȘè°ƒç”šæŒ‡ćźšçš„ć€ŒïŒˆćœąæˆäž€äžȘæ•°ç»„ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + setRequestHeader(headerName?: string, headerValue?: string): void; +} + +/** + * äžŠäŒ ä»»ćŠĄäș‹ä»¶ç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ +interface PlusUploaderUploadEvent { + /** + * äžŠäŒ ä»»ćŠĄçŠ¶æ€ć˜ćŒ–äș‹ä»¶ + * ćœ“äžŠäŒ ä»»ćŠĄçŠ¶æ€ć‘ç”Ÿć˜ćŒ–æ—¶è§Šć‘æ­€äș‹ä»¶ïŒŒäș‹ä»¶ćŽŸćž‹ć‚è€ƒUploadStateChangedCallback。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + statechanged?: string; +} + +/** + * äžŠäŒ ä»»ćŠĄçš„çŠ¶æ€ïŒŒNumber类枋 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ +type PlusUploaderUploadState = undefined | 0 | 1 | 2 | 3 | 4 | 5 | -1; + +/** + * JSONćŻčè±ĄïŒŒćˆ›ć»șäžŠäŒ ä»»ćŠĄçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ +interface PlusUploaderUploadOptions { + /** + * çœ‘ç»œèŻ·æ±‚ç±»ćž‹ + * ä»…æ”ŻæŒhttpćèźźçš„â€œPOSTâ€èŻ·æ±‚ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + method?: string; + /** + * äžŠäŒ ä»»ćŠĄæŻæŹĄäžŠäŒ çš„æ–‡ä»¶ć—ć€§ć°ïŒˆä»…ćœšæ”ŻæŒæ–­ç‚čç»­äŒ çš„æœćŠĄæœ‰æ•ˆïŒ‰ + * æ•°ć€Œç±»ćž‹ïŒŒć•äœäžșByteïŒˆć­—èŠ‚ïŒ‰ïŒŒé»˜èź€ć€Œäžș102400ïŒŒè‹„èźŸçœźć€Œć°äșŽç­‰äșŽ0ćˆ™èĄšç€șäžćˆ†ć—äžŠäŒ ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + blocksize?: number; + /** + * äžŠäŒ ä»»ćŠĄçš„äŒ˜ć…ˆçș§ + * æ•°ć€Œç±»ćž‹ïŒŒæ•°ć€Œè¶Šć€§äŒ˜ć…ˆçș§è¶Šé«˜ïŒŒé»˜èź€äŒ˜ć…ˆçș§ć€Œäžș0。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + priority?: number; + /** + * äžŠäŒ ä»»ćŠĄè¶…æ—¶æ—¶é—Ž + * æ•°ć€Œç±»ćž‹ïŒŒć•äœäžșs(秒)ïŒŒé»˜èź€ć€Œäžș120s。 + * è¶…æ—¶æ—¶é—ŽäžșæœćŠĄć™šć“ćș”èŻ·æ±‚çš„æ—¶é—ŽïŒˆäžæ˜ŻäžŠäŒ ä»»ćŠĄćźŒæˆçš„æ€»æ—¶é—ŽïŒ‰ïŒŒćŠ‚æžœèźŸçœźäžș0ćˆ™èĄšç€șæ°žèżœäžè¶…æ—¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + timeout?: number; + /** + * äžŠäŒ ä»»ćŠĄé‡èŻ•æŹĄæ•° + * æ•°ć€Œç±»ćž‹ïŒŒé»˜èź€äžșé‡èŻ•3æŹĄă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + retry?: number; + /** + * äžŠäŒ ä»»ćŠĄé‡èŻ•é—Žéš”æ—¶é—Ž + * æ•°ć€Œç±»ćž‹ïŒŒć•äœäžșs(秒)ïŒŒé»˜èź€ć€Œäžș30s。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + retryInterval?: number; +} + +/** + * JSONćŻčè±ĄïŒŒæ·»ćŠ äžŠäŒ æ–‡ä»¶çš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ +interface PlusUploaderUploadFileOptions { + /** + * æ–‡ä»¶é”źć + * äžŠäŒ æ–‡ä»¶ćœšäžŠäŒ ä»»ćŠĄäž­çš„é”źćïŒŒé»˜èź€ć€Œäžșäžșæ–‡ä»¶ćç§°ă€‚ + * äžŠäŒ ä»»ćŠĄäž­ćŠ‚æžœć·Čç»ć­˜ćœšç›žćŒkeyçš„äžŠäŒ æ–‡ä»¶æˆ–æ•°æźć°†ćŻŒè‡Žæ·»ćŠ æ–‡ä»¶ć€±èŽ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + key?: string; + /** + * æ–‡ä»¶ćç§° + * äžŠäŒ æ–‡ä»¶çš„ćç§°ïŒŒé»˜èź€ć€ŒäžșäžŠäŒ æ–‡ä»¶è·ŻćŸ„äž­çš„ćç§°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + name?: string; + /** + * æ–‡ä»¶ç±»ćž‹ + * äžŠäŒ æ–‡ä»¶çš„ç±»ćž‹ïŒˆćŠ‚ć›Ÿç‰‡æ–‡ä»¶äžș“image/jpegâ€ïŒ‰ïŒŒé»˜èź€ć€Œè‡Ș抹æ čæźæ–‡ä»¶ćŽçŒ€ćç§°ç”Ÿæˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/uploader.html](http://www.html5plus.org/doc/zh_cn/uploader.html) + */ + mime?: string; +} + +/** + * VideoæšĄć—çźĄç†ć€šćȘ’äœ“è§†éą‘ç›žć…łèƒœćŠ›ïŒŒćŻç”šćˆ›ć»șè§†éą‘æ’­æ”ŸæŽ§ä»¶ïŒŒç›Žæ’­æŽšæ”æŽ§ä»¶ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ +interface PlusVideo { + /** + * è§†éą‘æ’­æ”ŸæŽ§ä»¶ćŻčè±Ą + * VideoPlayerćŻčè±ĄèĄšç€șè§†éą‘æ’­æ”ŸæŽ§ä»¶ćŻčè±ĄïŒŒćœšçȘ—ćŁäž­æ’­æ”Ÿè§†éą‘ïŒŒćŻæ”ŻæŒæœŹćœ°è§†éą‘(mp4/flv)ïŒŒçœ‘ç»œè§†éą‘ćœ°ć€ïŒˆmp4/flv/m3u8ïŒ‰ćŠæ”ćȘ’䜓rtmp/hls/rtspïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + VideoPlayer?: PlusVideoVideoPlayer; + /** + * è§†éą‘æ’­æ”ŸæŽ§ä»¶ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + VideoPlayerStyles?: PlusVideoVideoPlayerStyles; + /** + * è§†éą‘æ’­æ”ŸæŽ§ä»¶äș‹ä»¶ç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + VideoPlayerEvents?: PlusVideoVideoPlayerEvents; + /** + * 盎播掚攁控件ćŻčè±Ą + * LivePusherćŻčè±ĄèĄšç€ș盎播掚攁控件ćŻčè±ĄïŒŒćœšçȘ—ćŁäž­æ˜Ÿç€șæ•èŽ·è§†éą‘ïŒŒćźžæ—¶æŽšé€ćˆ°æ”ćȘ’䜓RTMPïŒ‰æœćŠĄć™šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + LivePusher?: PlusVideoLivePusher; + /** + * ç›Žæ’­æŽšæ”æŽ§ä»¶é…çœźé€‰éĄč + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + LivePusherStyles?: PlusVideoLivePusherStyles; + /** + * 盎播掚攁控件äș‹ä»¶ç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + LivePusherEvents?: PlusVideoLivePusherEvents; + /** + * 戛ć»șVideoPlayerćŻčè±Ą + * 调甚歀æ–čæł•ćˆ›ć»ș搎ćč¶äžäŒšæ˜Ÿç€ș需芁调甚WebviewçȘ—ćŁçš„appendæ–čæł•ć°†ć…¶æ·»ćŠ ćˆ°WebviewçȘ—ćŁćŽæ‰èƒœæ˜Ÿç€ș。 + * æłšæ„ïŒšæ­€æ—¶éœ€èŠé€šèż‡stylesć‚æ•°çš„top/left/width/heightć±žæ€§èźŸçœźæŽ§ä»¶çš„äœçœźćŠć€§ć°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + createVideoPlayer(id?: string, styles?: PlusVideoVideoPlayerStyles): PlusVideoVideoPlayer; + /** + * 戛ć»șLivePusherćŻčè±Ą + * 调甚歀æ–čæł•ćˆ›ć»ș搎ćč¶äžäŒšæ˜Ÿç€ș需芁调甚WebviewçȘ—ćŁçš„appendæ–čæł•ć°†ć…¶æ·»ćŠ ćˆ°WebviewçȘ—ćŁćŽæ‰èƒœæ˜Ÿç€ș。 + * æłšæ„ïŒšæ­€æ—¶éœ€èŠé€šèż‡stylesć‚æ•°çš„top/left/width/heightć±žæ€§èźŸçœźæŽ§ä»¶çš„äœçœźćŠć€§ć°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + createLivePusher(id?: string, styles?: PlusVideoLivePusherStyles): PlusVideoLivePusher; + /** + * 柄扟ć·Čç»ćˆ›ć»ș的VideoPlayerćŻčè±Ą + * æŸ„æ‰ŸæŒ‡ćźšid的VideoPlayerćŻčè±ĄïŒŒćŠ‚æžœäžć­˜ćœšćˆ™èż”ć›žnull。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + getVideoPlayerById(id?: string): PlusVideoVideoPlayer; + /** + * 柄扟ć·Čç»ćˆ›ć»ș的LivePusherćŻčè±Ą + * æŸ„æ‰ŸæŒ‡ćźšid的LivePusherćŻčè±ĄïŒŒćŠ‚æžœäžć­˜ćœšćˆ™èż”ć›žnull。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + getLivePusherById(id?: string): PlusVideoLivePusher; +} + +/** + * è§†éą‘æ’­æ”ŸæŽ§ä»¶ćŻčè±Ą + * VideoPlayerćŻčè±ĄèĄšç€șè§†éą‘æ’­æ”ŸæŽ§ä»¶ćŻčè±ĄïŒŒćœšçȘ—ćŁäž­æ’­æ”Ÿè§†éą‘ïŒŒćŻæ”ŻæŒæœŹćœ°è§†éą‘(mp4/flv)ïŒŒçœ‘ç»œè§†éą‘ćœ°ć€ïŒˆmp4/flv/m3u8ïŒ‰ćŠæ”ćȘ’䜓rtmp/hls/rtspïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ +interface PlusVideoVideoPlayer { + /** + * ç›‘ćŹè§†éą‘æ’­æ”ŸæŽ§ä»¶äș‹ä»¶ + * ć‘è§†éą‘æ’­æ”ŸæŽ§ä»¶æ·»ćŠ äș‹ä»¶ç›‘ćŹć™šïŒŒćœ“æŒ‡ćźšçš„äș‹ä»¶ć‘ç”Ÿæ—¶ïŒŒć°†è§Šć‘listenerć‡œæ•°çš„æ‰§èĄŒă€‚ + * ćŻć€šæŹĄè°ƒç”šæ­€æ–čæł•ć‘è§†éą‘æ’­æ”ŸæŽ§ä»¶æ·»ćŠ ć€šäžȘç›‘ćŹć™šïŒŒćœ“ç›‘ćŹçš„äș‹ä»¶ć‘ç”Ÿæ—¶ïŒŒć°†æŒ‰ç…§æ·»ćŠ çš„ć…ˆćŽéĄșćșæ‰§èĄŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + addEventListener(event?: PlusVideoVideoPlayerEvents, listener?: (result: any) => void, capture?: boolean): void; + /** + * èźŸçœźè§†éą‘æ’­æ”ŸæŽ§ä»¶ć‚æ•° + * 甹äșŽćŠšæ€æ›Žæ–°è§†éą‘æ’­æ”ŸæŽ§ä»¶çš„é…çœźć‚æ•°ă€‚ + * æłšæ„ïŒšæœ‰äș›é€‰éĄčæ— æł•ćŠšæ€æ›Žæ–°ïŒŒćȘèƒœćˆ›ć»șæ—¶èż›èĄŒèźŸçœźïŒŒèŻŠæƒ…ć‚è€ƒVideoPlayerStyles。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + setStyles(styles?: PlusVideoVideoPlayerStyles): void; + /** + * èźŸçœźè§†éą‘æ’­æ”ŸæŽ§ä»¶ć‚æ•°ïŒˆć°†ćșŸćŒƒïŒŒäœżç”šsetStyles + * 甹äșŽćŠšæ€æ›Žæ–°è§†éą‘æ’­æ”ŸæŽ§ä»¶çš„é…çœźé€‰éĄč。 + * æłšæ„ïŒšæœ‰äș›é€‰éĄčæ— æł•ćŠšæ€æ›Žæ–°ïŒŒćȘèƒœćˆ›ć»șæ—¶èż›èĄŒèźŸçœźïŒŒèŻŠæƒ…ć‚è€ƒVideoPlayerStyles。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + setOptions(options?: PlusVideoVideoPlayerStyles): void; + /** + * æ’­æ”Ÿè§†éą‘ + * ćŠ‚æžœè§†éą‘ć·Čç»ć€„äșŽæ’­æ”ŸçŠ¶æ€ïŒŒćˆ™æ“äœœæ— æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + play(): void; + /** + * æš‚ćœè§†éą‘ + * ćŠ‚æžœè§†éą‘æœȘ怄äșŽæ’­æ”ŸçŠ¶æ€ïŒŒćˆ™æ“äœœæ— æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + pause(): void; + /** + * è·łèœŹćˆ°æŒ‡ćźšäœçœź + * ćŠ‚æžœè§†éą‘æœȘ怄äșŽæ’­æ”ŸçŠ¶æ€ïŒŒćˆ™æ“äœœæ— æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + seek(position?: number): void; + /** + * ćˆ‡æąćˆ°ć…šć± + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + requestFullScreen(direction?: number): void; + /** + * 退ć‡șć…šć± + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + exitFullScreen(): void; + /** + * ćœæ­ąæ’­æ”Ÿè§†éą‘ + * ćŠ‚æžœè§†éą‘æœȘ怄äșŽæ’­æ”Ÿæˆ–æš‚ćœçŠ¶æ€ïŒŒćˆ™æ“äœœæ— æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + stop(): void; + /** + * éšè—è§†éą‘æ’­æ”ŸæŽ§ä»¶ + * 隐藏ćȘæ˜ŻæŽ§ä»¶äžćŻè§ïŒŒæŽ§ä»¶äŸç„¶ć­˜ćœšćč¶äž”䞍æ”čć˜æ’­æ”ŸçŠ¶æ€ă€‚ + * ćŠ‚æžœæŽ§ä»¶ć·Čç»éšè—ïŒŒćˆ™æ“äœœæ— æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + hide(): void; + /** + * 星ç€șè§†éą‘æ’­æ”ŸæŽ§ä»¶ + * ć°†éšè—çš„æŽ§ä»¶æ˜Ÿç€șć‡șæ„ïŒˆć›žć€ćˆ°éšè—ć‰çš„çŠ¶æ€ïŒ‰ă€‚ + * ćŠ‚æžœæŽ§ä»¶ć·Č经星ç€șïŒŒćˆ™æ“äœœæ— æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + show(): void; + /** + * ć…łé—­è§†éą‘æ’­æ”ŸæŽ§ä»¶ + * ć…łé—­æ“äœœć°†é‡Šæ”ŸæŽ§ä»¶æ‰€æœ‰è”„æșïŒŒäžć†ćŻç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + close(): void; + /** + * 揑送ćŒčćč• + * ćŠ‚æžœè§†éą‘æœȘ怄äșŽæ’­æ”ŸçŠ¶æ€ïŒŒćˆ™æ“äœœæ— æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + sendDanmu(danmu?: any): void; + /** + * èźŸçœźć€é€Ÿæ’­æ”Ÿ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + playbackRate(rate?: number): void; +} + +/** + * è§†éą‘æ’­æ”ŸæŽ§ä»¶ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ +interface PlusVideoVideoPlayerStyles { + /** + * è§†éą‘è”„æșćœ°ć€ + * æ”ŻæŒæœŹćœ°ćœ°ć€ïŒŒä蟿”ŻæŒçœ‘ç»œćœ°ć€ćŠç›Žæ’­æ”ïŒˆRTMPïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + src?: string; + /** + * è§†éą‘ćˆć§‹æ’­æ”Ÿäœçœź + * ć•äœäžș秒sïŒ‰ă€‚ + * æłšæ„ïŒšä»…ćœšè§†éą‘ćŒ€ć§‹æ’­æ”Ÿć‰èźŸçœźæœ‰æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + 'initial-time'?: number; + /** + * è§†éą‘é•żćșŠ + * ć•äœäžș秒sïŒ‰ă€‚ + * æłšæ„ïŒšä»…ćœšè§†éą‘ćŒ€ć§‹æ’­æ”Ÿć‰èźŸçœźæœ‰æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + duration?: number; + /** + * æ˜ŻćŠæ˜Ÿç€șé»˜èź€æ’­æ”ŸæŽ§ä»¶ + * é»˜èź€ć€Œäžștrue。 + * ćŒ…æ‹Źæ’­æ”Ÿ/æš‚ćœæŒ‰é’źă€æ’­æ”Ÿèż›ćșŠă€æ—¶é—Žç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + controls?: boolean; + /** + * ćŒčćč•ćˆ—èĄš + * ćŒčćč•JSONćŻčè±ĄćŒ…æ‹Źć±žæ€§ïŒštextStringç±»ćž‹ïŒŒćŒčć蕿–‡æœŹç±»ćźčcolorStringç±»ćž‹ïŒŒćŒčćč•éąœè‰ČïŒŒæ ŒćŒäžș#RRGGBBtimeNumberç±»ćž‹ïŒŒćŒčćč•ć‡șçŽ°çš„æ—¶é—ŽïŒŒć•äœäžșç§’ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + 'danmu-list'?: any []; + /** + * æ˜ŻćŠæ˜Ÿç€șćŒčć蕿Œ‰é’ź + * é»˜èź€ć€Œäžșfalse。 + * æłšæ„ïŒšä»…ćœšæŽ§ä»¶æž„é€ æ—¶èźŸçœźæœ‰æ•ˆïŒŒäžèƒœćŠšæ€æ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + 'danmu-btn'?: boolean; + /** + * æ˜ŻćŠć±•ç€șćŒčćč• + * é»˜èź€ć€Œäžșfalse。 + * æłšæ„ïŒšä»…ćœšæŽ§ä»¶æž„é€ æ—¶èźŸçœźæœ‰æ•ˆïŒŒäžèƒœćŠšæ€æ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + 'enable-danmu'?: boolean; + /** + * æ˜ŻćŠè‡ȘćŠšæ’­æ”Ÿ + * é»˜èź€ć€Œäžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + autoplay?: boolean; + /** + * æ˜ŻćŠćŸȘçŽŻæ’­æ”Ÿ + * é»˜èź€ć€Œäžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + loop?: boolean; + /** + * æ˜ŻćŠé™éŸłæ’­æ”Ÿ + * é»˜èź€ć€Œäžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + muted?: boolean; + /** + * èźŸçœźć…šć±æ—¶è§†éą‘çš„æ–č搑 + * äžæŒ‡ćźšćˆ™æ čæźćźœé«˜æŻ”è‡ȘćŠšćˆ€æ–­ă€‚ + * æœ‰æ•ˆć€Œäžș 0ïŒˆæ­Łćžžç«–ć‘ïŒ‰, 90ïŒˆć±ćč•逆时针90ćșŠïŒ‰, -90ïŒˆć±ćč•éĄș时针90ćșŠïŒ‰ă€‚ + * é»˜èź€ć€Œäžș-90。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + direction?: number; + /** + * æ˜ŻćŠæ˜Ÿç€șæ’­æ”Ÿèż›ćșŠ + * é»˜èź€ć€Œäžștrue。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + 'show-progress'?: boolean; + /** + * æ˜ŻćŠæ˜Ÿç€șć…šć±æŒ‰é’ź + * é»˜èź€ć€Œäžștrue。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + 'show-fullscreen-btn'?: boolean; + /** + * æ˜ŻćŠæ˜Ÿç€șè§†éą‘ćș•éƒšæŽ§ćˆ¶æ çš„æ’­æ”ŸæŒ‰é’ź + * é»˜èź€ć€Œäžștrue。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + 'show-play-btn'?: boolean; + /** + * æ˜ŻćŠæ˜Ÿç€șè§†éą‘äž­é—Žçš„æ’­æ”ŸæŒ‰é’ź + * é»˜èź€ć€Œäžștrue。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + 'show-center-play-btn'?: boolean; + /** + * æ˜ŻćŠćŒ€ćŻæŽ§ćˆ¶èż›ćșŠçš„æ‰‹ćŠż + * é»˜èź€ć€Œäžștrue。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + 'enable-progress-gesture'?: boolean; + /** + * ćœ“è§†éą‘ć€§ć°äžŽ video ćźčć™šć€§ć°äžäž€è‡Žæ—¶ïŒŒè§†éą‘çš„èĄšçŽ°ćœąćŒ + * æœ‰æ•ˆć€ŒäžșcontainïŒˆćŒ…ć«ïŒ‰ïŒŒfillïŒˆćĄ«ć……ïŒ‰ïŒŒcoverïŒˆèŠ†ç›–ïŒ‰ă€‚ + * é»˜èź€ć€Œäžșcontain。 + * 仅Androidćčłć°æ”ŻæŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + objectFit?: string; + /** + * è§†éą‘ć°éąçš„ć›Ÿç‰‡çœ‘ç»œè”„æșćœ°ć€ + * ćŠ‚æžœ controls ć±žæ€§ć€Œäžș false ćˆ™èźŸçœź poster æ— æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + poster?: string; + /** + * VideoPlayeræŽ§ä»¶ć·ŠäžŠè§’çš„ćž‚ç›Žćç§»é‡ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶WebviewçȘ—ćŁçš„é«˜ćșŠïŒ› + * è‡ȘćŠšèźĄçź—ïŒŒćŠ‚"auto",æ čæźheightć€Œè‡ȘćŠšèźĄçź—ïŒŒç›žćŻčäșŽçˆ¶WebviewçȘ—ćŁćž‚ç›Žć±…äž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + top?: string; + /** + * VideoPlayeræŽ§ä»¶ć·ŠäžŠè§’çš„æ°Žćčłćç§»é‡ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶WebviewçȘ—ćŁçš„ćźœćșŠïŒ› + * è‡ȘćŠšèźĄçź—ïŒŒćŠ‚"auto"æ čæźwidthć€Œè‡ȘćŠšèźĄçź—ïŒŒç›žćŻčäșŽçˆ¶WebviewçȘ—ćŁæ°Žćčłć±…䞭。 + * é»˜èź€ć€Œäžș"0px"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + left?: string; + /** + * VideoPlayeræŽ§ä»¶çš„ćźœćșŠ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶WebviewçȘ—ćŁçš„ćźœćșŠă€‚ + * é»˜èź€ć€Œäžș"100%"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + width?: string; + /** + * VideoPlayer控件的高ćșŠ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶WebviewçȘ—ćŁçš„é«˜ćșŠă€‚ + * é»˜èź€ć€Œäžș"100%"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + height?: string; + /** + * VideoPlayeræŽ§ä»¶ćœšWebviewçȘ—ćŁçš„ćžƒć±€æšĄćŒ + * ćŻć–ć€ŒïŒš + * "static" - é™æ€ćžƒć±€æšĄćŒïŒŒćŠ‚æžœéĄ”éąć­˜ćœšæ»šćŠšæĄćˆ™éšçȘ—ćŁć†…ćźčæ»šćŠšïŒ› + * "absolute" - 绝ćŻčćžƒć±€æšĄćŒïŒŒćŠ‚æžœéĄ”éąć­˜ćœšæ»šćŠšæĄäžéšçȘ—ćŁć†…ćźčæ»šćŠšïŒ› + * é»˜èź€ć€Œäžș"static"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + position?: string; +} + +/** + * è§†éą‘æ’­æ”ŸæŽ§ä»¶äș‹ä»¶ç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ +interface PlusVideoVideoPlayerEvents { + /** + * è§†éą‘æ’­æ”Ÿäș‹ä»¶ + * ćœ“è§†éą‘ćŒ€ć§‹/ç»§ç»­æ’­æ”Ÿæ—¶è§Šć‘ă€‚ + * 无äș‹ä»¶ć›žè°ƒć‡œæ•°ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + play?: string; + /** + * è§†éą‘æš‚ćœäș‹ä»¶ + * ćœ“è§†éą‘æš‚ćœæ’­æ”Ÿæ—¶è§Šć‘ă€‚ + * 无äș‹ä»¶ć›žè°ƒć‡œæ•°ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + pause?: string; + /** + * è§†éą‘ç»“æŸäș‹ä»¶ + * ćœ“è§†éą‘æ’­æ”Ÿćˆ°æœ«ć°Ÿæ—¶è§Šć‘ă€‚ + * 无äș‹ä»¶ć›žè°ƒć‡œæ•°ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + ended?: string; + /** + * è§†éą‘æ’­æ”Ÿèż›ćșŠæ›Žæ–°äș‹ä»¶ + * ćœ“è§†éą‘æ’­æ”Ÿèż›ćșŠć˜ćŒ–æ—¶è§Šć‘ïŒŒè§Šć‘éą‘çŽ‡250msäž€æŹĄă€‚ + * äș‹ä»¶ć›žè°ƒć‡œæ•°ć‚æ•°event.detail = {currentTime:"Numberç±»ćž‹ïŒŒćœ“ć‰æ’­æ”Ÿæ—¶é—ŽïŒˆć•äœäžș秒",duration:"Numberç±»ćž‹ïŒŒè§†éą‘æ€»é•żćșŠïŒˆć•䜍äžș秒"}。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + timeupdate?: string; + /** + * è§†éą‘æ’­æ”Ÿć…šć±æ’­æ”ŸçŠ¶æ€ć˜ćŒ–äș‹ä»¶ + * ćœ“è§†éą‘æ’­æ”Ÿèż›ć…„æˆ–é€€ć‡șć…šć±æ—¶è§Šć‘ă€‚ + * äș‹ä»¶ć›žè°ƒć‡œæ•°ć‚æ•°event.detail = {fullScreen:"Booleanç±»ćž‹ïŒŒćœ“ć‰çŠ¶æ€æ˜ŻćŠäžșć…šć±", direction:"Stringç±»ćž‹ïŒŒvertical或horizontal"}。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + fullscreenchange?: string; + /** + * è§†éą‘çŒ“ć†Čäș‹ä»¶ + * ćœ“è§†éą‘æ’­æ”Ÿć‡ș现猓ć†Čæ—¶è§Šć‘ă€‚ + * 无äș‹ä»¶ć›žè°ƒć‡œæ•°ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + waiting?: string; + /** + * è§†éą‘é”™èŻŻäș‹ä»¶ + * ćœ“è§†éą‘æ’­æ”Ÿć‡șé”™æ—¶è§Šć‘ă€‚ + * 无äș‹ä»¶ć›žè°ƒć‡œæ•°ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + error?: string; +} + +/** + * 盎播掚攁控件ćŻčè±Ą + * LivePusherćŻčè±ĄèĄšç€ș盎播掚攁控件ćŻčè±ĄïŒŒćœšçȘ—ćŁäž­æ˜Ÿç€șæ•èŽ·è§†éą‘ïŒŒćźžæ—¶æŽšé€ćˆ°æ”ćȘ’䜓RTMPïŒ‰æœćŠĄć™šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ +interface PlusVideoLivePusher { + /** + * ç›‘ćŹç›Žæ’­æŽšæ”æŽ§ä»¶äș‹ä»¶ + * ć‘ç›Žæ’­æŽšæ”æŽ§ä»¶æ·»ćŠ äș‹ä»¶ç›‘ćŹć™šïŒŒćœ“æŒ‡ćźšçš„äș‹ä»¶ć‘ç”Ÿæ—¶ïŒŒć°†è§Šć‘listenerć‡œæ•°çš„æ‰§èĄŒă€‚ + * ćŻć€šæŹĄè°ƒç”šæ­€æ–čæł•ć‘ç›Žæ’­æŽšæ”æŽ§ä»¶æ·»ćŠ ć€šäžȘç›‘ćŹć™šïŒŒćœ“ç›‘ćŹçš„äș‹ä»¶ć‘ç”Ÿæ—¶ïŒŒć°†æŒ‰ç…§æ·»ćŠ çš„ć…ˆćŽéĄșćșæ‰§èĄŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + addEventListener(event?: PlusVideoLivePusherEvents, listener?: (result: any) => void, capture?: boolean): void; + /** + * èźŸçœźç›Žæ’­æŽšæ”æŽ§ä»¶ć‚æ•° + * 甹äșŽćŠšæ€æ›Žæ–°ç›Žæ’­æŽšæ”æŽ§ä»¶çš„é…çœźć‚æ•°ă€‚ + * æłšæ„ïŒšæœ‰äș›é€‰éĄčæ— æł•ćŠšæ€æ›Žæ–°ïŒŒćȘèƒœćˆ›ć»șæ—¶èż›èĄŒèźŸçœźïŒŒèŻŠæƒ…ć‚è€ƒLivePusherStyles。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + setStyles(styles?: PlusVideoLivePusherStyles): void; + /** + * èźŸçœźç›Žæ’­æŽšæ”æŽ§ä»¶ć‚æ•°ïŒˆć°†ćșŸćŒƒïŒŒäœżç”šsetStyles + * 甹äșŽćŠšæ€æ›Žæ–°ç›Žæ’­æŽšæ”æŽ§ä»¶çš„é…çœźé€‰éĄč。 + * æłšæ„ïŒšæœ‰äș›é€‰éĄčæ— æł•ćŠšæ€æ›Žæ–°ïŒŒćȘèƒœćˆ›ć»șæ—¶èż›èĄŒèźŸçœźïŒŒèŻŠæƒ…ć‚è€ƒLivePusherStyles。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + setOptions(options?: PlusVideoLivePusherStyles): void; + /** + * éą„è§ˆæ‘„ćƒć€Žé‡‡é›†æ•°æź + * è°ƒç”šæ‘„ćƒć€Žé‡‡é›†ć›Ÿćƒæ•°æźïŒŒćč¶ćœšæŽšæ”æŽ§ä»¶äž­éą„è§ˆïŒˆæ­€æ—¶äžäŒšć‘æœćŠĄć™šæŽšæ”ïŒŒéœ€è°ƒç”šstartæ–čæł•æ‰ćŒ€ć§‹æŽšæ”ïŒ‰ă€‚ + * æłšæ„ïŒšäžșäș†çĄźäżéą„览çȘ—ćŁć€§ć°æ­ŁçĄźïŒŒćș”èŻ„ćœšćˆ›ć»șæŽ§ä»¶ćŽć»¶æ—¶äž€ćźšçš„æ—¶é—ŽïŒˆćŠ‚500msïŒ‰èż›èĄŒéą„è§ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + preview(): void; + /** + * ćŒ€ć§‹æŽšæ” + * ćŠ‚æžœć·Čç»ć€„äșŽæŽšæ”çŠ¶æ€ïŒŒćˆ™æ“äœœæ— æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + start(successCB?: () => void, errorCB?: () => void): void; + /** + * ćœæ­ąæŽšæ” + * ćŠ‚æžœæœȘ怄äșŽæŽšæ”çŠ¶æ€ïŒŒćˆ™æ“äœœæ— æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + stop(options?: any): void; + /** + * æš‚ćœæŽšæ” + * ćŠ‚æžœæœȘ怄äșŽæŽšæ”çŠ¶æ€ïŒŒćˆ™æ“äœœæ— æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + pause(): void; + /** + * æąć€æŽšæ” + * ćŠ‚æžœæœȘ怄äșŽæš‚ćœçŠ¶æ€ïŒŒćˆ™æ“äœœæ— æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + resume(): void; + /** + * ćˆ‡æąć‰ćŽæ‘„ćƒć€Ž + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + switchCamera(): void; + /** + * 濫照 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + snapshot(successCB?: () => void, errorCB?: () => void): void; + /** + * ć…łé—­ç›Žæ’­æŽšæ”æŽ§ä»¶ + * ć…łé—­æ“äœœć°†é‡Šæ”ŸæŽ§ä»¶æ‰€æœ‰è”„æșïŒŒäžć†ćŻç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + close(): void; +} + +/** + * ç›Žæ’­æŽšæ”æŽ§ä»¶é…çœźé€‰éĄč + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ +interface PlusVideoLivePusherStyles { + /** + * æŽšæ”ćœ°ć€ + * æ”ŻæŒRTMPćèźźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + url?: string; + /** + * æŽšæ”è§†éą‘æšĄćŒ + * ćŻć–ć€ŒïŒšSD标枅, HD高枅, FHDïŒˆè¶…æž…ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + mode?: string; + /** + * æ˜ŻćŠé™éŸł + * é»˜èź€ć€Œäžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + muted?: boolean; + /** + * ćŒ€ćŻæ‘„ćƒć€Ž + * é»˜èź€ć€Œäžștrue。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + 'enable-camera'?: boolean; + /** + * è‡ȘćŠšèšé›† + * é»˜èź€ć€Œäžștrue。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + 'auto-focus'?: boolean; + /** + * æ˜ŻćŠçŸŽéąœ + * ćŻć–ć€Œ0、1ïŒŒć…¶äž­0èĄšç€șäžäœżç”šçŸŽéąœïŒŒ1èĄšç€șäžäœżç”šçŸŽéąœă€‚ + * é»˜èź€ć€Œäžș0(äžäœżç”šçŸŽéąœ)。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + beauty?: number; + /** + * æ˜ŻćŠçŸŽç™œ + * ćŻć–ć€Œ0、1、2、3、4、5ïŒŒć…¶äž­0èĄšç€șäžäœżç”šçŸŽç™œïŒŒć…¶äœ™ć€Œćˆ†ćˆ«èĄšç€ș矎癜的皋ćșŠïŒŒć€Œè¶Šć€§çŸŽç™œçš‹ćșŠè¶Šć€§ă€‚ + * é»˜èź€ć€Œäžș0ïŒˆäžäœżç”šçŸŽç™œïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + whiteness?: number; + /** + * ćźœé«˜æŻ” + * ćŻć–ć€ŒïŒš3:4, 9:16。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + aspect?: string; + /** + * LivePusheræŽ§ä»¶ć·ŠäžŠè§’çš„ćž‚ç›Žćç§»é‡ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶WebviewçȘ—ćŁçš„é«˜ćșŠïŒ› + * è‡ȘćŠšèźĄçź—ïŒŒćŠ‚"auto",æ čæźheightć€Œè‡ȘćŠšèźĄçź—ïŒŒç›žćŻčäșŽçˆ¶WebviewçȘ—ćŁćž‚ç›Žć±…äž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + top?: string; + /** + * LivePusheræŽ§ä»¶ć·ŠäžŠè§’çš„æ°Žćčłćç§»é‡ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶WebviewçȘ—ćŁçš„ćźœćșŠïŒ› + * è‡ȘćŠšèźĄçź—ïŒŒćŠ‚"auto"æ čæźwidthć€Œè‡ȘćŠšèźĄçź—ïŒŒç›žćŻčäșŽçˆ¶WebviewçȘ—ćŁæ°Žćčłć±…䞭。 + * é»˜èź€ć€Œäžș"0px"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + left?: string; + /** + * LivePusheræŽ§ä»¶çš„ćźœćșŠ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶WebviewçȘ—ćŁçš„ćźœćșŠă€‚ + * é»˜èź€ć€Œäžș"100%"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + width?: string; + /** + * LivePusher控件的高ćșŠ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶WebviewçȘ—ćŁçš„é«˜ćșŠă€‚ + * é»˜èź€ć€Œäžș"100%"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + height?: string; + /** + * LivePusheræŽ§ä»¶ćœšWebviewçȘ—ćŁçš„ćžƒć±€æšĄćŒ + * ćŻć–ć€ŒïŒš + * "static" - é™æ€ćžƒć±€æšĄćŒïŒŒćŠ‚æžœéĄ”éąć­˜ćœšæ»šćŠšæĄćˆ™éšçȘ—ćŁć†…ćźčæ»šćŠšïŒ› + * "absolute" - 绝ćŻčćžƒć±€æšĄćŒïŒŒćŠ‚æžœéĄ”éąć­˜ćœšæ»šćŠšæĄäžéšçȘ—ćŁć†…ćźčæ»šćŠšïŒ› + * é»˜èź€ć€Œäžș"static"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + position?: string; +} + +/** + * 盎播掚攁控件äș‹ä»¶ç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ +interface PlusVideoLivePusherEvents { + /** + * çŠ¶æ€ć˜ćŒ–äș‹ä»¶ + * ćœ“æŽšæ”èżžæŽ„æœćŠĄć™šçŠ¶æ€ć˜ćŒ–æ—¶è§Šć‘ă€‚ + * äș‹ä»¶ć›žè°ƒć‡œæ•°ć‚æ•°event={type:"äș‹ä»¶ç±»ćž‹ïŒŒæ­€æ—¶äžșstatechange",target:"è§Šć‘æ­€äș‹ä»¶çš„盎播掚攁控件ćŻčè±Ą",detail:{code:"çŠ¶æ€ç ïŒŒć‚è€ƒćŽéąçŠ¶æ€ç èŻŽæ˜Ž",message:"æèż°äżĄæŻ"}}。 + * ć…¶äž­code状态码 + * 1001 - ć·Čç»èżžæŽ„æŽšæ”æœćŠĄć™šïŒ› + * 1002 - ć·Čç»äžŽæœćŠĄć™šæĄæ‰‹ćźŒæŻ•,ćŒ€ć§‹æŽšæ”ïŒ› + * 1003 - æ‰“ćŒ€æ‘„ćƒć€ŽæˆćŠŸïŒ› + * 1004 - ćœ•ć±ćŻćŠšæˆćŠŸïŒ› + * 1005 - æŽšæ”ćŠšæ€è°ƒæ•Žćˆ†èŸšçŽ‡ïŒ› + * 1006 - æŽšæ”ćŠšæ€è°ƒæ•Žç çŽ‡ïŒ› + * 1007 - éŠ–ćž§ç”»éąé‡‡é›†ćźŒæˆïŒ› + * 1008 - çŒ–ç ć™šćŻćŠšïŒ› + * -1301 - æ‰“ćŒ€æ‘„ćƒć€Žć€±èŽ„ïŒ› + * -1302 - æ‰“ćŒ€éșŠć…‹éŁŽć€±èŽ„ïŒ› + * -1303 - è§†éą‘çŒ–ç ć€±èŽ„ïŒ› + * -1304 - éŸłéą‘çŒ–ç ć€±èŽ„ïŒ› + * -1305 - äžæ”ŻæŒçš„è§†éą‘ćˆ†èŸšçŽ‡ïŒ› + * -1306 - äžæ”ŻæŒçš„éŸłéą‘é‡‡æ ·çŽ‡ïŒ› + * -1307 - çœ‘ç»œæ–­èżžïŒŒäž”ç»ć€šæŹĄé‡èżžæŠąæ•‘æ— æ•ˆïŒŒæ›Žć€šé‡èŻ•èŻ·è‡ȘèĄŒé‡ćŻæŽšæ”ïŒ› + * -1308 - ćŒ€ć§‹ćœ•ć±ć€±èŽ„ïŒŒćŻèƒœæ˜Żèą«ç”šæˆ·æ‹’ç»ïŒ› + * -1309 - ćœ•ć±ć€±èŽ„ïŒŒäžæ”ŻæŒçš„Androidçł»ç»Ÿç‰ˆæœŹïŒŒéœ€èŠ5.0ä»„äžŠçš„çł»ç»ŸïŒ› + * -1310 - ćœ•ć±èą«ć…¶ä»–ćș”甚打断äș†ïŒ› + * -1311 - Android Micæ‰“ćŒ€æˆćŠŸïŒŒäœ†æ˜Żćœ•äžćˆ°éŸłéą‘æ•°æźïŒ› + * -1312 - ćœ•ć±ćŠšæ€ćˆ‡æšȘç«–ć±ć€±èŽ„ïŒ› + * 1101 - çœ‘ç»œçŠ¶ć†”äžäœłïŒšäžŠèĄŒćžŠćźœć€Șć°ïŒŒäžŠäŒ æ•°æźć—é˜»ïŒ› + * 1102 - çœ‘ç»œæ–­èżž, ć·Č搯抹è‡ȘćŠšé‡èżžïŒ› + * 1103 - çĄŹçŒ–ç ćŻćŠšć€±èŽ„,é‡‡ç”šèœŻçŒ–ç ïŒ› + * 1104 - è§†éą‘çŒ–ç ć€±èŽ„ïŒ› + * 1105 - æ–°çŸŽéąœèœŻçŒ–ç ćŻćŠšć€±èŽ„ïŒŒé‡‡ç”šè€çš„èœŻçŒ–ç ïŒ› + * 1106 - æ–°çŸŽéąœèœŻçŒ–ç ćŻćŠšć€±èŽ„ïŒŒé‡‡ç”šè€çš„èœŻçŒ–ç ïŒ› + * 3001 - RTMP -DNSè§Łæžć€±èŽ„ïŒ› + * 3002 - RTMPæœćŠĄć™šèżžæŽ„ć€±èŽ„ïŒ› + * 3003 - RTMPæœćŠĄć™šæĄæ‰‹ć€±èŽ„ïŒ› + * 3004 - RTMPæœćŠĄć™šäž»ćŠšæ–­ćŒ€ïŒŒèŻ·æŁ€æŸ„æŽšæ”ćœ°ć€çš„ćˆæł•æ€§æˆ–é˜Č盗铟有效期 + * 3005 - RTMP èŻ»/ć†™ć€±èŽ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + statechange?: string; + /** + * 眑络状态通矄äș‹ä»¶ + * ćœ“æŽšæ”çš„çœ‘ç»œçŠ¶æ€ć‘ç”Ÿć˜ćŒ–æ—¶è§Šć‘ă€‚ + * äș‹ä»¶ć›žè°ƒć‡œæ•°ć‚æ•°event={type:"äș‹ä»¶ç±»ćž‹ïŒŒæ­€æ—¶äžșnetstatus",target:"è§Šć‘æ­€äș‹ä»¶çš„盎播掚攁控件ćŻčè±Ą",detail:{videoBitrate:"è§†éą‘ç çŽ‡",audioBitrate:"音鱑码率",videoFPS:"è§†éą‘ćž§çŽ‡",netSpeed:"掚攁眑速",videoWidth:"è§†éą‘ćźœćșŠ",videoHeight:"è§†éą‘é«˜ćșŠ"}}。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + netstatus?: string; + /** + * æžČæŸ“é”™èŻŻäș‹ä»¶ + * ćœ“æŽšæ”ć‘ç”Ÿé”™èŻŻæ˜Żè§Šć‘ă€‚ + * äș‹ä»¶ć›žè°ƒć‡œæ•°ć‚æ•°event={type:"äș‹ä»¶ç±»ćž‹ïŒŒæ­€æ—¶äžșerror",target:"è§Šć‘æ­€äș‹ä»¶çš„盎播掚攁控件ćŻčè±Ą",detail:{code:"é”™èŻŻçŒ–ç ïŒŒć‚è€ƒćŽéąé”™èŻŻç èŻŽæ˜Ž",message:"æèż°äżĄæŻ"}}。 + * ć…¶äž­codeé”™èŻŻç ïŒš + * 1001 - ç”šæˆ·çŠæ­ąäœżç”šæ‘„ćƒć€ŽïŒ› + * 1002 - ç”šæˆ·çŠæ­ąäœżç”šćœ•éŸłă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/video.html](http://www.html5plus.org/doc/zh_cn/video.html) + */ + error?: string; +} + +/** + * WebviewæšĄć—çźĄç†ćș”甚çȘ—ćŁç•ŒéąïŒŒćźžçŽ°ć€šçȘ—ćŁçš„é€»èŸ‘æŽ§ćˆ¶çźĄç†æ“äœœă€‚é€šèż‡plus.webviewćŻèŽ·ć–ćș”ç”šç•ŒéąçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebview { + /** + * 䞀组甚äșŽćźšäč‰éĄ”éąæˆ–æŽ§ä»¶æ˜Ÿç€șćŠšç”»æ•ˆæžœ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + AnimationTypeShow?: PlusWebviewAnimationTypeShow; + /** + * 䞀组甚äșŽćźšäč‰éĄ”éąæˆ–æŽ§ä»¶ć…łé—­çš„ćŠšç”»æ•ˆæžœ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + AnimationTypeClose?: PlusWebviewAnimationTypeClose; + /** + * WebviewçȘ—揣ćŻčè±ĄïŒŒç”šäșŽæ“äœœćŠ èœœHTMLéĄ”éąçš„çȘ—揣 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewObject?: PlusWebviewWebviewObject; + /** + * WebviewçȘ—ćŁćŠšç”»ć‚æ•° + * 甹äșŽæŒ‡ćźšćŠšç”»ç›źæ ‡çȘ—ćŁïŒŒè”·ć§‹äœçœźă€ç›źæ ‡äœçœźç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewAnimationOptions?: PlusWebviewWebviewAnimationOptions; + /** + * WebviewçȘ—ćŁćŠšç”»æ ·ćŒ + * 甹äșŽæŒ‡ćźšćŠšç”»çȘ—ćŁçš„è”·ć§‹äœçœźă€ç›źæ ‡äœçœźç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewAnimationStyles?: PlusWebviewWebviewAnimationStyles; + /** + * WebviewçȘ—ćŁć›žćŒčæ ·ćŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewBounceStyle?: PlusWebviewWebviewBounceStyle; + /** + * WebviewçȘ—ćŁć†…ćźčćŠšç”»ć‚æ•° + * æŒ‡ćźšćŠšç”»çš„ç±»ćž‹ă€æŒç»­æ—¶é—Žç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewContentAnimationOptions?: PlusWebviewWebviewContentAnimationOptions; + /** + * ćŽŸç”ŸæŽ§ä»¶ćœšçȘ—ćŁäž­ćœé çš„æ–čćŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewDock?: PlusWebviewWebviewDock; + /** + * WebviewçȘ—ćŁæ»‘ćŠšäș‹ä»¶æ•°æź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewDragEvent?: PlusWebviewWebviewDragEvent; + /** + * çȘ—ćŁæ‰‹ćŠżæ“äœœć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewDragOptions?: PlusWebviewWebviewDragOptions; + /** + * æ‰‹ćŠżæ“äœœć…łè”ćŻčè±Ąć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewDragOtherViewOptions?: PlusWebviewWebviewDragOtherViewOptions; + /** + * æˆȘć±ç»˜ćˆ¶æ“äœœć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewDrawOptions?: PlusWebviewWebviewDrawOptions; + /** + * çȘ—ćŁæ”¶è—ć‚æ•° + * ćœšæ”ćș”ç”šçŽŻćąƒäž­è°ƒç”šæ”¶è—ćŠŸèƒœæ—¶äœżç”šçš„ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewFavoriteOptions?: PlusWebviewWebviewFavoriteOptions; + /** + * 戛ć»șćŠ èœœHTMLæ•°æźć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewLoadDataOptions?: PlusWebviewWebviewLoadDataOptions; + /** + * çȘ—ćŁçš„ćˆ†äș«ć‚æ•° + * ćœšæ”ćș”ç”šçŽŻćąƒäž­è°ƒç”šćˆ†äș«ćŠŸèƒœæ—¶äœżç”šçš„ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewShareOptions?: PlusWebviewWebviewShareOptions; + /** + * çȘ—ćŁćŽŸç”Ÿć­ViewæŽ§ä»¶æ ·ćŒ + * ćŻèźŸçœźćŽŸç”ŸæŽ§ä»¶çš„æ ‡èŻ†ă€ć€§ć°ă€äœçœźä»„ćŠç»˜ćˆ¶çš„ć†…ćźč等。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewSubNViewStyles?: PlusWebviewWebviewSubNViewStyles; + /** + * çȘ—ćŁæ ‡éą˜æ æŽ§ä»¶æ ·ćŒ + * æ ‡éą˜æ æŽ§ä»¶ć›șćźšé«˜ćșŠäžș44px,ćŻé€šèż‡WebviewçȘ—揣ćŻčè±Ąçš„getTitleNViewæ–čæł•èŽ·ć–æ ‡éą˜æ ćŽŸç”ŸæŽ§ä»¶ćŻčè±ĄćŠšæ€ç»˜ćˆ¶ć†…ćźč。 + * ćŻä»„é€šèż‡WebviewObjectćŻčè±Ąçš„getTitleNView()èŽ·ć–æ ‡éą˜æ çš„NViewćŻčè±ĄïŒŒç„¶ćŽè°ƒç”šć…¶setStyleæ–čæł•æ›Žæ–°æ ·ćŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewTitleNViewStyles?: PlusWebviewWebviewTitleNViewStyles; + /** + * çȘ—ćŁæ ‡éą˜æ è‡Ș漚ä艿Œ‰é’źæ ·ćŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewTitleNViewButtonStyles?: PlusWebviewWebviewTitleNViewButtonStyles; + /** + * æ ‡éą˜æ æŽ§ä»¶çš„èż›ćșŠæĄæ ·ćŒ + * 星ç€șćœšæ ‡éą˜æ æŽ§ä»¶ćș•éƒšă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewProgressStyles?: PlusWebviewWebviewProgressStyles; + /** + * çȘ—ćŁæ ‡éą˜æ æŽ§ä»¶çš„ćˆ†ć‰Čçșżæ ·ćŒ + * 星ç€șćœšæ ‡éą˜æ æŽ§ä»¶ćș•éƒšă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewSplitLineStyles?: PlusWebviewWebviewSplitLineStyles; + /** + * WebviewçȘ—揣äș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewEvent?: PlusWebviewWebviewEvent; + /** + * JSONćŻčè±ĄïŒŒćŽŸç”ŸçȘ—ćŁæ‰©ć±•ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewExtraOptions?: PlusWebviewWebviewExtraOptions; + /** + * ćŽŸç”ŸæŽ§ä»¶ćœšçȘ—ćŁäž­æ˜Ÿç€șçš„äœçœź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewPosition?: PlusWebviewWebviewPosition; + /** + * WebviewçȘ—ćŁäž‹æ‹‰ćˆ·æ–°æ ·ćŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewPullToRefreshStyles?: PlusWebviewWebviewPullToRefreshStyles; + /** + * WebviewçȘ—揣renderedäș‹ä»¶ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewRenderedEventOptions?: PlusWebviewWebviewRenderedEventOptions; + /** + * æ›żæąH5æ ‡ć‡†APIé…çœźäżĄæŻ + * ç›źć‰ä»…æ”ŻæŒæ›żæąH5æ ‡ć‡†ćźšäœæŽ„ćŁ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewReplaceWebApiOptions?: PlusWebviewWebviewReplaceWebApiOptions; + /** + * JSONćŻčè±ĄïŒŒWebviewçȘ—ćŁçš„çł»ç»ŸçŠ¶æ€æ ćŒșćŸŸæ ·ćŒ + * ä»…ćœšćș”ç”šèźŸçœźäžșæČ‰æ”žćŒçŠ¶æ€æ æ ·ćŒäž‹æœ‰æ•ˆïŒŒéžæČ‰æ”žćŒçŠ¶æ€æ æ ·ćŒäž‹ćżœç•„æ­€ć±žæ€§ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewStatusbarStyles?: PlusWebviewWebviewStatusbarStyles; + /** + * JSONćŻčè±ĄïŒŒWebviewçȘ—揣ćŻčè±Ąçš„æ ·ćŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewStyles?: PlusWebviewWebviewStyles; + /** + * 䞀组甚äșŽćźšäč‰éĄ”éąæˆ–æŽ§ä»¶ć˜ćœąçš„ć±žæ€§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewTransform?: PlusWebviewWebviewTransform; + /** + * 䞀组甚äșŽćźšäč‰éĄ”éąæˆ–æŽ§ä»¶èœŹæąæ•ˆæžœçš„ć±žæ€§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewTransition?: PlusWebviewWebviewTransition; + /** + * 拊æˆȘWebviewçȘ—ćŁè”„æșèŻ·æ±‚çš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewOverrideResourceOptions?: PlusWebviewWebviewOverrideResourceOptions; + /** + * 拊æˆȘWebviewçȘ—揣URLèŻ·æ±‚çš„ć±žæ€§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewOverrideUrlOptions?: PlusWebviewWebviewOverrideUrlOptions; + /** + * 监搬WebviewçȘ—ćŁè”„æșćŠ èœœçš„ć±žæ€§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + WebviewListenResourceOptions?: PlusWebviewWebviewListenResourceOptions; + /** + * èŽ·ć–æ‰€æœ‰WebviewçȘ—揣 + * èŽ·ć–ćș”甚䞭ć·Č戛ć»ș的所有WebviewçȘ—ćŁïŒŒćŒ…æ‹Źæ‰€æœ‰æœȘ星ç€ș的WebviewçȘ—ćŁă€‚ + * èż”ć›žWebviewObjectćŻčè±Ąćœšæ•°ç»„äž­æŒ‰ćˆ›ć»ș的慈搎éĄșćșæŽ’ćˆ—ïŒŒćłæ•°ç»„äž­çŹŹäž€äžȘWebviewObjectćŻčè±Ąç”šæ˜ŻćŠ èœœćș”ç”šçš„ć…„ćŁéĄ”éąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + all(): PlusWebview []; + /** + * 慳闭WebviewçȘ—揣 + * 慳闭ć·Čç»æ‰“ćŒ€çš„WebviewçȘ—ćŁïŒŒéœ€ć…ˆèŽ·ć–çȘ—揣ćŻčè±Ąæˆ–çȘ—揣idćč¶ćŻæŒ‡ćźšć…łé—­çȘ—ćŁçš„ćŠšç”»ćŠćŠšç”»æŒç»­æ—¶é—Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + close(id_wvobj?: string, aniClose?: string, duration?: number, extras?: PlusWebviewWebviewExtraOptions): void; + /** + * 戛ć»ș新的WebviewçȘ—揣 + * 戛ć»șWebviewçȘ—ćŁïŒŒç”šäșŽćŠ èœœæ–°çš„HTMLéĄ”éąïŒŒćŻé€šèż‡stylesèźŸçœźWebviewçȘ—ćŁçš„æ ·ćŒïŒŒćˆ›ć»șćźŒæˆćŽéœ€èŠè°ƒç”šshowæ–čæł•æ‰èƒœć°†WebviewçȘ—ćŁæ˜Ÿç€șć‡șæ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + create(url?: string, id?: string, styles?: PlusWebviewWebviewStyles, extras?: any): PlusWebviewWebviewObject; + /** + * èŽ·ć–ćœ“ć‰çȘ—ćŁçš„WebviewObjectćŻčè±Ą + * èŽ·ć–ćœ“ć‰éĄ”éąæ‰€ć±žçš„WebviewçȘ—揣ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + currentWebview(): PlusWebviewWebviewObject; + /** + * èŽ·ć–ć±ć蕿‰€æœ‰ćŻè§†çš„WebviewçȘ—揣 + * ä»…ćœšć±ćč•ćŒșćŸŸæ˜Ÿç€ș的WebviewçȘ—ćŁïŒŒćŠ‚æžœWebviewçȘ—ćŁæ˜Ÿç€șäș†äœ†èą«ć…¶ćźƒWebviewçȘ—ćŁç›–äœćˆ™èź€äžșäžćŻè§†ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + getDisplayWebview(): PlusWebview []; + /** + * æŸ„æ‰ŸæŒ‡ćźšæ ‡èŻ†çš„WebviewObjectçȘ—揣 + * 朹ć·Č戛ć»ș的çȘ—ćŁćˆ—èĄšäž­æŸ„æ‰ŸæŒ‡ćźšæ ‡èŻ†çš„WebviewçȘ—揣ćč¶èż”曞。 + * è‹„æČĄæœ‰æŸ„æ‰Ÿćˆ°æŒ‡ćźšæ ‡èŻ†çš„çȘ—ćŁćˆ™èż”ć›žnullïŒŒè‹„ć­˜ćœšć€šäžȘç›žćŒæ ‡èŻ†çš„WebviewçȘ—ćŁïŒŒćˆ™èż”ć›žçŹŹäž€äžȘ戛ć»ș的WebviewçȘ—ćŁă€‚ + * ćŠ‚æžœèŠèŽ·ć–ćș”ç”šć…„ćŁéĄ”éąæ‰€ć±žçš„WebviewçȘ—ćŁïŒŒć…¶æ ‡è݆äžșćș”甚的%APPID%ïŒŒćŻé€šèż‡plus.runtime.appidèŽ·ć–ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + getWebviewById(id?: string): PlusWebviewWebviewObject; + /** + * èŽ·ć–ćș”甚銖饔WebviewObjectçȘ—揣ćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + getLaunchWebview(): PlusWebviewWebviewObject; + /** + * èŽ·ć–ćș”甚珏äșŒäžȘ銖饔WebviewObjectçȘ—揣ćŻčè±Ą + * ćœšćŒéŠ–éĄ”æšĄćŒäž‹ïŒˆćœšmanifest.json的plus->secondwebview节ç‚čäž‹é…çœźïŒ‰ïŒŒćș”甚䌚è‡Ș抹戛ć»ș䞀äžȘ銖饔WebviewïŒŒé€šèż‡getLaunchWebview()ćŻèŽ·ć–çŹŹäž€äžȘ銖饔çȘ—揣ćŻčè±ĄïŒŒé€šèż‡getSecondWebview()ćŻèŽ·ć–çŹŹäșŒäžȘ銖饔çȘ—揣ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + getSecondWebview(): PlusWebviewWebviewObject; + /** + * èŽ·ć–ćș”甚星ç€șæ ˆéĄ¶çš„WebviewObjectçȘ—揣ćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + getTopWebview(): PlusWebviewWebviewObject; + /** + * 隐藏WebviewçȘ—揣 + * æ čæźæŒ‡ćźšçš„WebviewObjectćŻčè±Ąæˆ–id隐藏WebviewçȘ—ćŁïŒŒäœżćŸ—çȘ—ćŁäžćŻè§ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + hide(id_wvobj?: string, aniHide?: string, duration?: number, extras?: PlusWebviewWebviewExtraOptions): void; + /** + * 戛ć»șćč¶æ‰“ćŒ€WebviewçȘ—揣 + * 戛ć»șćč¶æ˜Ÿç€șWebviewçȘ—ćŁïŒŒç”šäșŽćŠ èœœæ–°çš„HTMLéĄ”éąïŒŒćŻé€šèż‡stylesèźŸçœźWebviewçȘ—ćŁçš„æ ·ćŒïŒŒćˆ›ć»șćźŒæˆćŽè‡Ș抹氆WebviewçȘ—ćŁæ˜Ÿç€șć‡șæ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + open(url?: string, id?: string, styles?: PlusWebviewWebviewStyles, aniShow?: string, duration?: number, showedCB?: () => void): PlusWebviewWebviewObject; + /** + * éą„èœœçœ‘ç»œéĄ”éą + * éą„èœœçœ‘ç»œéĄ”éąäŒšć‘æœćŠĄć™šć‘è”·http/httpsèŻ·æ±‚èŽ·ć–htmléĄ”éąć†…ćźč + * ćŸ…WebviewçȘ—ćŁćŠ èœœæ­€urléĄ”éąæ—¶äŒšćˆ™æ čæźçŒ“ć­˜æœșćˆ¶äŒ˜ć…ˆäœżç”šéą„èœœçš„éĄ”éąć†…ćźč(ćŠ ćż«éĄ”éąæ˜Ÿç€ș速ćșŠ)。 + * æłšæ„ïŒšéą„èœœçœ‘ç»œéĄ”éąä»…ćœšèżèĄŒæœŸç”Ÿæ•ˆïŒŒäžșäș†èŠ‚çœć†…ć­˜ä»…äżç•™æœ€ćŽ5äžȘéą„èœœéĄ”éąæ•°æźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + prefetchURL(url?: string): void; + /** + * éą„èœœçœ‘ç»œéĄ”éąïŒˆć€šäžȘćœ°ć€ïŒ‰ + * éą„èœœçœ‘ç»œéĄ”éąäŒšć‘æœćŠĄć™šć‘è”·http/httpsèŻ·æ±‚èŽ·ć–htmléĄ”éąć†…ćźč + * ćŸ…WebviewçȘ—ćŁćŠ èœœæ­€urléĄ”éąæ—¶äŒšćˆ™æ čæźçŒ“ć­˜æœșćˆ¶äŒ˜ć…ˆäœżç”šéą„èœœçš„éĄ”éąć†…ćźč(ćŠ ćż«éĄ”éąæ˜Ÿç€ș速ćșŠ)。 + * æłšæ„ïŒšéą„èœœçœ‘ç»œéĄ”éąä»…ćœšèżèĄŒæœŸç”Ÿæ•ˆïŒŒäžșäș†èŠ‚çœć†…ć­˜ä»…äżç•™æœ€ćŽ5äžȘéą„èœœéĄ”éąæ•°æźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + prefetchURLs(urls?: any []): void; + /** + * 星ç€șWebviewçȘ—揣 + * 星ç€șć·Č戛ć»ș或隐藏的WebviewçȘ—ćŁïŒŒéœ€ć…ˆèŽ·ć–çȘ—揣ćŻčè±Ąæˆ–çȘ—揣idćč¶ćŻæŒ‡ćꚿ˜Ÿç€șçȘ—ćŁçš„ćŠšç”»ćŠćŠšç”»æŒç»­æ—¶é—Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + show(id_wvobj?: string, aniShow?: string, duration?: number, showedCB?: () => void, extras?: PlusWebviewWebviewExtraOptions): PlusWebviewWebviewObject; + /** + * WebviewçȘ—ćŁç»„ćˆćŠšç”» + * ćŒæ­„ç»„ćˆäž€äžȘWebviewçȘ—ćŁćŠšç”»ïŒŒćŠšç”»ćꌿˆćŽçȘ—ćŁçš„äœçœźäŒšć‘ç”Ÿć˜ćŒ–ïŒŒäž€æŹĄéœ€èŠćœšćŠšç”»ć±žæ€§ć‚æ•°äž­èźŸçœźćŠšç”»è”·ć§‹äœçœźă€ç»“æŸäœçœźç­‰ă€‚ + * æłšæ„ïŒšæ­€ćŠšç”»æ“äœœäŒšæ”č揘çȘ—ćŁäœçœźïŒˆćŠ‚leftć€Œç­‰ïŒ‰ïŒŒć†æŹĄè°ƒç”šshowæ–čæł•æ—¶éœ€èŠçĄźäżć…¶äœçœźæ˜ŻćŠćœšćŻè§†ćŒșćŸŸïŒŒćŠ‚æžœäžćœšćŻè§†ćŒșćŸŸćˆ™éœ€èŠè°ƒç”šçȘ—ćŁçš„setStyleæ–čæł•èźŸçœźć…¶äœçœźćˆ°ćŻè§†ćŒșćŸŸć†…ïŒŒćŠ‚setStyle({left:'0px'});。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + startAnimation(options?: PlusWebviewWebviewAnimationOptions, otherOptions?: PlusWebviewWebviewAnimationOptions, callback?: (result: any) => void): void; + /** + * èŽ·ć–Webviewé»˜èź€æ˜ŻćŠćŒ€ćŻçĄŹä»¶ćŠ é€Ÿ + * 由äșŽäžćŒèźŸć€‡ćŻčçĄŹä»¶ćŠ é€Ÿçš„æ”ŻæŒæƒ…ć†”ć­˜ćœšć·źćŒ‚ïŒŒćŒ€ćŻçĄŹä»¶ćŠ é€ŸèƒœćŠ é€ŸHTMLéĄ”éąçš„æžČ染䜆äčŸäŒšæ¶ˆè€—æ›Žć€šçš„çł»ç»Ÿè”„æșïŒŒä»Žè€ŒćŻŒè‡Žćœšéƒšćˆ†èźŸć€‡äžŠćŻèƒœć‡ș现é—Șć±ă€ć‘è™šă€ćˆ†ć—æžČæŸ“ç­‰é—źéą˜ïŒŒ ć› æ­€5+ Runtime䌚æ čæźèźŸć€‡ćźžé™…æ”ŻæŒæƒ…ć†”è‡ȘćŠšé€‰æ‹©æ˜ŻćŠćŒ€ćŻçĄŹä»¶ćŠ é€Ÿă€‚ + * ć…łé—­çĄŹä»¶ćŠ é€Ÿćˆ™ćŻèƒœäŒšćŻŒè‡ŽWebviewéĄ”éąæ— æł•æ”ŻæŒVideoæ ‡ç­Ÿæ’­æ”Ÿè§†éą‘ç­‰é—źéą˜ïŒŒćŠ‚æžœćœšç‰čćźšæƒ…ć†”äž‹éœ€èŠè°ƒæ•Žäżźæ”čé»˜èź€ćŒ€ćŻçĄŹä»¶ćŠ é€Ÿçš„èĄŒäžșïŒŒćˆ™ćŻé€šèż‡plus.webview.defaultHardwareAccelerated()æ–čæł•èŽ·ć–ćœ“ć‰èźŸć€‡é»˜èź€æ˜ŻćŠćŒ€ćŻçĄŹä»¶ćŠ é€ŸçŠ¶æ€ïŒŒä»Žè€Œć†łćźšæ˜ŻćŠéœ€èŠæ˜ŸćŒćŒ€ćŻæˆ–ć…łé—­æŒ‡ćźšWebviewçš„çĄŹä»¶ćŠ é€ŸćŠŸèƒœïŒˆé€šèż‡WebviewStyles的hardwareAcceleratedć±žæ€§èźŸçœźïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + defaultHardwareAccelerated(): boolean; +} + +/** + * 䞀组甚äșŽćźšäč‰éĄ”éąæˆ–æŽ§ä»¶æ˜Ÿç€șćŠšç”»æ•ˆæžœ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewAnimationTypeShow { + /** + * è‡ȘćŠšé€‰æ‹©ćŠšç”»æ•ˆæžœ + * è‡ȘćŠšé€‰æ‹©ćŠšç”»æ•ˆæžœïŒŒäœżç”šäžŠæŹĄæ˜Ÿç€șçȘ—ćŁèźŸçœźçš„ćŠšç”»æ•ˆæžœïŒŒćŠ‚æžœæ˜ŻçŹŹäž€æŹĄæ˜Ÿç€șćˆ™é»˜èź€ćŠšç”»æ•ˆæžœâ€œnone”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + auto?: string; + /** + * æ— ćŠšç”»æ•ˆæžœ + * ç«‹ćłæ˜Ÿç€șéĄ”éąïŒŒæ— ä»»äœ•ćŠšç”»æ•ˆæžœïŒŒéĄ”éąæ˜Ÿç€șé»˜èź€çš„ćŠšç”»æ•ˆæžœă€‚ + * æ­€æ•ˆæžœćżœç•„ćŠšç”»æ—¶é—Žć‚æ•°ïŒŒç«‹ćłæ˜Ÿç€ș。 + * ćŻčćș”慳闭抚画"none"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + none?: string; + /** + * ä»ŽćłäŸ§æšȘć‘æ»‘ćŠšæ•ˆæžœ + * éĄ”éąä»Žć±ćč•ćłäŸ§ć€–ć‘ć†…æšȘć‘æ»‘ćŠšæ˜Ÿç€ș。 + * ćŻčćș”慳闭抚画"slide-out-right"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + 'slide-in-right'?: string; + /** + * ä»Žć·ŠäŸ§æšȘć‘æ»‘ćŠšæ•ˆæžœ + * éĄ”éąä»Žć±ćč•ć·ŠäŸ§ć‘ćłæšȘć‘æ»‘ćŠšæ˜Ÿç€ș。 + * ćŻčćș”慳闭抚画"slide-out-left"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + 'slide-in-left'?: string; + /** + * ä»ŽäžŠäŸ§ç«–ć‘æ»‘ćŠšæ•ˆæžœ + * éĄ”éąä»Žć±ćč•äžŠäŸ§ć‘äž‹ç«–ć‘æ»‘ćŠšæ˜Ÿç€ș。 + * ćŻčćș”慳闭抚画"slide-out-top"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + 'slide-in-top'?: string; + /** + * ä»Žäž‹äŸ§ç«–ć‘æ»‘ćŠšæ•ˆæžœ + * éĄ”éąä»Žć±ćč•äž‹äŸ§ć‘äžŠç«–ć‘æ»‘ćŠšæ˜Ÿç€ș。 + * ćŻčćș”慳闭抚画"slide-out-bottom"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + 'slide-in-bottom'?: string; + /** + * ä»Žé€æ˜Žćˆ°äžé€æ˜Žé€æžæ˜Ÿç€ș效果 + * éĄ”éąä»ŽćźŒć…šé€æ˜Žćˆ°äžé€æ˜Žé€æžæ˜Ÿç€ș。 + * ćŻčćș”慳闭抚画"fade-out"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + 'fade-in'?: string; + /** + * ä»Žć°ćˆ°ć€§é€æžæ”Ÿć€§æ˜Ÿç€ș效果 + * éĄ”éąćœšć±ćč•äž­é—Žä»Žć°ćˆ°ć€§é€æžæ”Ÿć€§æ˜Ÿç€ș。 + * ćŻčćș”慳闭抚画"zoom-in"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + 'zoom-out'?: string; + /** + * ä»Žć°ćˆ°ć€§é€æžæ”Ÿć€§ćč¶äž”ä»Žé€æ˜Žćˆ°äžé€æ˜Žé€æžæ˜Ÿç€ș效果 + * éĄ”éąćœšć±ćč•äž­é—Žä»Žć°ćˆ°ć€§é€æžæ”Ÿć€§ćč¶äž”ä»Žé€æ˜Žćˆ°äžé€æ˜Žé€æžæ˜Ÿç€ș。 + * ćŻčćș”慳闭抚画"zoom-fade-in"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + 'zoom-fade-out'?: string; + /** + * ä»ŽćłäŸ§ćčłç§»ć…„æ ˆćŠšç”»æ•ˆæžœ + * éĄ”éąä»Žć±ćč•ćłäŸ§æ»‘ć…„星ç€șïŒŒćŒæ—¶äžŠäž€äžȘéĄ”éąćžŠé˜Žćœ±æ•ˆæžœä»Žć±ćč•ć·ŠäŸ§æ»‘ć‡șéšè—ă€‚ + * ćŻčćș”慳闭抚画"pop-out"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + 'pop-in'?: string; +} + +/** + * 䞀组甚äșŽćźšäč‰éĄ”éąæˆ–æŽ§ä»¶ć…łé—­çš„ćŠšç”»æ•ˆæžœ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewAnimationTypeClose { + /** + * è‡ȘćŠšé€‰æ‹©ćŠšç”»æ•ˆæžœ + * è‡ȘćŠšé€‰æ‹©æ˜Ÿç€șçȘ—ćŁç›žćŻčäșŽçš„ćŠšç”»æ•ˆæžœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + auto?: string; + /** + * æ— ćŠšç”» + * ç«‹ćłć…łé—­éĄ”éąïŒŒæ— ä»»äœ•ćŠšç”»æ•ˆæžœă€‚ + * æ­€æ•ˆæžœćżœç•„ćŠšç”»æ—¶é—Žć‚æ•°ïŒŒç«‹ćłć…łé—­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + none?: string; + /** + * æšȘć‘ć‘ćłäŸ§æ»‘ć‡șć±ćč•抚画 + * éĄ”éąä»Žć±ćč•äž­æšȘć‘ć‘ćłäŸ§æ»‘ćŠšćˆ°ć±ćč•怖慳闭。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + 'slide-out-right'?: string; + /** + * æšȘć‘ć‘ć·ŠäŸ§æ»‘ć‡șć±ćč•抚画 + * éĄ”éąä»Žć±ćč•äž­æšȘć‘ć‘ć·ŠäŸ§æ»‘ćŠšćˆ°ć±ćč•怖慳闭。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + 'slide-out-left'?: string; + /** + * ç«–ć‘ć‘äžŠäŸ§æ»‘ć‡șć±ćč•抚画 + * éĄ”éąä»Žć±ćč•äž­ç«–ć‘ć‘äžŠäŸ§æ»‘ćŠšćˆ°ć±ćč•怖慳闭。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + 'slide-out-top'?: string; + /** + * ç«–ć‘ć‘äž‹äŸ§æ»‘ć‡șć±ćč•抚画 + * éĄ”éąä»Žć±ćč•äž­ç«–ć‘ć‘äž‹äŸ§æ»‘ćŠšćˆ°ć±ćč•怖慳闭。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + 'slide-out-bottom'?: string; + /** + * ä»Žäžé€æ˜Žćˆ°é€æ˜Žé€æžéšè—ćŠšç”» + * éĄ”éąä»Žäžé€æ˜Žćˆ°é€æ˜Žé€æžéšè—ć…łé—­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + 'fade-out'?: string; + /** + * ä»Žć€§é€æžçŒ©ć°ć…łé—­ćŠšç”» + * éĄ”éąé€æžć‘éĄ”éąäž­ćżƒçŒ©ć°ć…łé—­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + 'zoom-in'?: string; + /** + * ä»Žć€§é€æžçŒ©ć°ćč¶äž”ä»Žäžé€æ˜Žćˆ°é€æ˜Žé€æžéšè—ć…łé—­ćŠšç”» + * éĄ”éąé€æžć‘éĄ”éąäž­ćżƒçŒ©ć°ćč¶äž”ä»Žäžé€æ˜Žćˆ°é€æ˜Žé€æžéšè—ć…łé—­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + 'zoom-fade-in'?: string; + /** + * ä»ŽćłäŸ§ćčłç§»ć‡șæ ˆćŠšç”»æ•ˆæžœ + * éĄ”éąä»Žć±ćč•ćłäŸ§æ»‘ć‡șæ¶ˆć€±ïŒŒćŒæ—¶äžŠäž€äžȘéĄ”éąćžŠé˜Žćœ±æ•ˆæžœä»Žć±ćč•ć·ŠäŸ§æ»‘ć…„星ç€ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + 'pop-out'?: string; +} + +/** + * WebviewçȘ—揣ćŻčè±ĄïŒŒç”šäșŽæ“äœœćŠ èœœHTMLéĄ”éąçš„çȘ—揣 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewObject { + /** + * WebviewçȘ—ćŁçš„æ ‡è݆ + * ćœšæ‰“ćŒ€æˆ–ćˆ›ć»șWebviewçȘ—ćŁæ—¶èźŸçœźïŒŒćŠ‚æžœæČĄæœ‰èźŸçœźçȘ—ćŁæ ‡èŻ†ïŒŒæ­€ć±žæ€§ć€Œäžșundefined。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + id?: string; + /** + * WebviewçȘ—ćŁć…łé—­äș‹ä»¶ + * ćœ“WebviewçȘ—ćŁć…łé—­æ—¶è§Šć‘æ­€äș‹ä»¶ïŒŒç±»ćž‹äžșEventCallback。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + onclose?: (result: any) => void; + /** + * WebviewçȘ—ćŁé”™èŻŻäș‹ä»¶ + * ćœ“WebviewçȘ—ćŁćŠ èœœé”™èŻŻæ—¶è§Šć‘æ­€äș‹ä»¶ïŒŒç±»ćž‹äžșEventCallback。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + onerror?: PlusWebviewWebviewEvent; + /** + * WebviewçȘ—ćŁéĄ”éąćŠ èœœćźŒæˆäș‹ä»¶ + * ćœ“WebviewçȘ—ćŁéĄ”éąćŠ èœœćźŒæˆæ—¶è§Šć‘æ­€äș‹ä»¶ïŒŒç±»ćž‹äžșEventCallback。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + onloaded?: PlusWebviewWebviewEvent; + /** + * WebviewçȘ—ćŁéĄ”éąćŒ€ć§‹ćŠ èœœäș‹ä»¶ + * ćœ“WebviewçȘ—ćŁćŒ€ć§‹ćŠ èœœæ–°éĄ”éąæ—¶è§Šć‘æ­€äș‹ä»¶ïŒŒç±»ćž‹äžșEventCallback。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + onloading?: PlusWebviewWebviewEvent; + /** + * æ·»ćŠ äș‹ä»¶ç›‘搏晚 + * 搑WebviewçȘ—ćŁæ·»ćŠ äș‹ä»¶ç›‘ćŹć™šïŒŒćœ“æŒ‡ćźšçš„äș‹ä»¶ć‘ç”Ÿæ—¶ïŒŒć°†è§Šć‘listenerć‡œæ•°çš„æ‰§èĄŒă€‚ + * ćŻć€šæŹĄè°ƒç”šæ­€æ–čæł•搑Webviewæ·»ćŠ ć€šäžȘç›‘ćŹć™šïŒŒćœ“ç›‘ćŹçš„äș‹ä»¶ć‘ç”Ÿæ—¶ïŒŒć°†æŒ‰ç…§æ·»ćŠ çš„ć…ˆćŽéĄșćșæ‰§èĄŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + addEventListener(event?: PlusWebviewWebviewEvent, listener?: (result: any) => void, capture?: boolean): void; + /** + * 朹WebviewçȘ—ćŁäž­æ·»ćŠ ć­çȘ—揣 + * 氆揩侀äžȘWebviewçȘ—ćŁäœœäžș歐çȘ—ćŁæ·»ćŠ ćˆ°ćœ“ć‰WebviewçȘ—ćŁäž­ïŒŒæ·»ćŠ ćŽć…¶æ‰€æœ‰æƒćœ’çˆ¶WebviewçȘ—ćŁïŒŒćœ“çˆ¶çȘ—ćŁć…łé—­æ—¶ć­çȘ—揣è‡Ș抹慳闭。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + append(webview?: PlusNativeObjView): void; + /** + * æ·»ćŠ WebviewçȘ—ćŁéą„ćŠ èœœjs文件 + * ćŻčäșŽäž€äș›çœ‘络HTMLéĄ”éąïŒŒćœšæ— æł•äżźæ”čHTMLéĄ”éąæ—¶ćŻé€šèż‡æ­€æ–čæł•è‡ȘćŠšćŠ èœœæœŹćœ°jsæ–‡ä»¶ă€‚ + * ćœ“WebviewçȘ—ćŁè·łèœŹćˆ°æ–°éĄ”éąæ—¶äčŸäŒšè‡ȘćŠšćŠ èœœæŒ‡ćźšçš„jsæ‰§èĄŒïŒŒæ·»ćŠ ć€šäžȘjsæ–‡ä»¶ć°†æŒ‰ç…§æ·»ćŠ çš„ć…ˆćŽéĄșćșæ‰§èĄŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + appendJsFile(file?: string): void; + /** + * WebviewçȘ—ćŁć†…ćźč抚画 + * ćŠšç”»ćŽćŻèƒœäŒšćŻŒè‡ŽWebviewçȘ—ćŁæ˜Ÿç€ș憅ćźčæ”čć˜ïŒŒćŻé€šèż‡è°ƒç”šrestoreæ–čæł•æąć€ă€‚ + * ćœ“WebviewçȘ—ćŁć†…ćźčćŠšç”»ćŒ•è”·ć†…ćźčäžćŻè§ïŒˆé€æ˜ŽïŒ‰ïŒŒć°†æ˜Ÿç€șæ­€çȘ—ćŁćŽéąçš„ć†…ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + animate(options?: PlusWebviewWebviewContentAnimationOptions, callback?: () => void): void; + /** + * ćŽé€€ćˆ°äžŠæŹĄćŠ èœœçš„éĄ”éą + * WebviewçȘ—ćŁćŽ†ćČèź°ćœ•æ“äœœïŒŒćŽé€€ćˆ°çȘ—ćŁäžŠæŹĄćŠ èœœçš„HTMLéĄ”éąă€‚ + * ćŠ‚æžœçȘ—ćŁćŽ†ćČèź°ćœ•äž­æČĄæœ‰ćŻćŽé€€çš„éĄ”éąćˆ™äžè§Šć‘ä»»äœ•æ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + back(): void; + /** + * ćŒ€ć§‹WebviewçȘ—ćŁçš„äž‹æ‹‰ćˆ·æ–° + * ćŒ€ć§‹è§Šć‘äž‹æ‹‰ćˆ·æ–°æ•ˆæžœïŒŒäžŽç”šæˆ·æ“äœœäž‹æ‹‰ćˆ·æ–°èĄŒäžșäž€è‡ŽïŒˆæœ‰ćŠšç”»æ•ˆæžœïŒ‰ă€‚ + * è§Šć‘setPullTorefreshæ–čæł•èźŸçœźçš„äž‹æ‹‰ćˆ·æ–°äș‹ä»¶ć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + beginPullToRefresh(): void; + /** + * æŸ„èŻąWebviewçȘ—ćŁæ˜ŻćŠćŻćŽé€€ + * WebviewçȘ—ćŁćŽ†ćČèź°ćœ•æŸ„èŻąæ“äœœïŒŒèŽ·ć–Webviewæ˜ŻćŠćŻćŽé€€ćˆ°ćŽ†ćČćŠ èœœçš„éĄ”éąïŒŒç»“æžœé€šèż‡queryCallbackć›žè°ƒæ–čæł•èż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + canBack(queryCallback?: (result: any) => void): void; + /** + * æŸ„èŻąWebviewçȘ—ćŁæ˜ŻćŠćŻć‰èż› + * WebviewçȘ—ćŁćŽ†ćČèź°ćœ•æŸ„èŻąæ“äœœïŒŒèŽ·ć–Webviewæ˜ŻćŠćŻć‰èż›ćˆ°ćŽ†ćČćŠ èœœçš„éĄ”éąïŒŒç»“æžœé€šèż‡queryCallbackć›žè°ƒæ–čæł•èż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + canForward(queryCallback?: (result: any) => void): void; + /** + * æŁ€æ”‹WebviewçȘ—ćŁæ˜ŻćŠæžČæŸ“ćźŒæˆ + * æŁ€æ”‹æ–čćŒäžșćˆ€æ–­çš„WebviewçȘ—ćŁć†…ćźčæ˜ŻćŠäžșç™œć±ïŒŒćŠ‚æžœéžç™œć±ćˆ™èź€äžșæžČæŸ“ćźŒæˆïŒŒćŠćˆ™èź€äžșæžČ染æœȘćźŒæˆă€‚ + * é€šèż‡successCallbackć›žè°ƒć‡œæ•°èż”ć›žç»“æžœïŒŒćŠ‚æžœæŁ€æ”‹èż‡çš‹äž­ć‘ç”Ÿé”™èŻŻćˆ™è§Šć‘errorCallbackć›žè°ƒć‡œæ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + checkRenderedContent(options?: PlusWebviewWebviewRenderedEventOptions, successCallback?: () => void, errorCallback?: (result: any) => void): void; + /** + * èŽ·ć–WebviewçȘ—ćŁçš„æ‰€æœ‰ć­WebviewçȘ—揣 + * èŽ·ć–æ·»ćŠ ćˆ°WebviewçȘ—ćŁäž­çš„æ‰€æœ‰ć­WebviewçȘ—ćŁïŒŒćŠ‚æžœæČĄæœ‰ć­WebviewçȘ—ćŁćˆ™èż”ć›žç©șæ•°ç»„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + children(): PlusWebview []; + /** + * æž…ç©ș掟生WebviewçȘ—ćŁćŠ èœœçš„ć†…ćźč + * æž…é™€ćŽŸç”ŸçȘ—ćŁçš„ć†…ćźč甚äșŽé‡çœźćŽŸç”ŸçȘ—ćŁćŠ èœœçš„ć†…ćźčïŒŒæž…é™€ć…¶ćŠ èœœçš„ćŽ†ćČèź°ćœ•ç­‰ć†…ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + clear(): void; + /** + * 慳闭WebviewçȘ—揣 + * 慳闭ćč¶é”€æŻWebviewçȘ—ćŁïŒŒćŻèźŸçœźć…łé—­ćŠšç”»ć’ŒćŠšç”»æŒç»­æ—¶é—Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + close(aniClose?: PlusWebviewAnimationTypeClose, duration?: number, extras?: PlusWebviewWebviewExtraOptions): void; + /** + * èźŸçœźWebviewçȘ—ćŁçš„æ»‘ć±æ“äœœæ‰‹ćŠż + * 氆WebviewçȘ—ćŁçš„ć·Šćłæ»‘ćŠšæ‰‹ćŠżć…łè”ćˆ°ć…¶ćźƒWebviewçȘ—ćŁïŒŒćŻćźžçŽ°æ»‘ćŠšćˆ‡æąæ˜Ÿç€șWebviewçš„ćŠšç”»æ•ˆæžœïŒˆćŠ‚TabéĄ”éąćˆ‡æąæ•ˆæžœïŒ‰ă€‚ + * æłšæ„ïŒšæ»‘ć±æ“äœœäŒšæ”č揘çȘ—ćŁäœçœźïŒˆćŠ‚leftć€Œç­‰ïŒ‰ïŒŒćŠ‚æžœäžćœšćŻè§†ćŒșćŸŸćˆ™éœ€èŠè°ƒç”šçȘ—ćŁçš„setStyleæ–čæł•èźŸçœźć…¶äœçœźćˆ°ćŻè§†ćŒșćŸŸć†…ïŒŒćŠ‚setStyle({left:'0px'});。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + drag(options?: PlusWebviewWebviewDragOptions, otherView?: PlusWebviewWebviewDragOtherViewOptions, callback?: (result: PlusWebviewWebviewDragEvent) => void): void; + /** + * æˆȘć±ç»˜ćˆ¶ + * 氆WebviewçȘ—ćŁçš„ćŻè§†ćŒș㟟æˆȘć±ćč¶ç»˜ćˆ¶ćˆ°Bitmapć›Ÿç‰‡ćŻčè±Ąäž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + draw(bitmap?: PlusNativeObjBitmap, successCallback?: () => void, errorCallback?: (result: any) => void, options?: PlusWebviewWebviewDrawOptions): void; + /** + * 结束WebviewçȘ—ćŁçš„äž‹æ‹‰ćˆ·æ–° + * ć…łé—­äž‹æ‹‰ćˆ·æ–°æ•ˆæžœïŒŒæąć€ćˆ°ćŒ€ć§‹äž‹æ‹‰ćˆ·æ–°äč‹ć‰çš„æ•ˆæžœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + endPullToRefresh(): void; + /** + * 朹WebviewçȘ—ćŁäž­æ‰§èĄŒJSè„šæœŹ + * 氆JSè„šæœŹć‘é€ćˆ°WebviewçȘ—ćŁäž­èżèĄŒïŒŒćŻç”šäșŽćźžçްWebviewçȘ—ćŁé—Žçš„æ•°æźé€šèźŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + evalJS(js?: string): void; + /** + * ć‰èż›ćˆ°äžŠæŹĄćŠ èœœçš„éĄ”éą + * WebviewçȘ—ćŁćŽ†ćČèź°ćœ•æ“äœœïŒŒć‰èż›ćˆ°çȘ—ćŁäžŠæŹĄćŠ èœœçš„HTMLéĄ”éąă€‚ + * ćŠ‚æžœçȘ—ćŁćŽ†ćČèź°ćœ•äž­æČĄæœ‰ćŻć‰èż›çš„éĄ”éąćˆ™äžè§Šć‘ä»»äœ•æ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + forward(): void; + /** + * èŽ·ć–WebviewçȘ—ćŁçš„æ”¶è—ć‚æ•° + * èŽ·ć–WebviewçȘ—ćŁçš„æ”¶è—ć‚æ•°ïŒŒćŠ‚æ”¶è—éĄ”éąçš„æ ‡éą˜ă€ć›Ÿæ ‡ă€ćœ°ć€ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + getFavoriteOptions(): PlusWebviewWebviewFavoriteOptions; + /** + * èŽ·ć–WebviewçȘ—ćŁçš„ćˆ†äș«ć‚æ•° + * èŽ·ć–WebviewçȘ—ćŁçš„ćˆ†äș«ć‚æ•°ïŒŒćŠ‚ćˆ†äș«çš„æ ‡éą˜ă€ć›Ÿæ ‡ă€é“ŸæŽ„朰杀等。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + getShareOptions(): PlusWebviewWebviewShareOptions; + /** + * èŽ·ć–WebviewçȘ—ćŁçš„æ ·ćŒ + * èŽ·ć–WebviewçȘ—ćŁçš„æ ·ćŒć±žæ€§ïŒŒćŠ‚çȘ—ćŁäœçœźă€ć€§ć°ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + getStyle(): PlusWebviewWebviewStyles; + /** + * èŽ·ć–WebviewçȘ—ćŁçš„ćŽŸç”Ÿć­View控件ćŻčè±Ą + * 戛ć»șWebviewçȘ—ćŁçš„æ‰€æœ‰ćŽŸç”Ÿć­ViewæŽ§ä»¶ă€‚ + * ćŻä»„ćœšćˆ›ć»șçȘ—ćŁæ—¶èźŸçœźć…¶subNViewsć±žæ€§è‡Ș抹戛ć»șćș”ç”šéŠ–éĄ”ćŻé€šèż‡manfest.json侭的plus->launchwebview->subNNViews节ç‚čé…çœźćˆ›ć»ș + * äčŸćŻä»„é€šèż‡WebviewçȘ—ćŁçš„appendæ–čæł•ć°†ć·Čç»ćˆ›ć»ș的掟生ViewæŽ§ä»¶æ·»ćŠ äžș慶歐。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + getSubNViews(): any []; + /** + * èŽ·ć–WebviewçȘ—ćŁćŠ èœœHTMLéĄ”éąçš„æ ‡éą˜ + * æ ‡éą˜äžșHTMLéĄ”éąhead节ç‚č例title节ç‚čäž­çš„æ–‡æœŹć†…ćźčïŒŒćœ“çȘ—ćŁć†…ćźčć‘ç”ŸéĄ”éąć†…è·łèœŹæ—¶ćŻé€šèż‡çȘ—ćŁè§Šć‘çš„â€œloaded”äș‹ä»¶äž­è°ƒç”šæ­€æ–čæł•æ„èŽ·ć–è·łèœŹćŽéĄ”éąçš„æ ‡éą˜ă€‚ + * ćŠ‚æžœHTMLéĄ”éąæČĄæœ‰äœżç”štitle节ç‚čæ„èźŸçœźæ ‡éą˜ïŒŒćˆ™èż”ć›žç©ș歗笩äžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + getTitle(): string; + /** + * èŽ·ć–WebviewçȘ—ćŁçš„æ ‡éą˜æ æŽ§ä»¶ćŻčè±Ą + * 戛ć»șWebviewçȘ—ćŁæ—¶èźŸçœźć…¶titleNViewć±žæ€§æ—¶ćˆ™è‡Ș抹戛ć»șæ ‡éą˜æ æŽ§ä»¶ïŒŒćș”ç”šéŠ–éĄ”ćŻé€šèż‡manfest.json侭的plus->launchwebview->titleNView节ç‚čé…çœźćˆ›ć»șæ ‡éą˜æ æŽ§ä»¶ă€‚ + * ćŻé€šèż‡æ­€æ–čæł•èŽ·ć–WebviewçȘ—ćŁćˆ›ć»șçš„æ ‡éą˜æ æŽ§ä»¶ïŒŒćŻčè±Ąç±»ćž‹äžșplus.nativeObj.ViewïŒŒćŻé€šèż‡è°ƒç”šć…¶drawBitmap/drawRect/drawTextæ–čæł•ç»˜ćˆ¶æ›Žæ–°ć†…ćźčæ„ćźžçŽ°è‡Ș漚ä艿 ·ćŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + getTitleNView(): PlusNativeObjView; + /** + * èŽ·ć–WebviewçȘ—ćŁćŠ èœœHTMLéĄ”éąçš„ćœ°ć€ + * ćœ“çȘ—ćŁć†…ćźčć‘ç”ŸéĄ”éąć†…è·łèœŹæ—¶ćŻé€šèż‡çȘ—ćŁè§Šć‘çš„â€œloaded”äș‹ä»¶äž­è°ƒç”šæ­€æ–čæł•æ„èŽ·ć–è·łèœŹćŽéĄ”éąçš„ćœ°ć€ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + getURL(): string; + /** + * 隐藏WebviewçȘ—揣 + * 隐藏WebviewçȘ—ćŁćŻäżć­˜ć·ČćŠ èœœHTMLéĄ”éąçš„äžŠäž‹æ–‡æ•°æźïŒŒèƒœé™äœŽćș”ç”šäœżç”šçš„çł»ç»Ÿè”„æșïŒŒé€šèż‡showæ–čæł•ćŻć°†éšè—çš„WebviewçȘ—ćŁæ˜Ÿç€șć‡șæ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + hide(aniHide?: PlusWebviewAnimationTypeClose, duration?: number, extras?: PlusWebviewWebviewExtraOptions): void; + /** + * éšè—æ ‡éą˜æ äžŠæŒ‰é’źçš„çșąç‚č + * ä»…ćœšçȘ—ćŁäœżç”šćŽŸç”Ÿæ ‡éą˜æ ïŒˆtitleNView时生效æœȘ星ç€șćŽŸç”Ÿæ ‡éą˜æ æ—¶æ“äœœæ­€æŽ„ćŁæ— ä»»äœ•æ•ˆæžœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + hideTitleNViewButtonRedDot(index?: number): void; + /** + * æ˜ŻćŠæ‹ŠæˆȘWebviewçȘ—ćŁçš„è§Šć±äș‹ä»¶ + * 拊æˆȘćŽè§Šć±äș‹ä»¶äžć†äŒ é€’ïŒŒćŠćˆ™äŒ é€’ç»™ViewæŽ§ä»¶äž‹çš„ć…¶ćźƒçȘ—ćŁć€„ç†ă€‚ + * WebviewçȘ—ćŁé»˜èꀿ‹ŠæˆȘæ‰€æœ‰è§Šć±äș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + interceptTouchEvent(intercept?: boolean): void; + /** + * æŸ„èŻąWebviewçȘ—ćŁæ˜ŻćŠćŒ€ćŻçĄŹä»¶ćŠ é€Ÿ + * è‹„WebviewçȘ—揣ć·Čç»ćŒ€ćŻçĄŹä»¶ćŠ é€Ÿćˆ™èż”ć›žtrueïŒŒćŠćˆ™èż”ć›žfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + isHardwareAccelerated(): boolean; + /** + * æŸ„èŻąWebviewçȘ—ćŁæ˜ŻćŠćŻè§ + * è‹„WebviewçȘ—揣ć·Č经星ç€șïŒˆè°ƒç”šèż‡showæ–čæł•ïŒŒćłäœżèą«ć…¶ćźƒçȘ—ćŁæŒĄäœäș†äčŸèź€äžșć·Č星ç€șïŒ‰ćˆ™èż”ć›žtrue苄WebviewçȘ—ćŁèą«éšè—ćˆ™èż”ć›žfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + isVisible(): boolean; + /** + * ç›‘ćŹéĄ”éąćŒ€ć§‹ćŠ èœœè”„æș + * WebviewćŠ èœœè”„æșæ—¶ïŒŒćŠ‚æžœæ»Ąè¶łoptionsć‚æ•°äž­ćźšäč‰çš„æĄä»¶ïŒŒćˆ™è§Šć‘callbackć›žè°ƒă€‚ + * æ­€æ–čæł•ä»…è§Šć‘ć›žè°ƒäș‹ä»¶ïŒŒäžäŒšé˜»æ­ąè”„æșçš„ćŠ èœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + listenResourceLoading(options?: PlusWebviewWebviewListenResourceOptions, callback?: (result: any) => void): void; + /** + * ćŠ èœœæ–°HTMLæ•°æź + * è§Šć‘WebviewçȘ—ćŁćŠ èœœHTMLéĄ”éąæ•°æźïŒŒćŠ‚æžœHTMLæ•°æźæ— æ•ˆć°†ćŻŒè‡ŽéĄ”éąćŠ èœœć€±èŽ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + loadData(data?: string, options?: PlusWebviewWebviewLoadDataOptions): void; + /** + * ćŠ èœœæ–°URLéĄ”éą + * è§Šć‘WebviewçȘ—ćŁä»Žæ–°çš„URLćœ°ć€ćŠ èœœéĄ”éąïŒŒćŠ‚æžœurlćœ°ć€æ— æ•ˆć°†ćŻŒè‡ŽéĄ”éąæ˜Ÿç€șć€±èŽ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + loadURL(url?: string, additionalHttpHeaders?: any): void; + /** + * èŽ·ć–WebviewçȘ—揣ćŻčè±Ąçš„ćŽŸç”ŸïŒˆNative.JSïŒ‰ćźžäŸ‹ćŻčè±Ą + * Androidćčłć°èż”曞WebviewçȘ—揣ćŻčè±Ąçš„android.webkit.WebviewćźžäŸ‹ćŻčè±ĄïŒŒ + * iOSćčłć°èż”曞WebviewçȘ—揣ćŻčè±Ąçš„UIWebviewćźžäŸ‹ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + nativeInstanceObject(): PlusAndroidInstanceObject | PlusIosInstanceObject; + /** + * èŽ·ć–ćœšćœ“ć‰WebviewçȘ—ćŁäž­ćˆ›ć»ș的所有çȘ—揣 + * èż”ć›žä»Žćœ“ć‰Webview䞭调甚plus.webview.open或plus.webview.create戛ć»ș的所有WebviewçȘ—ćŁæ•°ç»„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + opened(): PlusWebview []; + /** + * èŽ·ć–ćœ“ć‰WebviewçȘ—ćŁçš„ćˆ›ć»ș者 + * 戛ć»ș者äžș调甚plus.webview.open或plus.webview.createæ–čæł•ćˆ›ć»șćœ“ć‰çȘ—ćŁçš„WebviewçȘ—ćŁă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + opener(): PlusWebviewWebviewObject; + /** + * 拊æˆȘWebviewçȘ—ćŁçš„è”„æșćŠ èœœ + * æ čæźćŒșé…è§„ćˆ™æ‹ŠæˆȘWebviewçȘ—ćŁćŠ èœœè”„æșçš„URLćœ°ć€ïŒŒé‡ćźšć‘ćˆ°ć…¶ćźƒè”„æșćœ°ć€ïŒˆæš‚ä»…æ”ŻæŒæœŹćœ°ćœ°ć€ïŒ‰ă€‚ + * æłšæ„ïŒšć€šæŹĄè°ƒç”šoverrideResourceRequestæ—¶ä»…ä»„æœ€ćŽäž€æŹĄè°ƒç”šèźŸçœźçš„ć‚æ•°ć€Œç”Ÿæ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + overrideResourceRequest(options?: PlusWebview []): void; + /** + * 拊æˆȘWebviewçȘ—ćŁçš„URLèŻ·æ±‚ + * 拊æˆȘURLèŻ·æ±‚ćŽïŒŒWebviewçȘ—ćŁć°†äžäŒšè·łèœŹćˆ°æ–°çš„URLćœ°ć€ïŒŒæ­€æ—¶ć°†é€šèż‡callbackć›žè°ƒæ–čæł•èż”ć›žæ‹ŠæˆȘ的URLćœ°ć€ïŒˆćŻæ–°ćŒ€WebviewçȘ—ćŁćŠ èœœURLéĄ”éąç­‰ïŒ‰ă€‚ + * æ­€æ–čæł•ćȘ胜拊æˆȘçȘ—ćŁçš„çœ‘ç»œè¶…é“ŸæŽ„è·łèœŹïŒˆćŒ…æ‹Źè°ƒç”šloadURLæ–čæł•è§Šć‘çš„è·łèœŹïŒ‰ïŒŒäžćŻæ‹ŠæˆȘéĄ”éąèŻ·æ±‚è”„æșèŻ·æ±‚ïŒˆćŠ‚ćŠ èœœcss/js/png等蔄æșçš„èŻ·æ±‚ïŒ‰ă€‚ + * æłšæ„ïŒšć€šæŹĄè°ƒç”šoverrideUrlLoadingæ—¶ä»…ä»„æœ€ćŽäž€æŹĄè°ƒç”šèźŸçœźçš„ć‚æ•°ć€Œç”Ÿæ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + overrideUrlLoading(options?: PlusWebviewWebviewOverrideUrlOptions, callback?: (result: any) => void): void; + /** + * èŽ·ć–ćœ“ć‰WebviewçȘ—ćŁçš„çˆ¶çȘ—揣 + * WebviewçȘ—ćŁäœœäžș歐çȘ—ćŁæ·»ćŠ ïŒˆWebview.appendïŒ‰ćˆ°ć…¶ćźƒWebviewçȘ—ćŁäž­æ—¶æœ‰æ•ˆïŒŒèż™æ—¶ć…¶ćźƒWebviewçȘ—揣äžș父çȘ—ćŁă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + parent(): PlusWebviewWebviewObject; + /** + * é‡æ–°ćŠ èœœWebviewçȘ—ćŁæ˜Ÿç€ș的HTMLéĄ”éą + * è§Šć‘WebviewçȘ—ćŁé‡æ–°ćŠ èœœćœ“ć‰æ˜Ÿç€șçš„éĄ”éąć†…ćźč。 + * ćŠ‚æžœćœ“ć‰HTMLéĄ”éąæœȘćŠ èœœćźŒćˆ™ćœæ­ąćč¶é‡æ–°ćŠ èœœïŒŒćŠ‚æžœćœ“ć‰WebviewçȘ—揣æČĄæœ‰ćŠ èœœä»»äœ•éĄ”éąćˆ™æ— ć“ćș”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + reload(force?: boolean): void; + /** + * é‡çœźWebviewçȘ—ćŁçš„ć›žćŒčäœçœź + * ćŒ€ćŻçȘ—ćŁć›žćŒčæ•ˆæžœćŽïŒŒćœ“çȘ—ćŁäž­ć±•çŽ°çš„ć†…ćźčæ»šćŠšćˆ°ć€ŽïŒˆéĄ¶éƒšæˆ–ćș•éƒšïŒ‰æ—¶ïŒŒć†æ‹–æ‹œæ—¶çȘ—ćŁæ•Žäœ“ć†…ćźčć°†è·Ÿéšç§»ćŠšïŒŒæŸćŒ€ćŽè‡Ș抹曞ćŒčćˆ°ćœé äœçœźă€‚ + * èż™æ—¶éœ€èŠè°ƒç”šæ­€æ–čæł•æ„é‡çœźçȘ—ćŁçš„ć›žćŒčäœçœźïŒŒçȘ—ćŁć°†é‡‡ç”šćŠšç”»æ–čćŒć›žćŒčćˆ°ć…¶ćˆć§‹æ˜Ÿç€șçš„äœçœźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + resetBounce(): void; + /** + * æąć€Webview控件星ç€ș憅ćźč + * æąć€è°ƒç”šanimateæ–čæł•æ”č揘WebviewæŽ§ä»¶çš„ć†…ćźčïŒŒæ›Žæ–°è‡łćŠšç”»ć‰æ˜Ÿç€ș的憅ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + restore(): void; + /** + * 移陀歐WebviewçȘ—揣 + * ä»Žćœ“ć‰WebviewçȘ—ćŁç§»é™€æŒ‡ćźšçš„ć­WebviewçȘ—ćŁïŒŒè‹„æŒ‡ćźšçš„webviewćŻčè±Ąäžæ˜Żćœ“ć‰çȘ—ćŁçš„ć­çȘ—ćŁćˆ™æ— ä»»äœ•äœœç”šă€‚ + * 移陀搎歐WebviewçȘ—ćŁäžäŒšć…łé—­ïŒŒéœ€èŠè°ƒç”šć…¶closeæ–čæł•æ‰èƒœçœŸæ­Łć…łé—­ćč¶é”€æŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + remove(webview?: PlusNativeObjView): void; + /** + * 移陀WebviewçȘ—揣äș‹ä»¶ç›‘搏晚 + * 从WebviewçȘ—ćŁç§»é™€é€šèż‡addEventListeneræ–čæł•æ·»ćŠ çš„äș‹ä»¶ç›‘ćŹć™šïŒŒè‹„æČĄæœ‰æŸ„æ‰Ÿćˆ°ćŻčćș”çš„äș‹ä»¶ç›‘ćŹć™šïŒŒćˆ™æ— ä»»äœ•äœœç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + removeEventListener(event?: PlusWebviewWebviewEvent, listener?: (result: any) => void): void; + /** + * 从父çȘ—ćŁäž­ç§»é™€ + * ä»Žæ‰€ć±žçš„çˆ¶WebviewçȘ—ćŁç§»é™€ïŒŒćŠ‚æžœæČĄæœ‰çˆ¶çȘ—ćŁïŒŒćˆ™æ— ä»»äœ•äœœç”šă€‚ + * 从父çȘ—ćŁäž­ç§»é™€ćŽć­WebviewçȘ—ćŁäžäŒšć…łé—­ïŒŒéœ€èŠè°ƒç”šć…¶closeæ–čæł•æ‰èƒœçœŸæ­Łć…łé—­ćč¶é”€æŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + removeFromParent(): void; + /** + * ç§»é™€æ ‡éą˜æ äžŠæŒ‰é’źçš„è§’æ ‡ + * ä»…ćœšçȘ—ćŁäœżç”šćŽŸç”Ÿæ ‡éą˜æ ïŒˆtitleNView时生效æœȘ星ç€șćŽŸç”Ÿæ ‡éą˜æ æ—¶æ“äœœæ­€æŽ„ćŁæ— ä»»äœ•æ•ˆæžœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + removeTitleNViewButtonBadge(index?: number): void; + /** + * èźŸçœźWebviewçȘ—ćŁçš„ć›žćŒč效果 + * ćŒ€ćŻçȘ—ćŁć›žćŒčæ•ˆæžœćŽïŒŒćœ“çȘ—ćŁäž­ć±•çŽ°çš„ć†…ćźčæ»šćŠšćˆ°ć€ŽïŒˆéĄ¶éƒšæˆ–ćș•éƒšïŒ‰æ—¶ïŒŒć†æ‹–æ‹œæ—¶çȘ—ćŁæ•Žäœ“ć†…ćźčć°†è·Ÿéšç§»ćŠšïŒŒæŸćŒ€ćŽè‡Ș抹曞ćŒčćˆ°ćœé äœçœźïŒˆćŻé€šèż‡styleèźŸçœźïŒ‰ă€‚ + * 拖拜çȘ—ćŁć†…ćźčæ—¶éĄ”éąæ˜Ÿç€șWebviewçȘ—ćŁçš„èƒŒæ™Żè‰ČïŒŒé»˜èź€äžș透明歀时星ç€șWebview例靱的憅ćźčïŒŒćˆ©ç”šèż™äžȘç‰čç‚čćŻä»„ćźžçŽ°è‡Șćźšäž‹æ‹‰ćˆ·æ–°ç‰čæ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + setBounce(style?: PlusWebviewWebviewBounceStyle): void; + /** + * èźŸçœźWebviewçȘ—ćŁæ˜ŻćŠé˜»ćĄžćŠ èœœéĄ”éąäž­äœżç”šçš„çœ‘ç»œć›Ÿç‰‡ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + setBlockNetworkImage(block?: boolean): void; + /** + * èźŸçœźHTML憅ćźčæ˜ŻćŠćŻè§ + * èźŸçœźHTML憅ćźčäžćŻè§ćŽïŒŒć°†æ˜Ÿç€șWebviewçȘ—ćŁçš„èƒŒæ™Żè‰Č。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + setContentVisible(visible?: boolean): void; + /** + * èźŸçœźéą„ćŠ èœœçš„CSS文件 + * éą„ćŠ èœœCSSæ–‡ä»¶äžéœ€èŠćœšHTMLéĄ”éąäž­æ˜ŸćŒćŒ•ç”šïŒŒćœšWebviewçȘ—ćŁćŠ èœœHTMLéĄ”éąæ—¶è‡ȘćŠšćŠ èœœïŒŒćœšéĄ”éąè·łèœŹæ—¶äčŸäŒšè‡ȘćŠšćŠ èœœă€‚ + * èźŸçœźæ–°çš„CSSæ–‡ä»¶ćŽć°†æž…ç©șäč‹ć‰èźŸçœźçš„ć€ŒïŒˆćŒ…æ‹Źè°ƒç”šsetCssTextèźŸçœźçš„ć€ŒïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + setCssFile(file?: string): void; + /** + * èźŸçœźéą„ćŠ èœœçš„CSS憅ćźč + * éą„ćŠ èœœCSS憅ćźčäžéœ€èŠćœšHTMLéĄ”éąäž­æ˜ŸćŒćŒ•ç”šïŒŒćœšWebviewçȘ—ćŁćŠ èœœHTMLéĄ”éąæ—¶è‡ȘćŠšćŠ èœœïŒŒćœšéĄ”éąè·łèœŹæ—¶äčŸäŒšè‡ȘćŠšćŠ èœœă€‚ + * èźŸçœźæ–°çš„CSS憅ćźčćŽć°†æž…ç©șäč‹ć‰èźŸçœźçš„ć€ŒïŒˆćŒ…æ‹Źè°ƒç”šsetCssFileèźŸçœźçš„ć€ŒïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + setCssText(text?: string): void; + /** + * èźŸçœźWebviewçȘ—ćŁçš„æ”¶è—ć‚æ•° + * ä»…ćœšæ”ćș”ç”šçŽŻćąƒïŒˆæ”ćș”甚/5+æ”è§ˆć™šïŒ‰äž­æœ‰æ•ˆïŒšç”šæˆ·ç‚čć‡»æ”ćș”ç”šçŽŻćąƒçš„æ”¶è—æŒ‰é’źæ—¶äœżç”šçš„ć‚æ•°ïŒŒćŠ‚èźŸçœźæ”¶è—éĄ”éąæ ‡éą˜ïŒŒć›Ÿæ ‡ă€éĄ”éąćœ°ć€ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + setFavoriteOptions(options?: PlusWebviewWebviewFavoriteOptions): void; + /** + * èźŸçœźWebviewçȘ—揣ćș•éƒšäżźć€ćŒș㟟高ćșŠ + * ćŠ‚æžœWebviewćŠ èœœéĄ”éąäž­ć­˜ćœšćș•éƒšćœé ćŒșćŸŸïŒˆćŠ‚â€œè˜‘è‡èĄ—â€WAPéĄ”éąçš„ćș•郚Tabæ ïŒ‰ïŒŒćœšéĄ”éąæ»šćŠšæ—¶ćŠšæ€æ”č揘Webview高ćșŠćŻèƒœäŒšć‡ș现ćș•éƒšćœé ćŒșćŸŸæŠ–ćŠšçš„çŽ°è±ĄïŒˆćŠ‚360æ”è§ˆć™šäž­ć‘äžŠæ»‘éĄ¶éƒšæ ‡éą˜æ è‡ȘćŠšæ¶ˆć€±ćŒ•è”·Webviewć˜é«˜ïŒ‰ă€‚ + * æ­€æ—¶ćŻä»„è°ƒç”šæ­€æ–čæł•æ„æŒ‡ćźšćș•éƒšćœé ćŒșćŸŸïŒˆé€šćžžæ˜Żćș•郚Tabæ ïŒ‰èż›èĄŒäŒ˜ćŒ–äżźć€æŠ–ćŠšæ•ˆæžœïŒŒé«˜ćșŠć€Œäžșćș•éƒšćœé ćŒșćŸŸçš„é«˜ćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + setFixBottom(height?: number): void; + /** + * èźŸçœźéą„ćŠ èœœçš„JS文件 + * éą„ćŠ èœœJSæ–‡ä»¶äžéœ€èŠćœšHTMLéĄ”éąäž­æ˜ŸćŒćŒ•ç”šïŒŒćœšWebviewçȘ—ćŁćŠ èœœHTMLéĄ”éąæ—¶è‡ȘćŠšćŠ èœœïŒŒćœšéĄ”éąè·łèœŹæ—¶äčŸäŒšè‡ȘćŠšćŠ èœœă€‚ + * èźŸçœźæ–°çš„JSæ–‡ä»¶ćŽć°†æž…ç©șäč‹ć‰èźŸçœźçš„ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + setJsFile(file?: string): void; + /** + * èźŸçœźWebviewçȘ—ćŁçš„äž‹æ‹‰ćˆ·æ–°æ•ˆæžœ + * ćŒ€ćŻWebviewçȘ—ćŁçš„äž‹æ‹‰ćˆ·æ–°ćŠŸèƒœïŒŒæ˜Ÿç€șçȘ—ćŁć†…çœźçš„äž‹æ‹‰ćˆ·æ–°æŽ§ä»¶æ ·ćŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + setPullToRefresh(style?: PlusWebviewWebviewPullToRefreshStyles, refreshCB?: () => void): void; + /** + * èźŸçœźWebviewçȘ—揣renderedäș‹ä»¶ć‚æ•° + * ćŻèźŸçœźéĄ”éąæžČæŸ“ćźŒæˆçš„ćˆ€æ–­æ ‡ć‡†ïŒŒćŠ‚ćˆ€æ–­éĄ”éąéĄ¶éƒšćŒș柟、侭问ćŒșćŸŸă€æˆ–ćș•郚ćŒș柟。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + setRenderedEventOptions(options?: PlusWebviewWebviewRenderedEventOptions): void; + /** + * èźŸçœźWebviewçȘ—ćŁçš„æ ·ćŒ + * 曎新WebviewçȘ—ćŁçš„æ ·ćŒïŒŒćŠ‚çȘ—ćŁäœçœźă€ć€§ć°ă€èƒŒæ™Żè‰Č等。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + setStyle(styles?: PlusWebviewWebviewStyles): void; + /** + * èźŸçœźWebviewçȘ—ćŁçš„ćˆ†äș«ć‚æ•° + * ä»…ćœšæ”ćș”ç”šçŽŻćąƒïŒˆæ”ćș”甚/5+æ”è§ˆć™šïŒ‰äž­æœ‰æ•ˆïŒšç”šæˆ·ç‚čć‡»æ”ćș”ç”šçŽŻćąƒçš„ćˆ†äș«æŒ‰é’źæ—¶äœżç”šçš„ć‚æ•°ïŒŒćŠ‚èźŸçœźćˆ†äș«çš„æ ‡éą˜ă€é“ŸæŽ„朰杀等。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + setShareOptions(options?: PlusWebviewWebviewShareOptions): void; + /** + * èźŸçœźæ ‡éą˜æ äžŠæŒ‰é’źçš„è§’æ ‡ + * ä»…ćœšçȘ—ćŁäœżç”šćŽŸç”Ÿæ ‡éą˜æ ïŒˆtitleNView时生效æœȘ星ç€șćŽŸç”Ÿæ ‡éą˜æ æ—¶æ“äœœæ­€æŽ„ćŁæ— ä»»äœ•æ•ˆæžœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + setTitleNViewButtonBadge(index?: number, text?: string): void; + /** + * èźŸçœźWebviewçȘ—ćŁæ˜ŻćŠćŻè§ + * äżźæ”čçȘ—ćŁæ˜ŻćŠćŻè§ćč¶äžćœ±ć“çȘ—ćŁçš„æ˜Ÿç€ș栈éĄșćșïŒŒçȘ—ćŁæ˜Ÿç€ș䞎隐藏äčŸäžäŒšæœ‰ćŠšç”»æ•ˆæžœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + setVisible(visible?: boolean): void; + /** + * 星ç€șWebviewçȘ—揣 + * ćœ“è°ƒç”šplus.webview.createæ–čæł•ćˆ›ć»șWebviewçȘ—ćŁćŽïŒŒéœ€èŠè°ƒç”šć…¶showæ–čæł•才胜星ç€șćč¶ćŻèźŸçœźçȘ—ćŁæ˜Ÿç€șćŠšç”»ćŠćŠšç”»æ—¶é—Žă€‚ + * WebviewçȘ—ćŁèą«éšè—ćŽäčŸćŻè°ƒç”šæ­€æ–čæł•杄重新星ç€ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + show(aniShow?: PlusWebviewAnimationTypeShow, duration?: number, showedCB?: () => void, extras?: PlusWebviewWebviewExtraOptions): void; + /** + * ćœšæŒ‡ćźšWebviewçȘ—ćŁćŽæ˜Ÿç€ș + * ćœ“è°ƒç”šplus.webview.createæ–čæł•ćˆ›ć»șWebviewçȘ—ćŁćŽïŒŒćŻè°ƒç”šć…¶showBehindæ–čæł•星ç€șćœšæŒ‡ćźšWebviewçȘ—揣äč‹ćŽă€‚ + * èż™ç§æ˜Ÿç€șæ–čćŒäžäŒšć‡șçŽ°ćŠšç”»æ•ˆæžœïŒŒćœ“æŒ‡ćźšçš„WebviewçȘ—ćŁć…łé—­ćŽïŒŒćˆ™è‡Șèș«çȘ—揣è‡ȘćŠšæ˜Ÿç€șć‡șæ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + showBehind(webview?: PlusWebviewWebviewObject): void; + /** + * èźŸçœźæ ‡éą˜æ äžŠæŒ‰é’źçš„çșąç‚č + * ä»…ćœšçȘ—ćŁäœżç”šćŽŸç”Ÿæ ‡éą˜æ ïŒˆtitleNView时生效æœȘ星ç€șćŽŸç”Ÿæ ‡éą˜æ æ—¶æ“äœœæ­€æŽ„ćŁæ— ä»»äœ•æ•ˆæžœă€‚ + * æłšæ„ïŒšèźŸçœźæ˜Ÿç€șæŒ‰é’źçš„è§’æ ‡ćŽçșąç‚č䞍星ç€ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + showTitleNViewButtonRedDot(index?: number): void; + /** + * ćœæ­ąćŠ èœœHTMLéĄ”éąć†…ćźč + * è§Šć‘WebviewçȘ—ćŁćœæ­ąćŠ èœœéĄ”靱憅ćźčïŒŒćŠ‚æžœć·Čç»ćŠ èœœéƒšćˆ†ć†…ćźčćˆ™æ˜Ÿç€ș郹戆憅ćźčïŒŒćŠ‚æžœćŠ èœœćźŒæˆćˆ™æ˜Ÿç€ș慹郹憅ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + stop(): void; + /** + * 曎新WebviewçȘ—ćŁçš„ćŽŸç”Ÿć­View控件ćŻčè±Ą + * é€šèż‡WebviewSubNViewStyles侭的idć±žæ€§ć€ŒćŒč配歐ViewæŽ§ä»¶æ›Žæ–°ç»˜ćˆ¶ć†…ćźčïŒŒćŠ‚æžœæČĄæœ‰æŸ„æ‰Ÿćˆ°ćŻčćș”id的歐ViewæŽ§ä»¶ćˆ™ćżœç•„ă€‚ + * æ­€æ“äœœä»…æ›Žæ–°ć­ViewæŽ§ä»¶äžŠç»˜ćˆ¶çš„ć†…ćźčïŒŒäžäŒšæ·»ćŠ æˆ–ćˆ é™€ćŽŸç”Ÿć­View控件ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + updateSubNViews(styles?: PlusWebview []): void; +} + +/** + * WebviewçȘ—ćŁćŠšç”»ć‚æ•° + * 甹äșŽæŒ‡ćźšćŠšç”»ç›źæ ‡çȘ—ćŁïŒŒè”·ć§‹äœçœźă€ç›źæ ‡äœçœźç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewAnimationOptions { + /** + * æ‰§èĄŒćŠšç”»çš„çȘ—揣ćŻčè±Ą + * ćŻć–ć€ŒWebviewçȘ—揣ćŻčè±Ąă€WebviewçȘ—ćŁçš„idStringç±»ćž‹ïŒ‰ă€ćŽŸç”ŸViewçȘ—揣ćŻčè±ĄïŒˆplus.nativeObj.ViewïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + view?: PlusWebviewWebviewObject; + /** + * ćŠšç”»æ ·ćŒ + * 甹äșŽæŒ‡ćźšćŠšç”»çȘ—ćŁçš„è”·ć§‹äœçœźïŒŒç›źæ ‡äœçœźç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + styles?: PlusWebviewWebviewAnimationStyles; + /** + * çȘ—ćŁćŠšç”»ćꌿˆćŽçš„èĄŒäžș + * ćŻć–ć€ŒïŒš + * "none" - ćŠšç”»ćźŒæˆćŽäžćšä»»äœ•æ“äœœïŒ› + * "hide" - ćŠšç”»ćźŒæˆćŽéšè—çȘ—ćŁïŒ› + * "close" - ćŠšç”»ćźŒæˆćŽć…łé—­çȘ—ćŁă€‚ + * é»˜èź€ć€Œäžș"none"。 + * - none: ćŠšç”»ćźŒæˆćŽäžćšä»»äœ•æ“äœœ + * - hide: ćŠšç”»ćźŒæˆćŽéšè—çȘ—揣 + * - close: ćŠšç”»ćźŒæˆćŽć…łé—­çȘ—揣 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + action?: 'none' | 'hide' | 'close'; +} + +/** + * WebviewçȘ—ćŁćŠšç”»æ ·ćŒ + * 甹äșŽæŒ‡ćźšćŠšç”»çȘ—ćŁçš„è”·ć§‹äœçœźă€ç›źæ ‡äœçœźç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewAnimationStyles { + /** + * 画çȘ—ćŁçš„è”·ć§‹ć·ŠäŸ§äœçœź + * æ”ŻæŒç™Ÿćˆ†æŻ”ă€ćƒçŽ ć€ŒïŒŒé»˜èź€ć€Œäžșćœ“ć‰çȘ—ćŁçš„äœçœźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + fromLeft?: string; + /** + * 画çȘ—ćŁçš„ç›źæ ‡ć·ŠäŸ§äœçœź + * æŒç™Ÿćˆ†æŻ”ă€ćƒçŽ ć€Œă€‚ + * æłšæ„ïŒšćŠ‚æžœèźŸçœźçš„äœçœźäžŽè”·ć§‹äœçœźäž€ç›ŽïŒŒćˆ™æ— ćŠšç”»æ•ˆæžœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + toLeft?: string; +} + +/** + * WebviewçȘ—ćŁć›žćŒčæ ·ćŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewBounceStyle { + /** + * WebviewçȘ—ćŁæ”ŻæŒć›žćŒč效果的æ–č搑 + * ćŻé€šèż‡æ­€ć‚æ•°èźŸçœźćŒ€ćŻWebviewć“ȘäžȘæ–čć‘æ”ŻæŒć›žćŒčæ•ˆæžœă€‚ + * æ”ŻæŒä»„äž‹ć±žæ€§ïŒš + * topïŒšèĄšç€șçȘ—ćŁéĄ¶éƒšæ”ŻæŒć›žćŒč效果 + * leftïŒšèĄšç€șçȘ—ćŁć·ŠäŸ§æ”ŻæŒć›žćŒč效果 + * rightïŒšèĄšç€șçȘ—ćŁćłäŸ§æ”ŻæŒć›žćŒč效果 + * bottomïŒšèĄšç€șçȘ—揣ćș•éƒšæ”ŻæŒć›žćŒčæ•ˆæžœă€‚ + * **ç›źć‰ä»…æ”ŻæŒtopć±žæ€§** + * ć±žæ€§ć€ŒïŒšç”šäșŽæŒ‡ćźšćŻæ‹–æ‹œçš„èŒƒć›ŽïŒŒćŻć–ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"ïŒ›ćƒçŽ ć€ŒïŒŒćŠ‚"100px"è‡ȘćŠšèźĄçź—ć€ŒïŒŒćŠ‚"auto"ïŒ›æ— ć›žćŒčæ•ˆæžœć€ŒïŒŒćŠ‚"none" + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + position?: any; + /** + * WebviewçȘ—ćŁć›žćŒčæ—¶ćœé çš„äœçœź + * ćŒ€ćŻçȘ—ćŁć›žćŒčæ•ˆæžœćŽïŒŒćœ“çȘ—ćŁäž­ć±•çŽ°çš„ć†…ćźčæ»šćŠšćˆ°ć€ŽïŒˆéĄ¶éƒšæˆ–ćș•éƒšïŒ‰æ—¶ïŒŒć†æ‹–æ‹œæ—¶çȘ—ćŁæ•Žäœ“ć†…ćźčć°†è·Ÿéšç§»ćŠšïŒŒæ‹–æ‹œèż‡çš‹äž­ć°†è§Šć‘"dragBounce"äș‹ä»¶ïŒŒæŸćŒ€ćŽè‡Ș抹曞ćŒčćˆ°ćœé äœçœźă€‚ + * æ”ŻæŒä»„äž‹ć±žæ€§ïŒš + * topïŒšèĄšç€șçȘ—ćŁéĄ¶éƒšć›žćŒčæ—¶ćœé çš„äœçœźă€‚ + * ć±žæ€§ć€ŒïŒšç”šäșŽæŒ‡ćźšçȘ—ćŁć›žćŒčçš„äœçœźïŒŒćŻć–ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"5%"ïŒ›ćƒçŽ ć€ŒïŒŒćŠ‚"100px"è‡ȘćŠšèźĄçź—ć€ŒïŒŒćŠ‚"auto"ïŒŒé»˜èź€äžșćŻæ‹–æ‹œçš„èŒƒć›Žć€Œçš„äž€ćŠïŒ› + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + changeoffset?: any; + /** + * WebviewçȘ—ćŁäŸ§æ»‘æ—¶ćœé çš„äœçœź + * ćŒ€ćŻçȘ—ćŁć›žćŒčæ•ˆæžœćŽïŒŒćœ“çȘ—ćŁäž­ć±•çŽ°çš„ć†…ćźčæ»šćŠšćˆ°ć€ŽïŒˆć·ŠäŸ§æˆ–ćłäŸ§ïŒ‰æ—¶ïŒŒćœšæ‹–æ‹œæ—¶çȘ—ćŁæ•Žäœ“ć†…ćźčć°†è·Ÿéšç§»ćŠšïŒŒæŸćŒ€ćŽè‡ȘćŠšćœé çš„äŸ§æ»‘äœçœźïŒŒćč¶è§Šć‘"slideBounce"äș‹ä»¶ă€‚ + * æ”ŻæŒä»„äž‹ć±žæ€§ïŒš + * leftïŒšèĄšç€șçȘ—ćŁć·ŠäŸ§äŸ§æ»‘çš„äœçœźïŒ› + * rightïŒšèĄšç€șçȘ—ćŁćłäŸ§äŸ§æ»‘çš„äœçœźă€‚ + * ć±žæ€§ć€ŒïŒšç”šäșŽæŒ‡ćꚿ»‘ćŠšćŽćœé çš„è·çŠ»ïŒŒćŻć–ç™Ÿćˆ†æŻ”ïŒˆleft/right盾ćŻčäșŽçȘ—ćŁçš„ćźœćșŠïŒŒtop/bottom盾ćŻčäșŽçȘ—ćŁçš„é«˜ćșŠïŒ‰ïŒŒćŠ‚"30%"ïŒ›ćƒçŽ ć€ŒïŒŒćŠ‚"100px"è‡ȘćŠšèźĄçź—ć€ŒïŒŒäžșćŻæ‹–æ‹œèŒƒć›ŽïŒŒćŠ‚"auto"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + slideoffset?: any; + /** + * WebviewçȘ—ćŁæ‹–æ‹œćç§»çš„äœçœź + * ćŒ€ćŻçȘ—ćŁć›žćŒčæ•ˆæžœćŽïŒŒćŻä»„é€šèż‡æ­€ć±žæ€§ć€Œæ„äž»ćŠšèźŸçœźæ‹–æ‹œçš„ćç§»äœçœźïŒŒäžŽæ‰‹ćŠšæ“äœœæ‹–æ‹œè‡łæ­€ćç§»äœçœźæŸćŒ€ćŽçš„é€»èŸ‘äž€è‡Žă€‚ + * æ”ŻæŒä»„äž‹ć±žæ€§ïŒš + * topïŒšèĄšç€șçȘ—ćŁéĄ¶éƒšćç§»çš„äœçœźïŒ› + * leftïŒšèĄšç€șçȘ—ćŁć·ŠäŸ§ćç§»çš„äœçœźïŒ› + * rightïŒšèĄšç€șçȘ—ćŁćłäŸ§ćç§»çš„äœçœźïŒ› + * bottomïŒšèĄšç€șçȘ—揣ćș•éƒšćç§»çš„äœçœźă€‚ + * ć±žæ€§ć€ŒïŒšç”šäșŽæŒ‡ćźšćç§»çš„äœçœźïŒŒćŻć–ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"5%"ïŒ›ćƒçŽ ć€ŒïŒŒćŠ‚"100px"ïŒ›æœ‰æ•ˆć€ŒèŒƒć›Žäžș0戰positionć±žæ€§ćźšäč‰çš„äœçœźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + offset?: any; + /** + * WebviewçȘ—ćŁæ˜ŻćŠé˜»æ­ątouchäș‹ä»¶äŒ é€’ç»™DOM慃箠 + * èźŸçœźäžștrueèĄšç€șé˜»æ­ątouchäș‹ä»¶ïŒŒèźŸçœźäžșfalseèĄšç€șäžé˜»æ­ątouchäș‹ä»¶ă€‚ćœ“ćŒ€ćŻäŸ§æ»‘ćŠŸèƒœïŒˆć·ŠäŸ§æ»‘ć’ŒćłäŸ§æ»‘ïŒ‰æ—¶é»˜èź€ć€ŒäžștrueïŒŒćŠćˆ™äžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + preventTouchEvent?: boolean; +} + +/** + * WebviewçȘ—ćŁć†…ćźčćŠšç”»ć‚æ•° + * æŒ‡ćźšćŠšç”»çš„ç±»ćž‹ă€æŒç»­æ—¶é—Žç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewContentAnimationOptions { + /** + * 抚画类枋 + * ćŻć–ć€ŒïŒš"shrink" - ä»ŽäžŠćˆ°äž‹ćˆ†ć—æ”¶çŒ©æž…é™€çȘ—ćŁćŠšç”»ă€‚ + * - shrink: ä»ŽäžŠćˆ°äž‹ćˆ†ć—æž…é™€ćŠšç”» + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + type?: 'shrink'; + /** + * ćŠšç”»æŒç»­æ—¶é—Ž + * ć•äœäžșæŻ«ç§’ïŒŒé»˜èź€ć€Œäžș200ms。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + duration?: number; + /** + * ćŠšç”»ćž§æ•° + * 濅饻äžș性äșŽ0çš„æ•Žæ•°ïŒŒé»˜èź€ć€Œäžș12。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + frames?: number; + /** + * ćŠšç”»äœœç”šćŒș㟟 + * æ”ŻæŒä»„äž‹ć±žæ€§ïŒš + * top - ćŒșćŸŸè·çŠ»æŽ§ä»¶éĄ¶éƒšçš„ćç§»é‡ïŒŒć±žæ€§ć€ŒćŻć–ćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ïŒŒç™Ÿćˆ†æŻ”ïŒˆćŠ‚"10%"盞ćŻčäșŽæŽ§ä»¶çš„é«˜ćșŠïŒ‰,é»˜èź€ć€Œäžș'0px' + * bottom - ćŒșćŸŸè·çŠ»æŽ§ä»¶ćș•éƒšçš„ćç§»é‡ïŒŒć±žæ€§ć€ŒćŻć–ćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ïŒŒç™Ÿćˆ†æŻ”ïŒˆćŠ‚"10%"盞ćŻčäșŽæŽ§ä»¶çš„é«˜ćșŠïŒ‰,é»˜èź€ć€Œäžș'0px' + * left - ćŒșćŸŸè·çŠ»æŽ§ä»¶ć·ŠäŸ§çš„ćç§»é‡ïŒŒć±žæ€§ć€ŒćŻć–ćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ïŒŒç™Ÿćˆ†æŻ”ïŒˆćŠ‚"10%"盞ćŻčäșŽæŽ§ä»¶çš„ćźœćșŠïŒ‰,é»˜èź€ć€Œäžș'0px' + * right - ćŒșćŸŸè·çŠ»æŽ§ä»¶ćłäŸ§çš„ćç§»é‡ïŒŒć±žæ€§ć€ŒćŻć–ćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ïŒŒç™Ÿćˆ†æŻ”ïŒˆćŠ‚"10%"盞ćŻčäșŽæŽ§ä»¶çš„ćźœćșŠïŒ‰,é»˜èź€ć€Œäžș'0px'。 + * 橂“{top:'44px',bottom:'48px'}”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + region?: any; +} + +/** + * ćŽŸç”ŸæŽ§ä»¶ćœšçȘ—ćŁäž­ćœé çš„æ–čćŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewDock { + /** + * æŽ§ä»¶ćœé ćˆ™éĄ”éąéĄ¶éƒš + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + top?: string; + /** + * æŽ§ä»¶ćœé ćœšéĄ”éąćș•郚 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + bottom?: string; + /** + * æŽ§ä»¶ćœé ćœšéĄ”éąćłäŸ§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + right?: string; + /** + * æŽ§ä»¶ćœé ćœšéĄ”éąć·ŠäŸ§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + left?: string; +} + +/** + * WebviewçȘ—ćŁæ»‘ćŠšäș‹ä»¶æ•°æź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewDragEvent { + /** + * æ‰‹ćŠżç±»ćž‹ + * ćŻć–ć€ŒïŒš + * "rtl" - ä»Žćłć‘ć·Šæ»‘ćŠšæ‰‹ćŠżïŒ› + * "left" - ć‘ć·Šæ»‘ćŠšæ‰‹ćŠżïŒŒäžŽrtl䞀臎 + * "ltr" - ä»Žć·Šć‘ćłæ»‘ćŠšæ‰‹ćŠżïŒ› + * "right" - ć‘ćłæ»‘ćŠšæ‰‹ćŠżïŒŒäžŽlträž€è‡Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + direction?: string; + /** + * çȘ—ćŁæ»‘ćŠšç±»ćž‹ + * ćŻć–ć€ŒïŒš + * "start" - èĄšç€șćŒ€ć§‹æ»‘ćŠšæ“äœœïŒ› + * "move" - èĄšç€șæ­Łćœšæ»‘ćŠšïŒ› + * "end" - èĄšç€șæ»‘ćŠšæ“äœœç»“æŸă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + type?: string; + /** + * çȘ—ćŁæ»‘ćŠšç»“æžœ + * ćŻć–ć€ŒïŒš + * "true" - èĄšç€șæ»‘ćŠšæ“äœœæˆćŠŸïŒ› + * "false" - èĄšç€șæ»‘ćŠšæ“äœœć€±èŽ„ïŒˆæąć€ćˆ°æ»‘ćŠšć‰çš„çŠ¶æ€ïŒ‰ïŒ› + * "undefined" - æ— çŠ¶æ€ć€ŒïŒˆćœ“typeć€Œäžș"end"æ—¶èż”ć›žæ­€ć€ŒïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + result?: string; + /** + * ćœ“ć‰æ“äœœçȘ—ćŁæ ‡è݆ + * ćœ“typeć€Œäžș"start"/"move"æ—¶ïŒŒäżć­˜ćœ“ć‰æ“äœœçȘ—ćŁïŒˆæˆ–ViewæŽ§ä»¶ïŒ‰çš„æ ‡èŻ†ïŒ› + * ćœ“typeć€Œäžș"end"æ—¶äżć­˜æ»‘ćŠšæ“äœœćŽæ˜Ÿç€șçȘ—ćŁïŒˆæˆ–ViewæŽ§ä»¶ïŒ‰çš„æ ‡èŻ†ïŒˆćłresultć€Œäžș"true"ćˆ™èź€äžșć…łè”çȘ—ćŁæ˜Ÿç€șresultć€Œäžșfalsećˆ™èź€äžșäž»çȘ—ćŁæ˜Ÿç€șïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + id?: string; + /** + * ć…łè”çȘ—ćŁæ ‡è݆ + * æ»‘ćŠšæ“äœœć…łè”çȘ—ćŁïŒˆæˆ–ViewæŽ§ä»¶ïŒ‰çš„æ ‡èŻ†ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + otherId?: string; + /** + * äž»çȘ—ćŁæ ‡è݆ + * æ»‘ćŠšæ“äœœäž»çȘ—ćŁïŒˆæˆ–ViewæŽ§ä»¶ïŒ‰çš„æ ‡èŻ†ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + targetId?: string; + /** + * æ»‘ćŠšèż›ćșŠ + * æ»‘ćŠšèż›ćșŠäœçœźäżĄæŻïŒŒć–ć€ŒèŒƒć›Žäžș0-100ïŒŒćŠ‚20èĄšç€șæ»‘ćŠšäș†æ€»è·çŠ»çš„20% + * ćœ“typeć€Œäžș"start"时progressć€Œäžș0 + * ćœ“typeć€Œäžș"end"æ—¶ćŠ‚æžœresultäžștrue戙progressć€Œäžș0ïŒŒćŠ‚æžœresultäžșfalse戙progressć€Œäžș100 + * ćœ“typeć€Œäžș"move"æ—¶ïŒŒäżć­˜ćœ“ć‰æ»‘ćŠšçš„èż›ćșŠäżĄæŻïŒˆæłšïŒšć€šæŹĄè§Šć‘moveäș‹ä»¶ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + progress?: number; +} + +/** + * çȘ—ćŁæ‰‹ćŠżæ“äœœć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewDragOptions { + /** + * æ»‘ć±æ“äœœć›žè°ƒäș‹ä»¶è§Šć‘æ­„长 + * 甹äșŽèźŸçœźæ»‘ć±ć›žè°ƒäș‹ä»¶è§Šć‘éą‘çŽ‡ïŒŒć–ć€ŒèŒƒć›Žäžș1-100ïŒŒć€Œè¶Šć°è§Šć‘éą‘çŽ‡è¶Šé«˜ïŒŒć€Œè¶Šć€§è§Šć‘éą‘çŽ‡è¶Šć°ïŒŒé»˜èź€ć€Œäžș20。 + * ćŠ‚èźŸçœźć€Œäžș20ïŒŒćˆ™èĄšç€șæ»‘ć±æ“äœœç§»ćŠšè·çŠ»è¶…èż‡ćŻç§»ćŠšèŒƒć›Žçš„20%ćˆ™è§Šć‘äž€æŹĄć›žè°ƒäș‹ä»¶ïŒŒćŻé€šèż‡ć›žè°ƒć‡œæ•°ć‚数WebviewDragEvent的progressć±žæ€§èŽ·ć–ă€‚ + * æłšæ„ïŒšè§Šć‘éą‘çŽ‡èż‡ć€§äŒšćœ±ć“æ•ˆçŽ‡ïŒŒćŒ€ć‘è€…éœ€è°šæ…ŽèźŸçœźæ­€ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + callbackStep?: number; + /** + * èźŸçœźçš„æ‰‹ćŠżç±»ćž‹ + * ćŻć–ć€ŒïŒš + * ćŻć–ć€ŒïŒš + * "rtl" - ä»Žćłć‘ć·Šæ»‘ćŠšæ‰‹ćŠżïŒ› + * "left" - ć‘ć·Šæ»‘ćŠšæ‰‹ćŠżïŒŒäžŽrtl䞀臎 + * "ltr" - ä»Žć·Šć‘ćłæ»‘ćŠšæ‰‹ćŠżïŒ› + * "right" - ć‘ćłæ»‘ćŠšæ‰‹ćŠżïŒŒäžŽlträž€è‡Žă€‚ + * - rtl: ä»Žćłć‘ć·Šæ»‘ćŠšæ‰‹ćŠż + * - left: ć‘ć·Šæ»‘ćŠšæ‰‹ćŠżïŒŒäžŽrtl䞀臎 + * - ltr: ä»Žć·Šć‘ćłæ»‘ćŠšæ‰‹ćŠż + * - right: ć‘ćłæ»‘ćŠšæ‰‹ćŠżïŒŒäžŽltr䞀臎 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + direction?: 'rtl' | 'left' | 'ltr' | 'right'; + /** + * æ»‘ćŠšæ‰‹ćŠżæšĄćŒ + * ćŻć–ć€ŒïŒš + * "followFinger" - ćœ“ć‰WebviewçȘ—ćŁè·Ÿéšæ‰‹æŒ‡æ»‘ćŠšïŒ› + * "silent" - ćœ“ć‰WebviewçȘ—ćŁäžè·Ÿéšæ‰‹æŒ‡æ»‘ćŠšïŒ› + * "bounce" - ćœ“ć‰WebviewçȘ—揣è‡Ș抹曞ćŒčïŒˆæŸæ‰‹ćŽçȘ—ćŁæąć€ćˆ°æ‹–ćŠšć‰çš„äœçœźïŒ‰,é€šćžžćŻé€šèż‡èźŸçœźæ­€æšĄćŒæ„ćźžçŽ°TabéĄčæ— æł•ç»§ç»­æ»‘ćŠšćˆ‡æąè‡Ș抹曞ćŒčæ•ˆæžœă€‚ + * - followFinger: ćœ“ć‰WebviewçȘ—ćŁè·Ÿéšæ‰‹æŒ‡æ»‘ćŠš + * - silent: ćœ“ć‰WebviewçȘ—ćŁäžè·Ÿéšæ‰‹æŒ‡æ»‘ćŠš + * - bounce: ćœ“ć‰WebviewçȘ—揣è‡Ș抹曞ćŒč + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + moveMode?: 'followFinger' | 'silent' | 'bounce'; +} + +/** + * æ‰‹ćŠżæ“äœœć…łè”ćŻčè±Ąć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewDragOtherViewOptions { + /** + * æ‰‹ćŠżć…łè”ćŻčè±Ą + * ćŻć–ć€ŒWebviewçȘ—ćŁçš„idStringç±»ćž‹ïŒ‰ă€WebviewçȘ—揣ćŻčè±Ąă€ćŽŸç”ŸViewçȘ—揣ćŻčè±ĄïŒˆplus.nativeObj.ViewïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + view?: string; + /** + * æ»‘ćŠšæšĄćŒ + * ćŻć–ć€ŒïŒš + * "follow" - ćŒæ­„è·Ÿéšäž»WebviewçȘ—ćŁæ»‘ćŠšïŒ› + * "silent" - 䞍跟随䞻WebviewçȘ—ćŁæ»‘ćŠšă€‚ + * - follow: ćŒæ­„è·Ÿéšäž»WebviewçȘ—ćŁæ»‘ćŠš + * - silent: 䞍跟随䞻WebviewçȘ—ćŁæ»‘ćŠš + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + moveMode?: 'follow' | 'silent'; +} + +/** + * æˆȘć±ç»˜ćˆ¶æ“äœœć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewDrawOptions { + /** + * æˆȘć±ć›Ÿç‰‡çš„äœæ·± + * ćŻć–ć€ŒïŒš + * "RGB565" - RGB565ćœ©è‰ČæšĄćŒ,侀äžȘćƒçŽ ć äž€äžȘć­—èŠ‚ïŒ› + * "ARGB" - ARGBćœ©è‰ČæšĄćŒ,äżć­˜é€æ˜ŽćșŠäżĄæŻă€‚ + * - RGB565: + * RGB565ćœ©è‰ČæšĄćŒ,侀äžȘćƒçŽ ć äž€äžȘć­—èŠ‚ă€‚ + * + * - ARGB: + * ARGBćœ©è‰ČæšĄćŒ,äżć­˜é€æ˜ŽćșŠäżĄæŻă€‚ + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + bit?: 'RGB565' | 'ARGB'; + /** + * æ˜ŻćŠæŁ€æ”‹æˆȘć±ć›Ÿç‰‡æ˜ŻćŠäžșç©ș癜 + * ćŻć–ć€ŒïŒš + * true - èĄšç€șæŁ€æ”‹ćˆ°æˆȘć±ćˆ°ç©șç™œć›Ÿç‰‡æ—¶èź€äžșæ“äœœć€±èŽ„ïŒˆè§Šć‘é”™èŻŻć›žè°ƒć‡œæ•°ïŒ‰ïŒ› + * false - èĄšç€șäžæŁ€æ”‹ïŒŒćłäœżäžșç©șç™œć›Ÿç‰‡ä»ç„¶èż”ć›žæˆćŠŸă€‚ + * é»˜èź€ć€Œäžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + check?: boolean; + /** + * èźŸçœźæˆȘć±ćŒș㟟 + * 盾ćŻčäșŽWebviewçȘ—ćŁçš„ćŒșćŸŸäżĄæŻïŒŒé»˜èź€ć€Œäžș{top:'0px',left:'0px',width:'100%',height:'100%'}。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + clip?: PlusNativeObj; + /** + * æ˜ŻćŠæŁ€æ”‹ćœ“ć‰æ˜ŻćŠćŒčć‡șèœŻé”źç›˜ + * ćŻć–ć€ŒïŒš + * true - èĄšç€șæŁ€æ”‹ćˆ°ćŒčć‡șèœŻé”źç›˜æ˜Żèź€äžșæˆȘć±æ“äœœć€±èŽ„ïŒˆè§Šć‘é”™èŻŻć›žè°ƒć‡œæ•°ïŒ‰ïŒ› + * false - èĄšç€șäžæŁ€æ”‹èœŻé”źç›˜çŠ¶æ€ïŒŒç›ŽæŽ„æˆȘć±ă€‚ + * é»˜èź€ć€Œäžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + checkKeyboard?: boolean; +} + +/** + * çȘ—ćŁæ”¶è—ć‚æ•° + * ćœšæ”ćș”ç”šçŽŻćąƒäž­è°ƒç”šæ”¶è—ćŠŸèƒœæ—¶äœżç”šçš„ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewFavoriteOptions { + /** + * 收藏时星ç€șçš„ć›Ÿæ ‡ + * ćœšæ”¶è—ćˆ—èĄšäž­æ˜Ÿç€șçš„ć›Ÿæ ‡ïŒŒé»˜èź€äœżç”šćș”ç”šć›Ÿæ ‡ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + icon?: string; + /** + * 收藏时星ç€șçš„æ ‡éą˜ + * ćœšæ”¶è—ćˆ—èĄšäž­æ˜Ÿç€șçš„æ ‡éą˜ć­—çŹŠäžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + title?: string; + /** + * æ”¶è—çš„éĄ”éąćœ°ć€ + * ćż…éĄ»æ˜Żçœ‘ç»œćœ°ć€ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + href?: string; +} + +/** + * 戛ć»șćŠ èœœHTMLæ•°æźć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewLoadDataOptions { + /** + * éĄ”éąçš„Base URL + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + baseURL?: string; + /** + * HTMLæ•°æźçš„æ•°æźç±»ćž‹ + * é»˜èź€ć€Œäžș"text/html"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + mimeType?: string; + /** + * HTMLæ•°æźçš„çŒ–ç ç±»ćž‹ + * é»˜èź€ć€Œäžș"utf-8"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + encoding?: string; +} + +/** + * çȘ—ćŁçš„ćˆ†äș«ć‚æ•° + * ćœšæ”ćș”ç”šçŽŻćąƒäž­è°ƒç”šćˆ†äș«ćŠŸèƒœæ—¶äœżç”šçš„ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewShareOptions { + /** + * 戆äș«æ—¶äœżç”šçš„ć›Ÿæ ‡ + * é»˜èź€äœżç”šćș”ç”šć›Ÿæ ‡ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + icon?: string; + /** + * 戆äș«æ—¶äœżç”šçš„æ ‡éą˜ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + title?: string; + /** + * 戆äș«æ—¶äœżç”šçš„铟掄朰杀 + * ćż…éĄ»æ˜Żçœ‘ç»œćœ°ć€ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + href?: string; +} + +/** + * çȘ—ćŁćŽŸç”Ÿć­ViewæŽ§ä»¶æ ·ćŒ + * ćŻèźŸçœźćŽŸç”ŸæŽ§ä»¶çš„æ ‡èŻ†ă€ć€§ć°ă€äœçœźä»„ćŠç»˜ćˆ¶çš„ć†…ćźč等。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewSubNViewStyles { + /** + * 掟生歐ViewæŽ§ä»¶çš„æ ‡èŻ† + * ćŻé€šèż‡plus.nativeObj.View.getViewById(id)æ–čæł•äŒ ć…„æ­€æ ‡èŻ†æ„èŽ·ć–ć­View控件ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + id?: string; + /** + * 掟生歐ViewæŽ§ä»¶ç±»ćž‹ + * ćŻć–ć€ŒïŒš + * "NView" - 掟生歐View控件plus.nativeObj.NView + * "ImageSlider" - ćŽŸç”Ÿć›Ÿç‰‡èœźæ’­æŽ§ä»¶ïŒˆplus.nativeObj.ImageSliderïŒ‰ă€‚ + * é»˜èź€ć€Œäžș"NView"。 + * - NView: + * 掟生歐View控件plus.nativeObj.NView + * + * - ImageSlider: + * ćŽŸç”Ÿć›Ÿç‰‡èœźæ’­æŽ§ä»¶ïŒˆplus.nativeObj.ImageSlider + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + type?: 'NView' | 'ImageSlider'; + /** + * 掟生歐ViewæŽ§ä»¶çš„æ ·ćŒ + * ćŻèźŸçœźćŽŸç”ŸæŽ§ä»¶çš„äœçœźă€ć€§ć°ç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + styles?: PlusNativeObjViewStyles; + /** + * 掟生歐ViewæŽ§ä»¶ćˆć§‹ç»˜ćˆ¶ć†…ćźč + * ćŻèźŸçœźç»˜ćˆ¶ć›Ÿç‰‡ă€çŸ©ćœąćŒșćŸŸă€æ–‡æœŹç­‰ć†…ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + tags?: any []; +} + +/** + * çȘ—ćŁæ ‡éą˜æ æŽ§ä»¶æ ·ćŒ + * æ ‡éą˜æ æŽ§ä»¶ć›șćźšé«˜ćșŠäžș44px,ćŻé€šèż‡WebviewçȘ—揣ćŻčè±Ąçš„getTitleNViewæ–čæł•èŽ·ć–æ ‡éą˜æ ćŽŸç”ŸæŽ§ä»¶ćŻčè±ĄćŠšæ€ç»˜ćˆ¶ć†…ćźč。 + * ćŻä»„é€šèż‡WebviewObjectćŻčè±Ąçš„getTitleNView()èŽ·ć–æ ‡éą˜æ çš„NViewćŻčè±ĄïŒŒç„¶ćŽè°ƒç”šć…¶setStyleæ–čæł•æ›Žæ–°æ ·ćŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewTitleNViewStyles { + /** + * æ ‡éą˜æ æŽ§ä»¶æ˜ŻćŠæ˜Ÿç€șć·ŠäŸ§èż”ć›žæŒ‰é’ź + * ćŻć–ć€ŒïŒš + * "true" - 星ç€șèż”ć›žæŒ‰é’źïŒ› + * "false" - 䞍星ç€șèż”ć›žæŒ‰é’źă€‚ + * é»˜èź€ć€Œäžș"false"。 + * èż”ć›žæŒ‰é’źçš„éąœè‰ČäžșçȘ—ćŁæ ‡éą˜æ–‡ć­—éąœè‰ČïŒŒæŒ‰äž‹æ—¶éąœè‰Čè‡ȘćŠšè°ƒæ•Žé€æ˜ŽćșŠäžș0.3。 + * ç‚čć‡»èż”ć›žæŒ‰é’źçš„é€»èŸ‘äžŽæŒ‰äž‹çł»ç»Ÿèż”ć›žé”źé€»èŸ‘äž€è‡Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + autoBackButton?: boolean; + /** + * æ ‡éą˜æ æŽ§ä»¶çš„èƒŒæ™Żéąœè‰Č + * 鱜è‰Čć€Œæ ŒćŒäžș"#RRGGBB"ïŒŒćŠ‚"#FF0000"èĄšç€șäžșçșąè‰ČèƒŒæ™ŻïŒŒé»˜èź€ć€Œäžș"#F7F7F7"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + backgroundColor?: string; + /** + * æ ‡éą˜æ äžŠçš„è‡Ș漚ä艿Œ‰é’ź + * 戛ć»ș的è‡Ș漚ä艿Œ‰é’źæ•°ç›źäžé™ćˆ¶ïŒŒćźžé™…ćș”甚䞭ć»șèźźæœ€ć€šèźŸçœź4äžȘæŒ‰é’źïŒˆćŒ…æ‹Źć·ŠäŸ§èż”ć›žæŒ‰é’źïŒ‰ă€‚ + * æłšæ„ïŒšæ­€ć±žæ€§äžæ”ŻæŒćŠšæ€äżźæ”čïŒŒä»…ćœšćˆ›ć»știtleNViewæ—¶èźŸçœźæœ‰æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + buttons?: PlusWebview []; + /** + * æ ‡éą˜æ æŽ§ä»¶ć˜ćŒ–äœœç”šèŒƒć›Ž + * ä»…ćœštypeć€Œäžștransparentæ—¶æœ‰æ•ˆïŒŒéĄ”éąæ»šćŠšæ—¶æ ‡éą˜æ èƒŒæ™Żé€æ˜ŽćșŠć°†ć‘ç”Ÿć˜ćŒ–ă€‚ + * ćœ“éĄ”éąæ»šćŠšćˆ°æŒ‡ćźšćç§»é‡æ—¶æ ‡éą˜æ èƒŒæ™Żć˜äžșćźŒć…šäžé€æ˜Žă€‚ + * æ”ŻæŒç™Ÿćˆ†æŻ”ă€ćƒçŽ ć€ŒïŒŒé»˜èź€äžș'132px'。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + coverage?: string; + /** + * æ ‡éą˜æ æŽ§ä»¶æ˜ŻćŠæ˜Ÿç€șHomeæŒ‰é’ź + * ćŻć–ć€ŒïŒš + * "true" - 星ç€șHomeæŒ‰é’źïŒ› + * "false" - 䞍星ç€șHomeæŒ‰é’źă€‚ + * é»˜èź€ć€Œäžș"false"。 + * HomeæŒ‰é’źçš„éąœè‰ČäžșçȘ—ćŁæ ‡éą˜æ–‡ć­—éąœè‰ČïŒŒæŒ‰äž‹æ—¶éąœè‰Čè‡ȘćŠšè°ƒæ•Žé€æ˜ŽćșŠäžș0.3。 + * ç‚č懻HomeæŒ‰é’źçš„é€»èŸ‘äžșć…łé—­æ‰€æœ‰éžéŠ–éĄ”çȘ—ćŁïŒŒæ˜Ÿç€ș銖饔çȘ—ćŁă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + homeButton?: boolean; + /** + * 憅èŸč距 + * æ ‡éą˜æ ć·Šćłçš„ć†…èŸčè·ïŒŒć•äœäžșpxïŒˆé€»èŸ‘ćƒçŽ ć€ŒïŒ‰ïŒŒćŠ‚"10px"èĄšç€ș10é€»èŸ‘ćƒçŽ ć€Œă€‚ + * é»˜èź€ć€Œäžș"0px"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + padding?: string; + /** + * 揳憅èŸč距 + * æ ‡éą˜æ ćłäŸ§ć†…èŸčè·ïŒŒć•äœäžșpxïŒˆé€»èŸ‘ćƒçŽ ć€ŒïŒ‰ïŒŒćŠ‚"10px"èĄšç€ș10é€»èŸ‘ćƒçŽ ć€Œă€‚ + * é»˜èź€ć€Œäžș"0px"ïŒŒäŒ˜ć…ˆçș§padding-right > padding。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + 'padding-right'?: string; + /** + * 淊憅èŸč距 + * æ ‡éą˜æ ć·ŠäŸ§ć†…èŸčè·ïŒŒć•äœäžșpxïŒˆé€»èŸ‘ćƒçŽ ć€ŒïŒ‰ïŒŒćŠ‚"10px"èĄšç€ș10é€»èŸ‘ćƒçŽ ć€Œă€‚ + * é»˜èź€ć€Œäžș"0px"ïŒŒäŒ˜ć…ˆçș§padding-left > padding。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + 'padding-left'?: string; + /** + * æ ‡éą˜æ æŽ§ä»¶çš„èż›ćșŠæĄæ ·ćŒ + * èźŸçœźæ­€ć±žæ€§ćˆ™ćœšæ ‡éą˜æ æŽ§ä»¶çš„ćș•郚星ç€șèż›ćșŠæĄïŒŒćŻé…çœźèż›ćșŠæĄéąœè‰Čć€Œćłé«˜ćșŠă€‚ + * èźŸçœźæ­€ć±žæ€§ć€Œäžșundefined或nullćˆ™éšè—èż›ćșŠæĄă€‚ + * é»˜èź€äžæ˜Ÿç€șćș•éƒšèż›ćșŠæĄă€‚ + * æłšæ„ïŒšæ­€ć±žæ€§ć°†ćșŸćŒƒïŒŒæŽšèäœżç”šWebviewStyles的progress。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + progress?: PlusWebviewWebviewProgressStyles; + /** + * æ ‡éą˜æ æŽ§ä»¶çš„ćș•éƒšćˆ†ć‰Čçșż + * èźŸçœźæ­€ć±žæ€§ćˆ™ćœšæ ‡éą˜æ æŽ§ä»¶çš„ćș•郚星ç€ș戆ć‰ČçșżïŒŒćŻé…çœźéąœè‰Čć€ŒćŠé«˜ćșŠă€‚ + * èźŸçœźæ­€ć±žæ€§ć€Œäžșundefined或nullćˆ™éšè—ćˆ†ć‰Čçșżă€‚ + * é»˜èź€äžæ˜Ÿç€șćș•éƒšćˆ†ć‰Čçșżă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + splitLine?: PlusWebviewWebviewSplitLineStyles; + /** + * æ ‡éą˜æ äžŠćˆć§‹è‡Ș漚äč‰ç»˜ćˆ¶ć†…ćźč + * 揯甹äșŽèźŸçœźè‡Ș漚äč‰ç»˜ćˆ¶ć›Ÿç‰‡ă€çŸ©ćœąćŒșćŸŸă€æ–‡æœŹç­‰ć†…ćźč。 + * æłšæ„ïŒšæ­€ć±žæ€§äžæ”ŻæŒćŠšæ€äżźæ”čïŒŒä»…ćœšćˆ›ć»știtleNViewæ—¶èźŸçœźæœ‰æ•ˆïŒŒćŠ‚æžœéœ€èŠæ›Žæ–°ç»˜ćˆ¶ć†…ćźč揯æ čæźtags的id调甚drawæ–čæł•æ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + tags?: any []; + /** + * æ ‡éą˜æ æŽ§ä»¶çš„æ ‡éą˜æ–‡ć­—éąœè‰Č + * 鱜è‰Čć€Œæ ŒćŒäžș"#RRGGBB"ïŒŒćŠ‚"#FF0000"èĄšç€șæ ‡éą˜æ–‡ć­—éąœè‰Čäžșçșąè‰ČïŒŒé»˜èź€ć€Œäžș"#000000"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + titleColor?: string; + /** + * æ ‡éą˜æ æŽ§ä»¶çš„æ ‡éą˜æ–‡ć­—è¶…ć‡ș星ç€șćŒșćŸŸæ—¶ć€„ç†æ–čćŒ + * ćŻć–ć€ŒïŒš + * "clip" - 超ć‡ș星ç€șćŒșćŸŸæ—¶ć†…ćźčèŁć‰Ș + * "ellipsis" - 超ć‡ș星ç€șćŒșćŸŸæ—¶ć°Ÿéƒšæ˜Ÿç€șçœç•„æ ‡èź°ïŒˆ...ïŒ‰ă€‚ + * é»˜èź€ć€Œäžș"ellipsis"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + titleOverflow?: string; + /** + * æ ‡éą˜æ æŽ§ä»¶çš„æ ‡éą˜æ–‡ć­—ć†…ćźč + * ćœšæ ‡éą˜æ æŽ§ä»¶ć±…äž­ïŒˆæ°Žćčłć’Œćž‚盎星ç€șïŒŒć·ŠćłèŸč距äžș88pxïŒŒćŠ‚æžœæ–‡æœŹèż‡é•żćˆ™ć°ŸéƒšèŁć‰ȘïŒˆćŠ äž‰äžȘç‚č"..."星ç€ș。 + * ćœ“äžèźŸçœźtitleTextć±žæ€§æˆ–ć±žæ€§ć€Œäžșundefined/nullæ—¶ïŒŒäœżç”šćœ“ć‰WebviewçȘ—ćŁćŠ èœœéĄ”éąçš„æ ‡éą˜ïŒŒćč¶è‡ȘćŠšćŒæ­„æ›Žæ–°éĄ”éąçš„æ ‡éą˜ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + titleText?: string; + /** + * æ ‡éą˜æ æŽ§ä»¶çš„æ ‡éą˜æ–‡ć­—ć­—äœ“ć€§ć° + * ć­—äœ“ć€§ć°ć•äœäžșćƒçŽ ïŒŒćŠ‚"20px"èĄšç€șć­—äœ“ć€§ć°äžș20ćƒçŽ ïŒŒé»˜èź€ć€Œäžș17惏箠。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + titleSize?: string; + /** + * æ ‡éą˜æ æŽ§ä»¶æ ·ćŒ + * ćŻć–ć€ŒïŒš + * "default" - é»˜èź€æ ·ćŒïŒŒéĄ¶éƒšćœé æ˜Ÿç€șïŒŒæŒ€ćŽ‹WebviewéĄ”éąć†…ćźč星ç€șćŒșćŸŸïŒ› + * "transparent" - é€æ˜Žæ ·ćŒïŒŒéĄ¶éƒšæČ‰æ”žćŒæ˜Ÿç€ș芆盖WebviewéĄ”éąć†…ćźčïŒŒæ ‡éą˜æ äžŠć†…ćźčïŒˆé™€æŒ‰é’źć€–ïŒ‰ć…šéƒšé€æ˜ŽïŒŒćœ“éĄ”éąæ»šćŠšæ—¶é€æ˜ŽćșŠé€æžć˜ćŒ–ïŒŒç›Žćˆ°äžé€æ˜Žæ˜Ÿç€ș。 + * é»˜èź€ć€Œäžș"default"。 + * æłšæ„ïŒšæ­€ć±žæ€§äžæ”ŻæŒćŠšæ€æ›Žæ–°ă€‚ + * - default: + * é»˜èź€æ ·ćŒïŒŒéĄ¶éƒšćœé æ˜Ÿç€șïŒŒæŒ€ćŽ‹WebviewéĄ”éąć†…ćźč星ç€șćŒș㟟 + * + * - transparent: + * é€æ˜Žæ ·ćŒïŒŒéĄ¶éƒšæČ‰æ”žćŒæ˜Ÿç€ș芆盖WebviewéĄ”éąć†…ćźčïŒŒæ ‡éą˜æ äžŠć†…ćźčïŒˆé™€æŒ‰é’źć€–ïŒ‰ć…šéƒšé€æ˜ŽïŒŒćœ“éĄ”éąæ»šćŠšæ—¶é€æ˜ŽćșŠé€æžć˜ćŒ–ïŒŒç›Žćˆ°äžé€æ˜Žæ˜Ÿç€ș + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + type?: 'default' | 'transparent'; +} + +/** + * çȘ—ćŁæ ‡éą˜æ è‡Ș漚ä艿Œ‰é’źæ ·ćŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewTitleNViewButtonStyles { + /** + * æŒ‰é’źæ ·ćŒ + * èżèĄŒçŽŻćąƒäž­ć†…çœźæŒ‰é’źæ ·ćŒç›ŽæŽ„äœżç”šïŒŒć†…çœźæ ·ćŒćżœç•„fontSrc撌textć±žæ€§ă€‚ + * ćŻć–ć€ŒïŒš + * "forward" - ć‰èż›æŒ‰é’źïŒ› + * "back" - ćŽé€€æŒ‰é’źïŒ› + * "share" - 戆äș«æŒ‰é’źïŒ› + * "favorite" - æ”¶è—æŒ‰é’źïŒ› + * "home" - äž»éĄ”æŒ‰é’źïŒ› + * "menu" - èœć•æŒ‰é’źïŒ› + * "close" - ć…łé—­æŒ‰é’źïŒ› + * "none" - æ— æ ·ćŒă€‚ + * é»˜èź€ć€Œäžșæ— æ ·ćŒïŒˆ"none"ïŒ‰ïŒŒéœ€é€šèż‡textć±žæ€§èźŸçœźæŒ‰é’źäžŠæ˜Ÿç€ș的憅ćźčă€é€šèż‡fontSrcć±žæ€§èźŸçœźäœżç”šçš„ć­—äœ“ćș“。 + * - forward: ć‰èż›æŒ‰é’ź + * - back: ćŽé€€æŒ‰é’ź + * - share: 戆äș«æŒ‰é’ź + * - favorite: æ”¶è—æŒ‰é’ź + * - home: äž»éĄ”æŒ‰é’ź + * - menu: èœć•æŒ‰é’ź + * - close: ć…łé—­æŒ‰é’ź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + type?: 'forward' | 'back' | 'share' | 'favorite' | 'home' | 'menu' | 'close'; + /** + * æŒ‰é’źçš„èƒŒæ™Żéąœè‰Č + * ä»…ćœšæ ‡éą˜æ type=transparentæ—¶ç”Ÿæ•ˆïŒŒćœ“æ ‡éą˜æ é€æ˜Žæ—¶æŒ‰é’źæ˜Ÿç€șçš„èƒŒæ™Żéąœè‰Č。 + * ćŻć–ć€Œ#RRGGBB撌rgbaæ ŒćŒéąœè‰Č歗笩äžČïŒŒé»˜èź€ć€Œäžș灰è‰ČćŠé€æ˜Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + background?: string; + /** + * æŒ‰é’źäžŠæ˜Ÿç€șçš„è§’æ ‡æ–‡æœŹ + * æœ€ć€šæ˜Ÿç€ș3äžȘć­—çŹŠïŒŒè¶…èż‡ćˆ™æ˜Ÿç€șäžș...。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + badgeText?: string; + /** + * æŒ‰é’źäžŠæ–‡ć­—éąœè‰Č + * ćŻć–ć€ŒïŒš "#RRGGBB"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"#FF0000"èĄšç€ș绘戶çșąè‰Čèż”ć›žé”źïŒ› + * "rgba(R,G,B,A)"ïŒŒć…¶äž­R/G/Bćˆ†ćˆ«ä»ŁèĄšçșąè‰Čć€Œ/绿è‰Čć€Œ/蓝è‰Čć€ŒïŒŒæ­Łæ•Žæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-255Aäžș透明ćșŠïŒŒæ”źç‚čæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-10äžșć…šé€æ˜ŽïŒŒ1äžșäžé€æ˜ŽïŒ‰ïŒŒćŠ‚"rgba(255,0,0,0.5)"ïŒŒèĄšç€șçșąè‰ČćŠé€æ˜Žă€‚ + * é»˜èź€ć€ŒäžșçȘ—ćŁæ ‡éą˜æ æŽ§ä»¶çš„æ ‡éą˜æ–‡ć­—éąœè‰Č。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + color?: string; + /** + * æŒ‰äž‹çŠ¶æ€æŒ‰é’źæ–‡ć­—éąœè‰Č + * ćŻć–ć€ŒïŒš "#RRGGBB"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"#FF0000"èĄšç€ș绘戶çșąè‰Čèż”ć›žé”źïŒ› + * "rgba(R,G,B,A)"ïŒŒć…¶äž­R/G/Bćˆ†ćˆ«ä»ŁèĄšçșąè‰Čć€Œ/绿è‰Čć€Œ/蓝è‰Čć€ŒïŒŒæ­Łæ•Žæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-255Aäžș透明ćșŠïŒŒæ”źç‚čæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-10äžșć…šé€æ˜ŽïŒŒ1äžșäžé€æ˜ŽïŒ‰ïŒŒćŠ‚"rgba(255,0,0,0.5)"ïŒŒèĄšç€șçșąè‰ČćŠé€æ˜Žă€‚ + * é»˜èź€ć€Œäžșcolorć±žæ€§ć€Œè‡ȘćŠšè°ƒæ•Žé€æ˜ŽćșŠäžș0.3。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + colorPressed?: string; + /** + * æŒ‰é’źćœšæ ‡éą˜æ äžŠçš„æ˜Ÿç€șäœçœź + * ćŻć–ć€ŒïŒš + * "right" - ćœšæ ‡éą˜æ äž­é ćłæŽ’ćˆ—æ˜Ÿç€ș + * "left" - ćœšæ ‡éą˜æ äž­é ć·ŠäŸ§æŽ’ćˆ—æ˜Ÿç€șïŒˆćœšèż”ć›žé”źćŽïŒ‰ă€‚ + * é»˜èź€ć€Œäžș"right"。 + * - right: + * ćœšæ ‡éą˜æ äž­é ćłæŽ’ćˆ—æ˜Ÿç€ș + * + * - left: + * ćœšæ ‡éą˜æ äž­é ć·ŠäŸ§æŽ’ćˆ—æ˜Ÿç€șïŒˆćœšèż”ć›žé”źćŽïŒ‰ + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + float?: 'right' | 'left'; + /** + * æŒ‰é’źäžŠæ–‡ć­—çš„çȗ细 + * ćŻć–ć€ŒïŒš + * "normal" - æ ‡ć‡†ć­—äœ“ïŒ› + * "bold" - ㊠çČ—ć­—äœ“ă€‚ + * é»˜èź€ć€Œäžș"normal"。 + * - normal: + * æ ‡ć‡†ć­—äœ“ + * + * - bold: + * ㊠çČ—ć­—äœ“ + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + fontWeight?: 'normal' | 'bold'; + /** + * æŒ‰é’źäžŠæ–‡ć­—ć€§ć° + * ćŻć–ć€ŒïŒšć­—äœ“é«˜ćșŠćƒçŽ ć€ŒïŒŒæ•°ć­—ćŠ "px"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"22px"。 + * çȘ—ćŁæ ‡éą˜æ äžșé€æ˜Žæ ·ćŒïŒˆtype="transparent"ïŒ‰æ—¶ïŒŒé»˜èź€ć€Œäžș"22px" + * çȘ—ćŁæ ‡éą˜æ äžșé»˜èź€æ ·ćŒïŒˆtype="default"ïŒ‰æ—¶ïŒŒé»˜èź€ć€Œäžș"27px"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + fontSize?: string; + /** + * æŒ‰é’źäžŠæ–‡ć­—äœżç”šçš„ć­—äœ“æ–‡ä»¶è·ŻćŸ„ + * ć­—äœ“æ–‡ä»¶è·ŻćŸ„æ”ŻæŒä»„äž‹ç±»ćž‹ïŒš + * 盾ćŻčè·ŻćŸ„ - 盾ćŻčäșŽćœ“ć‰éĄ”靱的hostäœçœźïŒŒćŠ‚"a.ttf"ïŒŒæłšæ„ćœ“ć‰éĄ”éąäžșçœ‘ç»œćœ°ć€ćˆ™äžæ”ŻæŒïŒ› + * 绝ćŻčè·ŻćŸ„ - çł»ç»Ÿç»ćŻčè·ŻćŸ„ïŒŒćŠ‚Androidćčłć°"/sdcard/a.ttf"ïŒŒæ­€ç±»è·ŻćŸ„é€šćžžé€šèż‡ć…¶ćźƒ5+ APIèŽ·ć–çš„ïŒ› + * æ‰©ć±•ç›žćŻčè·ŻćŸ„URL(RelativeURL) - 仄"_"ćŒ€ć€Žçš„ç›žćŻčè·ŻćŸ„ïŒŒćŠ‚"_www/a.ttf" + * æœŹćœ°è·ŻćŸ„URL - 仄“file://â€ćŒ€ć€ŽïŒŒćŽéąè·Ÿéšçł»ç»Ÿç»ćŻčè·ŻćŸ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + fontSrc?: string; + /** + * æŒ‰é’źç‚čć‡»ćŽè§Šć‘çš„ć›žè°ƒć‡œæ•° + * ć›žè°ƒć‡œæ•°äž­ć°†èż”ć›žæ­€JSONćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + onclick?: (result: any) => void; + /** + * æŒ‰é’źäžŠæ˜ŻćŠæ˜Ÿç€șçșąç‚č + * èźŸçœźäžștruećˆ™æ˜Ÿç€șçșąç‚čfalsećˆ™äžæ˜Ÿç€șçșąç‚čă€‚é»˜èź€ć€Œäžșfalse。 + * æłšæ„ïŒšćœ“èźŸçœźäș†è§’æ ‡æ–‡æœŹæ—¶çșąç‚č䞍星ç€ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + redDot?: boolean; + /** + * æ˜ŻćŠæ˜Ÿç€ș选择指ç€șć›Ÿæ ‡ + * èźŸçœźäžștruećˆ™æ˜Ÿç€ș选择指ç€șć›Ÿæ ‡ïŒˆć‘äž‹çź­ć€ŽïŒ‰ïŒŒéąœè‰ČäžŽæ–‡ć­—éąœè‰Č䞀臎 + * falsećˆ™äžæ˜Ÿç€șă€‚é»˜èź€ć€Œäžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + select?: boolean; + /** + * æŒ‰é’źäžŠæ˜Ÿç€șçš„æ–‡ć­— + * æŽšèäœżç”šäž€äžȘć­—çŹŠïŒŒè¶…èż‡äž€äžȘć­—çŹŠćŻèƒœæ— æł•æ­Łćžžæ˜Ÿç€șïŒŒäœżç”šć­—äœ“ć›Ÿæ ‡æ—¶unicodeć­—çŹŠèĄšç€ș濅饻'\u'ćŒ€ć€ŽïŒŒćŠ‚"\ue123"ïŒˆæłšæ„äžèƒœć†™æˆ"\e123"ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + text?: string; + /** + * æŒ‰é’źçš„ćźœćșŠ + * ćŻć–ć€ŒïŒš + * "*px" - é€»èŸ‘ćƒçŽ ć€ŒïŒŒćŠ‚"10px"èĄšç€ș10é€»èŸ‘ćƒçŽ ć€ŒïŒŒæŒ‰é’źçš„ć†…ćźčć±…äž­æ˜Ÿç€ș + * "auto" - è‡ȘćźšèźĄçź—ćźœćșŠïŒŒæ čæźć†…ćźčè‡ȘćŠšè°ƒæ•ŽæŒ‰é’źćźœćșŠă€‚ + * é»˜èź€ć€Œäžș"44px"ïŒˆé€‚ćˆć­—äœ“ć›Ÿæ ‡ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + width?: string; +} + +/** + * æ ‡éą˜æ æŽ§ä»¶çš„èż›ćșŠæĄæ ·ćŒ + * 星ç€șćœšæ ‡éą˜æ æŽ§ä»¶ćș•éƒšă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewProgressStyles { + /** + * èż›ćșŠæĄéąœè‰Č + * ćŻć–ć€ŒïŒš "#RRGGBB"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"#FF0000"èĄšç€ș绘戶çșąè‰Č戆ć‰ČçșżïŒ› + * "rgba(R,G,B,A)"ïŒŒć…¶äž­R/G/Bćˆ†ćˆ«ä»ŁèĄšçșąè‰Čć€Œ/绿è‰Čć€Œ/蓝è‰Čć€ŒïŒŒæ­Łæ•Žæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-255Aäžș透明ćșŠïŒŒæ”źç‚čæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-10äžșć…šé€æ˜ŽïŒŒ1äžșäžé€æ˜ŽïŒ‰ïŒŒćŠ‚"rgba(255,0,0,0.5)"ïŒŒèĄšç€șçșąè‰ČćŠé€æ˜Žă€‚ + * é»˜èź€ć€Œäžș"#00FF00"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + color?: string; + /** + * èż›ćșŠæĄé«˜ćșŠ + * ćŻć–ć€ŒïŒšćƒçŽ ć€ŒïŒˆé€»èŸ‘ćƒçŽ ïŒ‰ïŒŒæ”ŻæŒć°æ•°ç‚čïŒŒćŠ‚"1px"èĄšç€ș1ćƒçŽ é«˜ïŒ›ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"1%"盞ćŻčäșŽæ ‡éą˜æ æŽ§ä»¶çš„高ćșŠă€‚ + * é»˜èź€ć€Œäžș"2px"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + height?: string; +} + +/** + * çȘ—ćŁæ ‡éą˜æ æŽ§ä»¶çš„ćˆ†ć‰Čçșżæ ·ćŒ + * 星ç€șćœšæ ‡éą˜æ æŽ§ä»¶ćș•éƒšă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewSplitLineStyles { + /** + * ćș•éƒšćˆ†ć‰Čçșżéąœè‰Č + * ćŻć–ć€ŒïŒš "#RRGGBB"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"#FF0000"èĄšç€ș绘戶çșąè‰Č戆ć‰ČçșżïŒ› + * "rgba(R,G,B,A)"ïŒŒć…¶äž­R/G/Bćˆ†ćˆ«ä»ŁèĄšçșąè‰Čć€Œ/绿è‰Čć€Œ/蓝è‰Čć€ŒïŒŒæ­Łæ•Žæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-255Aäžș透明ćșŠïŒŒæ”źç‚čæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-10äžșć…šé€æ˜ŽïŒŒ1äžșäžé€æ˜ŽïŒ‰ïŒŒćŠ‚"rgba(255,0,0,0.5)"ïŒŒèĄšç€șçșąè‰ČćŠé€æ˜Žă€‚ + * é»˜èź€ć€Œäžș"#CCCCCC"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + color?: string; + /** + * ćș•éƒšćˆ†ć‰Čçșżé«˜ćșŠ + * ćŻć–ć€ŒïŒšćƒçŽ ć€ŒïŒˆé€»èŸ‘ćƒçŽ ïŒ‰ïŒŒæ”ŻæŒć°æ•°ç‚čïŒŒćŠ‚"1px"èĄšç€ș1ćƒçŽ é«˜ïŒ›ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"1%"盞ćŻčäșŽæ ‡éą˜æ æŽ§ä»¶çš„高ćșŠă€‚ + * é»˜èź€ć€Œäžș"1px"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + height?: string; +} + +/** + * WebviewçȘ—揣äș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewEvent { + /** + * WebviewçȘ—ćŁć…łé—­äș‹ä»¶ + * é€šèż‡WebviewObjectćŻčè±Ąçš„addEventListeneræ–čæł•æ·»ćŠ äș‹ä»¶ç›‘ćŹć‡œæ•°ïŒŒćœ“WebviewçȘ—ćŁć…łé—­æ—¶è§Šć‘æ­€äș‹ä»¶ïŒŒć›žè°ƒć‡œæ•°ç±»ćž‹äžșEventCallback。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + close?: string; + /** + * WebviewçȘ—ćŁć›žćŒčäș‹ä»¶ + * é€šèż‡WebviewObjectćŻčè±Ąçš„setBounceæ–čæł•ćŒ€ćŻć›žćŒčæ•ˆæžœèźŸçœźéĄ¶éƒšäž‹æ‹‰ć›žćŒčchangeoffsetć±žæ€§ćŽïŒŒćœ“ç”šæˆ·ć‘äž‹æ‹–æ‹œçȘ—ćŁæ—¶è§Šć‘ć‘æ­€äș‹ä»¶ïŒŒć›žè°ƒć‡œæ•°ç±»ćž‹äžșBounceEventCallback。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + dragBounce?: string; + /** + * WebviewçȘ—ćŁć›žćŒčäș‹ä»¶ + * é€šèż‡WebviewObjectćŻčè±Ąçš„setBounceæ–čæł•ćŒ€ćŻć›žćŒčæ•ˆæžœèźŸçœźć·ŠćłäŸ§äŸ§æ»‘slideoffsetć±žæ€§ćŽïŒŒćœ“ç”šæˆ·ć‘ć·ŠćłäŸ§æ‹–æ‹œçȘ—ćŁäŸ§æ»‘æ—¶è§Šć‘ć‘æ­€äș‹ä»¶ïŒŒć›žè°ƒć‡œæ•°ç±»ćž‹äžșBounceEventCallback。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + slideBounce?: string; + /** + * WebviewçȘ—ćŁćŠ èœœé”™èŻŻäș‹ä»¶ + * é€šèż‡WebviewObjectćŻčè±Ąçš„addEventListeneræ–čæł•æ·»ćŠ äș‹ä»¶ç›‘ćŹć‡œæ•°ïŒŒćœ“WebviewçȘ—ćŁćŠ èœœé”™èŻŻæ—¶è§Šć‘æ­€äș‹ä»¶ïŒŒć›žè°ƒć‡œæ•°ç±»ćž‹äžșEventCallback。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + error?: string; + /** + * WebviewçȘ—ćŁéšè—äș‹ä»¶ + * é€šèż‡WebviewObjectćŻčè±Ąçš„addEventListeneræ–čæł•æ·»ćŠ äș‹ä»¶ç›‘ćŹć‡œæ•°ïŒŒćœ“WebviewçȘ—ćŁéšè—ïŒˆçȘ—ćŁćŠšç”»ćꌿˆćŽïŒ‰æ—¶è§Šć‘æ­€äș‹ä»¶ïŒŒć›žè°ƒć‡œæ•°ç±»ćž‹äžșEventCallback。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + hide?: string; + /** + * WebviewçȘ—ćŁéĄ”éąćŒ€ć§‹ćŠ èœœäș‹ä»¶ + * é€šèż‡WebviewObjectćŻčè±Ąçš„addEventListeneræ–čæł•æ·»ćŠ äș‹ä»¶ç›‘ćŹć‡œæ•°ïŒŒćœ“WebviewçȘ—ćŁćŒ€ć§‹ćŠ èœœæ–°éĄ”éąæ—¶è§Šć‘æ­€äș‹ä»¶ïŒŒć›žè°ƒć‡œæ•°ç±»ćž‹äžșEventCallback。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + loading?: string; + /** + * WebviewçȘ—ćŁéĄ”éąćŠ èœœćźŒæˆäș‹ä»¶ + * é€šèż‡WebviewObjectćŻčè±Ąçš„addEventListeneræ–čæł•æ·»ćŠ äș‹ä»¶ç›‘ćŹć‡œæ•°ïŒŒćœ“WebviewçȘ—ćŁéĄ”éąćŠ èœœćźŒæˆæ—¶è§Šć‘æ­€äș‹ä»¶ïŒŒć›žè°ƒć‡œæ•°ç±»ćž‹äžșEventCallback。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + loaded?: string; + /** + * WebviewçȘ—ćŁæ˜Ÿç€șéźçœ©ć±‚æ—¶ç‚č懻äș‹ä»¶ + * é€šèż‡WebviewObjectćŻčè±Ąçš„addEventListeneræ–čæł•æ·»ćŠ äș‹ä»¶ç›‘ćŹć‡œæ•°ïŒŒćœ“WebviewçȘ—ćŁé€šèż‡maskć±žæ€§èźŸçœźæ˜Ÿç€șéźçœ©ć±‚ćč¶äž”ç‚čć‡»æ—¶è§Šć‘æ­€äș‹ä»¶ïŒŒć›žè°ƒć‡œæ•°ç±»ćž‹äžșEventCallback。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + maskClick?: string; + /** + * WebviewçȘ—ćŁćŒ€ć§‹æžČ染äș‹ä»¶ + * é€šèż‡WebviewObjectćŻčè±Ąçš„addEventListeneræ–čæł•æ·»ćŠ äș‹ä»¶ç›‘ćŹć‡œæ•°ïŒŒćœ“WebviewçȘ—ćŁćŒ€ć§‹æžČæŸ“ć†…ćźčæ—¶è§Šć‘æ­€äș‹ä»¶ïŒŒć›žè°ƒć‡œæ•°ç±»ćž‹äžșEventCallback。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + rendering?: string; + /** + * WebviewçȘ—揣æžČæŸ“ćźŒæˆäș‹ä»¶ + * é€šèż‡WebviewObjectćŻčè±Ąçš„addEventListeneræ–čæł•æ·»ćŠ äș‹ä»¶ç›‘ćŹć‡œæ•°ïŒŒćœ“WebviewçȘ—揣æžČæŸ“ćźŒæˆæ—¶è§Šć‘æ­€äș‹ä»¶ïŒŒć›žè°ƒć‡œæ•°ç±»ćž‹äžșEventCallback。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + rendered?: string; + /** + * WebviewçȘ—ćŁæ˜Ÿç€șäș‹ä»¶ + * é€šèż‡WebviewObjectćŻčè±Ąçš„addEventListeneræ–čæł•æ·»ćŠ äș‹ä»¶ç›‘ćŹć‡œæ•°ïŒŒćœ“WebviewçȘ—ćŁæ˜Ÿç€șçȘ—ćŁćŠšç”»ćꌿˆćŽïŒ‰æ—¶è§Šć‘æ­€äș‹ä»¶ïŒŒć›žè°ƒć‡œæ•°ç±»ćž‹äžșEventCallback。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + show?: string; + /** + * WebviewćŠ èœœéĄ”éąæ ‡éą˜æ›Žæ–°äș‹ä»¶ + * é€šèż‡WebviewObjectćŻčè±Ąçš„addEventListeneræ–čæł•æ·»ćŠ äș‹ä»¶ç›‘ćŹć‡œæ•°ïŒŒćœ“WebviewçȘ—ćŁćŠ èœœæ–°éĄ”éąæ›Žæ–°æ ‡éą˜æ—¶è§Šć‘æ­€äș‹ä»¶ïŒŒć›žè°ƒć‡œæ•°ç±»ćž‹äžșSuccessCallback。 + * æłšæ„ïŒšæ­€äș‹ä»¶äŒšć…ˆäșŽloadedäș‹ä»¶è§Šć‘ïŒŒé€šćžžćœšćŠ èœœçœ‘ç»œéĄ”éąæ—¶é€šèż‡æ­€äș‹ä»¶ćŻæ›Žćż«èŽ·ć–ćˆ°éĄ”éąçš„æ ‡éą˜ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + titleUpdate?: string; + /** + * WebviewçȘ—ćŁæŽ„æ”¶ćˆ°è§Šć±äș‹ä»¶ + * é€šèż‡WebviewObjectćŻčè±Ąçš„addEventListeneræ–čæł•æ·»ćŠ äș‹ä»¶ç›‘ćŹć‡œæ•°ïŒŒćœ“ç”šæˆ·æ“äœœæŒ‰äž‹ćˆ°WebviewçȘ—ćŁæ—¶è§Šć‘æ­€äș‹ä»¶ïŒŒć›žè°ƒć‡œæ•°ç±»ćž‹äžșSuccessCallback。 + * æłšæ„ïŒšæŻæŒ‰äž‹ć±ćč•è§Šć‘äž€æŹĄæ­€äș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + touchstart?: string; + /** + * WebviewçȘ—ćŁäŸ§æ»‘èż”ć›žäș‹ä»¶ + * é€šèż‡WebviewObjectćŻčè±Ąçš„addEventListeneræ–čæł•æ·»ćŠ äș‹ä»¶ç›‘ćŹć‡œæ•°ïŒŒćœ“WebviewçȘ—ćŁäŸ§æ»‘èż”ć›žæ—¶è§Šć‘æ­€äș‹ä»¶ïŒŒć›žè°ƒć‡œæ•°ç±»ćž‹äžșPopGestureCallback。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + popGesture?: string; + /** + * WebviewçȘ—ćŁćŠ èœœèż›ćșŠć˜ćŒ–äș‹ä»¶ + * é€šèż‡WebviewObjectćŻčè±Ąçš„addEventListeneræ–čæł•æ·»ćŠ äș‹ä»¶ç›‘ćŹć‡œæ•°ïŒŒćœ“WebviewçȘ—ćŁćŠ èœœéĄ”éąèż›ćșŠć˜ćŒ–æ—¶è§Šć‘æ­€äș‹ä»¶ă€‚ + * ć›žè°ƒć‡œæ•°ćŽŸćž‹äžșvoid PorgressCandedCallback(Event e),ćŻé€šèż‡e.progressèŽ·ć–çȘ—ćŁćŠ èœœèż›ćșŠïŒŒć–ć€ŒèŒƒć›Žäžș0-100。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + progressChanged?: string; + /** + * WebviewçȘ—ćŁäž‹æ‹‰ćˆ·æ–°äș‹ä»¶ + * WebviewçȘ—ćŁæ‰“ćŒ€äž‹æ‹‰ćˆ·æ–°ćŠŸèƒœćŽïŒŒç”šæˆ·æ“äœœäž‹æ‹‰ćˆ·æ–°æ—¶æˆ–è°ƒç”šbeginPullToRefreshæ–čæł•æ—¶è§Šć‘ïŒŒç”šäșŽé€šçŸ„äžšćŠĄé€»èŸ‘ćŻä»„ćŒ€ć§‹æ‰§èĄŒćˆ·æ–°æ“äœœă€‚ + * æ›Žæ–°æ“äœœćźŒæˆćŽè°ƒç”šçȘ—ćŁçš„endPullToRefreshæ–čæł•ç»“æŸäž‹æ‹‰ćˆ·æ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + pullToRefresh?: string; +} + +/** + * JSONćŻčè±ĄïŒŒćŽŸç”ŸçȘ—ćŁæ‰©ć±•ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewExtraOptions { + /** + * çȘ—ćŁćŠšç”»ćŠ é€Ÿ + * ćŒ€ćŻçȘ—ćŁćŠšç”»ćŠ é€ŸćŠŸèƒœćŻäŒ˜ćŒ–çȘ—ćŁćŠšç”»æ•ˆæžœïŒŒæć‡ćŠšç”»æ”çš‹ćșŠïŒŒćŻéżć…éƒšćˆ†èźŸć€‡äžŠæ‰“ćŒ€ïŒˆć…łé—­ïŒ‰çȘ—揣é—Șć±çš„é—źéą˜ă€‚ + * ćŻć–ć€ŒïŒš + * "auto" - è‡ȘćŠšäŒ˜ćŒ–çȘ—ćŁćŠšç”»ïŒ› + * "none" - 慳闭çȘ—ćŁćŠšç”»ćŠ é€ŸćŠŸèƒœïŒ› + * "capture" - äœżç”šæˆȘć±æ–čćŒćŠ é€ŸçȘ—ćŁćŠšç”»ă€‚ + * é»˜èź€ć€Œäžș"auto"。 + * - auto: + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + acceleration?: 'auto'; + /** + * çȘ—ćŁćŠšç”»ćŠ é€Ÿæ—¶äœżç”šçš„ć›Ÿç‰‡ + * ćœ“äœżç”šæˆȘć±æ–čćŒćŠ é€ŸçȘ—ćŁćŠšç”»æ—¶ïŒŒćŻèźŸçœźć·Čç»ćˆ›ć»șć„œçš„æˆȘć±ć›Ÿç‰‡ïŒŒæ­€æ—¶äžäŒšèż›èĄŒćźžæ—¶æˆȘć±æ“äœœïŒŒćŠ é€ŸçȘ—ćŁćŠšç”»ć“ćș”æ—¶é—ŽïŒŒæć‡ç”šæˆ·äœ“éȘŒă€‚ + * ćŠ‚æžœæœȘæŒ‡ćźšæˆȘć±ć›Ÿç‰‡ïŒŒćˆ™ćźžæ—¶æˆȘć–ćœ“ć‰WebviewçȘ—揣ćŻčè±Ąçš„ć›Ÿç‰‡èż›èĄŒćŠšç”»æ“äœœă€‚ + * ćŠ‚æžœçȘ—揣æœȘäœżç”šæˆȘć±æ–čćŒćŠ é€ŸćŠšç”»ïŒŒćˆ™ćżœç•„æ­€ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + capture?: PlusNativeObjBitmap; + /** + * ć…łè”çȘ—ćŁćŠšç”»äœżç”šçš„ć›Ÿç‰‡ + * ćœ“äœżç”šæˆȘć±æ–čćŒćŠ é€ŸçȘ—ćŁćŠšç”»æ—¶ïŒŒćŻèźŸçœźć·Čç»ćˆ›ć»șć„œçš„æˆȘć±ć›Ÿç‰‡ïŒŒæ­€æ—¶äžäŒšèż›èĄŒćźžæ—¶æˆȘć±æ“äœœïŒŒćŠ é€Ÿć…łè”çȘ—ćŁćŠšç”»ć“ćș”æ—¶é—ŽïŒŒæć‡ç”šæˆ·äœ“éȘŒă€‚ + * ćŠ‚æžœæœȘæŒ‡ćźšæˆȘć±ć›Ÿç‰‡ïŒŒćˆ™ćźžæ—¶æˆȘć–ć…łè”WebviewçȘ—揣ćŻčè±Ąçš„ć›Ÿç‰‡èż›èĄŒćŠšç”»æ“äœœă€‚ + * ćŠ‚æžœçȘ—揣æœȘäœżç”šæˆȘć±æ–čćŒćŠ é€ŸćŠšç”»ïŒŒćˆ™ćżœç•„æ­€ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + otherCapture?: PlusNativeObjBitmap; +} + +/** + * ćŽŸç”ŸæŽ§ä»¶ćœšçȘ—ćŁäž­æ˜Ÿç€șçš„äœçœź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewPosition { + /** + * æŽ§ä»¶ćœšéĄ”éąäž­æ­ŁćžžćźšäœïŒŒćŠ‚æžœéĄ”éąć­˜ćœšæ»šćŠšæĄćˆ™éšçȘ—ćŁć†…ćźčæ»šćŠš + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + static?: string; + /** + * æŽ§ä»¶ćœšéĄ”éąäž­ç»ćŻčćźšäœïŒŒćŠ‚æžœéĄ”éąć­˜ćœšæ»šćŠšæĄäžéšçȘ—ćŁć†…ćźčæ»šćŠš + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + absolute?: string; + /** + * æŽ§ä»¶ćœšéĄ”éąäž­ćœé ïŒŒćœé çš„äœçœźé€šèż‡dockć±žæ€§èż›èĄŒćźšäč‰ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + dock?: string; +} + +/** + * WebviewçȘ—ćŁäž‹æ‹‰ćˆ·æ–°æ ·ćŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewPullToRefreshStyles { + /** + * æ˜ŻćŠćŒ€ćŻWebviewçȘ—ćŁçš„äž‹æ‹‰ćˆ·æ–°ćŠŸèƒœ + * trueèĄšç€șćŒ€ćŻçȘ—ćŁçš„äž‹æ‹‰ćˆ·æ–°ćŠŸèƒœïŒ› + * falseèĄšç€ș慳闭çȘ—ćŁçš„äž‹æ‹‰ćˆ·æ–°ćŠŸèƒœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + support?: boolean; + /** + * äž‹æ‹‰ćˆ·æ–°æŽ§ä»¶éąœè‰Č + * 鱜è‰Čć€Œæ ŒćŒäžș"#RRGGBB"ïŒŒćŠ‚"#FF0000"äžșèźŸçœźäž‹æ‹‰ć±žæ€§æŽ§ä»¶äžșçșąè‰ČïŒŒé»˜èź€ć€Œäžș"#2BD009"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + color?: string; + /** + * äž‹æ‹‰ćˆ·æ–°æ ·ćŒ + * 甹äșŽćźšäč‰äž‹æ‹‰ćˆ·æ–°éŁŽæ Œæ ·ćŒïŒŒćŻć–ć€ŒïŒš + * "default" - ç»ć…žäž‹æ‹‰ćˆ·æ–°æ ·ćŒïŒˆäž‹æ‹‰æ‹–ćŠšæ—¶éĄ”éąć†…ćźč跟随 + * "circle" - ćœ†ćœˆæ ·ćŒäž‹æ‹‰ćˆ·æ–°æŽ§ä»¶æ ·ćŒïŒˆäž‹æ‹‰æ‹–ćŠšæ—¶ä»…ćˆ·æ–°æŽ§ä»¶è·ŸéšïŒ‰ă€‚ + * é»˜èź€ć€Œäžș"default"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + style?: string; + /** + * çȘ—ćŁçš„äž‹æ‹‰ćˆ·æ–°æŽ§ä»¶èż›ć…„ćˆ·æ–°çŠ¶æ€çš„æ‹‰æ‹œé«˜ćșŠ + * æ”ŻæŒç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"ïŒ›ćƒçŽ ć€ŒïŒŒćŠ‚"50px"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + height?: string; + /** + * çȘ—ćŁćŻäž‹æ‹‰æ‹–æ‹œçš„èŒƒć›Ž + * æ”ŻæŒç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"ïŒ›ćƒçŽ ć€ŒïŒŒćŠ‚"50px"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + range?: string; + /** + * äž‹æ‹‰ćˆ·æ–°æŽ§ä»¶çš„è”·ć§‹äœçœź + * 仅ćŻč"circle"æ ·ćŒäž‹æ‹‰ćˆ·æ–°æŽ§ä»¶æœ‰æ•ˆïŒŒç”šäșŽćźšäč‰ćˆ·æ–°æŽ§ä»¶äž‹æ‹‰æ—¶çš„è”·ć§‹äœçœźă€‚ + * 盾ćŻčäșŽWebviewçš„éĄ¶éƒšćç§»é‡ïŒŒæ”ŻæŒç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"ïŒ›ćƒçŽ ć€ŒïŒŒćŠ‚"50px"。 + * é»˜èź€ć€Œäžș"0px"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + offset?: string; + /** + * ćœšäž‹æ‹‰ćŻćˆ·æ–°çŠ¶æ€æ—¶æ˜Ÿç€ș的憅ćźč + * æ”ŻæŒä»„äž‹ć±žæ€§ïŒš + * captionïŒšćœšäž‹æ‹‰ćŻćˆ·æ–°çŠ¶æ€æ—¶äž‹æ‹‰ćˆ·æ–°æŽ§ä»¶äžŠæ˜Ÿç€șçš„æ ‡éą˜ć†…ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + contentdown?: any; + /** + * ćœšé‡Šæ”ŸćŻćˆ·æ–°çŠ¶æ€æ—¶æ˜Ÿç€ș的憅ćźč + * æ”ŻæŒä»„äž‹ć±žæ€§ïŒš + * captionïŒšćœšé‡Šæ”ŸćŻćˆ·æ–°çŠ¶æ€æ—¶äž‹æ‹‰ćˆ·æ–°æŽ§ä»¶äžŠæ˜Ÿç€șçš„æ ‡éą˜ć†…ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + contentover?: any; + /** + * ćœšæ­Łćœšćˆ·æ–°çŠ¶æ€æ—¶æ˜Ÿç€ș的憅ćźč + * æ”ŻæŒä»„äž‹ć±žæ€§ïŒš + * captionïŒšćœšæ­Łćœšćˆ·æ–°çŠ¶æ€æ—¶äž‹æ‹‰ćˆ·æ–°æŽ§ä»¶äžŠæ˜Ÿç€șçš„æ ‡éą˜ć†…ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + contentrefresh?: any; +} + +/** + * WebviewçȘ—揣renderedäș‹ä»¶ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewRenderedEventOptions { + /** + * ćˆ€æ–­çȘ—揣æžČæŸ“ćźŒæˆç±»ćž‹ + * ćŻć–ć€ŒïŒš + * "top"-ä»ŽéĄ¶éƒšć‘äž‹ćç§»22pxæšȘçșżæˆȘć±æŁ€æ”‹æžČæŸ“æ˜ŻćŠćźŒæˆïŒ› + * "bottom"-从ćș•éƒšć‘äžŠćç§»25pxæšȘçșżæŁ€æ”‹æžČæŸ“æ˜ŻćŠćźŒæˆïŒ› + * "center"-从䞭闎æšȘçșżæŁ€æ”‹æžČæŸ“æ˜ŻćŠćźŒæˆïŒ› + * "auto"äžșć…šć±æŁ€æ”‹ïŒˆć·Šă€äž­ă€ćłäž‰æĄç«–çșżïŒ‰ă€‚ + * é»˜èź€ć€Œäžș"auto"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + type?: string; + /** + * ćˆ€æ–­çȘ—揣æžČæŸ“ćźŒæˆé—Žéš”æ—¶é—Ž + * ć•äœäžșmsïŒˆæŻ«ç§’ïŒ‰ïŒŒé»˜èź€ć€Œäžș150ms。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + interval?: number; +} + +/** + * æ›żæąH5æ ‡ć‡†APIé…çœźäżĄæŻ + * ç›źć‰ä»…æ”ŻæŒæ›żæąH5æ ‡ć‡†ćźšäœæŽ„ćŁ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewReplaceWebApiOptions { + /** + * æ›żæąH5æ ‡ć‡†ćźšäœæŽ„ćŁ(navigator.geolocation.*) + * 由äșŽçœ‘ç»œćŽŸć› ïŒŒćœšéƒšćˆ†æ‰‹æœșäžŠćŻèƒœæ— æł•è°ƒç”šæ ‡ć‡†H5ćźšäœæŽ„ćŁ(navigator.geolocation.*)èŽ·ć–ćźšäœæ•°æźïŒŒæ­€æ—¶ćŻä»„é€šèż‡æ­€ć±žæ€§é…çœźäœżç”šćŽŸç”ŸćźšäœæšĄć—æ›żæąæ ‡ć‡†H5ćźšäœæŽ„ćŁïŒŒćŻć–ć€ŒïŒš + * "alldevice" - ćœšæ‰€æœ‰èźŸć€‡äžŠæ›żæąæ ‡ć‡†H5ćźšäœæŽ„ćŁ(navigator.geolocation.*) + * "auto" - è‡ȘćŠšæ›żæąH5æ ‡ć‡†ćźšäœæŽ„ćŁïŒŒä»…ćœšè°ƒç”šæ ‡ć‡†H5ćźšäœæŽ„ćŁæ— æł•èŽ·ć–æ•°æźçš„èźŸć€‡äžŠæ›żæąïŒ› + * "none" - äžæ›żæąH5æ ‡ć‡†ćźšäœæŽ„ćŁ(navigator.geolocation.*)。 + * é»˜èź€ć€Œäžș"none"。 + * æłšæ„ïŒšæ›żæąH5æ ‡ć‡†ćźšäœæŽ„ćŁïŒŒäŒšćŻŒè‡ŽéĄ”éąćŠ èœœé€ŸćșŠć»¶èżŸ100msć·ŠćłïŒŒæŽšèäœżç”š"auto"æšĄćŒă€‚ + * - alldevice: + * ćŒșćˆ¶æ›żæąH5æ ‡ć‡†ćźšäœæŽ„ćŁ(navigator.geolocation.*) + * + * - auto: + * è‡ȘćŠšæ›żæąæ ‡ć‡†H5ćźšäœæŽ„ćŁïŒŒä»…ćœšè°ƒç”šæ ‡ć‡†H5ćźšäœæŽ„ćŁæ— æł•èŽ·ć–æ•°æźçš„èźŸć€‡äžŠæ›żæą + * + * - none: + * äžæ›żæąæ ‡ć‡†H5ćźšäœæŽ„ćŁ(navigator.geolocation.*) + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + geolocation?: 'alldevice' | 'auto' | 'none'; +} + +/** + * JSONćŻčè±ĄïŒŒWebviewçȘ—ćŁçš„çł»ç»ŸçŠ¶æ€æ ćŒșćŸŸæ ·ćŒ + * ä»…ćœšćș”ç”šèźŸçœźäžșæČ‰æ”žćŒçŠ¶æ€æ æ ·ćŒäž‹æœ‰æ•ˆïŒŒéžæČ‰æ”žćŒçŠ¶æ€æ æ ·ćŒäž‹ćżœç•„æ­€ć±žæ€§ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewStatusbarStyles { + /** + * çł»ç»ŸçŠ¶æ€æ ćŒșćŸŸèƒŒæ™Żéąœè‰Č + * 鱜è‰Čć€Œæ ŒćŒäžș"#RRGGBB"ïŒŒćŠ‚"#FF0000"èĄšç€șäžșçșąè‰ČèƒŒæ™Żă€‚ + * é»˜èź€ć€Œäžșćș”甚manifest.jsonäž­plus->statusbar->backgroundć±žæ€§é…çœźçš„ć€ŒïŒŒćŠ‚æžœæœȘé…çœźæ­€ć±žæ€§ć€ŒïŒŒćˆ™äœżç”šçł»ç»Ÿé»˜èź€çŠ¶æ€æ çš„èƒŒæ™Żéąœè‰Č。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + background?: string; +} + +/** + * JSONćŻčè±ĄïŒŒWebviewçȘ—揣ćŻčè±Ąçš„æ ·ćŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewStyles { + /** + * çȘ—ćŁćŠ èœœéĄ”éąæ—¶éąć€–æ·»ćŠ çš„HTTPèŻ·æ±‚ć€Žæ•°æź + * ä»…ćœšWebviewçȘ—ćŁçŹŹäž€æŹĄćŠ èœœéĄ”éąæ—¶äœżç”šïŒŒćŠ‚ç”šæˆ·ç‚čć‡»çš„è§Šć‘çš„é“ŸæŽ„è·łèœŹćˆ™äžć†æ·»ćŠ æ­€éąć€–èŻ·æ±‚ć€Žæ•°æźă€‚ + * ćŠ‚æžœWebviewçȘ—ćŁéžçŹŹäž€æŹĄćŠ èœœéĄ”éąæ—¶äčŸéœ€èŠéąć€–æ·»ćŠ HTTPèŻ·æ±‚ć€Žæ•°æźïŒŒćŻé€šèż‡loadURL()æ–čæł•çš„ć‚æ•°èźŸçœźă€‚ + * ćŠ‚æžœHTTPèŻ·æ±‚ć€Žäž­ć·Čç»ćŒ…ć«éœ€èŠéąć€–æ·»ćŠ çš„ć€Žæ•°æźïŒŒćˆ™æ·»ćŠ çš„èŻ·æ±‚æ•°æźèŠ†ç›–é»˜èź€ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + additionalHttpHeaders?: any; + /** + * çȘ—ćŁćŠšç”»äŒ˜ćŒ–æ–čćŒ + * ćŻć–ć€ŒïŒš + * "auto" - ćŠ‚æžœçȘ—ćŁäž­ć­˜ćœštitleNView或subNViewsçȘ—ćŁćŠšç”»æ—¶çœŸćźžWebviewæŽ§ä»¶ä»ŽćŠšç”»çȘ—ćŁäž­ç§»é™€ćŠ é€ŸïŒˆéżć…çœŸćźžWebviewæžČæŸ“ćœ±ć“ćŠšç”»æ•ˆçŽ‡ïŒ‰ïŒ› + * "none" - çȘ—ćŁćŠšç”»äžäœżç”šäŒ˜ćŒ–ă€‚ + * é»˜èź€ć€Œäžș"auto"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + animationOptimization?: string; + /** + * çȘ—ćŁçš„çŒ“ć­˜æšĄćŒ + * ćŻć–ć€ŒïŒš + * "default" - æ čæźcache-controlć†łćźšæ˜ŻćŠäœżç”šçŒ“ć­˜æ•°æźïŒŒćŠ‚æžœć­˜ćœšçŒ“ć­˜ćč¶äž”æČĄæœ‰èż‡æœŸćˆ™äœżç”šæœŹćœ°çŒ“ć­˜è”„æșïŒŒćŠćˆ™ä»Žçœ‘ç»œèŽ·ć–ïŒ› + * "cacheElseNetwork" - ćȘèŠć­˜ćœšçŒ“ć­˜ïŒˆćłäœżèż‡æœŸïŒ‰æ•°æźćˆ™äœżç”šïŒŒćŠćˆ™ä»Žçœ‘ç»œèŽ·ć–ïŒ› + * "noCache" - äžäœżç”šçŒ“ć­˜æ•°æźïŒŒć…šéƒšä»Žçœ‘ç»œèŽ·ć–ïŒ› + * "cacheOnly" - ä»…äœżç”šçŒ“ć­˜æ•°æźïŒŒäžä»Žçœ‘ç»œèŽ·ć–ïŒˆæłšïŒšćŠ‚æžœæČĄæœ‰çŒ“ć­˜æ•°æźćˆ™äŒšćŻŒè‡ŽćŠ èœœć€±èŽ„ïŒ‰ă€‚ + * é»˜èź€äœżç”š"default"。 + * - default: + * æ čæźcache-controlć†łćźšæ˜ŻćŠäœżç”šçŒ“ć­˜æ•°æźïŒŒćŠ‚æžœć­˜ćœšçŒ“ć­˜ćč¶äž”æČĄæœ‰èż‡æœŸćˆ™äœżç”šæœŹćœ°çŒ“ć­˜è”„æșïŒŒćŠćˆ™ä»Žçœ‘ç»œèŽ·ć–ă€‚ + * + * - cacheElseNetwork: + * ćȘèŠć­˜ćœšçŒ“ć­˜ïŒˆćłäœżèż‡æœŸïŒ‰æ•°æźćˆ™äœżç”šïŒŒćŠćˆ™ä»Žçœ‘ç»œèŽ·ć–ă€‚ + * + * - noCache: + * äžäœżç”šçŒ“ć­˜æ•°æźïŒŒć…šéƒšä»Žçœ‘ç»œèŽ·ć–ă€‚ + * + * - cacheOnly: + * ä»…äœżç”šçŒ“ć­˜æ•°æźïŒŒäžä»Žçœ‘ç»œèŽ·ć–ïŒˆæłšïŒšćŠ‚æžœæČĄæœ‰çŒ“ć­˜æ•°æźćˆ™äŒšćŻŒè‡ŽćŠ èœœć€±èŽ„ïŒ‰ă€‚ + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + cachemode?: 'default' | 'cacheElseNetwork' | 'noCache' | 'cacheOnly'; + /** + * WebviewçȘ—揣è‡ȘćŠšć€„ç†èż”ć›žé”źé€»èŸ‘ + * ćœ“WebviewçȘ—ćŁćœšæ˜Ÿç€șæ ˆéĄ¶ïŒŒćč¶äž”WebviewçȘ—揣侭æČĄæœ‰è°ƒç”šJSç›‘ćŹèż”ć›žé”źïŒˆplus.key.addEventListener('backbutton',...)ïŒ‰æ—¶æŒ‰äž‹èż”ć›žé”źć“ćș”èĄŒäžș。 + * ćŻć–ć€ŒïŒš + * "hide" - 隐藏WebviewçȘ—ćŁïŒŒéšè—ćŠšç”»äžŽäžŠäž€æŹĄè°ƒç”šæ˜Ÿç€șæ—¶èźŸçœźçš„ćŠšç”»ç±»ćž‹ç›žćŻčćș”ïŒˆćŠ‚â€œslide-in-right”ćŻčćș”的慳闭抚画äžș“slid-out-right” + * "close" - 慳闭WebviewçȘ—ćŁïŒŒć…łé—­ćŠšç”»äžŽäžŠäž€æŹĄè°ƒç”šæ˜Ÿç€șæ—¶èźŸçœźçš„ćŠšç”»ç±»ćž‹ç›žćŻčćș”ïŒˆćŠ‚â€œslide-in-right”ćŻčćș”的慳闭抚画äžș“slid-out-right”  + * "none" - äžćšæ“äœœïŒŒć°†èż”ć›žé”źäŒ é€’ç»™äž‹äž€WebviewçȘ—ćŁć€„ç†ïŒ› + * "quit" - 退ć‡șćș”甚。 + * - hide: + * 隐藏WebviewçȘ—ćŁïŒŒéšè—ćŠšç”»äžŽäžŠäž€æŹĄè°ƒç”šæ˜Ÿç€șæ—¶èźŸçœźçš„ćŠšç”»ç±»ćž‹ç›žćŻčćș”ïŒˆćŠ‚â€œslide-in-right”ćŻčćș”的慳闭抚画äžș“slid-out-rightâ€ïŒ‰ă€‚ + * + * - close: + * 慳闭WebviewçȘ—ćŁïŒŒć…łé—­ćŠšç”»äžŽäžŠäž€æŹĄè°ƒç”šæ˜Ÿç€șæ—¶èźŸçœźçš„ćŠšç”»ç±»ćž‹ç›žćŻčćș”ïŒˆćŠ‚â€œslide-in-right”ćŻčćș”的慳闭抚画äžș“slid-out-rightâ€ïŒ‰ă€‚ + * + * - none: + * äžćšæ“äœœïŒŒć°†èż”ć›žé”źäŒ é€’ç»™äž‹äž€WebviewçȘ—ćŁć€„ç†ă€‚ + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + backButtonAutoControl?: 'hide' | 'close' | 'none'; + /** + * çȘ—ćŁçš„èƒŒæ™Żéąœè‰Č + * çȘ—揣ç©ș癜ćŒșćŸŸçš„èƒŒæ™ŻæšĄćŒïŒŒèźŸçœźbackgroundäžș鱜è‰Čć€Œ(ć‚è€ƒCSS Color NamesïŒŒćŻć–ć€Œ/ćć…­èż›ćˆ¶ć€Œ/rgbć€Œ/rgbać€Œ)çȘ—揣äžșç‹Źć æšĄćŒæ˜Ÿç€șïŒˆć æ•ŽäžȘć±ćč•ćŒșćŸŸïŒ‰ïŒ› + * èźŸçœźbackgroundäžș“transparentâ€ïŒŒćˆ™èĄšç€șçȘ—ćŁèƒŒæ™Żé€æ˜ŽïŒŒäžșéžç‹Źć æšĄćŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + background?: string; + /** + * çȘ—ćŁéĄ¶éƒšèƒŒæ™Żéąœè‰Čć€Œ + * çȘ—ćŁć†…ćźčæ»šćŠšćˆ°éĄ¶éƒšäž‹æ‹‰æ—¶ćŻè§ă€‚ + * ćŻć–ć€ŒïŒš + * "#RRGGBB"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"#FF0000"èĄšç€șçșąè‰Č + * "rgba(R,G,B,A)"ïŒŒć…¶äž­R/G/Bćˆ†ćˆ«ä»ŁèĄšçșąè‰Čć€Œ/绿è‰Čć€Œ/蓝è‰Čć€ŒïŒŒæ­Łæ•Žæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-255Aäžș透明ćșŠïŒŒæ”źç‚čæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-10äžșć…šé€æ˜ŽïŒŒ1äžșäžé€æ˜ŽïŒ‰ïŒŒćŠ‚"rgba(255,0,0,0.5)"ïŒŒèĄšç€șçșąè‰ČćŠé€æ˜Žă€‚ + * é»˜èź€ć€Œäžșé€æ˜Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + backgroundColorTop?: string; + /** + * çȘ—揣ćș•éƒšèƒŒæ™Żéąœè‰Č + * çȘ—ćŁć†…ćźčæ»šćŠšćˆ°ćș•éƒšäžŠæ‹‰æ—¶ćŻè§ă€‚ + * ćŻć–ć€ŒïŒš + * "#RRGGBB"æ ŒćŒć­—çŹŠäžČïŒŒćŠ‚"#FF0000"èĄšç€șçșąè‰Č + * "rgba(R,G,B,A)"ïŒŒć…¶äž­R/G/Bćˆ†ćˆ«ä»ŁèĄšçșąè‰Čć€Œ/绿è‰Čć€Œ/蓝è‰Čć€ŒïŒŒæ­Łæ•Žæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-255Aäžș透明ćșŠïŒŒæ”źç‚čæ•°ç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Žäžș0-10äžșć…šé€æ˜ŽïŒŒ1äžșäžé€æ˜ŽïŒ‰ïŒŒćŠ‚"rgba(255,0,0,0.5)"ïŒŒèĄšç€șçșąè‰ČćŠé€æ˜Žă€‚ + * é»˜èź€ć€Œäžșé€æ˜Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + backgroundColorBottom?: string; + /** + * æ˜ŻćŠé˜»ćĄžçœ‘ç»œć›Ÿç‰‡çš„ćŠ èœœ + * ćžƒć°”ç±»ćž‹ïŒŒtrueèĄšç€șé˜»ćĄžïŒŒfalseèĄšç€șäžé˜»ćĄžïŒŒé»˜èź€ć€Œäžșfalse。 + * é˜»ćĄžćŽWebviewçȘ—ćŁć°†äžćŠ èœœéĄ”éąäž­äœżç”šçš„æ‰€æœ‰çœ‘ç»œć›Ÿç‰‡ïŒŒćŻé€šèż‡WebviewçȘ—揣ćŻčè±Ąçš„setBlockNetWorkImage()æ–čæł•ćŠšæ€äżźæ”čæ­€çŠ¶æ€ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + blockNetworkImage?: boolean; + /** + * çȘ—ćŁćž‚ç›Žć‘äžŠçš„ćç§»é‡ + * æ”ŻæŒç™Ÿćˆ†æŻ”ă€ćƒçŽ ć€ŒïŒŒé»˜èź€ć€Œæ— ć€ŒïŒˆæ čæźtop撌heightć±žæ€§ć€Œæ„è‡ȘćŠšèźĄçź—ïŒ‰ă€‚ + * ćœ“ćŒæ—¶èźŸçœźäș†top撌heightć€Œæ—¶ïŒŒćżœç•„æ­€ć±žæ€§ć€ŒïŒ› + * ćœ“æœȘèźŸçœźheightć€Œæ—¶ïŒŒćŻé€šèż‡top撌bottomć±žæ€§ć€Œæ„çĄźćźšçȘ—ćŁçš„é«˜ćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + bottom?: string; + /** + * çȘ—ćŁé‡ćˆ°èŸčæĄ†æ˜ŻćŠæœ‰ććŒč效果 + * ćŻć–ć€ŒïŒš + * "none" - èĄšç€șæČĄæœ‰ććŒč效果 + * "vertical" - èĄšç€ș枂目æ–čć‘æœ‰ććŒč效果 + * "horizontal" - èĄšç€șæ°Žćčłæ–čć‘æœ‰ććŒč效果 + * "all" - èĄšç€șćž‚ç›Žć’Œæ°Žćčłæ–čć‘éƒœæœ‰ććŒčæ•ˆæžœă€‚ + * é»˜èź€ć€Œäžș"none"。 + * - none: æČĄæœ‰ććŒč效果 + * - vertical: 枂目æ–čć‘æœ‰ććŒč效果 + * - horizontal: æ°Žćčłæ–čć‘æœ‰ććŒč效果 + * - all: ćž‚ç›Žć’Œæ°Žćčłæ–čć‘éƒœæœ‰ććŒč效果 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + bounce?: 'none' | 'vertical' | 'horizontal' | 'all'; + /** + * çȘ—ćŁć›žćŒč效果ćŒșćŸŸçš„èƒŒæ™Ż + * çȘ—ćŁć›žćŒč效果ćŒșćŸŸèƒŒæ™ŻćŻæ”ŻæŒéąœè‰Čć€Œæˆ–ć›Ÿç‰‡ïŒš + * 鱜è‰Čć€Œæ ŒćŒäžș"#RRGGBB"ïŒŒćŠ‚"#FFFFFF"äžșèźŸçœźç™œè‰ČèƒŒæ™ŻïŒ› + * èƒŒæ™Żć›Ÿäžș"url(%image path%)"ïŒŒćŠ‚"url(./icon.png)"äžșèźŸçœźicon.pngäžșèƒŒæ™Żć›ŸïŒŒć›Ÿç‰‡é‡‡ç”šćčłé“șæšĄćŒç»˜ćˆ¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + bounceBackground?: string; + /** + * çȘ—ćŁć†…ćźčćœæ­ąæ»‘ćŠšçš„ć‡é€ŸćșŠ + * ćœ“WebviewćŠ èœœçš„ć†…ćźčè¶…èż‡ć…¶é«˜ćșŠæ—¶ïŒŒćŻä»„æ‹–æ‹œæ»‘ćŠšć†…ćźčdecelerationRateć±žæ€§æŽ§ćˆ¶æ‰‹æŒ‡æŸćŒ€ćŽéĄ”éąæ»‘ćŠšçš„é€ŸćșŠă€‚ + * èźŸçœźć€Œè¶Šć€§æ‰‹æŒ‡æŸćŒ€ćŽçš„æ»‘ćŠšé€ŸćșŠè¶Šćż«ïŒˆæ»‘ćŠšè·çŠ»è¶Šé•żïŒ‰ïŒŒć…¶ć€ŒćŸŸèŒƒć›Žäžș0.0-1.0ïŒŒé»˜èź€ć€Œäžș0.989。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + decelerationRate?: number; + /** + * çȘ—ćŁçš„ćœé æ–čćŒ + * ćœ“WebviewçȘ—ćŁæ·»ćŠ ćˆ°ćŠć€–äž€äžȘçȘ—ćŁäž­æ—¶ïŒŒćœé æ–čćŒæ‰äŒšç”Ÿæ•ˆïŒŒé‡‡ç”šćœé æ–čćŒæ·»ćŠ äŒšćŻŒè‡ŽćŽŸWebviewçȘ—揣è‡ȘćŠšè°ƒæ•Žć…¶ć€§ć°éżć…ć…¶ć†…ćźčèą«ć­çȘ—ćŁç›–äœă€‚ + * ćŻć–ć€ŒïŒš"top"ïŒŒæŽ§ä»¶ćœé ćˆ™éĄ”éąéĄ¶éƒšïŒ›"bottom"ïŒŒæŽ§ä»¶ćœé ćœšéĄ”éąćș•郚"right"ïŒŒæŽ§ä»¶ćœé ćœšéĄ”éąćłäŸ§ïŒ›"left"ïŒŒæŽ§ä»¶ćœé ćœšéĄ”éąć·ŠäŸ§ă€‚ + * é»˜èź€ć€Œäžș"bottom"。 + * - top: æŽ§ä»¶ćœé ćˆ™éĄ”éąéĄ¶éƒš + * - bottom: æŽ§ä»¶ćœé ćœšéĄ”éąćș•郚 + * - right: æŽ§ä»¶ćœé ćœšéĄ”éąćłäŸ§ + * - left: æŽ§ä»¶ćœé ćœšéĄ”éąć·ŠäŸ§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + dock?: 'top' | 'bottom' | 'right' | 'left'; + /** + * çȘ—ćŁćŠ èœœé”™èŻŻæ—¶è·łèœŹçš„éĄ”éąćœ°ć€ + * ćœ“WebviewçȘ—ćŁæ— æł•ćŠ èœœæŒ‡ćźšçš„urlćœ°ć€æ—¶ïŒˆćŠ‚æœŹćœ°éĄ”éąäžć­˜ćœšïŒŒæˆ–è€…æ— æł•èźżé—źçš„çœ‘ç»œćœ°ć€ïŒ‰ïŒŒæ­€æ—¶äŒšè‡ȘćŠšè·łèœŹćˆ°æŒ‡ćźšçš„é”™èŻŻéĄ”éąćœ°ć€ïŒˆä»…æ”ŻæŒæœŹćœ°éĄ”éąćœ°ć€ïŒ‰ă€‚ + * èźŸçœźäžș“noneâ€ćˆ™ć…łé—­è·łèœŹćˆ°é”™èŻŻéĄ”éąćŠŸèƒœïŒŒæ­€æ—¶éĄ”éąæ˜Ÿç€șWebviewé»˜èź€çš„é”™èŻŻéĄ”éąć†…ćźčă€‚é»˜èź€äœżç”š5+ Runtimeć†…çœźçš„é”™èŻŻéĄ”éąă€‚ + * - none: ć…łé—­ćŠ èœœéĄ”éąé”™èŻŻè‡ȘćŠšè·łèœŹćŠŸèƒœ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + errorPage?: 'none'; + /** + * æ›żæąH5æ ‡ć‡†API + * 甹äșŽè§Łć†łćœšéƒšćˆ†èźŸć€‡äžŠè°ƒç”šH5æ ‡ć‡†ćźšäœæŽ„ćŁćŻèƒœæ— æł•èŽ·ć–ćźšäœæ•°æźçš„é—źéą˜ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + replacewebapi?: PlusWebviewWebviewReplaceWebApiOptions; + /** + * çȘ—ćŁæ˜ŻćŠćŒ€ćŻçĄŹä»¶ćŠ é€Ÿ + * ćžƒć°”ç±»ćž‹ïŒŒtrueèĄšç€șćŒ€ćŻçĄŹä»¶ćŠ é€ŸïŒŒfalseèĄšç€șäžćŒ€ćŻçĄŹä»¶ćŠ é€ŸïŒŒé»˜èź€æƒ…ć†”5+ Runtime䌚æ čæźèźŸć€‡ćźžé™…æ”ŻæŒæƒ…ć†”è‡ȘćŠšé€‰æ‹©æ˜ŻćŠćŒ€ćŻçĄŹä»¶ćŠ é€ŸïŒŒćŻä»„é€šèż‡plus.webview.defaultHardwareAccelerated()æ–čæł•èŽ·ć–é»˜èź€Webviewæ˜ŻćŠćŒ€ćŻçĄŹä»¶ćŠ é€Ÿă€‚ + * 由äșŽäžćŒèźŸć€‡ćŻčçĄŹä»¶ćŠ é€Ÿçš„æ”ŻæŒæƒ…ć†”ć­˜ćœšć·źćŒ‚ïŒŒćŒ€ćŻçĄŹä»¶ćŠ é€ŸèƒœćŠ é€ŸHTMLéĄ”éąçš„æžČ染䜆äčŸäŒšæ¶ˆè€—æ›Žć€šçš„çł»ç»Ÿè”„æșïŒŒä»Žè€ŒćŻŒè‡Žćœšéƒšćˆ†èźŸć€‡äžŠćŻèƒœć‡ș现é—Șć±ă€ć‘è™šă€ćˆ†ć—æžČæŸ“ç­‰é—źéą˜ïŒŒć› æ­€ćœšç‰čćźšèźŸć€‡çš„ç‰čćźšéĄ”éąćŠ‚æžœć‡șçŽ°ä»„äžŠé—źéą˜éœ€èŠæ‰‹ćŠšèźŸçœźć…łé—­çĄŹä»¶ćŠ é€Ÿæ„éżć…ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + hardwareAccelerated?: boolean; + /** + * çȘ—ćŁçš„é«˜ćșŠ + * æ”ŻæŒç™Ÿćˆ†æŻ”ă€ćƒçŽ ć€ŒïŒŒé»˜èź€äžș100%。 + * ćœ“æœȘèźŸçœźheightć±žæ€§ć€Œæ—¶ïŒŒäŒ˜ć…ˆé€šèż‡top撌bottomć±žæ€§ć€Œæ„èźĄçź—çȘ—ćŁçš„é«˜ćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + height?: string; + /** + * çȘ—ćŁäœżç”šçš„ć†…æ ž + * ćŻć–ć€ŒïŒš + * "WKWebview" - 朹iOS8.0ćŠä»„äžŠçł»ç»Ÿäœżç”šWKWebviewć†…æ žïŒŒäœŽç‰ˆæœŹäž‹ä»ç„¶äœżç”šUIWebviewć†…æ žïŒ› + * "UIWebview" - ćœšæ‰€æœ‰ç‰ˆæœŹäžŠéƒœäœżç”šUIWebviewć†…æ žă€‚ + * é»˜èź€ć€Œäžș"UIWebview"。 + * WKWebviewć†…æ žçš„äŒ˜ćŠżæ˜ŻïŒš + * 1. æ»šćŠšæ—¶æ‡’ćŠ èœœçš„ć›Ÿç‰‡äčŸćŻä»„ćźžæ—¶æžČ染UIWebviewćœšæ»šćŠšćœæ­ąćŽæ‰èƒœæžČ染 + * 2. WKWebview的videoæ”ŻæŒAirPlay。 + * 䜆WKWebviewä蟿œ‰äș›é™ćˆ¶ć’Œäžè¶łïŒŒç›źć‰ć·ČçŸ„çš„é—źéą˜æœ‰ïŒš + * 1. äžæ”ŻæŒè·šćŸŸèźŸçœźcookieïŒŒćłplus.navigator.setCookie()APIæ— æł•äœżç”šïŒ› + * 2. æœŹćœ°çš„HTMLéĄ”éąäž­çš„XHRäžæ”ŻæŒè·šćŸŸèźżé—źïŒŒéœ€äœżç”šplus.net.XMLHttpRequestæ„æ›żæąïŒ› + * 3. äžæ”ŻæŒäœżç”šWebSQLïŒŒéœ€äœżç”šindexDBæ„æ›żæąïŒ› + * 4. äžæ”ŻæŒjsćŽŸç”Ÿæ··æ·†ćŠŸèƒœïŒŒéœ€äœżç”šć‰ç«Żjsæ··æ·†æ„æ›żæąïŒ› + * 5. ć†…ć­˜äžè¶łæ—¶äŒšç™œć±ă€‚ + * 銖饔的Webview的kernel朹manifestäž­é…çœźïŒˆplus->kernel->iosïŒ‰ă€‚ + * - WKWebview: + * äœżç”š"WKWebview"ć†…æ žă€‚ + * + * - UIWebview: + * äœżç”š"UIWebview"ć†…æ žă€‚ + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + kernel?: 'WKWebview' | 'UIWebview'; + /** + * çȘ—ćŁæ°Žćčłć‘ćłçš„ćç§»é‡ + * æ”ŻæŒç™Ÿćˆ†æŻ”ă€ćƒçŽ ć€ŒïŒŒé»˜èź€ć€Œäžș0px。 + * æœȘèźŸçœźleftć±žæ€§ć€Œæ—¶ïŒŒäŒ˜ć…ˆé€šèż‡right撌widthć±žæ€§ć€Œæ„èźĄçź—çȘ—ćŁçš„leftäœçœźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + left?: string; + /** + * çȘ—ćŁçš„èŸč距 + * 甹äșŽćźšäœçȘ—ćŁçš„äœçœźïŒŒæ”ŻæŒautoautoèĄšç€șć±…äž­ă€‚è‹„èźŸçœźäș†left、right、top、bottom戙ćŻčćș”çš„èŸčè·ć€Œć€±æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + margin?: string; + /** + * çȘ—ćŁçš„éźçœ© + * 甹äșŽèźŸçœźWebviewçȘ—ćŁçš„éźçœ©ć±‚æ ·ćŒïŒŒéźçœ©ć±‚äŒšèŠ†ç›–Webviewäž­æ‰€æœ‰ć†…ćźčïŒŒćŒ…æ‹Źć­webviewćč¶äž”æˆȘ获webviewçš„æ‰€æœ‰è§Šć±äș‹ä»¶ïŒŒæ­€æ—¶WebviewçȘ—ćŁçš„ç‚čć‡»æ“äœœäŒšè§Šć‘maskClickäș‹ä»¶ă€‚ + * 歗笩äžČç±»ćž‹ïŒŒćŻć–ć€ŒïŒš + * rgbaæ ŒćŒć­—çŹŠäžČïŒŒćźšäč‰çșŻè‰Čéźçœ©ć±‚æ ·ćŒïŒŒćŠ‚"rgba(0,0,0,0.5)"ïŒŒèĄšç€ș黑è‰ČćŠé€æ˜ŽïŒ› + * "none"ïŒŒèĄšç€șäžäœżç”šéźçœ©ć±‚ïŒ› + * é»˜èź€ć€Œäžș"none"ïŒŒćłæ— éźçœ©ć±‚ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + mask?: string; + /** + * çȘ—ćŁçš„äžé€æ˜ŽćșŠ + * 0äžșć…šé€æ˜ŽïŒŒ1äžșäžé€æ˜ŽïŒŒé»˜èź€ć€Œäžș1ïŒŒćłäžé€æ˜Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + opacity?: number; + /** + * æŽ§ćˆ¶Webviewæłšć…„5+ API时æœș + * ćŻć–ć€ŒïŒš + * "ahead" - ć°œé‡æć‰ïŒŒæ‹ŠæˆȘéĄ”éąäž­çœ‘ç»œjsèŻ·æ±‚ćźžçŽ°æć‰æłšć…„ïŒŒćŠ‚æžœæČĄæœ‰æ‹ŠæˆȘ戰jsèŻ·æ±‚ćˆ™ćœšéĄ”éąloadedæ—¶æłšć…„ïŒ› + * "normal" - éĄ”éąloadedæ—¶æłšć…„ïŒ› + * "later" - èŸƒæ™šćœšæłšć…„ïŒŒćœšloadedäș‹ä»¶ć‘ç”ŸćŽ2sć†æłšć…„ïŒŒplusreadyäș‹ä»¶ćŒæ ·ć»¶èżŸïŒ› + * "none" - äžæłšć…„ïŒŒéĄ”éąæ— æł•è°ƒç”š5+ APIïŒŒäžè§Šć‘plusreadyäș‹ä»¶ă€‚ + * é»˜èź€ć€Œäžș"normal"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + plusrequire?: string; + /** + * çȘ—ćŁçš„èż›ćșŠæĄæ ·ćŒ + * èźŸçœźæ­€ć±žæ€§ćˆ™ćœšWebviewçȘ—ćŁçš„éĄ¶éƒšæ˜Ÿç€șèż›ćșŠæĄïŒŒćŻé…çœźèż›ćșŠæĄéąœè‰ČćŠé«˜ćșŠă€‚ + * èźŸçœźæ­€ć±žæ€§ć€Œäžșundefined或nullćˆ™éšè—èż›ćșŠæĄă€‚ + * é»˜èź€äžæ˜Ÿç€șèż›ćșŠæĄă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + progress?: PlusWebviewWebviewProgressStyles; + /** + * çȘ—ćŁçš„äŸ§æ»‘èż”ć›žćŠŸèƒœ + * ćŻć–ć€ŒïŒš + * "none"-æ— äŸ§æ»‘èż”ć›žćŠŸèƒœïŒ› + * "close"-äŸ§æ»‘èż”ć›žć…łé—­WebviewçȘ—ćŁïŒ› + * "hide"-äŸ§æ»‘èż”ć›žéšè—webviewçȘ—ćŁă€‚ + * - none: æ— äŸ§æ»‘èż”ć›žćŠŸèƒœ + * - close: äŸ§æ»‘èż”ć›žć…łé—­WebviewçȘ—揣 + * - hide: äŸ§æ»‘èż”ć›žéšè—webviewçȘ—揣 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + popGesture?: 'none' | 'close' | 'hide'; + /** + * çȘ—ćŁäž‹æ‹‰ćˆ·æ–°é…çœź + * èźŸçœźçȘ—ćŁæ˜ŻćŠćŒ€ćŻäž‹æ‹‰ćˆ·æ–°ćŠŸèƒœćŠæ ·ćŒă€‚ + * ćŒ€ćŻäž‹æ‹‰ćˆ·æ–°ćŽćŻé€šèż‡ç›‘ćŹçȘ—ćŁçš„"pullToRefresh"äș‹ä»¶ć€„ç†äž‹æ‹‰ćˆ·æ–°äžšćŠĄé€»èŸ‘ïŒŒæ›Žæ–°æ“äœœćꌿˆćŽè°ƒç”šçȘ—ćŁçš„endPullToRefreshæ–čæł•ç»“æŸäž‹æ‹‰ćˆ·æ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + pullToRefresh?: PlusWebviewWebviewPullToRefreshStyles; + /** + * çȘ—揣æžČæŸ“æšĄćŒ + * æ”ŻæŒä»„äž‹ć±žæ€§ć€ŒïŒš + * "onscreen" - WebviewçȘ—ćŁćœšć±ćč•ćŒșćŻè§æ—¶æžČæŸ“ïŒŒäžćŻè§æ—¶äžèż›èĄŒæžČæŸ“ïŒŒæ­€æ—¶èƒœć‡ć°‘ć†…ć­˜äœżç”šé‡ïŒ› + * "always" - Webviewćœšä»»äœ•æ—¶ć€™éƒœæžČæŸ“ïŒŒćœšć†…ć­˜èŸƒć€§çš„èźŸć€‡äžŠäœżç”šïŒŒèą«éźæŒĄçš„çȘ—ćŁćœšæ­€äž­æšĄćŒäž‹æ˜Ÿç€șçš„æ—¶ć€™äŒšæœ‰æ›Žæ”ç•…çš„æ•ˆæžœă€‚ + * é»˜èź€ć€Œäžș"onscreen"。 + * 仅Androidćčłć°æ”ŻæŒă€‚ + * - onscreen: WebviewçȘ—ćŁćœšć±ćč•ćŒșćŻè§æ—¶æžČæŸ“ïŒŒäžćŻè§æ—¶äžèż›èĄŒæžČæŸ“ïŒŒæ­€æ—¶èƒœć‡ć°‘ć†…ć­˜äœżç”šé‡ + * - always: Webviewćœšä»»äœ•æ—¶ć€™éƒœæžČæŸ“ïŒŒćœšć†…ć­˜èŸƒć€§çš„èźŸć€‡äžŠäœżç”šïŒŒèą«éźæŒĄçš„çȘ—ćŁćœšæ­€äž­æšĄćŒäž‹æ˜Ÿç€șçš„æ—¶ć€™äŒšæœ‰æ›Žæ”ç•…çš„æ•ˆæžœ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + render?: 'onscreen' | 'always'; + /** + * çȘ—ćŁæ°Žćčłć‘ć·Šçš„ćç§»é‡ + * æ”ŻæŒç™Ÿćˆ†æŻ”ă€ćƒçŽ ć€ŒïŒŒé»˜èź€æ— ć€ŒïŒˆæ čæźleft撌widthć±žæ€§ć€Œæ„è‡ȘćŠšèźĄçź—ïŒ‰ă€‚ + * ćœ“èźŸçœźäș†left撌widthć€Œæ—¶ïŒŒćżœç•„æ­€ć±žæ€§ć€ŒïŒ› + * ćœ“æœȘèźŸçœźwidthć€Œæ—¶ïŒŒćŻé€šèż‡left撌bottomć±žæ€§ć€Œæ„çĄźćźšçȘ—ćŁçš„ćźœćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + right?: string; + /** + * çȘ—ćŁæ˜ŻćŠćŻçŒ©æ”Ÿ + * çȘ—ćŁèźŸçœźäžșćŻçŒ©æ”ŸïŒˆscalable:trueïŒ‰æ—¶ïŒŒç”šæˆ·ćŻé€šèż‡ćŒæŒ‡æ“äœœæ”Ÿć€§æˆ–çŒ©ć°éĄ”éąïŒŒæ­€æ—¶htmléĄ”éąćŻé€šèż‡meta节ç‚čèźŸçœźâ€œname="viewport" content="user-scalable=no"â€æ„é™ćˆ¶éĄ”éąäžćŻçŒ©æ”Ÿă€‚ + * çȘ—ćŁèźŸçœźäžșäžćŻçŒ©æ”ŸïŒˆscalable:falseïŒ‰æ—¶ïŒŒç”šæˆ·äžćŻé€šèż‡ćŒæŒ‡æ“äœœæ”Ÿć€§æˆ–çŒ©ć°éĄ”éąïŒŒćłäœżéĄ”éąäž­çš„meta节ç‚čä蟿— æł•ćŒ€ćŻćŻçŒ©æ”ŸćŠŸèƒœă€‚ + * é»˜èź€ć€ŒäžșfalseïŒŒćłäžćŻçŒ©æ”Ÿă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + scalable?: boolean; + /** + * çȘ—ćŁæ˜ŻćŠæ˜Ÿç€șæ»šćŠšæĄ + * 甹äșŽæŽ§ćˆ¶çȘ—ćŁæ»šćŠšæĄæ ·ćŒïŒŒćŻć–ć€ŒïŒš + * "all"ïŒšćž‚ç›Žć’Œæ°Žćčłæ»šćŠšæĄéƒœæ˜Ÿç€ș + * "vertical"仅星ç€șćž‚ç›Žæ»šćŠšæĄïŒ› + * "horizontal"仅星ç€șæ°Žćčłæ»šćŠšæĄïŒ› + * "none"ïŒšćž‚ç›Žć’Œæ°Žćčłæ»šćŠšæĄéƒœäžæ˜Ÿç€ș。 + * é»˜èź€ć€Œäžș"all"ïŒŒćłćž‚ç›Žć’Œæ°Žćčłæ»šćŠšæĄéƒœæ˜Ÿç€ș。 + * æłšæ„ïŒšæ˜Ÿç€șæ»šćŠšæĄçš„ć‰ææĄä»¶æ˜ŻçȘ—ćŁäž­çš„ć†…ćźčè¶…èż‡çȘ—ćŁæ˜Ÿç€șçš„ćźœæˆ–é«˜ă€‚ + * - all: ćž‚ç›Žć’Œæ°Žćčłæ»šćŠšæĄéƒœæ˜Ÿç€ș + * - vertical: 仅星ç€șćž‚ç›Žæ»šćŠšæĄ + * - horizontal: 仅星ç€șæ°Žćčłæ»šćŠšæĄ + * - none: ćž‚ç›Žć’Œæ°Žćčłæ»šćŠšæĄéƒœäžæ˜Ÿç€ș + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + scrollIndicator?: 'all' | 'vertical' | 'horizontal' | 'none'; + /** + * ç‚čć‡»èźŸć€‡çš„çŠ¶æ€æ æ—¶æ˜ŻćŠæ»šćŠšèż”ć›žè‡łéĄ¶éƒš + * trueèĄšç€șç‚čć‡»èźŸć€‡çš„çŠ¶æ€æ ćŻä»„æ»šćŠšèż”ć›žè‡łéĄ¶éƒšïŒŒfalseèĄšç€șç‚čć‡»èźŸć€‡çš„çŠ¶æ€æ äžćŻä»„ïŒŒé»˜èź€ć€Œäžștrue。 + * æ­€ćŠŸèƒœä»…iOSćčłć°æ”ŻæŒïŒŒćœšiPhone䞊有䞔ćȘ有䞀äžȘWebviewçȘ—ćŁçš„scrollsToTopć±žæ€§ć€Œäžștrueæ—¶æ‰ç”Ÿæ•ˆïŒŒæ‰€ä»„ćœšæ˜Ÿç€ș撌慳闭WebviewçȘ—ćŁæ—¶éœ€ćŠšæ€æ›Žæ–°æ‰€æœ‰Webview的scrollsToTopć€ŒïŒŒć·ČçĄźäżæ­€ćŠŸèƒœç”Ÿæ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + scrollsToTop?: boolean; + /** + * æ˜ŻćŠćŻćˆ†äș«çȘ—ćŁćŠ èœœçš„é“ŸæŽ„朰杀 + * ćœšæ”ćș”ç”šçŽŻćąƒïŒˆæ”ćș”甚/5+æ”è§ˆć™šïŒ‰äž­ćŻé€šèż‡ćˆ†äș«æŒ‰é’źćˆ†äș«éĄ”éąé“ŸæŽ„ćœ°ć€ïŒŒ + * ćŻć–ć€ŒïŒš + * true - 揯戆äș«çȘ—ćŁćŠ èœœéĄ”éąé“ŸæŽ„ćœ°ć€ïŒ› + * false - 侍揯戆äș«çȘ—ćŁćŠ èœœçš„éĄ”éąé“ŸæŽ„ćœ°ć€ïŒŒæ­€æ—¶ćˆ†äș«çš„æ˜Żćș”甚。 + * é»˜èź€ć€Œć€Œäžștrue。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + shareable?: boolean; + /** + * ćŒčć‡șçł»ç»ŸèœŻé”źç›˜æšĄćŒ + * ćŻé€‰ć€ŒïŒšâ€œadjustPan”- ćŒčć‡șèœŻé”źç›˜æ—¶WebviewçȘ—揣è‡ȘćŠšäžŠç§»ïŒŒä»„äżèŻćœ“ć‰èŸ“ć…„æĄ†ćŻè§ïŒ›â€œadjustResize”- è‡ȘćŠšè°ƒæ•ŽWebviewçȘ—ćŁć€§ć°ïŒˆć±ćč•ćŒșćŸŸć‡ćŽ»èœŻé”źç›˜ćŒșćŸŸïŒ‰ïŒŒćŒæ—¶è‡ȘćŠšæ»šćŠšWebviewäżèŻèŸ“ć…„æĄ†ćŻè§ă€‚ + * é»˜èź€ć€Œäžș“adjustPan”。 + * - adjustPan: ćŒčć‡șèœŻé”źç›˜æ—¶WebviewçȘ—揣è‡ȘćŠšäžŠç§»ïŒŒä»„äżèŻćœ“ć‰èŸ“ć…„æĄ†ćŻè§ + * - adjustResize: è‡ȘćŠšè°ƒæ•ŽWebviewçȘ—ćŁć€§ć°ïŒˆć±ćč•ćŒșćŸŸć‡ćŽ»èœŻé”źç›˜ćŒșćŸŸïŒ‰ïŒŒćŒæ—¶è‡ȘćŠšæ»šćŠšWebviewäżèŻèŸ“ć…„æĄ†ćŻè§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + softinputMode?: 'adjustPan' | 'adjustResize'; + /** + * çȘ—ćŁçŠ¶æ€æ æ ·ćŒ + * ä»…ćœšćș”ç”šèźŸçœźäžșæČ‰æ”žćŒçŠ¶æ€æ æ ·ćŒäž‹æœ‰æ•ˆïŒŒèźŸçœźæ­€ć±žæ€§ćŽć°†è‡ȘćŠšäżç•™çł»ç»ŸçŠ¶æ€æ ćŒșćŸŸäžèą«WebviewçȘ—ćŁć ç”šïŒˆćłWebviewçȘ—揣靾æČ‰æ”žćŒæ ·ćŒæ˜Ÿç€șïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + statusbar?: PlusWebviewWebviewStatusbarStyles; + /** + * 漚äč‰çȘ—ćŁçš„ćŽŸç”Ÿć­View控件 + * æ•°ç»„ç±»ćž‹ïŒŒćŻé€šèż‡é…çœźéĄčèźŸçœźćŽŸç”Ÿć­ViewæŽ§ä»¶ïŒŒæŻäžȘé…çœźéĄčćŻčćș”æ·»ćŠ äž€äžȘ掟生歐ViewæŽ§ä»¶ă€‚ + * é€šèż‡WebviewçȘ—ćŁçš„getSubNViews()æ–čæł•ćŻèŽ·ć–ćŽŸç”Ÿć­View控件ćŻčè±Ąæ•°ç»„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + subNViews?: PlusWebview []; + /** + * 漚äč‰çȘ—ćŁçš„æ ‡éą˜æ æŽ§ä»¶æ ·ćŒ + * èźŸçœźæ­€ć±žæ€§ć€Œćˆ™èĄšæ˜Žćˆ›ć»șWebviewçȘ—ćŁçš„æ ‡éą˜æ æŽ§ä»¶ïŒŒćč¶ćŻé€šèż‡ć…¶ć±žæ€§ć€ŒèźŸçœźèƒŒæ™Żéąœè‰Čă€æ–‡æœŹć†…ćźčă€æ–‡æœŹéąœè‰Č等。 + * é€šèż‡WebviewçȘ—ćŁçš„getTitleNView()æ–čæł•ćŻèŽ·ć–æ ‡éą˜æ æŽ§ä»¶ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + titleNView?: PlusWebviewWebviewTitleNViewStyles; + /** + * çȘ—ćŁćž‚ç›Žć‘äž‹çš„ćç§»é‡ + * æ”ŻæŒç™Ÿćˆ†æŻ”ă€ćƒçŽ ć€ŒïŒŒé»˜èź€ć€Œäžș0px。 + * æœȘèźŸçœźtopć±žæ€§ć€Œæ—¶ïŒŒäŒ˜ć…ˆé€šèż‡bottom撌heightć±žæ€§ć€Œæ„èźĄçź—çȘ—ćŁçš„topäœçœźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + top?: string; + /** + * çȘ—揣漹äč‰çȘ—ćŁć˜æąçš„ćŠšç”»æ•ˆæžœ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + transition?: PlusWebviewWebviewTransition; + /** + * çȘ—揣漹äč‰çȘ—ćŁć˜ćœąæ•ˆæžœ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + transform?: PlusWebviewWebviewTransform; + /** + * WebviewçȘ—ćŁçš„æŽ’ç‰ˆäœçœź + * ćœ“WebviewçȘ—ćŁæ·»ćŠ ćˆ°ćŠć€–äž€äžȘçȘ—ćŁäž­æ—¶ïŒŒæŽ’ç‰ˆäœçœźæ‰äŒšç”Ÿæ•ˆïŒŒæŽ’ç‰ˆäœçœźć†łćźšć­çȘ—ćŁćœšçˆ¶çȘ—ćŁäž­çš„ćźšäœæ–čćŒă€‚ + * ćŻć–ć€ŒïŒš"static"ïŒŒæŽ§ä»¶ćœšéĄ”éąäž­æ­ŁćžžćźšäœïŒŒćŠ‚æžœéĄ”éąć­˜ćœšæ»šćŠšæĄćˆ™éšçȘ—ćŁć†…ćźčæ»šćŠšïŒ›"absolute"ïŒŒæŽ§ä»¶ćœšéĄ”éąäž­ç»ćŻčćźšäœïŒŒćŠ‚æžœéĄ”éąć­˜ćœšæ»šćŠšæĄäžéšçȘ—ćŁć†…ćźčæ»šćŠšïŒ›"dock"ïŒŒæŽ§ä»¶ćœšéĄ”éąäž­ćœé ïŒŒćœé çš„äœçœźç”±dockć±žæ€§ć€Œć†łćźšă€‚ + * é»˜èź€ć€Œäžș"absolute"。 + * - static: æŽ§ä»¶ćœšéĄ”éąäž­æ­ŁćžžćźšäœïŒŒćŠ‚æžœéĄ”éąć­˜ćœšæ»šćŠšæĄćˆ™éšçȘ—ćŁć†…ćźčæ»šćŠš + * - absolute: æŽ§ä»¶ćœšéĄ”éąäž­ç»ćŻčćźšäœïŒŒćŠ‚æžœéĄ”éąć­˜ćœšæ»šćŠšæĄäžéšçȘ—ćŁć†…ćźčæ»šćŠš + * - dock: æŽ§ä»¶ćœšéĄ”éąäž­ćœé ïŒŒćœé çš„äœçœźç”±dockć±žæ€§ć€Œć†łćźš + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + position?: 'static' | 'absolute' | 'dock'; + /** + * ç”šæˆ·æ˜ŻćŠćŻé€‰æ‹©ć†…ćźč + * ćŻć–ć€ŒïŒš + * true - èĄšç€șćŻé€‰æ‹©ć†…ćźčïŒŒç”šæˆ·ćŻé€šèż‡é•żæŒ‰æ„é€‰æ‹©éĄ”éąć†…ćźčïŒŒćŠ‚æ–‡æœŹć†…ćźčé€‰æ‹©ćŽćŻä»„ćŒčć‡șçł»ç»Ÿć€ćˆ¶çČ˜èŽŽèœć•ïŒ› + * false - èĄšç€șäžćŻé€‰æ‹©ć†…ćźčïŒŒç”šæˆ·äžćŻé€šèż‡é•żæŒ‰æ„é€‰æ‹©éĄ”éąć†…ćźč。 + * é»˜èź€ć€Œäžștrue。 + * æłšæ„ïŒšćœšWebéĄ”éąäž­ćŻé€šèż‡CSS的user-selectćŻč捕äžȘéĄ”éąć…ƒçŽ èż›èĄŒæŽ§ćˆ¶ïŒŒć‰ææ˜ŻWebviewćŻčè±Ąçš„userSelectèźŸçœźäžștrueïŒŒćŠćˆ™CSSèźŸçœźçš„user-selectć€±æ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + userSelect?: boolean; + /** + * è§†éą‘ć…šć±æ’­æ”Ÿæ—¶çš„æ˜Ÿç€șæ–č搑 + * ćŻć–ć€ŒïŒš + * "auto": è‡ȘćŠšé€‚é…ïŒŒćŠ‚æžœćœ“ć‰éĄ”éąç«–ć±ïŒŒćˆ™ç«–ć±æ˜Ÿç€șïŒ›ćŠ‚æžœćœ“ć‰éĄ”éąæšȘ盘星ç€șïŒŒćˆ™æšȘć±ïŒ›ćŠ‚æžœćœ“ć‰éĄ”éąè‡ȘćŠšæ„Ÿćș”ïŒŒćˆ™è‡ȘćŠšæ„Ÿćș”æšȘç«–ć±ćˆ‡æąă€‚ + * "portrait-primary": ç«–ć±æ­Łæ–čć‘ïŒ› + * "portrait-secondary": ç«–ć±ćæ–čć‘ïŒŒć±ć蕿­Łæ–čć‘æŒ‰éĄșæ—¶é’ˆæ—‹èœŹ180° + * "landscape-primary": æšȘć±æ­Łæ–čć‘ïŒŒć±ć蕿­Łæ–čć‘æŒ‰éĄșæ—¶é’ˆæ—‹èœŹ90° + * "landscape-secondary": æšȘć±æ–čć‘ïŒŒć±ć蕿­Łæ–čć‘æŒ‰éĄșæ—¶é’ˆæ—‹èœŹ270° + * "landscape": æšȘć±æ­Łæ–čć‘æˆ–ćæ–čć‘ïŒŒæ čæźèźŸć€‡é‡ćŠ›æ„Ÿćș”晚è‡ȘćŠšè°ƒæ•ŽïŒ› + * é»˜èź€ć€Œäžș“auto”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + videoFullscreen?: string; + /** + * çȘ—ćŁçš„ćźœćșŠ + * æ”ŻæŒç™Ÿćˆ†æŻ”ă€ćƒçŽ ć€ŒïŒŒé»˜èź€äžș100%。æœȘèźŸçœźwidthć±žæ€§ć€Œæ—¶ïŒŒćŻćŒæ—¶èźŸçœźleft撌rightć±žæ€§ć€Œæ”č揘çȘ—ćŁçš„é»˜èź€ćźœćșŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + width?: string; + /** + * çȘ—ćŁçš„ć †ć éĄșćșć€Œ + * æ‹„æœ‰æ›Žé«˜ć †ć éĄșćșçš„çȘ—ćŁæ€»æ˜ŻäŒšć€„äșŽć †ć éĄșćșèŸƒäœŽçš„çȘ—ćŁçš„ć‰éąïŒŒæ‹„æœ‰ç›žćŒć †ć éĄșćșçš„çȘ—ćŁćŽè°ƒç”šshowæ–čæł•ćˆ™ćœšć‰éąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + zindex?: number; +} + +/** + * 䞀组甚äșŽćźšäč‰éĄ”éąæˆ–æŽ§ä»¶ć˜ćœąçš„ć±žæ€§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewTransform { + /** + * æš‚äžæ”ŻæŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + rotate?: string; + /** + * æš‚äžæ”ŻæŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + translate?: string; + /** + * æš‚äžæ”ŻæŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + scale?: string; + /** + * æš‚äžæ”ŻæŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + skew?: string; + /** + * æš‚äžæ”ŻæŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + matrix?: string; +} + +/** + * 䞀组甚äșŽćźšäč‰éĄ”éąæˆ–æŽ§ä»¶èœŹæąæ•ˆæžœçš„ć±žæ€§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewTransition { + /** + * äș§ç”Ÿć˜æąæ•ˆæžœçš„ć±žæ€§ + * é»˜èź€ć€Œäžș"all"ïŒŒæš‚äžæ”ŻæŒć…¶ćźƒć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + property?: string; + /** + * ć˜æąæŒç»­çš„æ—¶é—Ž + * é»˜èź€ć€Œäžș0ïŒŒćłæ— ćŠšç”»æ•ˆæžœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + duration?: string; + /** + * çȘ—ćŁć˜æąæ•ˆæžœ + * ćŻć–ć€ŒïŒš + * "linear"ïŒšćŒ€é€Ÿć˜ćŒ–ïŒŒćŒ€é€ŸćŠšç”»æ•ˆæžœïŒ› + * "ease-in"ïŒšćŒ€ćŠ é€Ÿć˜ćŒ–ïŒŒé€æžć˜ćż«çš„ćŠšç”»æ•ˆæžœïŒ› + * "ease-out"ïŒšćŒ€ć‡é€Ÿć˜ćŒ–ïŒŒé€æžć˜æ…ąçš„ćŠšç”»æ•ˆæžœïŒ› + * "ease-in-out"ïŒšć…ˆćŠ é€ŸćŽć‡é€Ÿć˜ćŒ–ïŒŒć…ˆć˜ćż«ćŽć˜æ…ąçš„ćŠšç”»æ•ˆæžœă€‚ + * é»˜èź€ć€Œäžș"ease-in-out"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + timingfunction?: string; +} + +/** + * 拊æˆȘWebviewçȘ—ćŁè”„æșèŻ·æ±‚çš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewOverrideResourceOptions { + /** + * ćŒș配需芁拊æˆȘèŻ·æ±‚è”„æșçš„URL朰杀 + * æ”ŻæŒæ­Łćˆ™èĄšèŸŸćŒïŒŒé»˜èź€ć€Œäžșç©ș歗笩äžČïŒˆćłäžæ‹ŠæˆȘïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + match?: string; + /** + * 拊æˆȘé‡ćźšć‘çš„è”„æșćœ°ć€ + * ä»…æ”ŻæŒæœŹćœ°è”„æșćœ°ć€ïŒŒćŠ‚"_www"、"_doc"、"_downloads"、"_documents"ç­‰ćŒ€ć€Žçš„è·ŻćŸ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + redirect?: string; + /** + * é‡ćźšć‘çš„è”„æșæ•°æźç±»ćž‹ + * RFC2045/RFC2046/RFC2047/RFC2048/RFC2049è§„èŒƒäž­ćźšäč‰çš„æ•°æźç±»ćž‹ă€‚ + * ćŠ‚æ™źé€šæ–‡æœŹïŒˆtext/plainïŒ‰ă€PNGć›Ÿćƒ(image/png)、GIFć›Ÿćœą(image/gif)、JPEGć›Ÿćœą(image/jpeg)。 + * ćŠ‚æžœæœȘæŒ‡ćźšmimeç±»ćž‹ïŒŒćˆ™æ čæźé‡ćźšć‘è”„æșè·ŻćŸ„è‡Ș抹ćŒș配。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + mime?: string; + /** + * é‡ćźšć‘çš„è”„æșæ•°æźçŒ–码 + * 橂æœȘèźŸçœźïŒŒćˆ™äœżç”šé»˜èź€ć€Œ"UTF-8"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + encoding?: string; + /** + * èźŸçœźé‡ćźšć‘è”„æșæ•°æźçš„httpć€Žæ•°æź + * ćŻèźŸçœźæ ‡æłšhttpć€Žæ•°æźïŒˆćŠ‚Content-type,äčŸćŻèźŸçœźè‡Ș漚ä艿•°æźă€‚ + * é€šćžžćŻé€šèż‡æ­€ć±žæ€§æ„èźŸçœźæ‹ŠæˆȘ蔄æșçš„çŒ“ć­˜ç­–ç•„ïŒˆćŠ‚Cache-controlïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + header?: any; +} + +/** + * 拊æˆȘWebviewçȘ—揣URLèŻ·æ±‚çš„ć±žæ€§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewOverrideUrlOptions { + /** + * 拊æˆȘURLèŻ·æ±‚ç”Ÿæ•ˆæ—¶æœș + * ćŻć–ć€ŒïŒš + * "instant" - èĄšç€șç«‹ćłç”Ÿæ•ˆïŒŒćłè°ƒç”šoverrideUrlLoadingæ–čæł•ćŽç«‹ćłç”Ÿæ•ˆïŒ› + * "touchstart" - èĄšç€ș甚户操䜜WebviewçȘ—ćŁïŒˆè§Šć‘touchstartäș‹ä»¶ïŒ‰ćŽç”Ÿæ•ˆïŒŒćŠ‚æžœç”šæˆ·æČĄæœ‰æ“äœœWebviewçȘ—ćŁćˆ™äžćŻčURLèŻ·æ±‚æ“äœœèż›èĄŒæ‹ŠæˆȘ怄理。 + * é»˜èź€ć€Œäžș"instant"。 + * - instant: + * ç«‹ćłç”Ÿæ•ˆïŒŒćłè°ƒç”šoverrideUrlLoadingæ–čæł•ćŽç«‹ćłç”Ÿæ•ˆă€‚ + * + * - : + * èĄšç€ș甚户操䜜WebviewçȘ—ćŁïŒˆè§Šć‘touchstartäș‹ä»¶ïŒ‰ćŽç”Ÿæ•ˆă€‚ + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + effect?: 'instant' | ''; + /** + * 拊æˆȘæšĄćŒ + * ćŻć–ć€ŒïŒš + * "allow"èĄšç€șæ»Ąè¶łmatchć±žæ€§ćźšäč‰çš„æĄä»¶æ—¶äžæ‹ŠæˆȘurlç»§ç»­ćŠ èœœïŒŒäžæ»Ąè¶łmatchć±žæ€§ćźšäč‰çš„æĄä»¶æ—¶æ‹ŠæˆȘurlè·łèœŹćč¶è§Šć‘callbackć›žè°ƒïŒ› + * "reject"èĄšç€șæ»Ąè¶łmatchć±žæ€§ćźšäč‰çš„æäș€æ—¶æ‹ŠæˆȘurlè·łèœŹćč¶è§Šć‘callbackć›žè°ƒïŒŒäžæ»Ąè¶łmatchć±žæ€§ćźšäč‰çš„æĄä»¶æ—¶äžæ‹ŠæˆȘurlç»§ç»­ćŠ èœœă€‚ + * é»˜èź€ć€Œäžș"reject"。 + * - allow: + * æ»Ąè¶łmatchć±žæ€§ćźšäč‰çš„æĄä»¶æ—¶äžæ‹ŠæˆȘurlç»§ç»­ćŠ èœœïŒŒäžæ»Ąè¶łmatchć±žæ€§ćźšäč‰çš„æĄä»¶æ—¶æ‹ŠæˆȘurlè·łèœŹćč¶è§Šć‘callbackć›žè°ƒă€‚ + * + * - reject: + * æ»Ąè¶łmatchć±žæ€§ćźšäč‰çš„æäș€æ—¶æ‹ŠæˆȘurlè·łèœŹćč¶è§Šć‘callbackć›žè°ƒïŒŒäžæ»Ąè¶łmatchć±žæ€§ćźšäč‰çš„æĄä»¶æ—¶äžæ‹ŠæˆȘurlç»§ç»­ćŠ èœœă€‚ + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + mode?: 'allow' | 'reject'; + /** + * ćŒșé…æ˜ŻćŠéœ€èŠć€„ç†çš„URLèŻ·æ±‚ + * æ”ŻæŒæ­Łćˆ™èĄšèŸŸćŒïŒŒé»˜èź€ć€ŒäžșćŻč所有URLćœ°ć€ç”Ÿæ•ˆïŒˆç›žćœ“äșŽæ­Łćˆ™èĄšèŸŸćŒâ€œ.*â€ïŒ‰ă€‚ + * ćŠ‚æžœmodeć€Œäžș"allow"ćˆ™ć…èźžćŒș配的URLèŻ·æ±‚è·łèœŹïŒŒmodeć€Œäžș"reject"ćˆ™æ‹ŠæˆȘćŒș配的URLèŻ·æ±‚ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + match?: string; + /** + * 排陀拊æˆȘć€„ç†èŻ·æ±‚ç±»ćž‹ + * 䞍拊æˆȘć€„ç†æŒ‡ćźšç±»ćž‹çš„URLèŻ·æ±‚ïŒŒç›ŽæŽ„äœżç”šçł»ç»Ÿé»˜èź€ć€„ç†é€»èŸ‘ă€‚ + * ćŻć–ć€ŒïŒš + * "none"èĄšç€ș䞍排陀任䜕URLèŻ·æ±‚ïŒˆćłæ‹ŠæˆȘć€„ç†æ‰€æœ‰URLèŻ·æ±‚ïŒ‰ïŒ› + * "redirect"èĄšç€ș排陀拊æˆȘ怄理301/302è·łèœŹçš„èŻ·æ±‚ïŒˆè°šæ…Žäœżç”šïŒŒéža标筟的hrefè§Šć‘çš„URLèŻ·æ±‚ćŻèƒœäŒšèŻŻćˆ€æ–­äžș302è·łèœŹïŒ‰ă€‚ + * é»˜èź€ć€Œäžș"none"。 + * - none: + * 䞍排陀任䜕URLèŻ·æ±‚ïŒˆćłæ‹ŠæˆȘć€„ç†æ‰€æœ‰URLèŻ·æ±‚ïŒ‰ă€‚ + * + * - redirect: + * 排陀拊æˆȘ怄理301/302è·łèœŹçš„èŻ·æ±‚ïŒˆè°šæ…Žäœżç”šïŒŒéža标筟的hrefè§Šć‘çš„URLèŻ·æ±‚ćŻèƒœäŒšèŻŻćˆ€æ–­äžș302è·łèœŹïŒ‰ă€‚ + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + exclude?: 'none' | 'redirect'; +} + +/** + * 监搬WebviewçȘ—ćŁè”„æșćŠ èœœçš„ć±žæ€§ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ +interface PlusWebviewWebviewListenResourceOptions { + /** + * ćŒșé…æ˜ŻćŠéœ€èŠć€„ç†çš„URL蔄æș + * æ”ŻæŒæ­Łćˆ™èĄšèŸŸćŒïŒŒé»˜èź€ć€ŒäžșćŻč所有URL蔄æșèŻ·æ±‚ç”Ÿæ•ˆïŒˆç›žćœ“äșŽæ­Łćˆ™èĄšèŸŸćŒâ€œ.*â€ïŒ‰ă€‚ + * ćŠ‚æžœWebviewćŠ èœœçš„è”„æșćŒșé…æĄä»¶ïŒŒćˆ™è§Šć‘ć›žè°ƒäș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/webview.html](http://www.html5plus.org/doc/zh_cn/webview.html) + */ + match?: string; +} + +/** + * XMLHttpRequestæšĄć—çźĄç†çœ‘ç»œèŻ·æ±‚ïŒŒäžŽæ ‡ć‡†HTML侭的XMLHttpRequestç”šé€”äž€è‡ŽïŒŒć·źćˆ«ćœšäșŽć‰è€…ćŻä»„èż›èĄŒè·šćŸŸèźżé—źă€‚é€šèż‡plus.netćŻèŽ·ć–çœ‘ç»œèŻ·æ±‚çźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ +interface PlusNet { + /** + * è·šćŸŸçœ‘ç»œèŻ·æ±‚ćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + XMLHttpRequest?: PlusNetXMLHttpRequest; + /** + * HTTPèŻ·æ±‚èż›ćșŠäș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + ProgressEvent?: PlusNetProgressEvent; +} + +/** + * è·šćŸŸçœ‘ç»œèŻ·æ±‚ćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ +interface PlusNetXMLHttpRequest { + /** + * HTTP èŻ·æ±‚çš„çŠ¶æ€ + * ćœ“äž€äžȘ XMLHttpRequest ćˆæŹĄćˆ›ć»șæ—¶ïŒŒèż™äžȘć±žæ€§çš„ć€Œä»Ž 0 ćŒ€ć§‹ïŒŒç›Žćˆ°æŽ„æ”¶ćˆ°ćźŒæ•Žçš„ HTTP 操ćș”ïŒŒèż™äžȘć€ŒćąžćŠ ćˆ° 4。 + * 5 äžȘçŠ¶æ€äž­æŻäž€äžȘ郜有䞀äžȘç›žć…łè”çš„éžæ­ŁćŒçš„ćç§°ïŒŒäž‹èĄšćˆ—ć‡șäș†çŠ¶æ€ă€ćç§°ć’Œć«äč‰ïŒš + * 0 UninitializedæœȘćˆć§‹ćŒ–çŠ¶æ€ă€‚XMLHttpRequestćŻčè±Ąć·Č戛ć»ș或ć·Čèą«abort()æ–čæł•é‡çœźă€‚ + * 1 Openopen()æ–čæł•ć·Čè°ƒç”šïŒŒäœ†æ˜Żsend()æ–čæł•æœȘè°ƒç”šă€‚èŻ·æ±‚èż˜æČĄæœ‰èą«ć‘送。 + * 2 Sentsend()æ–čæł•ć·Č调甚HTTP èŻ·æ±‚ć·Č揑送戰WebæœćŠĄć™šă€‚æœȘæŽ„æ”¶ćˆ°ć“ćș”。 + * 3 ReceivingïŒŒæ‰€æœ‰ć“ćș”ć€Žéƒšéƒœć·Čç»æŽ„æ”¶ćˆ°ă€‚ć“ćș”äœ“ćŒ€ć§‹æŽ„收䜆æœȘćźŒæˆă€‚ + * 4 LoadedHTTP操ćș”ć·Čç»ćźŒć…šæŽ„æ”¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + readyState?: number; + /** + * èŻ·æ±‚ä»ŽæœćŠĄć™šæŽ„æ”¶ćˆ°çš„ć“ćș”æ•°æź + * ćŠ‚æžœæČĄæœ‰ä»ŽæœćŠĄć™šæŽ„æ”¶ćˆ°æ•°æźïŒŒćˆ™äžșnull + * 搩戙æ čæźresponseTypeç±»ćž‹ć†łćźšïŒš + * ćŠ‚æžœresponseTypeèźŸçœźäžșç©ș歗笩äžČ或"text"ïŒŒćˆ™èż”ć›žç©ș歗笩äžČ + * ćŠ‚æžœresponseTypeèźŸçœźäžș"document"ïŒŒćˆ™èż”ć›žDocumentćŻčè±ĄïŒ› + * ćŠ‚æžœresponseTypeèźŸçœźäžș"json"ïŒŒćˆ™èż”ć›žJSONćŻčè±ĄïŒ› + * è‹„æœćŠĄć™šèż”ć›žçš„æ•°æźäžŽèźŸçœźçš„responseTypeç±»ćž‹äžćŒșé…ïŒŒćˆ™èż”ć›žnull。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + response?: string; + /** + * èŻ·æ±‚ä»ŽæœćŠĄć™šæŽ„æ”¶ćˆ°çš„ć“ćș”æ•°æźïŒˆć­—çŹŠäžČæ•°æźïŒ‰ + * ćŠ‚æžœèż˜æČĄæœ‰æŽ„æ”¶ćˆ°æ•°æźçš„èŻïŒŒæ­€ć±žæ€§ć€Œäžșç©ș歗笩äžČ + * ćŠ‚æžœreadyState氏äșŽ3ïŒŒæ­€ć±žæ€§ć€Œäžșç©ș歗笩äžČ + * ćŠ‚æžœreadyStateäžș3ïŒŒæ­€ć±žæ€§ć€Œèż”ć›žç›źć‰ć·Č经掄收的HTTP操ćș”éƒšćˆ†æ•°æźć€ŒïŒ› + * ćŠ‚æžœreadyStateäžș4ïŒŒæ­€ć±žæ€§ć€Œäżć­˜äș†ćꌿ•Žçš„HTTP操ćș”æ•°æźäœ“ă€‚ + * ćŠ‚æžœHTTPèŻ·æ±‚èż”ć›žçš„æ•°æźć€Žäž­ćŒ…ć«äș†Content-Typeć€Œäž­æŒ‡ćźšć­—çŹŠçŒ–ç ïŒŒć°±äœżç”šèŻ„çŒ–ç ïŒŒćŠćˆ™ïŒŒäœżç”šUTF-8歗笩集。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + responseText?: string; + /** + * èŻ·æ±‚ć“ćș”æ•°æźresponse的类枋 + * é»˜èź€ć€Œäžșç©ș歗笩äžČïŒŒćłreponseäžșStringïŒŒç±»ćž‹ćŻèźŸçœźïŒš"document"èĄšç€șDocumentćŻčè±ĄïŒŒ"json"èĄšç€șJSONćŻčè±ĄïŒŒ"text"èĄšç€ș歗笩äžČ。 + * æ­€ć€Œćż…éĄ»ćœšè°ƒç”šsendæ–čæł•äč‹ć‰èźŸçœźïŒŒćŠćˆ™èźŸçœźçš„ć€Œäžç”Ÿæ•ˆïŒŒä»äœżç”šäč‹ć‰èźŸçœźçš„ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + responseType?: string; + /** + * èŻ·æ±‚ć“ćș”çš„DocumentćŻčè±Ą + * ćŻčèŻ·æ±‚çš„ć“ćș”ïŒŒè§Łæžäžș XML ćč¶äœœäžș Document ćŻčè±Ąèż”ć›žă€‚ + * ćŠ‚æžœèŻ·æ±‚æœȘæˆćŠŸïŒŒæˆ–ć“ćș”çš„æ•°æźæ— æł•èą«è§ŁæžäžșXMLïŒŒćˆ™èż”ć›žnull。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + responseXML?: string; + /** + * æœćŠĄć™šèż”ć›žçš„HTTPçŠ¶æ€ä»Łç  + * æœćŠĄć™šèż”ć›žçš„HTTPçŠ¶æ€ä»Łç ïŒŒćŠ‚200èĄšç€șæˆćŠŸïŒŒè€Œ404èĄšç€ș"Not Found"é”™èŻŻïŒ› + * ćœ“readyState氏äșŽ3çš„æ—¶ć€™æ­€ć±žæ€§ć€Œäžș0。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + status?: number; + /** + * æœćŠĄć™šèż”ć›žçš„HTTPçŠ¶æ€æèż° + * æ­€ć±žæ€§ć€Œç”šćç§°è€Œäžæ˜Żæ•°ć­—æŒ‡ćźšäș†èŻ·æ±‚çš„HTTPçš„çŠ¶æ€ä»Łç ă€‚ + * äčŸć°±æ˜ŻèŻŽïŒŒćœ“çŠ¶æ€äžș200çš„æ—¶ć€™ćźƒæ˜Ż"OK"ïŒ›ćœ“çŠ¶æ€äžș404çš„æ—¶ć€™ćźƒæ˜Ż"Not Found"。 + * 撌statusć±žæ€§ç±»äŒŒïŒŒćœ“readyState氏äșŽ3çš„æ—¶ć€™èŻ»ć–èż™äž€ć±žæ€§äŒšèż”ć›žç©ș歗笩äžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + statusText?: string; + /** + * èŻ·æ±‚æœćŠĄć™šçš„è¶…æ—¶æ—¶é—ŽïŒŒć•äœäžșæŻ«ç§’ïŒˆms + * æ•°ć€Œç±»ćž‹ïŒŒć•äœäžșmsïŒŒć…¶é»˜èź€ć€Œäžș120秒。 + * è¶…æ—¶æ—¶é—ŽäžșæœćŠĄć™šć“ćș”èŻ·æ±‚çš„æ—¶é—ŽïŒˆäžæ˜ŻHttpèŻ·æ±‚ćźŒæˆçš„æ€»æ—¶é—ŽïŒ‰ïŒŒćŠ‚æžœèźŸçœźäžș0ćˆ™èĄšç€șæ°žèżœäžè¶…æ—¶ă€‚ + * ćż…éĄ»ćœšèŻ·æ±‚ć‘è”·ć‰èźŸçœźïŒŒćŠćˆ™ćœ“ć‰èŻ·æ±‚ć°†äžç”Ÿæ•ˆïŒŒćœšćœ“ć‰èŻ·æ±‚ćźŒæˆćŽé‡æ–°ć‘è”·æ–°èŻ·æ±‚æ—¶ç”Ÿæ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + timeout?: number; + /** + * æ˜ŻćŠæ”ŻæŒè·šćŸŸèŻ·æ±‚ + * æ­€ćŻčè±Ąćˆ›ć»ș的HTTPèŻ·æ±‚éƒœæ”ŻæŒè·šćŸŸïŒŒæ‰€ä»„æ°žèżœèż”ć›žtrue。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + withCredentials?: boolean; + /** + * çœ‘ç»œèŻ·æ±‚çŠ¶æ€ć‘ç”Ÿć˜ćŒ–äș‹ä»¶ + * çœ‘ç»œèŻ·æ±‚çŠ¶æ€ć‘ç”Ÿć˜ćŒ–æ—¶è§Šć‘ïŒŒé€šćžžćœšć‡œæ•°äž­ćˆ€æ–­ćŻčè±Ąçš„stateć±žæ€§ć€Œæ„èŽ·ć–ćœ“ć‰èŻ·æ±‚çš„çŠ¶æ€ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + onreadystatechange?: () => void; + /** + * çœ‘ç»œèŻ·æ±‚ćŒ€ć§‹äș‹ä»¶ + * é€šćžžćœšè°ƒç”šsendæ–čæł•ćŒ€ć§‹ć‘è”·HTTPèŻ·æ±‚æ—¶è§Šć‘ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + onloadstart?: (result: PlusNetProgressEvent) => void; + /** + * çœ‘ç»œèŻ·æ±‚äŒ èŸ“æ•°æźäș‹ä»¶ + * 通澾朹HTTPèŻ·æ±‚é“ŸæŽ„ć·Č经ć»șç«‹ïŒŒćŒ€ć§‹äŒ èŸ“æ•°æźæ—¶è§Šć‘ïŒŒćœšæ•°æźäŒ èŸ“çš„èż‡çš‹äž­ćŻèƒœć€šæŹĄè§Šć‘ïŒŒæ­€äș‹ä»¶äžŽonreadystatechangeäș‹ä»¶è§Šć‘状态3ç±»äŒŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + onprogress?: (result: PlusNetProgressEvent) => void; + /** + * çœ‘ç»œèŻ·æ±‚ć–æ¶ˆäș‹ä»¶ + * é€šćžžćœšè°ƒç”šabortæ–čæł•ć–æ¶ˆHTTPèŻ·æ±‚æ—¶è§Šć‘ă€‚ + * æ­€äș‹ä»¶ćœšonreadystatechangeäș‹ä»¶è§Šć‘状态4äș‹ä»¶äč‹ćŽă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + onabort?: (result: PlusNetProgressEvent) => void; + /** + * çœ‘ç»œèŻ·æ±‚é”™èŻŻäș‹ä»¶ + * 通澾朹HTTPèŻ·æ±‚ć‘ç”Ÿé”™èŻŻæ—¶è§Šć‘ïŒŒćŠ‚æ— æł•èżžæŽ„ćˆ°æœćŠĄć™šç­‰ć„ç§é”™èŻŻéƒœè§Šć‘æ­€äș‹ä»¶ă€‚ + * æ­€äș‹ä»¶ćœšonreadystatechangeäș‹ä»¶è§Šć‘状态4äș‹ä»¶äč‹ćŽă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + onerror?: (result: PlusNetProgressEvent) => void; + /** + * çœ‘ç»œèŻ·æ±‚æˆćŠŸäș‹ä»¶ + * 通澾朹HTTPèŻ·æ±‚æˆćŠŸćźŒæˆæ—¶è§Šć‘ïŒŒćŠ‚æžœHTTPèŻ·æ±‚ć‘ç”Ÿé”™èŻŻćˆ™äžè§Šć‘æ­€äș‹ä»¶ă€‚ + * æ­€äș‹ä»¶ćœšonreadystatechangeäș‹ä»¶è§Šć‘状态4äș‹ä»¶äč‹ćŽă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + onload?: (result: PlusNetProgressEvent) => void; + /** + * çœ‘ç»œèŻ·æ±‚è¶…æ—¶äș‹ä»¶ + * 通澾朹HTTPèŻ·æ±‚è¶…æ—¶æ—¶è§Šć‘ïŒŒæ­€æ—¶äžäŒšè§Šć‘onerroräș‹ä»¶ă€‚ + * æ­€äș‹ä»¶ćœšonreadystatechangeäș‹ä»¶è§Šć‘状态4äș‹ä»¶äč‹ćŽă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + ontimeout?: (result: PlusNetProgressEvent) => void; + /** + * çœ‘ç»œèŻ·æ±‚ç»“æŸäș‹ä»¶ + * 通澾朹HTTPèŻ·æ±‚ç»“æŸæ—¶è§Šć‘ïŒŒäžçźĄæ˜ŻHTTPèŻ·æ±‚ć€±èŽ„ă€æˆćŠŸă€æˆ–è¶…æ—¶äč‹ćŽéƒœäŒšè§Šć‘æ­€äș‹ä»¶ă€‚ + * æ­€äș‹ä»¶ćœšonreadystatechangeäș‹ä»¶è§Šć‘状态4äș‹ä»¶äč‹ćŽă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + onloadend?: (result: PlusNetProgressEvent) => void; + /** + * ć–æ¶ˆćœ“ć‰ć“ćș”ïŒŒć…łé—­èżžæŽ„ćč¶äž”结束任䜕æœȘć†łçš„çœ‘ç»œæŽ»ćŠš + * æ­€æ–čæł•把XMLHttpRequestćŻčè±Ąé‡çœźäžșreadyStateäžș0的状态ćč¶äž”ć–æ¶ˆæ‰€æœ‰æœȘć†łçš„çœ‘ç»œæŽ»ćŠšă€‚ + * 调甚歀æ–čæł•ćŽć°†ćœæ­ąè§Šć‘XMLHttpRequestćŻčè±Ąçš„æ‰€æœ‰äș‹ä»¶ă€‚ + * äŸ‹ćŠ‚ïŒŒćŠ‚æžœèŻ·æ±‚ç”šäș†ć€Șé•żæ—¶é—ŽïŒŒè€Œäž”ć“ćș”äžć†ćż…èŠçš„æ—¶ć€™ïŒŒćŻä»„è°ƒç”šèż™äžȘæ–čæł•。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + abort(): void; + /** + * èŽ·ć–HTTP操ćș”ć€ŽéƒšäżĄæŻ + * 把HTTP操ćș”ć€ŽéƒšäœœäžșæœȘè§Łæžçš„ć­—çŹŠäžČèż”ć›žă€‚ ćŠ‚æžœreadyState氏äșŽ3ïŒŒèż™äžȘæ–čæł•èż”ć›žnull。 + * ćŠćˆ™ïŒŒćźƒèż”ć›žæœćŠĄć™šć‘é€çš„æ‰€æœ‰ HTTP 操ćș”çš„ć€Žéƒšă€‚ć€Žéƒšäœœäžș捕äžȘ的歗笩äžČèż”ć›žïŒŒäž€èĄŒäž€äžȘć€Žéƒšă€‚æŻèĄŒç”šæąèĄŒçŹŠ"\r\n"éš”ćŒ€ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + getAllResponseHeaders(): string; + /** + * èŽ·ć–æŒ‡ćźšçš„HTTP操ćș”ć€Žéƒšçš„ć€Œ + * ć…¶ć‚æ•°æ˜ŻèŠèż”ć›žçš„ HTTP 操ćș”ć€Žéƒšçš„ćç§°ă€‚ćŻä»„äœżç”šä»»äœ•ć€§ć°ć†™æ„ćˆ¶ćźšèż™äžȘć€Žéƒšćć­—ïŒŒć’Œć“ćș”ć€Žéƒšçš„æŻ”èŸƒæ˜ŻäžćŒșćˆ†ć€§ć°ć†™çš„ă€‚ + * èŻ„æ–čæł•çš„èż”ć›žć€Œæ˜ŻæŒ‡ćźšçš„ HTTP 操ćș”ć€Žéƒšçš„ć€ŒïŒŒćŠ‚æžœæČĄæœ‰æŽ„æ”¶ćˆ°èż™äžȘć€Žéƒšæˆ–è€…readyState氏äșŽ3戙äžșç©ș歗笩äžČ。 + * ćŠ‚æžœæŽ„æ”¶ćˆ°ć€šäžȘæœ‰æŒ‡ćźšćç§°çš„ć€ŽéƒšïŒŒèż™äžȘć€Žéƒšçš„ć€Œèą«èżžæŽ„è”·æ„ćč¶èż”ć›žïŒŒäœżç”šé€—ć·ć’Œç©șæ Œćˆ†éš”ćŒ€ć„äžȘć€Žéƒšçš„ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + getResponseHeader(headerName?: string): string; + /** + * 戝構挖HTTPèŻ·æ±‚ć‚æ•°ïŒŒäŸ‹ćŠ‚URL撌HTTPæ–čæł•ïŒŒäœ†æ˜Żćč¶äžć‘é€èŻ·æ±‚ + * èż™äžȘæ–čæł•ćˆć§‹ćŒ–èŻ·æ±‚ć‚æ•°ä»„äŸ› send() æ–čæł•çšćŽäœżç”šă€‚ćźƒæŠŠreadyStateèźŸçœźäžș1ïŒŒćˆ é™€äč‹ć‰æŒ‡ćźšçš„æ‰€æœ‰èŻ·æ±‚ć€ŽéƒšïŒŒä»„ćŠäč‹ć‰æŽ„æ”¶çš„æ‰€æœ‰ć“ćș”ć€ŽéƒšïŒŒćč¶äž”把responseText、responseXML、status ä»„ćŠ statusText ć‚æ•°èźŸçœźäžșćźƒä»Źçš„é»˜èź€ć€Œă€‚ + * ćœ“readyStateäžș0çš„æ—¶ć€™ïŒˆćœ“XMLHttpRequestćŻčè±Ąćˆšćˆ›ć»ș或者abort()æ–čæł•è°ƒç”šćŽïŒ‰ä»„ćŠćœ“readyStateäžș4时ć·Čç»æŽ„æ”¶ć“ćș”æ—¶ïŒ‰ïŒŒè°ƒç”šèż™äžȘæ–čæł•æ˜Żćź‰ć…šçš„ă€‚ + * ćœ“é’ˆćŻčä»»äœ•ć…¶ä»–çŠ¶æ€è°ƒç”šçš„æ—¶ć€™ïŒŒopen()æ–čæł•çš„èĄŒäžșæ˜ŻäžșæŒ‡ćźšçš„ă€‚ + * 陀äș†äżć­˜äŸ›send()æ–čæł•äœżç”šçš„èŻ·æ±‚ć‚æ•°ïŒŒä»„ćŠé‡çœź XMLHttpRequest ćŻčè±Ąä»„äŸżć€ç”šïŒŒopen()æ–čæł•æČĄæœ‰ć…¶ä»–çš„èĄŒäžș。 + * 芁ç‰čćˆ«æłšæ„ïŒŒćœ“èż™äžȘæ–čæł•è°ƒç”šçš„æ—¶ć€™ïŒŒćźžçŽ°é€šćžžäžäŒšæ‰“ćŒ€äž€äžȘ戰WebæœćŠĄć™šçš„çœ‘ç»œèżžæŽ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + open(method?: string, url?: string, username?: string, password?: string): void; + /** + * é‡ć†™æœćŠĄć™šèż”ć›žçš„MIME类枋 + * æ­€æ–čæł•芆盖HTTPèŻ·æ±‚èż”ć›žæ•°æźć€Ž"Content-Type"ć­—æź”ć€Œäž­ćŒ…ć«çš„IMIEç±»ćž‹ïŒŒćŠ‚æžœèźŸçœźçš„MIMEç±»ćž‹æ— æ•ˆćˆ™ç»§ç»­äœżç”š"Content-Type"ć­—æź”ć€Œäž­ćŒ…ć«çš„IMIE类枋。 + * ćŠ‚æžœMIMEç±»ćž‹äž­æŒ‡ćźšäș†ć­—çŹŠé›†ç±»ćž‹ïŒˆcharsetïŒ‰ïŒŒćˆ™éœ€æŒ‰ç…§æŒ‡ćźšçš„ć­—çŹŠé›†ç±»ćž‹ćŻčæŽ„æ”¶ćˆ°çš„æ•°æźäœ“ïŒˆresposeïŒ‰èż›èĄŒć€„ç†ïŒŒćŠćˆ™é»˜èź€äžșUTF-8歗笩集。 + * æłšæ„ïŒšæ­€æ–čæł•éœ€ćœšsendæ–čæł•ć‰è°ƒç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + overrideMimeType(mime?: string): void; + /** + * 揑送HTTPèŻ·æ±‚ + * æ­€æ–čæł•è§Šć‘HTTPèŻ·æ±‚ć‘é€ïŒŒćŠ‚æžœäč‹ć‰æČĄæœ‰è°ƒç”šopen()ïŒŒæˆ–è€…æ›Žć…·äœ“ćœ°èŻŽïŒŒćŠ‚æžœreadyStateäžæ˜Ż1send()抛ć‡ș侀äžȘćŒ‚ćžžă€‚ćŠćˆ™ïŒŒć°†ć‘é€HTTPèŻ·æ±‚ïŒŒèŻ„èŻ·æ±‚ç”±ä»„äž‹ć‡ éƒšćˆ†ç»„æˆïŒš + * äč‹ć‰è°ƒç”šopen()æ—¶æŒ‡ćźšçš„HTTPæ–čæł•、URL + * äč‹ć‰è°ƒç”šsetRequestHeader()æ—¶æŒ‡ćźšçš„èŻ·æ±‚ć€ŽéƒšïŒˆćŠ‚æžœæœ‰çš„èŻïŒ‰ïŒ› + * äŒ é€’ç»™èż™äžȘæ–čæł•çš„bodyć‚æ•°ă€‚ + * äž€æ—ŠèŻ·æ±‚ć‘é€äș†ïŒŒsend()把readyStateèźŸçœźäžș2ćč¶è§Šć‘onreadystatechangeäș‹ä»¶ïŒ› + * ćŠ‚æžœæœćŠĄć™šć“ćș”ćžŠæœ‰äž€äžȘHTTPé‡ćźšć‘ïŒŒsend()æ–čæł•ćœšćŽć°çșżçš‹è‡ȘćŠšé”ä»Žé‡ćźšć‘ïŒ› + * ćœ“æ‰€æœ‰çš„HTTP操ćș”ć€Žéƒšć·Č经掄收send()æˆ–ćŽć°çșżçš‹æŠŠreadyStateèźŸçœźäžș3ćč¶è§Šć‘onreadystatechangeäș‹ä»¶ïŒ› + * ćŠ‚æžœć“ćș”èŸƒé•żïŒŒsend()æˆ–ćŽć°çșżçš‹ćŻèƒœćœšçŠ¶æ€3äž­è§Šć‘ć€šæŹĄonreadystatechangeäș‹ä»¶ïŒ› + * æœ€ćŽïŒŒćœ“ć“ćș”ćꌿˆïŒŒsend()æˆ–ćŽć°çșżçš‹æŠŠreadyStateèźŸçœźäžș4ćč¶æœ€ćŽäž€æŹĄè§Šć‘onreadystatechangeäș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + send(body?: string): void; + /** + * æŒ‡ćźšäž€äžȘHTTPèŻ·æ±‚çš„Header + * Http的Headerćș”èŻ„ćŒ…ć«ćœšé€šèż‡ćŽç»­send()è°ƒç”šè€Œć‘è”·çš„èŻ·æ±‚äž­ă€‚ + * æ­€æ–čæł•ćȘæœ‰ćœ“readyStateäžș1çš„æ—¶ć€™æ‰èƒœè°ƒç”šïŒŒäŸ‹ćŠ‚ïŒŒćœšè°ƒç”šäș†open()äč‹ćŽïŒŒäœ†ćœšè°ƒç”šsend()äč‹ć‰ă€‚ + * ćŠ‚æžœćžŠæœ‰æŒ‡ćźšćç§°çš„ć€Žéƒšć·Čç»èą«æŒ‡ćźšäș†ïŒŒèż™äžȘć€Žéƒšçš„æ–°ć€Œć°±æ˜ŻïŒšäč‹ć‰æŒ‡ćźšçš„ć€ŒïŒŒćŠ äžŠé€—ć·ă€ä»„ćŠèż™äžȘè°ƒç”šæŒ‡ćźšçš„ć€ŒïŒˆćœąæˆäž€äžȘæ•°ç»„ïŒ‰ă€‚ + * ćŠ‚æžœWebæœćŠĄć™šć·Čç»äżć­˜äș†ć’ŒäŒ é€’ç»™open()的URLç›žć…łè”çš„cookieïŒŒé€‚ćœ“çš„Cookie或Cookie2怎郚äčŸè‡ȘćŠšćœ°ćŒ…ć«ćˆ°èŻ·æ±‚äž­ïŒŒćŻä»„é€šèż‡è°ƒç”šsetRequestHeader()æ„æŠŠèż™äș›cookieæ·»ćŠ ćˆ°ć€Žéƒšă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + setRequestHeader(headerName?: string, headerValue?: string): void; +} + +/** + * HTTPèŻ·æ±‚èż›ćșŠäș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ +interface PlusNetProgressEvent { + /** + * äș‹ä»¶çš„ç›źæ ‡ćŻčè±Ą + * 通矄HTTPèŻ·æ±‚èż›ćșŠäș‹ä»¶çš„XMLHttpRequestćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + target?: PlusNetXMLHttpRequest; + /** + * èż›ćșŠäżĄæŻæ˜ŻćŠćŻèźĄçź— + * HTTPèŻ·æ±‚èż›ćșŠäżĄæŻæ˜ŻćŠæœ‰æ•ˆïŒŒćŠ‚æžœHTTPèŻ·æ±‚ć€Žäž­ćŒ…ć«Content-Lengthć€ŽäżĄæŻćˆ™äžștrueïŒŒćŠćˆ™äžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + lengthComputable?: number; + /** + * ćœ“ć‰ć·Čç»æŽ„æ”¶ćˆ°çš„æ•°æźé•żćșŠ + * HTTPèŻ·æ±‚æŽ„æ”¶ćˆ°çš„æ•°æźé•żćșŠïŒŒć•䜍äžșć­—èŠ‚ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + loaded?: number; + /** + * æ€»æ•°æźé•żćșŠ + * HTTPèŻ·æ±‚èż”ć›žçš„æ€»æ•°æźé•żćșŠïŒŒć•䜍äžșć­—èŠ‚ă€‚ + * ćŠ‚æžœæ— æł•èŽ·ć–ćˆ™èźŸçœźäžș0。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/net.html](http://www.html5plus.org/doc/zh_cn/net.html) + */ + total?: number; +} + +/** + * ZipæšĄć—çźĄç†æ–‡ä»¶ćŽ‹çŒ©ć’Œè§ŁćŽ‹ïŒŒé€šèż‡plus.zipćŻèŽ·ć–ćŽ‹çŒ©çźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ +interface PlusZip { + /** + * JSONćŻčè±ĄïŒŒé…çœźć›Ÿç‰‡ćŽ‹çŒ©èœŹæąçš„ć‚æ•° + * èźŸçœźwidth/heightć±žæ€§ćˆ™èĄšç€ș需ćŻčć›Ÿç‰‡èż›èĄŒçŒ©æ”ŸèœŹæąæ“äœœïŒ› + * èźŸçœźrotateć±žæ€§ćˆ™èĄšç€ș需ćŻčć›Ÿç‰‡èż›èĄŒæ—‹èœŹèœŹæąæ“äœœïŒ› + * èźŸçœźclipć±žæ€§ćˆ™èĄšç€ș需ćŻčć›Ÿç‰‡èż›èĄŒèŁć‰ȘèœŹæąæ“äœœïŒ› + * ćŠ‚ćŒæ—¶èźŸçœźäș†ć€šäžȘèœŹæąæ“äœœïŒŒćˆ™æŒ‰çŒ©æ”Ÿă€æ—‹èœŹă€èŁć‰ȘéĄșćșèż›èĄŒæ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + CompressImageOptions?: PlusZipCompressImageOptions; + /** + * JSONćŻčè±ĄïŒŒć›Ÿç‰‡èŁć‰ȘćŒșćŸŸçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + ClipImageOptions?: PlusZipClipImageOptions; + /** + * ćŽ‹çŒ©ç”ŸæˆZip文件 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + compress(src?: string, zipfile?: string, successCB?: () => void, errorCB?: (result: any) => void): void; + /** + * è§ŁćŽ‹çŒ©Zip文件 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + decompress(zipfile?: string, target?: string, successCB?: () => void, errorCB?: (result: any) => void): void; + /** + * ć›Ÿç‰‡ćŽ‹çŒ©èœŹæą + * 揯甹äșŽć›Ÿç‰‡çš„èŽšé‡ćŽ‹çŒ©ă€ć€§ć°çŒ©æ”Ÿă€æ–čć‘æ—‹èœŹă€ćŒșćŸŸèŁć‰Șă€æ ŒćŒèœŹæąç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + compressImage(options?: PlusZipCompressImageOptions, successCB?: (result: any) => void, errorCB?: (result: any) => void): void; +} + +/** + * JSONćŻčè±ĄïŒŒé…çœźć›Ÿç‰‡ćŽ‹çŒ©èœŹæąçš„ć‚æ•° + * èźŸçœźwidth/heightć±žæ€§ćˆ™èĄšç€ș需ćŻčć›Ÿç‰‡èż›èĄŒçŒ©æ”ŸèœŹæąæ“äœœïŒ› + * èźŸçœźrotateć±žæ€§ćˆ™èĄšç€ș需ćŻčć›Ÿç‰‡èż›èĄŒæ—‹èœŹèœŹæąæ“äœœïŒ› + * èźŸçœźclipć±žæ€§ćˆ™èĄšç€ș需ćŻčć›Ÿç‰‡èż›èĄŒèŁć‰ȘèœŹæąæ“äœœïŒ› + * ćŠ‚ćŒæ—¶èźŸçœźäș†ć€šäžȘèœŹæąæ“äœœïŒŒćˆ™æŒ‰çŒ©æ”Ÿă€æ—‹èœŹă€èŁć‰ȘéĄșćșèż›èĄŒæ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ +interface PlusZipCompressImageOptions { + /** + * ćŽ‹çŒ©èœŹæąćŽŸć§‹ć›Ÿç‰‡çš„è·ŻćŸ„ + * æ”ŻæŒä»„äž‹ć›Ÿç‰‡è·ŻćŸ„ïŒš + * 盾ćŻčè·ŻćŸ„ - 盾ćŻčäșŽćœ“ć‰éĄ”靱的hostäœçœźïŒŒćŠ‚"a.jpg"ïŒŒæłšæ„ćœ“ć‰éĄ”éąäžșçœ‘ç»œćœ°ć€ćˆ™äžæ”ŻæŒïŒ› + * 绝ćŻčè·ŻćŸ„ - çł»ç»Ÿç»ćŻčè·ŻćŸ„ïŒŒćŠ‚Androidćčłć°"/storage/sdcard0/Android/data/io.dcloud.HBuilder/.HBuilder/apps/HBuilder/www/.jpg"iOSćčłć°"/var/mobile/Containers/Data/Application/757966CF-345C-4348-B07F-EEF83CF9A369/Library/Pandora/apps/HBuilder/www/a.png" + * 盾ćŻčè·ŻćŸ„URL(RelativeURL) - 仄"_"ćŒ€ć€Žçš„ç›žćŻčè·ŻćŸ„ïŒŒćŠ‚"_www/a.jpg"、"_doc/b.jpg"、"_documents/c.jpg"、"_downloads/d.jpg" + * æœŹćœ°è·ŻćŸ„URL - 仄“file://â€ćŒ€ć€ŽïŒŒćŽéąè·Ÿéšçł»ç»Ÿç»ćŻčè·ŻćŸ„ă€‚ + * - _www/: ćș”甚蔄æșç›źćœ• + * - _doc/: ćș”ç”šç§æœ‰æ–‡æĄŁç›źćœ• + * - _documents/: ć…±äș«æ–‡æĄŁç›źćœ• + * - _downloads/: ć…±äș«äž‹èœœç›źćœ• + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + src?: '_www/' | '_doc/' | '_documents/' | '_downloads/'; + /** + * ćŽ‹çŒ©èœŹæąç›źæ ‡ć›Ÿç‰‡çš„è·ŻćŸ„ + * æ”ŻæŒä»„äž‹ć›Ÿç‰‡è·ŻćŸ„ïŒš + * 绝ćŻčè·ŻćŸ„ - çł»ç»Ÿç»ćŻčè·ŻćŸ„ïŒŒćŠ‚Androidćčłć°"/storage/sdcard0/Android/data/io.dcloud.HBuilder/.HBuilder/apps/HBuilder/doc/.jpg"iOSćčłć°"/var/mobile/Containers/Data/Application/757966CF-345C-4348-B07F-EEF83CF9A369/Library/Pandora/apps/HBuilder/doc/a.png" + * 盾ćŻčè·ŻćŸ„URL(RelativeURL) - 仄"_"ćŒ€ć€Žçš„ç›žćŻčè·ŻćŸ„ïŒŒćŠ‚"_doc/b.jpg"、"_documents/c.jpg"、"_downloads/d.jpg"ïŒŒæłšæ„äžæ”ŻæŒ"_www"ćŒ€ć€Žçš„è·ŻćŸ„ïŒ› + * æœŹćœ°è·ŻćŸ„URL - 仄“file://â€ćŒ€ć€ŽïŒŒćŽéąè·Ÿéšçł»ç»Ÿç»ćŻčè·ŻćŸ„ă€‚ + * æłšæ„ïŒšćŠ‚æžœèźŸçœźçš„è·ŻćŸ„æ— æƒé™èźżé—źïŒŒćˆ™èż”ć›žć€±èŽ„ă€‚ + * - _doc/: ćș”ç”šç§æœ‰æ–‡æĄŁç›źćœ• + * - _documents/: ć…±äș«æ–‡æĄŁç›źćœ• + * - _downloads/: ć…±äș«äž‹èœœç›źćœ• + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + dst?: '_doc/' | '_documents/' | '_downloads/'; + /** + * 芆盖生成新文件 + * ä»…ćœšdstćˆ¶ćźšçš„è·ŻćŸ„æ–‡ä»¶ć­˜ćœšæ—¶æœ‰æ•ˆïŒš + * trueèĄšç€șèŠ†ç›–ć­˜ćœšçš„æ–‡ä»¶ïŒ› + * falseèĄšç€șäžèŠ†ç›–ïŒŒćŠ‚æžœæ–‡ä»¶ć­˜ćœšïŒŒćˆ™èż”ć›žć€±èŽ„ă€‚ + * é»˜èź€ć€Œäžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + overwrite?: boolean; + /** + * ćŽ‹çŒ©èœŹæąćŽçš„ć›Ÿç‰‡æ ŒćŒ + * æ”ŻæŒ"jpg"、"png",ćŠ‚æžœæœȘæŒ‡ćźšćˆ™äœżç”šæșć›Ÿç‰‡çš„æ ŒćŒă€‚ + * - jpg: JPGæ ŒćŒć›Ÿç‰‡ + * - png: PNGæ ŒćŒć›Ÿç‰‡ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + format?: 'jpg' | 'png'; + /** + * ćŽ‹çŒ©ć›Ÿç‰‡çš„èŽšé‡ + * ć–ć€ŒèŒƒć›Žäžș1-1001èĄšç€șäœżç”šæœ€äœŽçš„ć›Ÿç‰‡èŽšé‡ïŒˆèœŹæąćŽçš„ć›Ÿç‰‡æ–‡ä»¶æœ€ć°ïŒ‰ă€100èĄšç€șäœżç”šæœ€é«˜çš„ć›Ÿç‰‡èŽšé‡ïŒˆèœŹæąćŽçš„ć›Ÿç‰‡æ–‡ä»¶æœ€ć€§ïŒ‰ïŒ› + * é»˜èź€ć€Œäžș50。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + quality?: number; + /** + * çŒ©æ”Ÿć›Ÿç‰‡çš„ćźœćșŠ + * æ”ŻæŒćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ă€ç™Ÿćˆ†æŻ”ïŒˆćŠ‚"50%"ïŒ‰ă€è‡ȘćŠšèźĄçź—ïŒˆćŠ‚"auto"ïŒŒćłæ čæźheight侎æșć›Ÿé«˜çš„çŒ©æ”ŸæŻ”äŸ‹èźĄçź—ïŒŒè‹„æœȘèźŸçœźheightćˆ™äœżç”šæșć›Ÿé«˜ćșŠïŒ‰ïŒ› + * é»˜èź€ć€Œäžș"auto"。 + * æłšæ„ïŒšè‹„èźŸçœźäș†widthć±žæ€§ć€Œäžćˆæł•ïŒˆćŠ‚"0px"ïŒ‰ïŒŒćˆ™äžćŻčć›Ÿç‰‡èż›èĄŒçŒ©æ”Ÿæ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + width?: string; + /** + * çŒ©æ”Ÿć›Ÿç‰‡çš„é«˜ćșŠ + * æ”ŻæŒćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ă€ç™Ÿćˆ†æŻ”ïŒˆćŠ‚"50%"ïŒ‰ă€è‡ȘćŠšèźĄçź—ïŒˆćŠ‚"auto"ïŒŒćłæ čæźwidth侎æșć›Ÿćźœçš„çŒ©æ”ŸæŻ”äŸ‹èźĄçź—ïŒŒè‹„æœȘèźŸçœźwidthćˆ™äœżç”šæșć›Ÿé«˜ćșŠïŒ‰ïŒ› + * é»˜èź€ć€Œäžș"auto"。 + * æłšæ„ïŒšè‹„èźŸçœźäș†heightć±žæ€§ć€Œäžćˆæł•ïŒˆćŠ‚"0px"ïŒ‰ïŒŒćˆ™äžćŻčć›Ÿç‰‡èż›èĄŒçŒ©æ”Ÿæ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + height?: string; + /** + * æ—‹èœŹć›Ÿç‰‡çš„è§’ćșŠ + * æ”ŻæŒć€ŒïŒš90-èĄšç€șæ—‹èœŹ90ćșŠïŒ›180-èĄšç€șæ—‹èœŹ180ćșŠïŒ›270-èĄšç€șæ—‹èœŹ270ćșŠă€‚ + * æłšæ„ïŒšè‹„èźŸçœźrotateć±žæ€§ć€Œäžćˆæł•ïŒŒćˆ™äžćŻčć›Ÿç‰‡èż›èĄŒæ—‹èœŹæ“äœœă€‚ + * - 90: æ—‹èœŹ90ćșŠ + * - 180: æ—‹èœŹ180ćșŠ + * - 270: æ—‹èœŹ270ćșŠ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + rotate?: '90' | '180' | '270'; + /** + * èŁć‰Șć›Ÿç‰‡çš„ćŒș㟟 + * ć€Œć‚è€ƒClipImageOptions漚äč‰ïŒŒè‹„èźŸçœźclipć±žæ€§ć€Œäžćˆæł•ïŒŒćˆ™äžćŻčć›Ÿç‰‡èż›èĄŒèŁć‰Șæ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + clip?: PlusZipClipImageOptions; +} + +/** + * JSONćŻčè±ĄïŒŒć›Ÿç‰‡èŁć‰ȘćŒșćŸŸçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ +interface PlusZipClipImageOptions { + /** + * ć›Ÿç‰‡èŁć‰ȘćŒșćŸŸäžŽćŽŸć›Ÿç‰‡äžŠèŸčç•Œçš„ćç§»è·çŠ» + * æ”ŻæŒćƒçŽ ć€ŒïŒˆćŠ‚"10px"ïŒ‰ă€ç™Ÿćˆ†æŻ”ïŒˆćŠ‚"10%"ïŒ‰ïŒ›é»˜èź€ć€Œäžș"0px"。 + * æłšæ„ïŒšćŠ‚æžœtopć€Œè¶…ć‡șćŽŸć›Ÿç‰‡é«˜ćșŠïŒŒćˆ™ć›Ÿç‰‡èفć‰Șć€±èŽ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + top?: string; + /** + * ć›Ÿç‰‡èŁć‰ȘćŒșćŸŸäžŽćŽŸć›Ÿç‰‡ć·ŠèŸčç•Œçš„ćç§»è·çŠ» + * æ”ŻæŒćƒçŽ ć€ŒïŒˆćŠ‚"10px"ïŒ‰ă€ç™Ÿćˆ†æŻ”ïŒˆćŠ‚"10%"ïŒ‰ïŒ›é»˜èź€ć€Œäžș"0px"。 + * æłšæ„ïŒšćŠ‚æžœleftć€Œè¶…ć‡șćŽŸć›Ÿç‰‡ćźœćșŠïŒŒćˆ™ć›Ÿç‰‡èفć‰Șć€±èŽ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + left?: string; + /** + * ć›Ÿç‰‡èŁć‰ȘćŒșćŸŸçš„ćźœćșŠ + * æ”ŻæŒćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ă€ç™Ÿćˆ†æŻ”ïŒˆćŠ‚"50%"ïŒ‰ă€è‡ȘćŠšèźĄçź—ïŒˆćŠ‚"auto"ïŒŒćłä»Žleftäœçœźćˆ°ć›Ÿç‰‡ćłèŸčç•Œçš„ćźœćșŠïŒ‰ïŒ›é»˜èź€ć€Œäžș"auto"。 + * æłšæ„ïŒšćŠ‚æžœleftć€ŒćŠ widthć€Œè¶…ć‡șćŽŸć›Ÿç‰‡ćźœćșŠïŒŒćˆ™äœżç”š"auto"ć€Œèż›èĄŒèŁć‰Ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + width?: string; + /** + * ć›Ÿç‰‡èŁć‰ȘćŒșćŸŸçš„é«˜ćșŠ + * æ”ŻæŒćƒçŽ ć€ŒïŒˆćŠ‚"100px"ïŒ‰ă€ç™Ÿćˆ†æŻ”ïŒˆćŠ‚"50%"ïŒ‰ă€è‡ȘćŠšèźĄçź—ïŒˆćŠ‚"auto"ïŒŒćłä»Žtopäœçœźćˆ°ć›Ÿç‰‡äž‹èŸč界的高ćșŠïŒ‰ïŒ›é»˜èź€ć€Œäžș"auto"。 + * æłšæ„ïŒšćŠ‚æžœtopć€ŒćŠ heightć€Œè¶…ć‡șćŽŸć›Ÿç‰‡é«˜ćșŠïŒŒćˆ™äœżç”š"auto"ć€Œèż›èĄŒèŁć‰Ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/zip.html](http://www.html5plus.org/doc/zh_cn/zip.html) + */ + height?: string; +} + +/** + * BarcodeæšĄć—çźĄç†æĄç æ‰«æïŒŒæ”ŻæŒćžžè§çš„æĄç ïŒˆäž€ç»Žç ćŠäșŒç»Žç ïŒ‰çš„æ‰«æèŻ†ćˆ«ćŠŸèƒœă€‚ćŻè°ƒç”šèźŸć€‡çš„æ‘„ćƒć€ŽćŻčæĄç ć›Ÿç‰‡æ‰«æèż›èĄŒæ•°æźèŸ“ć…„ïŒŒè§Łç ćŽèż”ć›žç æ•°æźćŠç ç±»ćž‹ă€‚é€šèż‡plus.barcodećŻèŽ·ć–æĄç ç çźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ +interface PlusBarcode { + /** + * Barcode扫码控件ćŻčè±Ą + * BarcodećŻčè±ĄèĄšç€șæĄç èŻ†ćˆ«æŽ§ä»¶ćŻčè±ĄïŒŒćœšçȘ—ćŁäž­æ˜Ÿç€șæĄç èŻ†ćˆ«æŽ§ä»¶ïŒŒäœżç”šæ­€ćŻčè±ĄćŻè‡Ș漚ä艿Ąç èŻ†ćˆ«ç•Œéąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + Barcode?: PlusBarcodeBarcode; + /** + * Barcodeæ‰«ç æŽ§ä»¶æ ·ćŒ + * èźŸçœźBarcodeæ‰«ç æŽ§ä»¶çš„æ ·ćŒïŒŒćŠ‚æ‰«ç æĄ†ă€æ‰«ç æĄçš„éąœè‰Č等。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + BarcodeStyles?: PlusBarcodeBarcodeStyles; + /** + * æĄç èŻ†ćˆ«æŽ§ä»¶æ‰«æć‚æ•° + * èźŸçœźBarcodeæ‰«ç æŽ§ä»¶çš„æ‰«ç èŻ†ćˆ«ć‚æ•°ïŒŒćŠ‚æ˜ŻćŠäżć­˜æ‰«ç ćŠŸæ—¶çš„æˆȘć›Ÿç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + BarcodeOptions?: PlusBarcodeBarcodeOptions; + /** + * QRäșŒç»Žç ïŒŒæ•°ć€Œäžș0 + * 1994ćčŽç”±æ—„æœŹDenso-Waveć…Źćžć‘æ˜ŽïŒŒQR杄è‡Ș英文Quick Responseçš„çŒ©ć†™ïŒŒćłćż«é€Ÿććș”的意思æșè‡Șć‘æ˜Žè€…ćžŒæœ›QRç ćŻèź©ć…¶ć†…ćźčćż«é€Ÿèą«è§Łç ă€‚ + * ç›źć‰äœżç”šæœ€ćčżæł›çš„äșŒç»Žç ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + QR?: number; + /** + * EANæĄćœąç æ ‡ć‡†ç‰ˆïŒŒæ•°ć€Œäžș1 + * ć›œé™…ç‰©ć“çŒ–ç ćäŒšćœšć…šçƒæŽšćčżćș”ç”šçš„ć•†ć“æĄç ïŒŒæ˜Żç”±13äœæ•°ć­—ç»„æˆă€‚ + * ç›źć‰äœżç”šæœ€ćčżæł›çš„äž€ç»ŽæĄćœąç ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + EAN13?: number; + /** + * ENAæĄćœąç çź€ç‰ˆïŒŒæ•°ć€Œäžș2 + * ć›œé™…ç‰©ć“çŒ–ç ćäŒšćœšć…šçƒæŽšćčżćș”ç”šçš„ć•†ć“æĄç ïŒŒæ˜Żç”±8äœæ•°ć­—ç»„æˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + EAN8?: number; + /** + * AztecäșŒç»Žç ïŒŒæ•°ć€Œäžș3 + * Andrew Longacreć‘æ˜ŽäșŽ1995ćčŽïŒŒèŻ„ä»Łç æ˜Żç”šäșŽć›œé™…ć‡șç‰ˆă€‚æœ€ć°çš„Aztecç çŹŠć·çŒ–ç 13äžȘæ•°ć­—æˆ–12äžȘè‹±æ–‡ć­—æŻă€‚æœ€ć€§çš„Aztecç çŹŠć·çŒ–ç 3832æ•°ć­—æˆ–3067è‹±æ–‡ć­—æŻæˆ–1914ć­—èŠ‚çš„æ•°æźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + AZTEC?: number; + /** + * Data MatrixäșŒç»Žç ïŒŒæ•°ć€Œäžș4 + * Data Matrix掟損Data codeïŒŒç”±çŸŽć›œć›œé™…è”„æ–™ć…Źćž(International Data Matrix, 缀称IDMatrix)äșŽ1989ćčŽć‘æ˜Žă€‚ćŻçŒ–ç ć­—ć…ƒé›†ćŒ…æ‹Źć…šéƒšçš„ASCIIć­—ć…ƒćŠæ‰©ć……ASCIIć­—ć…ƒïŒŒćźčé‡ćŻćŒ…ć«2235äžȘè‹±æ–‡æ•°ć­—è”„æ–™ă€1556äžȘ8äœć…ƒè”„æ–™ïŒŒ3116äžȘæ•°ć­—è”„æ–™ă€‚ç”±äșŽData MatrixäșŒç»ŽæĄç ćȘéœ€èŠèŻ»ć–è”„æ–™çš„20%捳揯çČŸçĄźèŸšèŻ»ïŒŒć› æ­€ćŸˆé€‚ćˆćș”ç”šćœšæĄç ćźčæ˜“ć—æŸçš„ćœșæ‰€ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + DATAMATRIX?: number; + /** + * UPCæĄćœąç æ ‡ć‡†ç‰ˆïŒŒæ•°ć€Œäžș5 + * UPCç æ˜ŻçŸŽć›œç»Ÿäž€ä»Łç ć§”ć‘˜äŒšćˆ¶ćźšçš„äž€ç§ć•†ć“ç”šæĄç ïŒŒäž»èŠç”šäșŽçŸŽć›œć’ŒćŠ æ‹żć€§ćœ°ćŒșïŒŒćžžćœšçŸŽć›œèż›ćŁçš„ć•†ć“äžŠćŻä»„çœ‹ćˆ°ă€‚UPCç æ ‡ć‡†ç‰ˆç”±12äœæ•°ć­—æž„æˆïŒŒæ•…ć…¶ć­—ç é›†äžșæ•°ć­—0~9。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + UPCA?: number; + /** + * UPCæĄćœąç çŒ©çŸ­ç‰ˆïŒŒæ•°ć€Œäžș6 + * UPCç æ˜ŻçŸŽć›œç»Ÿäž€ä»Łç ć§”ć‘˜äŒšćˆ¶ćźšçš„äž€ç§ć•†ć“ç”šæĄç ïŒŒäž»èŠç”šäșŽçŸŽć›œć’ŒćŠ æ‹żć€§ćœ°ćŒșïŒŒćžžćœšçŸŽć›œèż›ćŁçš„ć•†ć“äžŠćŻä»„çœ‹ćˆ°ă€‚UPC码猩短版由8äœæ•°ć­—æž„æˆïŒŒæ•…ć…¶ć­—ç é›†äžșæ•°ć­—0~9。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + UPCE?: number; + /** + * CodabaræĄćœąç ïŒŒæ•°ć€Œäžș7 + * Codabarç æœ€ćˆæ˜Żäžșé›¶ć”źä»·æ Œæ ‡ç­Ÿçł»ç»Ÿè€Œç ”ćˆ¶ćŒ€ć‘çš„ă€‚1975ćčŽïŒŒNational Retail Merchants AssociationNRMA选择äș†ć…¶ćźƒçŹŠć·ç±»ćž‹äœœäžșæ ‡ć‡†ćŽïŒŒCodabarćŒ€ć§‹ćœšć€šäžȘæ–č靱甹äșŽéžé›¶ć”źćș”ç”šéą†ćŸŸïŒŒćŠ‚ć›ŸäčŠéŠ†ă€èŽ§èżć’ŒćŒ»èŻäžšă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + CODABAR?: number; + /** + * Code39æĄćœąç ïŒŒæ•°ć€Œäžș8 + * Code 39ç æ˜ŻIntermec慬揾äșŽ1975ćčŽæŽšć‡șçš„äž€ç»ŽæĄç ïŒŒ 39ç æ˜Żäž€ç§ćŻäŸ›äœżç”šè€…ćŒć‘æ‰«çž„çš„ćˆ†æ•ŁćŒæĄç ïŒŒäčŸć°±æ˜ŻèŻŽç›žäžŽäž€è”„æ–™ç äč‹é—ŽïŒŒ39ç ćż…éĄ»ćŒ…ć«äž€äžȘäžć…·ä»»äœ•æ„äč‰çš„ç©ș癜(æˆ–ç»†ç™œïŒŒć…¶é€»èŸ‘ć€Œäžș0)䞔 39ç ć…·æœ‰æ”ŻæŽæ–‡æ•°ć­—çš„èƒœćŠ›ïŒŒçŒ–ç è§„ćˆ™çź€ć•ă€èŻŻç çŽ‡äœŽă€æ‰€èƒœèĄšç€ș歗笩äžȘæ•°ć€šç­‰ç‰čç‚č39码朹搄äžȘéą†ćŸŸæœ‰ç€æžäžșćčżæł›çš„ćș”甚。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + CODE39?: number; + /** + * Code93æĄćœąç ïŒŒæ•°ć€Œäžș9 + * Code 93ç çš„æĄç çŹŠć·æ˜Żç”±Intermec慬揾äșŽ1982ćčŽèźŸèźĄçš„ æäŸ›æ›Žé«˜çš„毆ćșŠć’Œæ•°æźćź‰ć…šćąžćŒșcode39 ă€‚ćźƒæ˜Żäž€äžȘć­—æŻïŒŒé•żćșŠćŻć˜çŹŠć·ă€‚ä»Łç 93䞻芁甚äșŽç”±ćŠ æ‹żć€§é‚źæ”żçŒ–ç èĄ„ć……æäŸ›çš„è”„æ–™ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + CODE93?: number; + /** + * Code128æĄćœąç ïŒŒæ•°ć€Œäžș10 + * CODE128ç æ˜Ż1981ćčŽćŒ•ć…„çš„äž€ç§é«˜ćŻ†ćșŠæĄç ïŒŒCODE128 ç ćŻèĄšç€ș从 ASCII 0 戰ASCII 127 ć…±128äžȘć­—çŹŠïŒŒæ•…ç§°128码。CODE128ç æ˜Żćčżæł›ćș”ç”šćœšäŒäžšć†…éƒšçźĄç†ă€ç”Ÿäș§æ”çš‹ă€ç‰©æ”æŽ§ćˆ¶çł»ç»Ÿæ–čéąçš„æĄç ç ćˆ¶ïŒŒç”±äșŽć…¶äŒ˜è‰Żçš„ç‰čæ€§ćœšçźĄç†äżĄæŻçł»ç»Ÿçš„èźŸèźĄäž­èą«ćčżæł›äœżç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + CODE128?: number; + /** + * ITFæĄćœąç ïŒŒæ•°ć€Œäžș11 + * ITFæĄç ïŒŒćˆç§°äș€ć‰äșŒäș”æĄç ïŒŒç”±14äœæ•°ć­—ć­—çŹŠä»ŁèĄšç»„æˆă€‚äž»èŠç”šäșŽèżèŸ“ćŒ…èŁ…ïŒŒæ˜Żć°ćˆ·æĄä»¶èŸƒć·źïŒŒäžć…èźžć°ćˆ·EAN-13撌UPC-AæĄç æ—¶ćș”é€‰ç”šçš„äž€ç§æĄç ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + ITF?: number; + /** + * MaxiCodeäșŒç»Žç ïŒŒæ•°ć€Œäžș12 + * 1996ćčŽæ—¶ïŒŒçŸŽć›œè‡ȘćŠšèŸšèŻ†ćäŒšïŒˆAIMUSAïŒ‰ćˆ¶ćźšç»Ÿäž€çš„çŹŠć·è§„æ ŒïŒŒç§°äžșMaxicodeäșŒç»ŽæĄç ïŒŒä蟿œ‰äșșç§°USS-MaxicodeäșŒç»ŽæĄç ïŒˆUniform Symbology Specification-MaxicodeïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + MAXICODE?: number; + /** + * PDF 417äșŒç»ŽæĄç ïŒŒæ•°ć€Œäžș13 + * PDF417æĄç æ˜Żç”±çŸŽć›œSYMBOLć…Źćžć‘æ˜Žçš„ïŒŒPDFPortable Data FileïŒ‰æ„æ€æ˜Żâ€œäŸżæșæ•°æźæ–‡ä»¶â€ă€‚ç»„æˆæĄç çš„æŻäž€äžȘæĄç ć­—çŹŠç”±4äžȘæĄć’Œ4äžȘç©șć…±17äžȘæšĄć—æž„æˆïŒŒæ•…ç§°äžșPDF417æĄç ă€‚PDF417æĄç æœ€ć€§çš„äŒ˜ćŠżćœšäșŽć…¶ćșžć€§çš„æ•°æźćźčé‡ć’ŒæžćŒș的çș é”™èƒœćŠ›ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + PDF417?: number; + /** + * RSS 14æĄćœąç»„ćˆç ïŒŒæ•°ć€Œäžș14 + * RSSæĄç æ˜Żæœ‰ć›œé™…ç‰©ć“çŒ–ç ćäŒšEANć’ŒçŸŽć›œç»Ÿäž€ä»Łç ć§”ć‘˜äŒšUCCćŒ€ć‘çš„RSSReduced Space SymbologyïŒ‰æĄç çŹŠć·ă€‚ćźƒæ˜Żäž€ç§äž€ç»Žç ć’ŒäșŒç»Žç çš„ç»„ćˆç ă€‚ć’Œć…¶ćźƒçșżæ€§æĄç ç›žæŻ”RSSçł»ćˆ—ç ćˆ¶ć…·æœ‰æ›Žé«˜çš„ćŻ†ćșŠïŒŒć› äžșćźƒćŻä»„èĄšç€șæ›Žć€šçš„ć­—çŹŠă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + RSS14?: number; + /** + * æ‰©ć±•ćŒRSSæĄćœąç»„ćˆç ïŒŒæ•°ć€Œäžș15 + * RSSæĄç æ˜Żæœ‰ć›œé™…ç‰©ć“çŒ–ç ćäŒšEANć’ŒçŸŽć›œç»Ÿäž€ä»Łç ć§”ć‘˜äŒšUCCćŒ€ć‘çš„RSSReduced Space SymbologyïŒ‰æĄç çŹŠć·ă€‚ćźƒæ˜Żäž€ç§äž€ç»Žç ć’ŒäșŒç»Žç çš„ç»„ćˆç ă€‚ć’Œć…¶ćźƒçșżæ€§æĄç ç›žæŻ”RSSçł»ćˆ—ç ćˆ¶ć…·æœ‰æ›Žé«˜çš„ćŻ†ćșŠïŒŒć› äžșćźƒćŻä»„èĄšç€șæ›Žć€šçš„ć­—çŹŠă€‚æ‰©ć±•ćŒRSSç æ˜Żé•żćșŠćŻä»„揘挖的çșżæ€§ç ćˆ¶ïŒŒèƒœć€ŸćŻč74äžȘæ•°ć­—ć­—çŹŠæˆ–41äžȘć­—æŻć­—çŹŠçš„AIć•ć…ƒæ•°æźäŒ æ•°æźèż›èĄŒçŒ–ç ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + RSSEXPANDED?: number; + /** + * é€šèż‡ć›Ÿç‰‡æ‰«ç èŻ†ćˆ« + * ç›ŽæŽ„èŸ“ć…„ć›Ÿç‰‡æ‰«ç èŻ†ćˆ«ïŒŒæˆćŠŸæ‰«æćˆ°æĄç æ•°æźćŽé€šèż‡successCallbackć›žè°ƒèż”ć›žïŒŒć€±èŽ„ćˆ™é€šèż‡errorCallbackć›žè°ƒèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + scan(path?: string, successCB?: (result0: number, result1: string, result2: string) => void, errorCB?: (result: any) => void, filters?: any []): void; + /** + * 戛ć»șBarcodećŻčè±Ą + * 调甚歀æ–čæł•ćˆ›ć»ș搎ćč¶äžäŒšæ˜Ÿç€ș需芁调甚WebviewçȘ—ćŁçš„appendæ–čæł•ć°†ć…¶æ·»ćŠ ćˆ°WebviewçȘ—ćŁćŽæ‰èƒœæ˜Ÿç€ș。 + * æłšæ„ïŒšæ­€æ—¶éœ€èŠé€šèż‡stylesć‚æ•°çš„top/left/width/heightć±žæ€§èźŸçœźæŽ§ä»¶çš„äœçœźćŠć€§ć°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + create(id?: string, filters?: any [], styles?: PlusBarcodeBarcodeStyles): PlusBarcodeBarcode; + /** + * 柄扟ć·Čç»ćˆ›ć»ș的BarcodećŻčè±Ą + * 调甚歀æ–čæł•æŸ„æ‰ŸæŒ‡ćźšid的BarcodećŻčè±ĄïŒŒćŠ‚æžœäžć­˜ćœšćˆ™èż”ć›žnull。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + getBarcodeById(id?: string): PlusBarcodeBarcode; +} + +/** + * Barcode扫码控件ćŻčè±Ą + * BarcodećŻčè±ĄèĄšç€șæĄç èŻ†ćˆ«æŽ§ä»¶ćŻčè±ĄïŒŒćœšçȘ—ćŁäž­æ˜Ÿç€șæĄç èŻ†ćˆ«æŽ§ä»¶ïŒŒäœżç”šæ­€ćŻčè±ĄćŻè‡Ș漚ä艿Ąç èŻ†ćˆ«ç•Œéąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ +interface PlusBarcodeBarcode { + /** + * æĄç èŻ†ćˆ«æˆćŠŸäș‹ä»¶ + * Barcodeæ‰«ç æŽ§ä»¶èŻ†ćˆ«ćˆ°æœ‰æ•ˆçš„æĄç æ•°æźæ—¶è§Šć‘çš„æˆćŠŸäș‹ä»¶ïŒŒćč¶èż”ć›žæ‰«ç ç»“æžœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + onmarked?: (result0: number, result1: string, result2: string) => void; + /** + * æĄç èŻ†ćˆ«é”™èŻŻäș‹ä»¶ + * ææŽ§ä»¶èŻ†ćˆ«èż‡çš‹äž­ć‘ç”Ÿé”™èŻŻæ—¶è§Šć‘çš„ć€±èŽ„äș‹ä»¶ïŒŒćč¶èż”ć›žé”™èŻŻäżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + onerror?: (result: any) => void; + /** + * ćŒ€ć§‹æĄç èŻ†ćˆ« + * ćŒ€ć§‹è°ƒç”šçł»ç»Ÿæ‘„ćƒć€ŽèŽ·ć–ć›Ÿç‰‡æ•°æźèż›èĄŒæ‰«ç èŻ†ćˆ«ïŒŒćœ“èŻ†ćˆ«ć‡șæĄç æ•°æźæ—¶é€šèż‡onmarkedć›žè°ƒć‡œæ•°èż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + start(optons?: PlusBarcodeBarcodeOptions): void; + /** + * ç»“æŸæĄç èŻ†ćˆ« + * 结束ćŻčæ‘„ćƒć€ŽèŽ·ć–ć›Ÿç‰‡æ•°æźèż›èĄŒæĄç èŻ†ćˆ«æ“äœœïŒŒćŒæ—¶ć…łé—­æ‘„ćƒć€Žçš„è§†éą‘æ•èŽ·ă€‚ + * ç»“æŸćŽćŻè°ƒç”šstartæ–čæł•é‡æ–°ćŒ€ć§‹èŻ†ćˆ«ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + cancel(): void; + /** + * ć…łé—­æĄç èŻ†ćˆ«æŽ§ä»¶ + * é‡Šæ”ŸæŽ§ä»¶ć ç”šçł»ç»Ÿè”„æșïŒŒè°ƒç”šcloseæ–čæł•ćŽæŽ§ä»¶ćŻčè±Ąć°†äžćŻäœżç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + close(): void; + /** + * æ˜ŻćŠćŒ€ćŻé—Ș慉灯 + * èźŸçœźBarcodeæ‰«ç æŽ§ä»¶ćœšæ‰«ç æ—¶æ˜ŻćŠćŒ€ćŻæ‘„ćƒć€Žçš„é—Șć…‰çŻïŒŒé»˜èź€ć€ŒäžșäžćŒ€ćŻé—Ș慉灯。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + setFlash(open?: boolean): void; + /** + * èźŸçœźBarcodeæ‰«ç æŽ§ä»¶çš„é…çœźć‚æ•° + * 甹äșŽćŠšæ€æ›Žæ–°Barcodeæ‰«ç æŽ§ä»¶çš„ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + setStyles(styles?: PlusBarcodeBarcodeStyles): void; +} + +/** + * Barcodeæ‰«ç æŽ§ä»¶æ ·ćŒ + * èźŸçœźBarcodeæ‰«ç æŽ§ä»¶çš„æ ·ćŒïŒŒćŠ‚æ‰«ç æĄ†ă€æ‰«ç æĄçš„éąœè‰Č等。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ +interface PlusBarcodeBarcodeStyles { + /** + * æĄç èŻ†ćˆ«æŽ§ä»¶èƒŒæ™Żéąœè‰Č + * 鱜è‰Čć€Œæ”ŻæŒ(ć‚è€ƒCSS鱜è‰Č规范)ïŒšéąœè‰Č損称(ć‚è€ƒCSS Color Names)/ćć…­èż›ćˆ¶ć€Œ/rgbć€ŒïŒŒé»˜èź€ć€Œäžșçșąè‰Č。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + background?: string; + /** + * æ‰«ç æĄ†éąœè‰Č + * 鱜è‰Čć€Œæ”ŻæŒ(ć‚è€ƒCSS鱜è‰Č规范)ïŒšéąœè‰Č損称(ć‚è€ƒCSS Color Names)/ćć…­èż›ćˆ¶ć€Œ/rgbć€Œ/rgbać€ŒïŒŒé»˜èź€ć€Œäžșçșąè‰Č。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + frameColor?: string; + /** + * æ‰«ç æĄéąœè‰Č + * 鱜è‰Čć€Œæ”ŻæŒ(ć‚è€ƒCSS鱜è‰Č规范)ïŒšéąœè‰Č損称(ć‚è€ƒCSS Color Names)/ćć…­èż›ćˆ¶ć€Œ/rgbć€Œ/rgbać€ŒïŒŒé»˜èź€ć€Œäžșçșąè‰Č。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + scanbarColor?: string; + /** + * Barcodeæ‰«ç æŽ§ä»¶ć·ŠäžŠè§’çš„ćž‚ç›Žćç§»é‡ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶WebviewçȘ—ćŁçš„é«˜ćșŠïŒ› + * è‡ȘćŠšèźĄçź—ïŒŒćŠ‚"auto",æ čæźheightć€Œè‡ȘćŠšèźĄçź—ïŒŒç›žćŻčäșŽçˆ¶WebviewçȘ—ćŁćž‚ç›Žć±…äž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + top?: string; + /** + * Barcodeæ‰«ç æŽ§ä»¶ć·ŠäžŠè§’çš„æ°Žćčłćç§»é‡ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶WebviewçȘ—ćŁçš„ćźœćșŠïŒ› + * è‡ȘćŠšèźĄçź—ïŒŒćŠ‚"auto"æ čæźwidthć€Œè‡ȘćŠšèźĄçź—ïŒŒç›žćŻčäșŽçˆ¶WebviewçȘ—ćŁæ°Žćčłć±…䞭。 + * é»˜èź€ć€Œäžș"0px"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + left?: string; + /** + * Barcodeæ‰«ç æŽ§ä»¶çš„ćźœćșŠ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶WebviewçȘ—ćŁçš„ćźœćșŠă€‚ + * é»˜èź€ć€Œäžș"100%"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + width?: string; + /** + * Barcode扫码控件的高ćșŠ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶WebviewçȘ—ćŁçš„é«˜ćșŠă€‚ + * é»˜èź€ć€Œäžș"100%"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + height?: string; + /** + * Barcodeæ‰«ç æŽ§ä»¶ćœšWebviewçȘ—ćŁçš„ćžƒć±€æšĄćŒ + * ćŻć–ć€ŒïŒš + * "static" - é™æ€ćžƒć±€æšĄćŒïŒŒćŠ‚æžœéĄ”éąć­˜ćœšæ»šćŠšæĄćˆ™éšçȘ—ćŁć†…ćźčæ»šćŠšïŒ› + * "absolute" - 绝ćŻčćžƒć±€æšĄćŒïŒŒćŠ‚æžœéĄ”éąć­˜ćœšæ»šćŠšæĄäžéšçȘ—ćŁć†…ćźčæ»šćŠšïŒ› + * é»˜èź€ć€Œäžș"static"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + position?: string; +} + +/** + * æĄç èŻ†ćˆ«æŽ§ä»¶æ‰«æć‚æ•° + * èźŸçœźBarcodeæ‰«ç æŽ§ä»¶çš„æ‰«ç èŻ†ćˆ«ć‚æ•°ïŒŒćŠ‚æ˜ŻćŠäżć­˜æ‰«ç ćŠŸæ—¶çš„æˆȘć›Ÿç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ +interface PlusBarcodeBarcodeOptions { + /** + * æ˜ŻćŠäżć­˜æ‰«ç æˆćŠŸæ—¶çš„æˆȘć›Ÿ + * ćŠ‚æžœèźŸçœźäžștruećˆ™ćœšæ‰«ç æˆćŠŸæ—¶ć°†ć›Ÿç‰‡äżć­˜ïŒŒćč¶é€šèż‡onmarkedć›žè°ƒć‡œæ•°çš„fileć‚æ•°èż”ć›žäżć­˜æ–‡ä»¶çš„è·ŻćŸ„ă€‚ + * é»˜èź€ć€ŒäžșfalseïŒŒäžäżć­˜æˆȘć›Ÿă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + conserve?: boolean; + /** + * äżć­˜æ‰«ç æˆćŠŸæ—¶ć›Ÿç‰‡äżć­˜è·ŻćŸ„ + * ćŻé€šèż‡æ­€ć‚æ•°èźŸçœźäżć­˜æˆȘć›Ÿçš„è·ŻćŸ„ć’Œćç§°ïŒŒćŠ‚æžœèźŸçœźć›Ÿç‰‡æ–‡ä»¶ćç§°ćˆ™ćż…éĄ»æŒ‡ćźšæ–‡ä»¶çš„ćŽçŒ€ćïŒˆćż…éĄ»æ˜Ż.pngïŒ‰ïŒŒćŠćˆ™èź€äžșæ˜ŻæŒ‡ćźšç›źćœ•ïŒŒæ–‡ä»¶ćç§°ćˆ™è‡ȘćŠšç”Ÿæˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + filename?: string; + /** + * æ‰«ç æˆćŠŸæ—¶æ˜ŻćŠéœ€èŠéœ‡ćŠšæé†’ + * ćŠ‚æžœèźŸçœźäžștruećˆ™ćœšæ‰«ç æˆćŠŸæ—¶éœ‡ćŠšèźŸć€‡ïŒŒfalse戙侍震抹。 + * é»˜èź€ć€Œäžștrue。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + vibrate?: boolean; + /** + * æ‰«ç æˆćŠŸæ—¶æ’­æ”Ÿçš„æç€ș音 + * ćŻć–ć€ŒïŒš + * "none" - 䞍播攟提ç€șéŸłïŒ› + * "default" - æ’­æ”Ÿé»˜èź€æç€șéŸłïŒˆ5+ćŒ•æ“Žć†…çœźïŒ‰ă€‚ + * é»˜èź€ć€Œäžș"default"。 + * - none: æ‰«ç æˆćŠŸæ—¶äžæ’­æ”Ÿæç€ș音 + * - default: æ‰«ç æˆćŠŸæ—¶æ’­æ”Ÿé»˜èź€æç€ș音 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/barcode.html](http://www.html5plus.org/doc/zh_cn/barcode.html) + */ + sound?: 'none' | 'default'; +} + +/** + * MapsæšĄć—çźĄç†ćœ°ć›ŸæŽ§ä»¶ïŒŒç”šäșŽćœšwebéĄ”éąäž­æ˜Ÿç€șćœ°ć›ŸæŽ§ä»¶ïŒŒæäŸ›ć„ç§æŽ„ćŁæ“äœœćœ°ć›ŸæŽ§ä»¶ïŒŒćŠ‚æ·»ćŠ æ ‡ç‚čă€è·Żçșżç­‰ă€‚é€šèż‡plus.mapsćŻèŽ·ć–ćœ°ć›ŸçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMaps { + /** + * ćœ°ć›ŸæŽ§ä»¶ćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + Map?: PlusMapsMap; + /** + * ćœ°ć›ŸæŽ§ä»¶ćŻčè±Ąçš„ć‚æ•° + * èźŸçœźćœ°ć›ŸćŻčè±Ąæ˜Ÿç€șæ—¶äœżç”šçš„ć‚æ•°ïŒŒćŠ‚ćœ°ć›Ÿçš„äž­ćżƒäœçœźă€çŒ©æ”Ÿçș§ćˆ«ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + MapStyles?: PlusMapsMapStyles; + /** + * ćœ°ç†çŒ–ç èœŹæąçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + GeocodeOptions?: PlusMapsGeocodeOptions; + /** + * ćœ°ć›Ÿćæ ‡èœŹæąçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + CoordinateConvertOptions?: PlusMapsCoordinateConvertOptions; + /** + * PointćŻčè±Ąç”šäșŽèĄšç€șćœ°ć›Ÿć…ƒçŽ çš„ćæ ‡ + * ćžžç”šèŻ­ćŻčćœ°ć›ŸäžŠć…ƒçŽ èż›èĄŒćźšäœæ—¶äœżç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + Point?: PlusMapsPoint; + /** + * 朰理ćŒș㟟 + * æœ‰è„żć—ćŠäžœćŒ—ćæ ‡ç‚čæ•°æźç»„æˆçš„çŸ©ćœąćŒș柟。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + Bounds?: PlusMapsBounds; + /** + * ćœ°ć›Ÿè§†ć›Ÿç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + MapType?: PlusMapsMapType; + /** + * ćœ°ć›ŸèŠ†ç›–ç‰©ćŸșç±»ćŻčè±Ą + * Overlayæ˜Żćœ°ć›ŸäžŠæ˜Ÿç€ș慃箠的ćŸș类甚äșŽæŠœè±Ąćœ°ć›Ÿć…ƒçŽ ïŒŒäžç”šäșŽćźžäŸ‹ćŒ–。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + Overlay?: PlusMapsOverlay; + /** + * ćœ°ć›ŸäžŠæ˜Ÿç€ș的标ç‚čćŻčè±Ą + * 从OverlayćŻčè±Ąç»§æ‰żè€Œæ„ïŒŒćŻé€šèż‡MapćŻčè±Ąçš„addOverlay()æ–čæł•ć°†ćŻčè±Ąæ·»ćŠ ćœ°ć›Ÿäž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + Marker?: PlusMapsMarker; + /** + * ćœ°ć›ŸäžŠæ˜Ÿç€șçš„æ°”æłĄćŻčè±Ą + * æ­€ćŻčè±Ąäžèƒœç›ŽæŽ„æ·»ćŠ ćˆ°ćœ°ć›ŸäžŠæ˜Ÿç€șćȘćŻć…łè”ćˆ°ćœ°ć›Ÿæ ‡ç‚č芆盖物䞊甚户ç‚čć‡»æ ‡ç‚č时ćŒčć‡ș星ç€ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + Bubble?: PlusMapsBubble; + /** + * ćœ°ć›ŸäžŠæ˜Ÿç€ș的朆月ćŻčè±Ą + * 从OverlayćŻčè±Ąç»§æ‰żè€Œæ„ïŒŒćŻé€šèż‡MapćŻčè±Ąçš„addOverlay()æ–čæł•ć°†ćŻčè±Ąæ·»ćŠ ćœ°ć›Ÿäž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + Circle?: PlusMapsCircle; + /** + * ćœ°ć›ŸäžŠæ˜Ÿç€ș的折çșżćŻčè±Ą + * 从OverlayćŻčè±Ąç»§æ‰żè€Œæ„ïŒŒćŻé€šèż‡MapćŻčè±Ąçš„addOverlay()æ–čæł•ć°†ćŻčè±Ąæ·»ćŠ ćœ°ć›Ÿäž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + Polyline?: PlusMapsPolyline; + /** + * ćœ°ć›ŸäžŠæ˜Ÿç€ș的怚èŸčćœąćŻčè±Ą + * 从OverlayćŻčè±Ąç»§æ‰żè€Œæ„ïŒŒćŻé€šèż‡MapćŻčè±Ąçš„addOverlay()æ–čæł•ć°†ćŻčè±Ąæ·»ćŠ ćœ°ć›Ÿäž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + Polygon?: PlusMapsPolygon; + /** + * ćœ°ć›ŸæŁ€çŽąćŻčè±Ą + * SearchćŻčè±Ąç”šäșŽçźĄç†ćœ°ć›ŸäžŠçš„æŁ€çŽąćŠŸèƒœïŒŒćŒ…æ‹ŹäœçœźæŁ€çŽąă€ć‘šèŸčæŁ€çŽąć’ŒèŒƒć›ŽæŁ€çŽąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + Search?: PlusMapsSearch; + /** + * æŁ€çŽąç­–ç•„ç±»ćž‹ + * 朹çșżè·ŻæŁ€çŽąæ—¶èźŸçœźæŁ€çŽąç­–ç•„æ—¶äœżç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + SearchPolicy?: PlusMapsSearchPolicy; + /** + * äżć­˜äœçœźæŁ€çŽąă€ć‘šèŸčæŁ€çŽąć’ŒèŒƒć›ŽæŁ€çŽąèż”ć›žçš„ç»“æžœ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + SearchPoiResult?: PlusMapsSearchPoiResult; + /** + * äżć­˜äœçœźæŁ€çŽąă€ć‘šèŸčæŁ€çŽąć’ŒèŒƒć›ŽæŁ€çŽąèż”ć›žçš„ç»“æžœ + * äžćŻé€šèż‡newæ“äœœçŹŠćˆ›ć»șSearchRouteResultćŻčè±ĄïŒŒćœšè§Šć‘onRouteSearchComplete()时è‡Ș抹戛ć»ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + SearchRouteResult?: PlusMapsSearchRouteResult; + /** + * æŁ€çŽąç»“æžœçš„äœçœźç‚č + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + Position?: PlusMapsPosition; + /** + * ćœ°ć›Ÿäž­çš„è·ŻçșżćŻčè±Ą + * 从OverlayćŻčè±Ąç»§æ‰żè€Œæ„ïŒŒćŻé€šèż‡MapćŻčè±Ąçš„addOverlay()æ–čæł•ć°†ćŻčè±Ąæ·»ćŠ ćœ°ć›Ÿäž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + Route?: PlusMapsRoute; + /** + * è°ƒç”šçł»ç»ŸçŹŹäž‰æ–č繋ćșèż›èĄŒćŻŒèˆȘ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + openSysMap(dst?: PlusMapsPoint, des?: string, src?: PlusMapsPoint): void; + /** + * 戛ć»șMapćŻčè±Ą + * 调甚歀æ–čæł•ćˆ›ć»ș搎ćč¶äžäŒšæ˜Ÿç€ș需芁调甚WebviewçȘ—ćŁçš„appendæ–čæł•ć°†ć…¶æ·»ćŠ ćˆ°WebviewçȘ—ćŁćŽæ‰èƒœæ˜Ÿç€ș。 + * æłšæ„ïŒšæ­€æ—¶éœ€èŠé€šèż‡stylesć‚æ•°çš„top/left/width/heightć±žæ€§èźŸçœźæŽ§ä»¶çš„äœçœźćŠć€§ć°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + create(id?: string, styles?: PlusMapsMapStyles): PlusMapsMap; + /** + * 柄扟ć·Čç»ćˆ›ć»ș的MapćŻčè±Ą + * 调甚歀æ–čæł•æŸ„æ‰ŸæŒ‡ćźšid的MapćŻčè±ĄïŒŒćŠ‚æžœäžć­˜ćœšćˆ™èż”ć›žnull。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getMapById(id?: string): PlusMapsMap; +} + +/** + * ćœ°ć›ŸæŽ§ä»¶ćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsMap { + /** + * 甚户ç‚čć‡»ćœ°ć›Ÿäș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + onclick?: (result: PlusMapsPoint) => void; + /** + * ćœ°ć›ŸçŠ¶æ€æ”č揘äș‹ä»¶ + * ç”šæˆ·æ‹–ćŠšă€çŒ©æ”Ÿćœ°ć›Ÿç­‰æ“äœœćźŒæˆćŽè§Šć‘ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + onstatuschanged?: (result: any) => void; + /** + * 静态æ–čæł•ïŒŒèźĄçź—éąç§Ż + * èźĄçź—æŒ‡ćźšćœ°ç†ćŒșćŸŸçš„éąç§ŻïŒŒć•äœäžșćčłæ–č米。 + * æłšïŒšæ­€ćŠŸèƒœä»…ç™ŸćșŠćœ°ć›Ÿæ”ŻæŒïŒŒé«˜ćŸ·ćœ°ć›Ÿæš‚äžæ”ŻæŒæ­€ćŠŸèƒœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + calculateArea(bounds?: PlusMapsBounds, successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; + /** + * 静态æ–čæł•ïŒŒèźĄçź—è·çŠ» + * èźĄçź—ä»ŽpointStartćæ ‡ç‚č戰pointEndćæ ‡çš„ćźžé™…ç›Žçșżè·çŠ»ïŒŒć•äœäžșç±łïŒˆmïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + calculateDistance(pointStart?: PlusMapsPoint, pointEnd?: PlusMapsPoint, successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; + /** + * 静态æ–čæł•ïŒŒćæ ‡èœŹæą + * 氆第侉æ–čćæ ‡çł»ćæ ‡èœŹæąæˆćœ“ć‰ćœ°ć›Ÿçš„ćæ ‡çł»ćæ ‡ă€‚ + * èœŹæąæˆćŠŸé€šèż‡successCallbackèż”ć›žïŒŒèœŹæąć€±èŽ„ćˆ™é€šèż‡errorCallbackèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + convertCoordinates(point?: PlusMapsPoint, options?: PlusMapsCoordinateConvertOptions, successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; + /** + * 静态æ–čæł•ïŒŒćœ°ç†çŒ–ç  + * ć°†ćœ°ç†äœçœźäżĄæŻèœŹæąäžșćæ ‡ç‚č。 + * èœŹæąæˆćŠŸé€šèż‡successCallbackèż”ć›žïŒŒèœŹæąć€±èŽ„ćˆ™é€šèż‡errorCallbackèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + geocode(address?: string, options?: PlusMapsGeocodeOptions, successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; + /** + * 静态æ–čæł•ïŒŒćć‘ćœ°ç†çŒ–ç  + * ć°†ćæ ‡ç‚čèœŹæąäžșćœ°ç†äœçœźäżĄæŻă€‚ + * èœŹæąæˆćŠŸé€šèż‡successCallbackèż”ć›žïŒŒèœŹæąć€±èŽ„ćˆ™é€šèż‡errorCallbackèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + reverseGeocode(point?: PlusMapsPoint, options?: PlusMapsGeocodeOptions, successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; + /** + * ć‘ćœ°ć›Ÿäž­æ·»ćŠ èŠ†ç›–ç‰© + * æ­€æ–čæł•甚äșŽć‘ćœ°ć›Ÿäž­æ·»ćŠ èŠ†ç›–ç‰©ă€‚ + * æ”ŻæŒć„ç§ä»Žmaps.OverlayćŻčè±Ąç»§æ‰żçš„ć„ç§èŠ†ç›–ç‰©ćŻčè±ĄïŒ› + * ćŠ‚æžœæ·»ćŠ äžæ”ŻæŒçš„ćŻčè±Ąćˆ™ç›ŽæŽ„èż”ć›žfalse + * ćŒäž€èŠ†ç›–ç‰©ćŻčè±ĄćȘèƒœæ·»ćŠ ćˆ°ćœ°ć›Ÿäž­äž€æŹĄïŒŒć·Čćœšćœ°ć›Ÿäž­çš„èŠ†ç›–ç‰©ć†æŹĄæ·»ćŠ æ—¶ćˆ™èż”ć›žfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + addOverlay(overlay?: PlusMapsOverlay): boolean; + /** + * èźŸçœźćœ°ć›Ÿćˆć§‹äž­ćżƒç‚čć’ŒçŒ©æ”Ÿçș§ćˆ« + * 甹äșŽèźŸçœźćœ°ć›Ÿçš„ćˆć§‹äž­ćżƒç‚čć’ŒçŒ©æ”Ÿçș§ćˆ«ïŒŒé€šćžžćœšćˆ›ć»șćœ°ć›ŸćŽç«‹ćłè°ƒç”šă€‚ + * é»˜èź€äž­ćżƒç‚čäžșć€©ćź‰é—šïŒŒé»˜èź€çŒ©æ”Ÿçș§ćˆ«äžș12 + * èŻ„æ–čæł•èźŸçœźçš„äž­ćżƒç‚čć’ŒçŒ©æ”Ÿçș§ćˆ«ćŻé€šèż‡reset()æ–čæł•æąć€ïŒ› + * ćŠ‚æžœćœšćœ°ć›Ÿæ˜Ÿç€șćŽè°ƒç”šć°†æ”čć˜ćœ°ć›Ÿçš„äž­ćżƒç‚čć’ŒçŒ©æ”Ÿçș§ćˆ«ćč¶ç«‹ćłæ›Žæ–°ïŒŒćč¶ć°†ćˆć§‹ć€Œæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + centerAndZoom(center?: PlusMapsPoint, zoom?: number): void; + /** + * æž…é™€ćœ°ć›Ÿäž­æ‰€æœ‰èŠ†ç›–ç‰©ćŻčè±Ą + * æ­€æ–čæł•甚äșŽæž…é™€ćœ°ć›Ÿäž­æ‰€æœ‰èŠ†ç›–ç‰©ćŻčè±Ąă€‚ + * æž…é™€ćœ°ć›Ÿäž­çš„èŠ†ç›–ç‰©ćŻčè±ĄćŽäŒšè‡ȘćŠšæ›Žæ–°ćœ°ć›Ÿè§†ć›Ÿă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + clearOverlays(): void; + /** + * ć…łé—­ćœ°ć›ŸæŽ§ä»¶ + * ć…łé—­ćœ°ć›ŸæŽ§ä»¶ć°†äŒšé”€æŻćœ°ć›Ÿäœżç”šçš„è”„æșïŒŒäžćŻć†äœżç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + close(): void; + /** + * èŽ·ć–ćœ“ć‰ćœ°ć›ŸćŻè§†èŒƒć›Žçš„ćœ°ç†ćŒș㟟 + * ćœ“æ—‹èœŹæˆ–äżŻè§†æ—¶ïŒŒæ˜Żćœ“ć‰ćœ°ć›ŸćŻè§†èŒƒć›Žçš„æœ€ć€§ć€–æŽ„çŸ©ćœąćœ°ç†ćŒș柟。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getBounds(): PlusMapsBounds; + /** + * èŽ·ć–ćœ°ć›Ÿäž­ćżƒç‚čäœçœź + * æ­€æ–čæł•甚äșŽèŽ·ć–èźŸçœźçš„ćœ°ć›Ÿäž­ćżƒç‚čäœçœźïŒˆcenterAndZoom/setCenterïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getCenter(): PlusMapsPoint; + /** + * èŽ·ć–ćœ“ć‰ćœ°ć›Ÿæ˜Ÿç€șçš„ćœ°ć›Ÿäž­ćżƒç‚čäœçœź + * æ­€æ–čæł•甚äșŽèŽ·ć–ćœ“ć‰ćœ°ć›Ÿæ˜Ÿç€șçš„ćœ°ć›Ÿäž­ćżƒç‚čäœçœźïŒŒèŽ·ć–æˆćŠŸćŽé€šèż‡callbackć›žè°ƒèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getCurrentCenter(callback?: (result0: number, result1: PlusMapsPoint) => void): boolean; + /** + * èŽ·ć–ćœ°ć›Ÿçš„æ˜Ÿç€ș类枋 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getMapType(): PlusMapsMapType; + /** + * èŽ·ć–ç”šæˆ·çš„ćœ“ć‰äœçœźäżĄæŻ + * æ­€æ–čæł•甚äșŽèŽ·ć–ç”šæˆ·çš„ćœ“ć‰äœçœźäżĄæŻïŒŒèŽ·ć–æˆćŠŸćŽé€šèż‡callbackć›žè°ƒèż”ć›žă€‚ + * èŽ·ć–ç”šæˆ·ćœ“ć‰äœçœźäżĄæŻć°†æ‰“ćŒ€ćźšäœèźŸć€‡ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getUserLocation(callback?: (result0: number, result1: PlusMapsPoint) => void): boolean; + /** + * èŽ·ć–ćœ°ć›Ÿçš„çŒ©æ”Ÿçș§ćˆ« + * æ­€æ–čæł•甚äșŽèźŸçœźćœ°ć›Ÿçš„猩攟çș§ćˆ«ïŒŒç”šäșŽćˆ‡æąćœ“ć‰æ˜Ÿç€șćœ°ć›ŸçŒ©æ”Ÿçș§ćˆ«ă€‚ + * èŻ„æ–čæł•æ”čć˜çŒ©æ”Ÿçș§ćˆ«ćŽćœ°ć›Ÿæ˜Ÿç€ș憅ćźčć°†ç«‹ćłæ›Žæ–°ïŒ› + * èŻ„æ–čæł•䞍䌚æ”čć˜ćœ°ć›Ÿæ˜Ÿç€șćŒșćŸŸïŒŒä»„ćœ“ć‰ćœ°ć›Ÿæ˜Ÿç€ș的侭濃ç‚čäœçœźæ„çŒ©æ”Ÿćœ°ć›Ÿă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getZoom(): number; + /** + * éšè—ćœ°ć›ŸæŽ§ä»¶ + * æ­€æ–čæł•甚äșŽéšè—ćœ°ć›ŸæŽ§ä»¶ïŒŒé€šćžžćœšæ˜Ÿç€șćŽè°ƒç”šæ­€æ–čæł•æ„éšè—ă€‚ + * ćŠ‚æžœćœ°ć›Ÿć·Čç»éšè—ć†è°ƒç”šæ­€æ–čæł•ć°†æ— æ•ˆæžœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + hide(): void; + /** + * èŽ·ć–æ˜ŻćŠæ˜Ÿç€șç”šæˆ·äœçœź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + isShowUserLocation(): boolean; + /** + * èŽ·ć–æ˜ŻćŠæ˜Ÿç€șćœ°ć›Ÿć†…çœźçŒ©æ”ŸæŽ§ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + isShowZoomControls(): boolean; + /** + * èŽ·ć–æ˜ŻćŠæ‰“ćŒ€ćœ°ć›Ÿäș€é€šäżĄæŻć›Ÿć±‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + isTraffic(): boolean; + /** + * ä»Žćœ°ć›Ÿäž­ćˆ é™€èŠ†ç›–ç‰©ćŻčè±Ą + * æ­€æ–čæł•甚äșŽä»Žćœ°ć›Ÿäž­ćˆ é™€èŠ†ç›–ç‰©ćŻčè±Ąă€‚ + * æ”ŻæŒć„ç§ä»Žmaps.OverlayćŻčè±Ąç»§æ‰żçš„ć„ç§èŠ†ç›–ç‰©ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + removeOverlay(overlay?: PlusMapsOverlay): void; + /** + * é‡çœźćœ°ć›Ÿ + * æ­€æ–čæł•甚äșŽé‡æ–°èźŸçœźćœ°ć›ŸïŒŒæąć€ćœ°ć›Ÿçš„ćˆć§‹ćŒ–æ—¶çš„äž­ćżƒç‚čć’ŒçŒ©æ”Ÿçș§ćˆ«ă€‚ + * èŻ„æ–čæł•ć°†ćŻŒè‡Žæ˜Ÿç€ș憅ćźčć°†ç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + reset(): void; + /** + * é‡èźŸćœ°ć›ŸæŽ§ä»¶ć€§ć° + * æ­€æ–čæł•甚äșŽé‡æ–°èźĄçź—ćœ°ć›ŸæŽ§ä»¶ć€§ć°ïŒŒäżæŒäžŽæž„é€ æ—¶äŒ ć…„DOMć…ƒçŽ çš„ć€§ć°ćŠäœçœźäž€è‡Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + resize(): void; + /** + * èźŸçœźćœ°ć›Ÿçš„äž­ćżƒç‚č + * æ­€æ–čæł•甚äșŽèźŸçœźćœ°ć›Ÿçš„äž­ćżƒç‚č甚äșŽćˆ‡æąćœ“ć‰æ˜Ÿç€șćœ°ć›Ÿäœçœźă€‚ + * èŻ„æ–čæł•æ”č揘侭濃ç‚čćŽćœ°ć›Ÿæ˜Ÿç€ș憅ćźčć°†ç«‹ćłæ›Žæ–°ïŒ› + * èŻ„æ–čæł•䞍䌚æ”čć˜ćœ°ć›Ÿæ˜Ÿç€ș的猩攟çș§ćˆ«ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setCenter(center?: PlusMapsPoint): void; + /** + * èźŸçœźćœ°ć›Ÿçš„è§†ć›Ÿç±»ćž‹ + * æ­€æ–čæł•甚äșŽèźŸçœźćœ°ć›Ÿç±»ćž‹ïŒŒé»˜èź€äžșæ™źé€šèĄ—é“è§†ć›Ÿă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setMapType(type?: PlusMapsMapType): void; + /** + * èźŸçœźćœ°ć›ŸæŽ§ä»¶çš„é…çœźć‚æ•° + * 甹äșŽćŠšæ€æ›Žæ–°ćœ°ć›ŸæŽ§ä»¶çš„ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setStyles(styles?: PlusMapsMapStyles): void; + /** + * æ˜ŻćŠæ‰“ćŒ€ćœ°ć›Ÿäș€é€šäżĄæŻć›Ÿć±‚ + * æ­€æ–čæł•甚äșŽèźŸçœźæ˜ŻćŠæ‰“ćŒ€ćœ°ć›Ÿäș€é€šäżĄæŻć›Ÿć±‚ïŒŒé»˜èź€äžæ˜Ÿç€ș。 + * èŻ„æ–čæł•æ”čć˜æ˜ŻćŠæ˜Ÿç€șäș€é€šć›Ÿć±‚ćŽćœ°ć›Ÿæ˜Ÿç€ș憅ćźčć°†ç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setTraffic(traffic?: boolean): void; + /** + * èźŸçœźćœ°ć›Ÿçš„çŒ©æ”Ÿçș§ćˆ« + * æ­€æ–čæł•甚äșŽèźŸçœźćœ°ć›Ÿçš„猩攟çș§ćˆ«ïŒŒç”šäșŽćˆ‡æąćœ“ć‰æ˜Ÿç€șćœ°ć›ŸçŒ©æ”Ÿçș§ćˆ«ă€‚ + * èŻ„æ–čæł•æ”čć˜çŒ©æ”Ÿçș§ćˆ«ćŽćœ°ć›Ÿæ˜Ÿç€ș憅ćźčć°†ç«‹ćłæ›Žæ–°ïŒ› + * èŻ„æ–čæł•䞍䌚æ”čć˜ćœ°ć›Ÿæ˜Ÿç€șćŒșćŸŸïŒŒä»„ćœ“ć‰ćœ°ć›Ÿæ˜Ÿç€ș的侭濃ç‚čäœçœźæ„çŒ©æ”Ÿćœ°ć›Ÿă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setZoom(zoom?: number): void; + /** + * 星ç€șćœ°ć›ŸæŽ§ä»¶ + * æ­€æ–čæł•甚äșŽæ˜Ÿç€șćœ°ć›ŸæŽ§ä»¶ïŒŒé€šćžžćœšéšè—ćŽè°ƒç”šæ­€æ–čæł•杄星ç€ș。 + * ćŠ‚æžœćœ°ć›Ÿć·Č经星ç€șć†è°ƒç”šæ­€æ–čæł•ć°†æ— æ•ˆæžœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + show(): void; + /** + * 星ç€șç”šæˆ·äœçœź + * æ­€æ–čæł•ć°†ćœšćœ°ć›ŸäžŠæ˜Ÿç€șç”šæˆ·äœçœźäżĄæŻă€‚ + * 星ç€șç”šæˆ·äœçœźć°†æ‰“ćŒ€ćźšäœèźŸć€‡ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + showUserLocation(display?: boolean): void; + /** + * èźŸçœźæ˜ŻćŠæ˜Ÿç€șćœ°ć›Ÿć†…çœźçŒ©æ”ŸæŽ§ä»¶ + * æ­€æ–čæł•ć°†ćœšćœ°ć›ŸäžŠæ˜Ÿç€șć†…çœźçŒ©æ”ŸæŽ§ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + showZoomControls(display?: boolean): void; +} + +/** + * ćœ°ć›ŸæŽ§ä»¶ćŻčè±Ąçš„ć‚æ•° + * èźŸçœźćœ°ć›ŸćŻčè±Ąæ˜Ÿç€șæ—¶äœżç”šçš„ć‚æ•°ïŒŒćŠ‚ćœ°ć›Ÿçš„äž­ćżƒäœçœźă€çŒ©æ”Ÿçș§ćˆ«ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsMapStyles { + /** + * ćœ°ć›Ÿçš„äž­ćżƒäœçœź + * æœȘèźŸçœźćˆ™äœżç”šćœ°ć›Ÿçš„é»˜èź€äž­ćżƒç‚čïŒˆç”±ćœ°ć›ŸäŸ›ćș”ć•†çĄźćźšïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + center?: PlusMapsPoint; + /** + * ćœ°ć›Ÿçš„çŒ©æ”Ÿçș§ćˆ« + * æœ‰æ•ˆèŒƒć›Žäžș1-22ïŒŒé»˜èź€ć€Œäžș12ïŒŒèźŸçœźæ— æ•ˆçš„ć€Œćˆ™äœżç”šé»˜èź€ć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + zoom?: number; + /** + * ćœ°ć›Ÿçš„è§†ć›Ÿç±»ćž‹ + * ćŻèźŸçœźæ™źé€šèĄ—é“è§†ć›Ÿă€ć«æ˜Ÿè§†ć›ŸïŒŒé»˜èź€ć€Œäžșæ™źé€šèĄ—é“è§†ć›Ÿă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + type?: PlusMapsMapType; + /** + * ćœ°ć›Ÿçš„æ˜ŻćŠæ˜Ÿç€șäș€é€šäżĄæŻ + * trueèĄšç€ș星ç€șćœ°ć›Ÿçš„äș€é€šäżĄæŻć›Ÿć±‚falsećˆ™äžæ˜Ÿç€șïŒŒé»˜èź€ć€Œäžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + traffic?: boolean; + /** + * æ˜ŻćŠæ˜Ÿç€șćœ°ć›Ÿçš„ć†…çœźçŒ©æ”ŸæŽ§ä»¶ + * trueèĄšç€ș星ç€șćœ°ć›Ÿçš„ć†…çœźçŒ©æ”ŸæŽ§ä»¶ïŒŒfalsećˆ™äžæ˜Ÿç€șïŒŒé»˜èź€ć€Œäžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + zoomControls?: boolean; + /** + * ćœ°ć›ŸæŽ§ä»¶ć·ŠäžŠè§’çš„ćž‚ç›Žćç§»é‡ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶WebviewçȘ—ćŁçš„é«˜ćșŠïŒ› + * è‡ȘćŠšèźĄçź—ïŒŒćŠ‚"auto",æ čæźheightć€Œè‡ȘćŠšèźĄçź—ïŒŒç›žćŻčäșŽçˆ¶WebviewçȘ—ćŁćž‚ç›Žć±…äž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + top?: string; + /** + * ćœ°ć›ŸæŽ§ä»¶ć·ŠäžŠè§’çš„æ°Žćčłćç§»é‡ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶WebviewçȘ—ćŁçš„ćźœćșŠïŒ› + * è‡ȘćŠšèźĄçź—ïŒŒćŠ‚"auto"æ čæźwidthć€Œè‡ȘćŠšèźĄçź—ïŒŒç›žćŻčäșŽçˆ¶WebviewçȘ—ćŁæ°Žćčłć±…䞭。 + * é»˜èź€ć€Œäžș"0px"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + left?: string; + /** + * ćœ°ć›ŸæŽ§ä»¶çš„ćźœćșŠ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶WebviewçȘ—ćŁçš„ćźœćșŠă€‚ + * é»˜èź€ć€Œäžș"100%"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + width?: string; + /** + * ćœ°ć›ŸæŽ§ä»¶çš„é«˜ćșŠ + * ćŻć–ć€ŒïŒš + * ćƒçŽ ć€ŒïŒŒćŠ‚"100px" + * ç™Ÿćˆ†æŻ”ïŒŒćŠ‚"10%"盞ćŻčäșŽçˆ¶WebviewçȘ—ćŁçš„é«˜ćșŠă€‚ + * é»˜èź€ć€Œäžș"100%"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + height?: string; + /** + * ćœ°ć›ŸæŽ§ä»¶ćœšWebviewçȘ—ćŁçš„ćžƒć±€æšĄćŒ + * ćŻć–ć€ŒïŒš + * "static" - é™æ€ćžƒć±€æšĄćŒïŒŒćŠ‚æžœéĄ”éąć­˜ćœšæ»šćŠšæĄćˆ™éšçȘ—ćŁć†…ćźčæ»šćŠšïŒ› + * "absolute" - 绝ćŻčćžƒć±€æšĄćŒïŒŒćŠ‚æžœéĄ”éąć­˜ćœšæ»šćŠšæĄäžéšçȘ—ćŁć†…ćźčæ»šćŠšïŒ› + * é»˜èź€ć€Œäžș"static"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + position?: string; +} + +/** + * ćœ°ç†çŒ–ç èœŹæąçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsGeocodeOptions { + /** + * æșæ•°æźçš„ćæ ‡çł»ç±»ćž‹ + * ä»…ćœšćć‘ćœ°ç†çŒ–ç èœŹæąæ—¶ç”Ÿæ•ˆă€‚ + * “wgs84â€ïŒšèĄšç€șWGS-84ćæ ‡çł»ïŒ› “gcj02â€ïŒšèĄšç€șć›œæ”‹ć±€ç»çșŹćșŠćæ ‡çł»ïŒ› “bd09â€ïŒšèĄšç€ș癟ćșŠćąšćĄæ‰˜ćæ ‡çł»ïŒ› “bd09llâ€ïŒšèĄšç€ș癟ćșŠç»çșŹćșŠćæ ‡çł»ïŒ› + * é»˜èź€äœżç”šwgs84ćæ ‡çł»ă€‚ + * - wgs84: WGS-84ćæ ‡çł»ïŒŒćłGPSèźŸć€‡é‡‡é›†çš„ćŽŸć§‹GPSćæ ‡ + * - gcj02: ć›œæ”‹ć±€ç»çșŹćșŠćæ ‡çł»ïŒŒsosoćœ°ć›Ÿă€aliyunćœ°ć›Ÿă€mapabcćœ°ć›Ÿć’Œamapćœ°ć›Ÿæ‰€ç”šçš„ćæ ‡çł» + * - bd09: 癟ćșŠćąšćĄæ‰˜ćæ ‡çł» + * - bd09ll: 癟ćșŠç»çșŹćșŠćæ ‡çł» + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + coordType?: 'wgs84' | 'gcj02' | 'bd09' | 'bd09ll'; + /** + * æșćœ°ć€æ‰€ć±žçš„ćŸŽćž‚ + * ä»…ćœšćœ°ç†çŒ–ç èœŹæąæ—¶ç”Ÿæ•ˆïŒŒćŠ‚æžœäžæŒ‡ćźšćˆ™ćœšć…šć›œèŒƒć›Žć†…ćŒșé…èœŹæąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + city?: string; +} + +/** + * ćœ°ć›Ÿćæ ‡èœŹæąçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsCoordinateConvertOptions { + /** + * æșæ•°æźçš„ćæ ‡çł»ç±»ćž‹ + * “wgs84â€ïŒšèĄšç€șWGS-84ćæ ‡çł»ïŒ› “gcj02â€ïŒšèĄšç€șć›œæ”‹ć±€ç»çșŹćșŠćæ ‡çł»ïŒ› “bd09â€ïŒšèĄšç€ș癟ćșŠćąšćĄæ‰˜ćæ ‡çł»ïŒ› “bd09llâ€ïŒšèĄšç€ș癟ćșŠç»çșŹćșŠćæ ‡çł»ïŒ› + * é»˜èź€äœżç”šwgs84ćæ ‡çł»ă€‚ + * - wgs84: WGS-84ćæ ‡çł»ïŒŒćłGPSèźŸć€‡é‡‡é›†çš„ćŽŸć§‹GPSćæ ‡ + * - gcj02: ć›œæ”‹ć±€ç»çșŹćșŠćæ ‡çł»ïŒŒsosoćœ°ć›Ÿă€aliyunćœ°ć›Ÿă€mapabcćœ°ć›Ÿć’Œamapćœ°ć›Ÿæ‰€ç”šçš„ćæ ‡çł» + * - bd09: 癟ćșŠćąšćĄæ‰˜ćæ ‡çł» + * - bd09ll: 癟ćșŠç»çșŹćșŠćæ ‡çł» + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + coordType?: 'wgs84' | 'gcj02' | 'bd09' | 'bd09ll'; +} + +/** + * PointćŻčè±Ąç”šäșŽèĄšç€șćœ°ć›Ÿć…ƒçŽ çš„ćæ ‡ + * ćžžç”šèŻ­ćŻčćœ°ć›ŸäžŠć…ƒçŽ èż›èĄŒćźšäœæ—¶äœżç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsPoint { + /** + * èźŸçœźćæ ‡ç‚č的经ćșŠ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setLng(lng?: number): void; + /** + * èŽ·ć–ćæ ‡çš„ç»ćșŠ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getLng(): number; + /** + * èźŸçœźćæ ‡çš„çșŹćșŠ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setLat(): void; + /** + * èŽ·ć–ćæ ‡çš„çșŹćșŠ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getLat(): number; + /** + * ćˆ€æ–­äž€äžȘćæ ‡ç‚čæ˜ŻćŠç›žç­‰ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + equals(pt?: PlusMapsPoint): boolean; +} + +/** + * 朰理ćŒș㟟 + * æœ‰è„żć—ćŠäžœćŒ—ćæ ‡ç‚čæ•°æźç»„æˆçš„çŸ©ćœąćŒș柟。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsBounds { + /** + * èźŸçœźćœ°ç†ćŒșćŸŸçš„äžœćŒ—ćæ ‡ç‚č + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setNorthEase(point?: PlusMapsPoint): void; + /** + * 朰理ćŒșćŸŸçš„äžœćŒ—ćæ ‡ç‚č + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getNorthEase(): PlusMapsPoint; + /** + * èźŸçœźćœ°ç†ćŒșćŸŸçš„è„żć—ćæ ‡ç‚č + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setSouthWest(point?: PlusMapsPoint): void; + /** + * 朰理ćŒșćŸŸçš„è„żć—ćæ ‡ç‚č + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getSouthWest(): PlusMapsPoint; + /** + * ćˆ€æ–­ćˆ¶ćźšçš„ćæ ‡æ˜ŻćŠćœšćœ°ç†ćŒș柟侭 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + contains(point?: PlusMapsPoint): boolean; + /** + * ćˆ€æ–­äž€äžȘ朰理ćŒșćŸŸæ˜ŻćŠç›žç­‰ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + equals(bounds?: PlusMapsBounds): boolean; + /** + * èŽ·ć–ćœ°ç†ćŒș柟的侭濃ç‚čćæ ‡ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getCenter(): PlusMapsPoint; +} + +/** + * ćœ°ć›Ÿè§†ć›Ÿç±»ćž‹ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsMapType { + /** + * æ™źé€šèĄ—é“è§†ć›Ÿç±»ćž‹ + * ćœ°ć›Ÿè§†ć›Ÿç±»ćž‹ćžžé‡ïŒŒæ™źé€šèĄ—é“è§†ć›Ÿă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + MAPTYPE_NORMAL?: number; + /** + * ć«æ˜Ÿè§†ć›Ÿ + * ćœ°ć›Ÿè§†ć›Ÿç±»ćž‹ćžžé‡ïŒŒć«æ˜Ÿè§†ć›Ÿă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + MAPTYPE_SATELLITE?: number; +} + +/** + * ćœ°ć›ŸèŠ†ç›–ç‰©ćŸșç±»ćŻčè±Ą + * Overlayæ˜Żćœ°ć›ŸäžŠæ˜Ÿç€ș慃箠的ćŸș类甚äșŽæŠœè±Ąćœ°ć›Ÿć…ƒçŽ ïŒŒäžç”šäșŽćźžäŸ‹ćŒ–。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsOverlay { + /** + * ćˆ€æ–­ćœ°ć›ŸèŠ†ç›–ç‰©æ˜ŻćŠćŻè§ + * ćœ°ć›ŸèŠ†ç›–ç‰©ćŻčè±Ąé»˜èź€äžșćŻè§ïŒ›ćœ°ć›ŸèŠ†ç›–ç‰©ćŻčè±Ąæ˜ŻćŠćŻè§ç”±ć…¶è‡Șèș«çŠ¶æ€ć†łćźšïŒŒäžçźĄć…¶æ˜ŻćŠè૿·»ćŠ ćˆ°ćœ°ć›Ÿć±‚äž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + isVisible(): boolean; + /** + * 星ç€șćœ°ć›ŸäžŠçš„èŠ†ç›–ç‰© + * 澾甹äșŽćœ°ć›ŸèŠ†ç›–ç‰©ćœšéšè—ćŽè°ƒç”šæ­€æ–čæł•杄星ç€ș。 + * ćȘæœ‰æ·»ćŠ ćˆ°ćœ°ć›ŸäžŠçš„èŠ†ç›–ç‰©æ‰èƒœçœ‹ćˆ°æ•ˆæžœïŒ› + * ćŠ‚æžœèŠ†ç›–ç‰©ćŻčè±Ąć·Čç»ćœšćœ°ć›ŸäžŠæ˜Ÿç€șć†è°ƒç”šæ­€æ–čæł•ć°†æ— æ•ˆæžœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + show(): void; + /** + * éšè—ćœ°ć›ŸäžŠçš„èŠ†ç›–ç‰© + * 澾甹äșŽćœ°ć›ŸèŠ†ç›–ç‰©ćœšæ˜Ÿç€șćŽè°ƒç”šæ­€æ–čæł•æ„éšè—ă€‚ + * ćȘæœ‰æ·»ćŠ ćˆ°ćœ°ć›ŸäžŠçš„èŠ†ç›–ç‰©æ‰èƒœçœ‹ćˆ°æ•ˆæžœïŒ› + * ćŠ‚æžœèŠ†ç›–ç‰©ćŻčè±Ąć·Čç»ćœšćœ°ć›ŸäžŠéšè—ć†è°ƒç”šæ­€æ–čæł•ć°†æ— æ•ˆæžœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + hide(): void; +} + +/** + * ćœ°ć›ŸäžŠæ˜Ÿç€ș的标ç‚čćŻčè±Ą + * 从OverlayćŻčè±Ąç»§æ‰żè€Œæ„ïŒŒćŻé€šèż‡MapćŻčè±Ąçš„addOverlay()æ–čæł•ć°†ćŻčè±Ąæ·»ćŠ ćœ°ć›Ÿäž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsMarker { + /** + * 甚户ç‚čć‡»ćœ°ć›Ÿæ ‡ç‚čäș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + onclick?: (result: PlusMapsOverlay) => void; + /** + * 甚户拖拜标ç‚čäș‹ä»¶ + * ćŻè°ƒç”šæ ‡ç‚čćŻčè±Ąçš„markObj.setDraggable(true)æ–čæł•èźŸçœźæ ‡ç‚čć…èźžæ‹–æ‹œïŒŒćœ“ç”šæˆ·æ‹–æ‹œæ ‡ç‚čćŻčè±Ąæ—¶è§Šć‘æ­€äș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + onDrag?: (result: any) => void; + /** + * 芆盖物星ç€șćˆ°æœ€äžŠć±‚ + * 澾甹äșŽèŠ†ç›–ç‰©ç›žäș’芆盖时调敎芆盖物的星ç€șéĄșćșă€‚ + * ćȘæœ‰æ·»ćŠ ćˆ°ćœ°ć›ŸäžŠçš„èŠ†ç›–ç‰©æ‰èƒœçœ‹ćˆ°æ•ˆæžœïŒ› + * ćŠ‚æžœèŠ†ç›–ç‰©ćŻčè±Ąć·Čç»ćœšćœ°ć›ŸäžŠéšè—ć†è°ƒç”šæ­€æ–čæł•ć°†æ— æ•ˆæžœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + bringToTop(): void; + /** + * èźŸçœźæ ‡ç‚čćŻčè±Ąçš„ćæ ‡ + * 标ç‚čćœšèźŸçœźæ–°ćæ ‡ćŽć°†ćœšćœ°ć›ŸäžŠç«‹ćłæ›Žæ–°æ ‡ç‚čäœçœźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setPoint(point?: PlusMapsPoint): void; + /** + * èŽ·ć–æ ‡ç‚čçš„ćæ ‡ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getPoint(): PlusMapsPoint; + /** + * èźŸçœźæ ‡ç‚č䞊星ç€șçš„ć›Ÿæ ‡ + * è‹„æœȘèźŸçœźćˆ™æ˜Ÿç€șé»˜èź€æ ‡ç‚čć›Ÿæ ‡ïŒŒć·Čæ·»ćŠ çš„æ ‡ç‚čćœšèźŸçœźæ–°ć€ŒćŽć°†ćœšćœ°ć›ŸäžŠç«‹ćłæ›Žæ–°æ ‡ç‚č憅ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setIcon(icon?: string): void; + /** + * èźŸçœźæ ‡ç‚č䞊星ç€șçš„ć›Ÿæ ‡æ•°ç»„ + * èźŸçœźć›Ÿæ ‡æ•°ç»„ćŽćˆ™æŒ‰ç…§æŒ‡ćźšçš„é—Žéš”æ—¶é—Žèœźæ’­æ•°ç»„äž­ć›Ÿæ ‡ă€‚ + * èźŸçœźć›Ÿæ ‡æ•°ç»„ćŽć°†ćżœç•„setIconæ–čæł•èźŸçœźçš„ć›Ÿæ ‡ïŒŒæœȘèźŸçœźćˆ™æ˜Ÿç€șsetIconèźŸçœźçš„ć›Ÿæ ‡ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setIcons(icons?: any []): void; + /** + * èźŸçœźæ ‡ç‚č䞊星ç€șçš„æ–‡æœŹæ ‡æłš + * è‹„æœȘèźŸçœźćˆ™äžæ˜Ÿç€șæ ‡æłšïŒˆé»˜èź€äžșç©ș歗笩äžČć·Čæ·»ćŠ çš„æ ‡ç‚čćœšèźŸçœźæ–°ć€ŒćŽć°†ćœšćœ°ć›ŸäžŠç«‹ćłæ›Žæ–°æ ‡ç‚č憅ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setLabel(label?: string): void; + /** + * èŽ·ć–æ ‡ç‚č䞊星ç€șçš„æ–‡æœŹæ ‡æłš + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getLabel(): string; + /** + * èźŸçœźæ ‡ç‚čçš„æ°”æłĄć†…ćźč + * èźŸçœźæ°”æłĄć†…ćźčćŽïŒŒç”šæˆ·ç‚čć‡»æ ‡ç‚č时ćŒčć‡ș戙ćŒčć‡șæ°”æłĄă€‚ + * æłšæ„ïŒšç”šæˆ·ç‚čć‡»æ ‡ç‚čæ—¶ć…ˆćŒčć‡ș标ç‚čć…łè”çš„æ°”æłĄïŒŒć†ć“ćș”æ ‡ç‚č的onclickäș‹ä»¶ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setBubble(buuble?: PlusMapsBubble, pop?: boolean): void; + /** + * èŽ·ć–æ ‡ç‚č䞊星ç€șçš„æ–‡æœŹæ ‡æłš + * ćŠ‚æžœæČĄæœ‰èźŸçœźć…łè”çš„æ°”æłĄćŻčè±Ąćˆ™èż”ć›žnull。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getBubble(): PlusMapsBubble; + /** + * 隐藏标ç‚č䞊星ç€șçš„æ°”æłĄ + * ćŠ‚æžœæČĄæœ‰èźŸçœźć…łè”çš„æ°”æłĄćŻčè±Ąæˆ–è€…æ°”æłĄćŻčè±ĄæČĄæœ‰ćŒčć‡ș星ç€șïŒŒćˆ™äžćšä»»äœ•æ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + hideBubble(): void; + /** + * èźŸçœźæ ‡ç‚čçš„æ˜ŻćŠć…èźžæ‹–æ‹œ + * èźŸçœźæ ‡ç‚čćŻæ‹–æ‹œćŽïŒŒç”šæˆ·æŒ‰äœæ ‡ç‚čćŽæ‹–ćŠšïŒŒæ ‡ç‚čäŒšè·Ÿéšæ‰‹çš„æ‹–æ‹œè€Œç§»ćŠšă€‚ + * æ‹–æ‹œćŽäŒšæ›Žæ–°æ ‡ç‚čçš„ćæ ‡äżĄæŻă€‚ + * æłšïŒšæ‹–ćŠšć‰éœ€èŠć…ˆćœšæ ‡ç‚čäžŠé•żæŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setDraggable(draggable?: boolean): void; + /** + * èŽ·ć–æ ‡ç‚čæ˜ŻćŠć…èźžæ‹–拜 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + isDraggable(): boolean; +} + +/** + * ćœ°ć›ŸäžŠæ˜Ÿç€șçš„æ°”æłĄćŻčè±Ą + * æ­€ćŻčè±Ąäžèƒœç›ŽæŽ„æ·»ćŠ ćˆ°ćœ°ć›ŸäžŠæ˜Ÿç€șćȘćŻć…łè”ćˆ°ćœ°ć›Ÿæ ‡ç‚č芆盖物䞊甚户ç‚čć‡»æ ‡ç‚č时ćŒčć‡ș星ç€ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsBubble { + /** + * 甚户ç‚čć‡»æ°”æłĄäș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + onclick?: (result: PlusMapsOverlay) => void; + /** + * èźŸçœźæ°”æłĄäžŠæ˜Ÿç€șçš„ć›Ÿæ ‡ + * è‹„äžșèźŸçœźćˆ™æ— é»˜èź€ć›Ÿæ ‡ïŒŒć·Čæ·»ćŠ çš„æ˜Ÿç€șçš„æ°”æłĄćœšèźŸçœźæ–°ć€ŒćŽć°†ćœšćœ°ć›ŸäžŠç«‹ćłæ›Žæ–°ć†…ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setIcon(icon?: string): void; + /** + * èźŸçœźæ°”æłĄäžŠæ˜Ÿç€șçš„æ–‡ć­—ć†…ćźč + * è‹„æœȘèźŸçœźćˆ™äžæ˜Ÿç€șæ–‡ć­—ïŒˆé»˜èź€äžșç©ș歗笩äžČć·Čæ·»ćŠ çš„æ˜Ÿç€șçš„æ°”æłĄćœšèźŸçœźæ–°ć€ŒćŽć°†ćœšćœ°ć›ŸäžŠç«‹ćłæ›Žæ–°ć†…ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setLabel(label?: string): void; + /** + * èŽ·ć–æ°”æłĄäžŠæ˜Ÿç€șçš„æ–‡ć­—ć†…ćźč + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getLabel(): string; + /** + * èŽ·ć–æ°”æłĄæ‰€ć±žçš„æ ‡ç‚čćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + belongMarker(): PlusMapsMarker; + /** + * ä»Žć›Ÿç‰‡ćŠ èœœæ°”æłĄæ˜Ÿç€ș的憅ćźč + * é€šèż‡ćŠ èœœć›Ÿç‰‡æ„è‡Ș漚ä艿°”æłĄæ˜Ÿç€ș的憅ćźčïŒŒćŠ èœœć›Ÿç‰‡ćŽć°†æž…ç©șæ°”æłĄäœżç”šçš„ć›Ÿæ ‡ćŠæ–‡ć­—ć†…ćźč。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + loadImage(path?: string): void; + /** + * ä»Žć›Ÿç‰‡æ•°æźćŠ èœœæ°”æłĄæ˜Ÿç€ș的憅ćźč + * é€šèż‡ćŠ èœœć›Ÿç‰‡æ•°æźæ„è‡Ș漚ä艿°”æłĄæ˜Ÿç€ș的憅ćźčïŒŒćŠ èœœć›Ÿç‰‡ćŽć°†æž…ç©șæ°”æłĄäœżç”šçš„ć›Ÿæ ‡ćŠæ–‡ć­—ć†…ćźč。 + * ć›Ÿç‰‡æ•°æźćŻé€šèż‡Canvasè‡Ș漚äč‰ç»˜ćˆ¶ćŽè°ƒç”štoDataURLæ„èŽ·ć–ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + loadImageDataURL(data?: string): void; +} + +/** + * ćœ°ć›ŸäžŠæ˜Ÿç€ș的朆月ćŻčè±Ą + * 从OverlayćŻčè±Ąç»§æ‰żè€Œæ„ïŒŒćŻé€šèż‡MapćŻčè±Ąçš„addOverlay()æ–čæł•ć°†ćŻčè±Ąæ·»ćŠ ćœ°ć›Ÿäž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsCircle { + /** + * èźŸçœźćœ†ćœˆäž­ćżƒç‚č的经çșŹćșŠćæ ‡ + * èŻ„æ–čæł•èźŸçœźć°†ćŻŒè‡Žćœ°ć›Ÿäž­çš„ćœ†ćœˆç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setCenter(point?: PlusMapsPoint): void; + /** + * èŽ·ć–ćœ†ćœˆäž­ćżƒç‚čçš„ćæ ‡ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getCenter(): PlusMapsPoint; + /** + * èźŸçœźćœ†ćœˆçš„ćŠćŸ„ïŒŒć•äœäžș米 + * èŻ„æ–čæł•èźŸçœźć°†ćŻŒè‡Žćœ°ć›Ÿäž­çš„ćœ†ćœˆç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setRadius(radius?: number): void; + /** + * èŽ·ć–ćœ†ćœˆçš„ćŠćŸ„ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getRadius(): number; + /** + * èźŸçœźćœ†ćœˆçš„èŸčæĄ†éąœè‰Č + * ćœ†ćœˆé»˜èź€çš„ćœ†ćœˆèŸčæĄ†éąœè‰Čäžș黑è‰Č"#000000"ïŒŒèŻ„æ–čæł•èźŸçœźć°†ćŻŒè‡Žćœ°ć›Ÿäž­çš„ćœ†ćœˆç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setStrokeColor(color?: string): void; + /** + * èŽ·ć–ćœ†ćœˆçš„èŸčæĄ†éąœè‰Č + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getStrokeColor(): string; + /** + * èźŸçœźćœ†ćœˆçš„èŸčæĄ†éąœè‰Č + * ćœ†ćœˆé»˜èź€ć€Œäžșäžé€æ˜Žă€‚ + * ćŠ‚æžœèźŸçœźçš„ć€Œäžćˆæł•ćˆ™äżæŒćŽŸæœ‰çš„é€æ˜ŽćșŠïŒ›èŻ„æ–čæł•èźŸçœźć°†ćŻŒè‡Žćœ°ć›Ÿäž­çš„ćœ†ćœˆç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setStrokeOpacity(opacity?: number): void; + /** + * èŽ·ć–ćœ†ćœˆèŸčæĄ†çš„é€æ˜ŽćșŠ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getStrokeOpacity(): number; + /** + * èźŸçœźćœ†ćœˆçš„ćĄ«ć……éąœè‰Č + * ćœ†ćœˆé»˜èź€çš„ćœ†ćœˆćĄ«ć……éąœè‰Čäžș无è‰ČïŒŒèŻ„æ–čæł•èźŸçœźć°†ćŻŒè‡Žćœ°ć›Ÿäž­çš„ćœ†ćœˆç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setFillColor(color?: string): void; + /** + * èŽ·ć–ćœ†ćœˆçš„ćĄ«ć……éąœè‰Č + * ćŠ‚æžœćĄ«ć……éąœè‰Čäžș无è‰ČïŒŒćˆ™èż”ć›žç©ș歗笩äžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getFillColor(): string; + /** + * èźŸçœźćœ†ćœˆćĄ«ć……éąœè‰Č的透明ćșŠ + * ćœ†ćœˆé»˜èź€ć€Œäžșäžé€æ˜Žă€‚ + * ćŠ‚æžœèźŸçœźçš„ć€Œäžćˆæł•ćˆ™äżæŒćŽŸæœ‰çš„é€æ˜ŽćșŠïŒ›èŻ„æ–čæł•èźŸçœźć°†ćŻŒè‡Žćœ°ć›Ÿäž­çš„ćœ†ćœˆç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setFillOpacity(opacity?: number): void; + /** + * èŽ·ć–ćœ†ćœˆćĄ«ć……è‰Č的透明ćșŠ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getFillOpacity(): number; + /** + * èźŸçœźćœ†ćœˆèŸčæĄ†çš„çșżæĄćźœćșŠ + * 朆月èŸčæĄ†çš„é»˜èź€ć€Œäžș5。 + * ćŠ‚æžœèźŸçœźçš„ć€Œäžćˆæł•ćˆ™äżæŒćŽŸæœ‰çš„ćźœćșŠïŒ›èŻ„æ–čæł•èźŸçœźć°†ćŻŒè‡Žćœ°ć›Ÿäž­çš„ćœ†ćœˆç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setLineWidth(width?: number): void; + /** + * èŽ·ć–ćœ†ćœˆèŸčæĄ†çš„çșżæĄćźœćșŠ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getLineWidth(): number; +} + +/** + * ćœ°ć›ŸäžŠæ˜Ÿç€ș的折çșżćŻčè±Ą + * 从OverlayćŻčè±Ąç»§æ‰żè€Œæ„ïŒŒćŻé€šèż‡MapćŻčè±Ąçš„addOverlay()æ–čæł•ć°†ćŻčè±Ąæ·»ćŠ ćœ°ć›Ÿäž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsPolyline { + /** + * èźŸçœźæŠ˜çșżçš„饶ç‚čćæ ‡ + * èŻ„æ–čæł•èźŸçœźć°†ćŻŒè‡Žćœ°ć›Ÿäž­çš„æŠ˜çșżç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setPath(points?: any []): void; + /** + * èŽ·ć–æŠ˜çșżçš„饶ç‚čćæ ‡ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getPath(): any []; + /** + * èźŸçœźæŠ˜çșżçš„éąœè‰Č + * 折çșżé»˜èź€çš„éąœè‰Čäžș黑è‰Č"#000000"ïŒŒèŻ„æ–čæł•èźŸçœźć°†ćŻŒè‡Žćœ°ć›Ÿäž­çš„æŠ˜çșżç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setStrokeColor(color?: string): void; + /** + * èŽ·ć–æŠ˜çșżçš„éąœè‰Č + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getStrokeColor(): string; + /** + * èźŸèźŸçœźæŠ˜çșżçš„透明ćșŠ + * 折çșżé»˜èź€ć€Œäžșäžé€æ˜Žă€‚ + * ćŠ‚æžœèźŸçœźçš„ć€Œäžćˆæł•ćˆ™äżæŒćŽŸæœ‰çš„é€æ˜ŽćșŠïŒ›èŻ„æ–čæł•èźŸçœźć°†ćŻŒè‡Žćœ°ć›Ÿäž­çš„æŠ˜çșżç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setStrokeOpacity(opacity?: number): void; + /** + * èŽ·ć–æŠ˜çșżçš„透明ćșŠ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getStrokeOpacity(): number; + /** + * èźŸçœźæŠ˜çșżçš„çșżæĄćźœćșŠ + * 折çșżçșżæĄçš„ćźœćșŠé»˜èź€ć€Œäžș5。 + * ćŠ‚æžœèźŸçœźçš„ć€Œäžćˆæł•ćˆ™äżæŒćŽŸæœ‰çš„ćźœćșŠïŒ›èŻ„æ–čæł•èźŸçœźć°†ćŻŒè‡Žćœ°ć›Ÿäž­çš„æŠ˜çșżç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setLineWidth(width?: number): void; + /** + * èŽ·ć–æŠ˜çșżçš„çșżæĄćźœćșŠ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getLineWidth(): number; +} + +/** + * ćœ°ć›ŸäžŠæ˜Ÿç€ș的怚èŸčćœąćŻčè±Ą + * 从OverlayćŻčè±Ąç»§æ‰żè€Œæ„ïŒŒćŻé€šèż‡MapćŻčè±Ąçš„addOverlay()æ–čæł•ć°†ćŻčè±Ąæ·»ćŠ ćœ°ć›Ÿäž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsPolygon { + /** + * èźŸçœźć€šèŸčćœąçš„éĄ¶ç‚čćæ ‡ + * èŻ„æ–čæł•èźŸçœźć°†ćŻŒè‡Žćœ°ć›Ÿäž­çš„ć€šèŸčćœąç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setPath(points?: any []): void; + /** + * èŽ·ć–ć€šèŸčćœąçš„éĄ¶ç‚čćæ ‡ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getPath(): any []; + /** + * èźŸçœźć€šèŸčćœąçš„éąœè‰Č + * 〚èŸčćœąèŸčæĄ†é»˜èź€çš„éąœè‰Čäžș黑è‰Č"#000000"ïŒŒèŻ„æ–čæł•èźŸçœźć°†ćŻŒè‡Žćœ°ć›Ÿäž­çš„ć€šèŸčćœąç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setStrokeColor(color?: string): void; + /** + * èŽ·ć–ć€šèŸčćœąèŸčæĄ†çš„éąœè‰Č + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getStrokeColor(): string; + /** + * èźŸçœźć€šèŸčćœąçš„é€æ˜ŽćșŠ + * 〚èŸčćœąèŸčæĄ†é»˜èź€ć€Œäžșäžé€æ˜Žă€‚ + * ćŠ‚æžœèźŸçœźçš„ć€Œäžćˆæł•ćˆ™äżæŒćŽŸæœ‰çš„é€æ˜ŽćșŠïŒ›èŻ„æ–čæł•èźŸçœźć°†ćŻŒè‡Žćœ°ć›Ÿäž­çš„ć€šèŸčćœąç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setStrokeOpacity(opacity?: number): void; + /** + * èŽ·ć–ć€šèŸčćœąèŸčæĄ†çš„é€æ˜ŽćșŠ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getStrokeOpacity(): number; + /** + * èźŸçœźć€šèŸčćœąçš„ćĄ«ć……éąœè‰Č + * 〚èŸčćœąé»˜èź€ćĄ«ć……éąœè‰Čäžș无è‰ČïŒŒèŻ„æ–čæł•èźŸçœźć°†ćŻŒè‡Žćœ°ć›Ÿäž­çš„ć€šèŸčćœąç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setFillColor(color?: string): void; + /** + * èŽ·ć–ć€šèŸčćœąçš„ćĄ«ć……è‰Č + * ćŠ‚æžœćĄ«ć……è‰Čäžș无è‰ČïŒŒćˆ™èż”ć›žç©ș歗笩äžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getFillColor(): string; + /** + * èźŸçœźć€šèŸčćœąćĄ«ć……è‰Č的透明ćșŠ + * 〚èŸčćœąćĄ«ć……è‰Čé»˜èź€ć€Œäžșäžé€æ˜Žă€‚ + * ćŠ‚æžœèźŸçœźçš„ć€Œäžćˆæł•ćˆ™äżæŒćŽŸæœ‰çš„é€æ˜ŽćșŠïŒ›èŻ„æ–čæł•èźŸçœźć°†ćŻŒè‡Žćœ°ć›Ÿäž­çš„ć€šèŸčćœąç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setFillOpacity(opacity?: number): void; + /** + * èŽ·ć–ć€šèŸčćœąćĄ«ć……è‰Č的透明ćșŠ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getFillOpacity(): number; + /** + * èźŸçœźć€šèŸčćœąçš„èŸčæĄ†ćźœćșŠ + * 〚èŸčćœąèŸčæĄ†çš„ćźœćșŠé»˜èź€ć€Œäžș5。 + * ćŠ‚æžœèźŸçœźçš„ć€Œäžćˆæł•ćˆ™äżæŒćŽŸæœ‰çš„ćźœćșŠïŒ›èŻ„æ–čæł•èźŸçœźć°†ćŻŒè‡Žćœ°ć›Ÿäž­çš„ć€šèŸčćœąç«‹ćłæ›Žæ–°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setLineWidth(width?: number): void; + /** + * èŽ·ć–ć€šèŸčćœąèŸčæĄ†çš„ćźœćșŠ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getLineWidth(): number; +} + +/** + * ćœ°ć›ŸæŁ€çŽąćŻčè±Ą + * SearchćŻčè±Ąç”šäșŽçźĄç†ćœ°ć›ŸäžŠçš„æŁ€çŽąćŠŸèƒœïŒŒćŒ…æ‹ŹäœçœźæŁ€çŽąă€ć‘šèŸčæŁ€çŽąć’ŒèŒƒć›ŽæŁ€çŽąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsSearch { + /** + * ć…Žè¶Łç‚čæŁ€çŽąćźŒæˆäș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + onPoiSearchComplete?: (result0: number, result1: PlusMapsSearchPoiResult) => void; + /** + * çșżè·ŻæŁ€çŽąćźŒæˆäș‹ä»¶ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + onRouteSearchComplete?: (result0: number, result1: PlusMapsSearchRouteResult) => void; + /** + * èźŸçœźæŁ€çŽąèż”ć›žç»“æžœæŻéĄ”çš„äżĄæŻæ•°ç›ź + * ćœ°ć›ŸæŁ€çŽąç»“æžœæ˜ŻæŒ‰éĄ”èż”ć›žçš„ïŒŒé»˜èź€æŁ€çŽąæŻéĄ”èż”ć›ž10æĄäżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setPageCapacity(capacity?: number): void; + /** + * èŽ·ć–æŁ€çŽąèż”ć›žç»“æžœæŻéĄ”çš„äżĄæŻæ•°ç›ź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getPageCapacity(): number; + /** + * ćŸŽćž‚ć…Žè¶Łç‚čæŁ€çŽą + * æŁ€çŽąç»“æžœć°†é€šèż‡onPoiSearchCompleteäș‹ä»¶èż”曞。 + * ćŠ‚æžœè°ƒç”šæ­€æ–čæł•æ—¶ć·Čç»ć€„äșŽPOIæŁ€çŽąæ“äœœäž­ïŒŒćˆ™ç»ˆæ­ąäžŠæŹĄæŁ€çŽąæ“äœœïŒŒé‡æ–°ćŒ€ć§‹æ–°çš„æŁ€çŽąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + poiSearchInCity(city?: string, key?: string, index?: number): boolean; + /** + * 摹èŸčæŁ€çŽą + * 摹èŸčæŁ€çŽąæ čæźäž­ćżƒç‚čă€ćŠćŸ„äžŽæŁ€çŽąèŻèż›èĄŒæŁ€çŽąïŒŒæŁ€çŽąćźŒæˆćŽè§Šć‘onPoiSearchComplete()äș‹ä»¶ă€‚ + * 苄调甚歀æ–čæł•æ—¶ćŻčè±Ąć€„äșŽPOIæŁ€çŽąæ“äœœäž­ïŒŒćˆ™ç»ˆæ­ąäžŠæŹĄæŁ€çŽąæ“äœœïŒŒé‡æ–°ćŒ€ć§‹æ–°çš„æŁ€çŽąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + poiSearchNearBy(key?: string, pt?: PlusMapsPoint, radius?: number, index?: number): boolean; + /** + * æŒ‡ćźšèŒƒć›ŽæŁ€çŽą + * æ čæźèŒƒć›Žć’ŒæŁ€çŽąèŻèż›èĄŒæŁ€çŽąïŒŒæŁ€çŽąćźŒæˆćŽè§Šć‘onPoiSearchComplete()äș‹ä»¶ă€‚ + * 苄调甚歀æ–čæł•æ—¶ćŻčè±Ąć€„äșŽPOIæŁ€çŽąæ“äœœäž­ïŒŒćˆ™ç»ˆæ­ąäžŠæŹĄæŁ€çŽąæ“äœœïŒŒé‡æ–°ćŒ€ć§‹æ–°çš„æŁ€çŽąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + poiSearchInbounds(): boolean; + /** + * èźŸçœźć…Źäș€è·ŻçșżæŁ€çŽąç­–ç•„ + * é»˜èź€é‡‡ç”šmaps.SearchPolicy.TRANSIT_TIME_FIRST策畄。 + * éœ€ćœšè°ƒç”štransitSearch()æ–čæł•ć‰èźŸçœźçš„ç­–ç•„æ‰ç”Ÿæ•ˆïŒ› + * ćŠ‚æžœèźŸçœźéžæł•ć€Œćˆ™èź€äžșèźŸçœźć€±èŽ„ïŒŒé‡‡ç”šäžŠæŹĄèźŸçœźçš„æŁ€çŽąç­–ç•„ćč¶èż”曞false。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setTransitPolicy(policy?: PlusMapsSearchPolicy): boolean; + /** + * 慬äș€è·ŻçșżæŁ€çŽą + * æŁ€çŽąćźŒæˆćŽè§Šć‘onRouteSearchComplete()äș‹ä»¶ă€‚ + * 苄调甚歀æ–čæł•æ—¶ćŻčè±Ąć€„äșŽæŁ€çŽąæ“äœœäž­ïŒŒćˆ™ç»ˆæ­ąäžŠæŹĄæŁ€çŽąæ“äœœïŒŒé‡æ–°ćŒ€ć§‹æ–°çš„æŁ€çŽąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + transitSearch(start?: string, end?: string, city?: string): boolean; + /** + * èźŸçœźé©ŸèœŠè·ŻçșżæŁ€çŽąç­–ç•„ + * èźŸçœźé©ŸèœŠè·ŻçșżæŁ€çŽąç­–ç•„ïŒŒé»˜èź€é‡‡ç”šmaps.SearchPolicy.DRIVING_TIME_FIRST策畄。 + * ćŠ‚æžœèźŸçœźéžæł•ć€Œćˆ™èź€äžșèźŸçœźć€±èŽ„ïŒŒé‡‡ç”šäžŠæŹĄèźŸçœźçš„æŁ€çŽąç­–ç•„ćč¶èż”曞falseïŒ›éœ€ćœšè°ƒç”šdrivingSearch()æ–čæł•ć‰èźŸçœźçš„ç­–ç•„æ‰ç”Ÿæ•ˆă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + setDrivingPolicy(policy?: PlusMapsSearchPolicy): boolean; + /** + * é©ŸèœŠè·ŻçșżæŁ€çŽą + * 甹äșŽé©ŸèœŠè·ŻçșżæŁ€çŽąïŒŒæŁ€çŽąćźŒæˆćŽè§Šć‘onRouteSearchComplete()äș‹ä»¶ă€‚ + * 调甚歀æ–čæł•æ—¶ćŻčè±Ąć€„äșŽæŁ€çŽąæ“äœœäž­ïŒŒćˆ™ç»ˆæ­ąäžŠæŹĄæŁ€çŽąæ“äœœïŒŒé‡æ–°ćŒ€ć§‹æ–°çš„æŁ€çŽąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + drivingSearch(start?: string, startCity?: string, end?: string, endCity?: string): boolean; + /** + * æ­„èĄŒè·ŻçșżæŁ€çŽą + * 甹äșŽæ­„èĄŒè·ŻçșżæŁ€çŽąïŒŒæŁ€çŽąćźŒæˆćŽè§Šć‘onRouteSearchComplete()äș‹ä»¶ă€‚ + * 调甚歀æ–čæł•æ—¶ćŻčè±Ąć€„äșŽæŁ€çŽąæ“äœœäž­ïŒŒćˆ™ç»ˆæ­ąäžŠæŹĄæŁ€çŽąæ“äœœïŒŒé‡æ–°ćŒ€ć§‹æ–°çš„æŁ€çŽąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + walkingSearch(start?: string, startCity?: string, end?: string, endCity?: string): boolean; +} + +/** + * æŁ€çŽąç­–ç•„ç±»ćž‹ + * 朹çșżè·ŻæŁ€çŽąæ—¶èźŸçœźæŁ€çŽąç­–ç•„æ—¶äœżç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsSearchPolicy { + /** + * æ—¶é—ŽäŒ˜ć…ˆ + * æŁ€çŽąç­–ç•„ç±»ćž‹ćžžé‡ïŒŒç”šäșŽć…Źäș€æŁ€çŽąç­–ç•„ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + TRANSIT_TIME_FIRST?: number; + /** + * æœ€ć°‘æąäč˜äŒ˜ć…ˆ + * æŁ€çŽąç­–ç•„ç±»ćž‹ćžžé‡ïŒŒç”šäșŽć…Źäș€æŁ€çŽąç­–ç•„ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + TRANSIT_TRANSFER_FIRST?: number; + /** + * æœ€ć°‘æ­„èĄŒè·çŠ»äŒ˜ć…ˆ + * æŁ€çŽąç­–ç•„ç±»ćž‹ćžžé‡ïŒŒç”šäșŽć…Źäș€æŁ€çŽąç­–ç•„ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + TRANSIT_WALK_FIRST?: number; + /** + * é€‰æ‹©èœŠç„šèŠ±é”€æœ€ć°‘äŒ˜ć…ˆ + * æŁ€çŽąç­–ç•„ç±»ćž‹ćžžé‡ïŒŒç”šäșŽć…Źäș€æŁ€çŽąç­–ç•„ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + TRANSIT_FEE_FIRST?: number; + /** + * æœ€çŸ­è·çŠ»äŒ˜ć…ˆ + * æŁ€çŽąç­–ç•„ç±»ćž‹ćžžé‡ïŒŒç”šäșŽé©ŸèœŠæŁ€çŽąç­–ç•„ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + DRIVING_DIS_FIRST?: number; + /** + * æ— é«˜é€Ÿć…Źè·Żçșżè·Ż + * æŁ€çŽąç­–ç•„ç±»ćž‹ćžžé‡ïŒŒç”šäșŽé©ŸèœŠæŁ€çŽąç­–ç•„ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + DRIVING_NO_EXPRESSWAY?: number; + /** + * æœ€ć°‘èŽčç”šäŒ˜ć…ˆ + * æŁ€çŽąç­–ç•„ç±»ćž‹ćžžé‡ïŒŒç”šäșŽé©ŸèœŠæŁ€çŽąç­–ç•„ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + DRIVING_FEE_FIRST?: number; +} + +/** + * äżć­˜äœçœźæŁ€çŽąă€ć‘šèŸčæŁ€çŽąć’ŒèŒƒć›ŽæŁ€çŽąèż”ć›žçš„ç»“æžœ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsSearchPoiResult { + /** + * POIæŁ€çŽąæ€»ç»“æžœæ•° + * POIæŁ€çŽąæ€»ç»“æžœæ•°ïŒŒè‹„æČĄæœ‰æŁ€çŽąćˆ°ćˆ™èż”ć›ž0。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + totalNumber?: number; + /** + * ćœ“ć‰éĄ”çš„POIæŁ€çŽąç»“æžœæ•° + * ćœ“ć‰éĄ”POIæŁ€çŽąç»“æžœæ•°ïŒŒè‹„æČĄæœ‰æŁ€çŽąćˆ°ćˆ™èż”ć›ž0。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + currentNumber?: number; + /** + * æœŹæŹĄPOIæŁ€çŽąçš„æ€»éĄ”æ•° + * æœŹæŹĄPOIæŁ€çŽąçš„æ€»éĄ”æ•°ïŒŒè‹„æČĄæœ‰æŁ€çŽąćˆ°ćˆ™èż”ć›ž0。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + pageNumber?: number; + /** + * èŽ·ć–ćœ“ć‰éĄ”çš„çŽąćŒ• + * ćœ“ć‰éĄ”çš„çŽąćŒ•ć€ŒïŒŒä»Ž0ćŒ€ć§‹ïŒŒćł0èĄšç€ș珏䞀饔。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + pageIndex?: number; + /** + * æœŹæŹĄPOIæŁ€çŽąç»“æžœæ•°ç»„ + * POIæŁ€çŽąç»“æžœæ•°ç»„ïŒŒArray数组ćŻčè±ĄïŒŒæ•°ç»„ć†…ćźčäžșPositionćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + poiList?: any []; + /** + * èŽ·ć–æŒ‡ćźšçŽąćŒ•çš„æŁ€çŽąç»“æžœ + * ćŠ‚æžœindexć€Œè¶…ć‡șèŒƒć›Žćˆ™èż”ć›žnullćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getPosition(): PlusMapsPosition; +} + +/** + * äżć­˜äœçœźæŁ€çŽąă€ć‘šèŸčæŁ€çŽąć’ŒèŒƒć›ŽæŁ€çŽąèż”ć›žçš„ç»“æžœ + * äžćŻé€šèż‡newæ“äœœçŹŠćˆ›ć»șSearchRouteResultćŻčè±ĄïŒŒćœšè§Šć‘onRouteSearchComplete()时è‡Ș抹戛ć»ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsSearchRouteResult { + /** + * çșżè·Żçš„è”·ç‚čäœçœź + * çșżè·ŻæŁ€çŽąç»“æžœçš„è”·ć§‹äœçœźç‚čćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + startPosition?: PlusMapsPosition; + /** + * çșżè·Żçš„终ç‚čäœçœź + * çșżè·ŻæŁ€çŽąç»“æžœçš„ç»ˆç‚čäœçœźç‚čćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + endPosition?: PlusMapsPosition; + /** + * æœŹæŹĄçșżè·ŻæŁ€çŽąçš„æ€»æ–čæĄˆæ•° + * çșżè·ŻæŁ€çŽąç»“æžœçš„æ–čæĄˆæ•°ç›źïŒŒè‹„æœȘæŁ€çŽąćˆ°æœ‰æ•ˆç»“æžœćˆ™èż”ć›ž0。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + routeNumber?: number; + /** + * çșżè·ŻæŁ€çŽąç»“æžœæ•°ç»„ + * çșżè·ŻæŁ€çŽąç»“æžœæ•°ç»„ïŒŒArray数组ćŻčè±ĄïŒŒæ•°ç»„ć†…ćźčäžșRoutećŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + routeList?: any []; + /** + * èŽ·ć–æŒ‡ćźšçŽąćŒ•çš„çșżè·Żæ–čæĄˆ + * ćŠ‚æžœindexć€Œè¶…ć‡șèŒƒć›Žćˆ™èż”ć›žnullćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + getRoute(index?: number): PlusMapsRoute; +} + +/** + * æŁ€çŽąç»“æžœçš„äœçœźç‚č + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsPosition { + /** + * äœçœźç‚č的经çșŹćșŠćæ ‡ + * ćŠ‚æžœæČĄæœ‰ç»çșŹćșŠćæ ‡äżĄæŻïŒˆćŠ‚æžœć…Źäș€ă€ćœ°é“è·Żçșżæ•°æźç­‰ïŒ‰ïŒŒćˆ™ć…¶ć€Œäžșundefined。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + point?: PlusMapsPoint; + /** + * äœçœźç‚čçš„ćœ°ć€äżĄæŻ + * ćŠ‚æžœæČĄæœ‰äœçœźç‚čçš„ćœ°ć€äżĄæŻćˆ™èż”ć›žç©ș歗笩äžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + address?: string; + /** + * äœçœźç‚čçš„æ‰€ć±žćŸŽćž‚äżĄæŻ + * ćŠ‚æžœæČĄæœ‰äœçœźç‚čçš„æ‰€ć±žćŸŽćž‚äżĄæŻćˆ™èż”ć›žç©ș歗笩äžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + city?: string; + /** + * äœçœźç‚č的損称 + * ćŠ‚æžœæČĄæœ‰äœçœźç‚čçš„ćç§°ćˆ™èż”ć›žç©ș歗笩äžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + name?: string; + /** + * äœçœźç‚čçš„ç””èŻäżĄæŻ + * ćŠ‚æžœæČĄæœ‰äœçœźç‚čçš„ç””èŻäżĄæŻćˆ™èż”ć›žç©ș歗笩äžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + phone?: string; + /** + * äœçœźç‚čçš„é‚źçŒ–äżĄæŻ + * ćŠ‚æžœæČĄæœ‰äœçœźç‚čçš„é‚źçŒ–äżĄæŻćˆ™èż”ć›žç©ș歗笩äžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + postcode?: string; +} + +/** + * ćœ°ć›Ÿäž­çš„è·ŻçșżćŻčè±Ą + * 从OverlayćŻčè±Ąç»§æ‰żè€Œæ„ïŒŒćŻé€šèż‡MapćŻčè±Ąçš„addOverlay()æ–čæł•ć°†ćŻčè±Ąæ·»ćŠ ćœ°ć›Ÿäž­ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ +interface PlusMapsRoute { + /** + * è·Żçșżè”·ç‚čćœ°ç†ćæ ‡ç‚č + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + startPoint?: PlusMapsPoint; + /** + * è·Żçșżç»ˆç‚čćœ°ç†ćæ ‡ç‚č + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + endPoint?: PlusMapsPoint; + /** + * è·Żçșżćæ ‡ç‚čæź”æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + pointCount?: PlusMapsPoint; + /** + * è·Żçșżçš„ćœ°ç†ćæ ‡ç‚č数组 + * è·Żçșżçš„ćœ°ç†ćæ ‡ç‚čæ•°ç»„ïŒŒæ•°ç»„äž­äżć­˜PointćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + pointList?: any []; + /** + * è·Żçșżæ€»è·çŠ» + * è·Żçșżä»Žè”·ć§‹ç‚č戰终ç‚čçš„è·çŠ»ïŒŒć•äœäžș米。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + distance?: number; + /** + * çșżè·Żçš„æç€șäżĄæŻ + * çșżè·Żæç€șäżĄæŻïŒŒæČĄæœ‰æç€șäżĄæŻćˆ™èż”ć›žç©ș歗笩äžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/maps.html](http://www.html5plus.org/doc/zh_cn/maps.html) + */ + routeTip?: string; +} + +/** + * OAuthæšĄć—çźĄç†ćźąæˆ·ç«Żçš„ç”šæˆ·ç™»ćœ•æŽˆæƒéȘŒèŻćŠŸèƒœïŒŒć…èźžćș”ç”šèźżé—źçŹŹäž‰æ–čćčłć°çš„蔄æșă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ +interface PlusOauth { + /** + * ç™»ćœ•æŽˆæƒèź€èŻæœćŠĄćŻčè±Ą + * AuthServicećŻčè±Ąç”šäșŽèĄšç€șç™»ćœ•æŽˆæƒèź€èŻæœćŠĄïŒŒćœšJSäž­äžșćŻčè±ĄïŒŒç”šäșŽć‘çł»ç»Ÿèż›èĄŒç™»ćœ•æŽˆæƒèź€èŻæ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + AuthService?: PlusOauthAuthService; + /** + * JSONćŻčè±ĄïŒŒæŽˆæƒèź€èŻć‚æ•°é€‰éĄč + * æ­€ćŻčè±Ąæ”ŻæŒçš„ć±žæ€§ć€Œç”±ç™»ćœ•æŽˆæƒèź€èŻæœćŠĄćźšäč‰ă€‚ + * äŸ‹ćŠ‚â€œćŸźäżĄâ€ïŒŒćˆ™ćŻé…çœźä»„äž‹ć‚æ•°ïŒš + * scope - ćș”ç”šæŽˆæƒäœœç”šćŸŸïŒ› + * state - 甹äșŽäżæŒèŻ·æ±‚ć’Œć›žè°ƒçš„çŠ¶æ€ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + AuthOptions?: PlusOauthAuthOptions; + /** + * ç™»ćœ•æŽˆæƒèź€èŻäżĄæŻ + * æ­€ćŻčè±Ąä»…ćźšä艿 ‡ć‡†ć±žæ€§ïŒŒç™»ćœ•æŽˆæƒèź€èŻæœćŠĄćŻæ‰©ć±•è‡Ș漚ä艿•°æźă€‚ + * äŸ‹ćŠ‚â€œćŸźäżĄâ€ç™»ćœ•æŽˆæƒæœćŠĄïŒŒćˆ™ćŒ…æ‹Źä»„äž‹æ•°æźïŒš + * unionid - ç”šæˆ·ç»Ÿäž€æ ‡èŻ†ïŒŒé’ˆćŻč侀äžȘćŸźäżĄćŒ€æ”Ÿćčłć°ćžć·äž‹çš„ćș”ç”šïŒŒćŒäž€ç”šæˆ·çš„unionidæ˜Żć”Żäž€çš„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + AuthInfo?: PlusOauthAuthInfo; + /** + * ç™»ćœ•æŽˆæƒç”šæˆ·äżĄæŻ + * 甹äșŽäżć­˜ç™»ćœ•æŽˆæƒç”šæˆ·çš„äżĄæŻă€‚ + * æ­€ćŻčè±Ąä»…ćźšä艿 ‡ć‡†ć±žæ€§ïŒŒç™»ćœ•æŽˆæƒèź€èŻæœćŠĄćŻæ‰©ć±•è‡Ș漚ä艿•°æźă€‚ + * äŸ‹ćŠ‚â€œćŸźäżĄâ€ç™»ćœ•æŽˆæƒæœćŠĄïŒŒćŻèƒœćŒ…æ‹Źä»„äž‹è‡Ș漚ä艿•°æźïŒš + * privilege - 甚户ç‰čæƒäżĄæŻïŒŒjsonæ•°ç»„ïŒŒćŠ‚ćŸźäżĄæČƒćĄç”šæˆ·äžșchinaunicom + * unionid - ç”šæˆ·ç»Ÿäž€æ ‡èŻ†ïŒŒé’ˆćŻč侀äžȘćŸźäżĄćŒ€æ”Ÿćčłć°ćžć·äž‹çš„ćș”ç”šïŒŒćŒäž€ç”šæˆ·çš„unionidæ˜Żć”Żäž€çš„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + UserInfo?: PlusOauthUserInfo; + /** + * èŽ·ć–ç™»ćœ•æŽˆæƒèź€èŻæœćŠĄćˆ—èĄš + * èŽ·ć–ç»ˆç«Żæ”ŻæŒçš„æƒç™»ćœ•èź€èŻæœćŠĄćˆ—èĄšïŒŒćŻç”šäșŽæç€șç”šæˆ·èż›èĄŒç™»ćœ•ćčłć°çš„é€‰æ‹©ă€‚èŽ·ć–ç™»ćœ•æŽˆæƒèź€èŻæœćŠĄæˆćŠŸćŽé€šèż‡successCBć›žè°ƒèż”ć›žæ”ŻæŒçš„æ‰€æœ‰æœćŠĄćˆ—èĄšïŒŒèŽ·ć–æœćŠĄć€±èŽ„ćˆ™é€šèż‡errorCBć›žè°ƒèż”ć›žć€±èŽ„äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + getServices(successCB?: (result: PlusOauth []) => void, errorCB?: (result: any) => void): void; +} + +/** + * ç™»ćœ•æŽˆæƒèź€èŻæœćŠĄćŻčè±Ą + * AuthServicećŻčè±Ąç”šäșŽèĄšç€șç™»ćœ•æŽˆæƒèź€èŻæœćŠĄïŒŒćœšJSäž­äžșćŻčè±ĄïŒŒç”šäșŽć‘çł»ç»Ÿèż›èĄŒç™»ćœ•æŽˆæƒèź€èŻæ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ +interface PlusOauthAuthService { + /** + * ç™»ćœ•æŽˆæƒèź€èŻæœćŠĄæ ‡èŻ† + * 甹äșŽèĄšç€șç™»ćœ•æŽˆæƒèź€èŻæœćŠĄæ ‡èŻ†ïŒš + * "weixin" - èĄšç€șćŸźäżĄç™»ćœ•æŽˆæƒïŒ› + * "qq" - èĄšç€șQQç™»ćœ•æŽˆæƒïŒ› + * "sinaweibo" - èĄšç€ș新æ”ȘćŸźćšç™»ćœ•æŽˆæƒïŒ› + * "qihoo" - èĄšç€ș360èŽŠć·ç™»ćœ•ïŒˆä»…360æ‰‹ćŠ©æ”ćș”ç”šçŽŻćąƒäž‹æ”ŻæŒïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + id?: string; + /** + * ç™»ćœ•æŽˆæƒèź€èŻæœćŠĄæèż° + * 甹äșŽæèż°ç™»ćœ•æŽˆæƒèź€èŻæœćŠĄçš„äżĄæŻïŒš + * "ćŸźäżĄ" - èĄšç€șćŸźäżĄç™»ćœ•æŽˆæƒïŒ› + * "QQ" - èĄšç€șQQç™»ćœ•æŽˆæƒïŒ› + * "新æ”ȘćŸźćš" - èĄšç€ș新æ”ȘćŸźćšç™»ćœ•æŽˆæƒïŒ› + * "360èŽŠć·" - èĄšç€ș360èŽŠć·ç™»ćœ•ïŒˆä»…360æ‰‹ćŠ©æ”ćș”ç”šçŽŻćąƒäž‹æ”ŻæŒïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + description?: string; + /** + * æŽˆæƒèź€èŻç»“æžœæ•°æź + * 甹äșŽäżć­˜ç™»ćœ•æŽˆæƒèź€èŻèŽ·ć–çš„èź€èŻäżĄæŻïŒŒćŠ‚æžœć€Œäžș"undefined"ćˆ™èĄšç€șæœȘèż›èĄŒæŽˆæƒèź€èŻæˆ–è€…æ˜ŻæŽˆæƒèź€èŻć€±èŽ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + authResult?: PlusOauthAuthInfo; + /** + * ç™»ćœ•æŽˆæƒèź€èŻç”šæˆ·äżĄæŻ + * 甹äșŽäżć­˜ç™»ćœ•æŽˆæƒèź€èŻèŽ·ć–çš„ç”šæˆ·äżĄæŻïŒŒćŠ‚æžœć€Œäžș"undefined"ćˆ™èĄšç€șæœȘèŽ·ć–èż‡ç”šæˆ·äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + userInfo?: PlusOauthUserInfo; + /** + * ç™»ćœ•æŽˆæƒèź€èŻæ‰©ć±•äżĄæŻ + * 甹äșŽäżć­˜ç™»ćœ•æŽˆæƒèź€èŻæœćŠĄèż”ć›žçš„æ‰©ć±•äżĄæŻïŒŒć…·äœ“ć†…ćźčç”±ć„ç™»ćœ•ćčłć°ć†łćźšïŒŒćŠ‚æžœæČĄæœ‰æ‰©ć±•äżĄæŻćˆ™äžșundefined。 + * äŸ‹ćŠ‚â€œćŸźäżĄâ€ïŒŒćˆ™ćŻäżć­˜ä»„äž‹æ•°æźïŒš + * state - 甹äșŽäżæŒèŻ·æ±‚ć’Œć›žè°ƒçš„çŠ¶æ€ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + extra?: any; + /** + * èŻ·æ±‚æŽˆæƒèź€èŻ + * ć‘ćŒ€æ”Ÿćčłć°èŻ·æ±‚èż›èĄŒæŽˆæƒèź€èŻïŒŒéœ€æäŸ›æŽˆæƒćŸŸïŒˆscopeïŒ‰ïŒŒç”šæˆ·ćœšç»ˆç«ŻçĄźèź€ćŽé€šèż‡æˆćŠŸć›žè°ƒèż”ć›žæŽˆæƒäžŽæ—¶ç„šæźïŒˆcodeïŒ‰ă€‚ + * ćŒ€ć‘è€…ćŻä»„ć°†æŽˆæƒäžŽæ—¶ç„šæźïŒˆcode提äș€ćˆ°äžšćŠĄæœćŠĄć™šïŒŒćˆäžšćŠĄæœćŠĄć™šä»ŽćŸźäżĄćŒ€æ”Ÿćčłć°èŽ·ć–æŽˆæƒç™»ćœ•ç­‰ç›žć…łäżĄæŻïŒŒéżć…ć°†appsecretç­‰äżĄæŻäżć­˜ćœšćźąæˆ·ç«ŻćŻèƒœćŒ•è”·æł„éœČ的闼鱘。 + * æłšæ„ïŒšç›źć‰ä»…ćŸźäżĄćčłć°æ”ŻæŒèŻ·æ±‚æŽˆæƒèź€èŻïŒŒć…¶ćźƒćčłć°è°ƒç”šæ­€æ–čæł•ć°†èż”ć›žé”™èŻŻć›žè°ƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + authorize(successCallback?: (result: any) => void, errorCallback?: (result: any) => void, options?: PlusOauthAuthOptions): void; + /** + * èŻ·æ±‚ç™»ćœ•æŽˆæƒèź€èŻæ“äœœ + * ćŻčæŒ‡ćźšçš„ç™»ćœ•æŽˆæƒèź€èŻæœćŠĄèż›èĄŒç™»ćœ•èź€èŻæ“äœœïŒŒćœšç™»ćœ•ć‰ćŻé€šèż‡ćŻčè±Ąçš„authResultć±žæ€§ćˆ€æ–­æ˜ŻćŠć·Čç»ç™»ćœ•èź€èŻèż‡ïŒŒé€šćžžćȘ需芁ćŻčæČĄæœ‰èż›èĄŒèż‡ç™»ćœ•èź€èŻçš„æœćŠĄèż›èĄŒç™»ćœ•èź€èŻæ“äœœă€‚ + * æŽˆæƒèź€èŻæ“äœœæˆćŠŸćŽé€šèż‡successCBć›žè°ƒć‡œæ•°é€šçŸ„ïŒŒć€±èŽ„ćˆ™é€šèż‡errorCBć›žè°ƒć‡œæ•°é€šçŸ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + login(successCallback?: (result: any) => void, errorCallback?: (result: any) => void, options?: PlusOauthAuthOptions): void; + /** + * æłšé”€ç™»ćœ•æŽˆæƒèź€èŻ + * ćŻčæŒ‡ćźšçš„ç™»ćœ•æŽˆæƒèź€èŻæœćŠĄæłšé”€ç™»ćœ•èź€èŻæ“äœœïŒŒæłšé”€æŽˆæƒèź€èŻćŽïŒŒć†æŹĄæ“äœœæ—¶éœ€é‡æ–°èż›èĄŒç™»ćœ•èź€èŻæ“äœœă€‚ + * ćŠ‚æžœçŹŹäž‰æ–čćčłć°äžéœ€èŠæłšé”€æ“äœœïŒŒćˆ™æƒ…ć†”äżć­˜çš„ç›žć…łç™»ćœ•èź€èŻç­‰äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + logout(successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; + /** + * èŽ·ć–ç™»ćœ•æŽˆæƒç”šæˆ·äżĄæŻ + * èŽ·ć–ç™»ćœ•æŽˆæƒèź€èŻçš„ç”šæˆ·äżĄæŻïŒŒćœšèŽ·ć–ć‰ćŻé€šèż‡ćŻčè±Ąçš„userInfoć±žæ€§ćˆ€æ–­æ˜ŻćŠć·Čç»èŽ·ć–èż‡ïŒŒé€šćžžćȘ需芁ćŻčæČĄæœ‰èŽ·ć–èż‡ç”šæˆ·äżĄæŻçš„æœćŠĄèż›èĄŒæ“äœœă€‚ + * èŽ·ć–ç”šæˆ·äżĄæŻæ“äœœæˆćŠŸćŽé€šèż‡successCallbackć›žè°ƒć‡œæ•°é€šçŸ„ïŒŒć€±èŽ„ćˆ™é€šèż‡errorCallbackć›žè°ƒć‡œæ•°é€šçŸ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + getUserInfo(successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; + /** + * æ·»ćŠ ç”šæˆ·æ‰‹æœșć·äżĄæŻ + * æ‰“ćŒ€ç™»ćœ•æŽˆæƒæœćŠĄçš„æ·»ćŠ ç”šæˆ·æ‰‹æœșć·ç•Œéąèż›èĄŒæ“äœœïŒŒæ·»ćŠ ç”šæˆ·æ‰‹æœșć·æ“äœœæˆćŠŸćŽé€šèż‡successCallbackć›žè°ƒć‡œæ•°é€šçŸ„ïŒŒćŠćˆ™é€šèż‡errorCallbackć›žè°ƒć‡œæ•°é€šçŸ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + addPhoneNumber(successCallback?: (result: any) => void, errorCallback?: (result: any) => void): void; +} + +/** + * JSONćŻčè±ĄïŒŒæŽˆæƒèź€èŻć‚æ•°é€‰éĄč + * æ­€ćŻčè±Ąæ”ŻæŒçš„ć±žæ€§ć€Œç”±ç™»ćœ•æŽˆæƒèź€èŻæœćŠĄćźšäč‰ă€‚ + * äŸ‹ćŠ‚â€œćŸźäżĄâ€ïŒŒćˆ™ćŻé…çœźä»„äž‹ć‚æ•°ïŒš + * scope - ćș”ç”šæŽˆæƒäœœç”šćŸŸïŒ› + * state - 甹äșŽäżæŒèŻ·æ±‚ć’Œć›žè°ƒçš„çŠ¶æ€ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ +interface PlusOauthAuthOptions { + /** + * ç”łèŻ·çš„æƒé™äœœç”šèŒƒć›Ž + * ćŠ‚æžœć­˜ćœšć€šäžȘæƒé™ïŒŒćˆ™ä»„","çŹŠć·ćˆ†ć‰Č。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + scope?: string; + /** + * ćźąæˆ·ç«Żçš„ćœ“ć‰çŠ¶æ€ïŒŒćŻä»„æŒ‡ćźšä»»æ„ć€ŒïŒŒç™»ćœ•èź€èŻćŽćŽŸć°äžćŠšçš„èż”ć›žäżć­˜ćˆ°AuthServicećŻčè±Ąçš„extraäž­ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + state?: string; + /** + * ç™»ćœ•æŽˆæƒèź€èŻæœćŠĄćčłć°ç”łèŻ·çš„appid + * ćŠšæ€èźŸçœźç™»ćœ•æŽˆæƒæœćŠĄäž­éœ€èŠäœżç”šçš„appidïŒŒä»…éœ€èŠæ­€ć‚æ•°çš„ç™»ćœ•æŽˆæƒæœćŠĄïŒˆćŠ‚â€œćŸźäżĄç™»ćœ•â€ă€â€œQQç™»ćœ•â€ïŒ‰æ”ŻæŒă€‚ + * ćŠ‚æžœæœȘèźŸçœźćˆ™äœżç”šèżèĄŒçŽŻćąƒäž­ć†…çœźçš„appidć€ŒïŒˆćŠ‚ćœšHBuilder侭揯朹manifest.json的SDKé…çœźéĄčäž­èż›èĄŒèźŸçœźïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + appid?: string; + /** + * ç™»ćœ•æŽˆæƒèź€èŻæœćŠĄćčłć°ç”łèŻ·çš„appkey + * ćŠšæ€èźŸçœźç™»ćœ•æŽˆæƒæœćŠĄäž­éœ€èŠäœżç”šçš„appkeyïŒŒä»…éœ€èŠæ­€ć‚æ•°çš„ç™»ćœ•æŽˆæƒæœćŠĄïŒˆćŠ‚â€œæ–°æ”ȘćŸźćšç™»ćœ•â€ă€â€œ360ç™»ćœ•â€ïŒ‰æ”ŻæŒă€‚ + * ćŠ‚æžœæœȘèźŸçœźćˆ™äœżç”šèżèĄŒçŽŻćąƒäž­ć†…çœźçš„appkeyć€ŒïŒˆćŠ‚ćœšHBuilder侭揯朹manifest.json的SDKé…çœźéĄčäž­èż›èĄŒèźŸçœźïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + appkey?: string; + /** + * ç™»ćœ•æŽˆæƒèź€èŻæœćŠĄćčłć°ç”łèŻ·çš„appsecret + * ćŠšæ€èźŸçœźç™»ćœ•æŽˆæƒæœćŠĄäž­éœ€èŠäœżç”šçš„appsecretïŒŒä»…éœ€èŠæ­€ć‚æ•°çš„ç™»ćœ•æŽˆæƒæœćŠĄïŒˆćŠ‚â€œćŸźäżĄç™»ćœ•â€ă€â€œæ–°æ”ȘćŸźćšç™»ćœ•â€ïŒ‰æ”ŻæŒă€‚ + * ćŠ‚æžœæœȘèźŸçœźćˆ™äœżç”šèżèĄŒçŽŻćąƒäž­ć†…çœźçš„appkeyć€ŒïŒˆćŠ‚ćœšHBuilder侭揯朹manifest.json的SDKé…çœźéĄčäž­èż›èĄŒèźŸçœźïŒ‰ïŒ›ćœ“ćŒ€æ”Ÿćčłć°ç”łèŻ·çš„appsecretć€Œæ¶‰ćŠćˆ°ćź‰ć…šé—źéą˜æ—¶ïŒŒćŻćœšćș”ç”šèżèĄŒæ—¶ä»ŽæœćŠĄć™šèŽ·ć–ïŒŒç„¶ćŽé€šèż‡æ­€apićŠšæ€èźŸçœźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + appsecret?: string; + /** + * ç™»ćœ•æŽˆæƒèź€èŻæœćŠĄćčłć°ç”łèŻ·çš„redirect_url + * ćŠšæ€èźŸçœźç™»ćœ•æŽˆæƒæœćŠĄäž­éœ€èŠäœżç”šçš„redirect_urlïŒŒä»…éœ€èŠæ­€ć‚æ•°çš„ç™»ćœ•æŽˆæƒæœćŠĄïŒˆćŠ‚â€œæ–°æ”ȘćŸźćšç™»ćœ•â€ïŒ‰æ”ŻæŒă€‚ + * ćŠ‚æžœæœȘèźŸçœźćˆ™äœżç”šèżèĄŒçŽŻćąƒäž­ć†…çœźçš„redirect_urlć€ŒïŒˆćŠ‚ćœšHBuilder侭揯朹manifest.json的SDKé…çœźéĄčäž­èż›èĄŒèźŸçœźïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + redirect_url?: string; +} + +/** + * ç™»ćœ•æŽˆæƒèź€èŻäżĄæŻ + * æ­€ćŻčè±Ąä»…ćźšä艿 ‡ć‡†ć±žæ€§ïŒŒç™»ćœ•æŽˆæƒèź€èŻæœćŠĄćŻæ‰©ć±•è‡Ș漚ä艿•°æźă€‚ + * äŸ‹ćŠ‚â€œćŸźäżĄâ€ç™»ćœ•æŽˆæƒæœćŠĄïŒŒćˆ™ćŒ…æ‹Źä»„äž‹æ•°æźïŒš + * unionid - ç”šæˆ·ç»Ÿäž€æ ‡èŻ†ïŒŒé’ˆćŻč侀äžȘćŸźäżĄćŒ€æ”Ÿćčłć°ćžć·äž‹çš„ćș”ç”šïŒŒćŒäž€ç”šæˆ·çš„unionidæ˜Żć”Żäž€çš„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ +interface PlusOauthAuthInfo { + /** + * ç™»ćœ•æŽˆæƒçš„èźżé—źä»€ç‰Œ + * ćŠ‚æžœç™»ćœ•æŽˆæƒæœćŠĄäžæ”ŻæŒæ­€ć±žæ€§ïŒŒćˆ™èż”ć›ž"undefined"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + access_token?: string; + /** + * ç™»ćœ•æŽˆæƒç”šæˆ·çš„ć”Żäž€æ ‡èŻ† + * ćŠ‚æžœç™»ćœ•æŽˆæƒæœćŠĄäžæ”ŻæŒæ­€ć±žæ€§ïŒŒćˆ™èż”ć›ž"undefined"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + openid?: string; + /** + * ç™»ćœ•æŽˆæƒèźżé—źä»€ç‰Œèż‡æœŸæ—¶é—Ž + * ć•äœäžșç§’ïŒŒćŠ‚æžœç™»ćœ•æŽˆæƒæœćŠĄäžæ”ŻæŒæ­€ć±žæ€§ïŒŒćˆ™èż”ć›ž"undefined"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + expires_in?: string; + /** + * ç™»ćœ•æŽˆæƒçš„æ›Žæ–°ä»€ç‰Œ + * ç”šæ„èŽ·ć–äž‹äž€æŹĄçš„èźżé—źä»€ç‰ŒïŒŒćŠ‚æžœç™»ćœ•æŽˆæƒæœćŠĄäžæ”ŻæŒæ­€ć±žæ€§ïŒŒćˆ™èż”ć›ž"undefined"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + refresh_token?: string; + /** + * ç™»ćœ•æŽˆæƒçš„æƒé™èŒƒć›Ž + * ćŠ‚æžœć­˜ćœšć€šäžȘæƒé™ïŒŒćˆ™ä»„","çŹŠć·ćˆ†ć‰Č。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + scope?: string; +} + +/** + * ç™»ćœ•æŽˆæƒç”šæˆ·äżĄæŻ + * 甹äșŽäżć­˜ç™»ćœ•æŽˆæƒç”šæˆ·çš„äżĄæŻă€‚ + * æ­€ćŻčè±Ąä»…ćźšä艿 ‡ć‡†ć±žæ€§ïŒŒç™»ćœ•æŽˆæƒèź€èŻæœćŠĄćŻæ‰©ć±•è‡Ș漚ä艿•°æźă€‚ + * äŸ‹ćŠ‚â€œćŸźäżĄâ€ç™»ćœ•æŽˆæƒæœćŠĄïŒŒćŻèƒœćŒ…æ‹Źä»„äž‹è‡Ș漚ä艿•°æźïŒš + * privilege - 甚户ç‰čæƒäżĄæŻïŒŒjsonæ•°ç»„ïŒŒćŠ‚ćŸźäżĄæČƒćĄç”šæˆ·äžșchinaunicom + * unionid - ç”šæˆ·ç»Ÿäž€æ ‡èŻ†ïŒŒé’ˆćŻč侀äžȘćŸźäżĄćŒ€æ”Ÿćčłć°ćžć·äž‹çš„ćș”ç”šïŒŒćŒäž€ç”šæˆ·çš„unionidæ˜Żć”Żäž€çš„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ +interface PlusOauthUserInfo { + /** + * ç™»ćœ•æŽˆæƒç”šæˆ·çš„ć”Żäž€æ ‡èŻ† + * ćŠ‚æžœç™»ćœ•æŽˆæƒæœćŠĄäžæ”ŻæŒæ­€ć±žæ€§ïŒŒćˆ™èż”ć›ž"undefined"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + openid?: string; + /** + * ç™»ćœ•æŽˆæƒç”šæˆ·çš„ć€Žćƒć›Ÿç‰‡ćœ°ć€ + * 芁求äžș"http://"或"https://"ćŒ€ć€Žçš„ćœ°ć€ïŒŒćŠ‚æžœç™»ćœ•æŽˆæƒæœćŠĄäžæ”ŻæŒæ­€ć±žæ€§ïŒŒćˆ™èż”ć›ž"undefined"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + headimgurl?: string; + /** + * ç™»ćœ•æŽˆæƒç”šæˆ·çš„æ˜”ç§° + * ćŠ‚æžœç™»ćœ•æŽˆæƒæœćŠĄäžæ”ŻæŒæ­€ć±žæ€§ïŒŒćˆ™èż”ć›ž"undefined"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + nickname?: string; + /** + * ç™»ćœ•æŽˆæƒç”šæˆ·çš„é‚źçź±ćœ°ć€ + * ćŠ‚æžœç™»ćœ•æŽˆæƒæœćŠĄäžæ”ŻæŒæ­€ć±žæ€§ïŒŒćˆ™èż”ć›ž"undefined"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + email?: string; + /** + * ç™»ćœ•æŽˆæƒç”šæˆ·çš„ç””èŻć·ç  + * ćŠ‚æžœç™»ćœ•æŽˆæƒæœćŠĄäžæ”ŻæŒæ­€ć±žæ€§ïŒŒćˆ™èż”ć›ž"undefined"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + phonenumber?: string; + /** + * ç™»ćœ•æŽˆæƒç”šæˆ·çš„æ€§ćˆ« + * 1äžș男性2äžșć„łæ€§ă€‚ + * ćŠ‚æžœç™»ćœ•æŽˆæƒæœćŠĄäžæ”ŻæŒæ­€ć±žæ€§ïŒŒćˆ™èż”ć›ž"undefined"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + sex?: string; + /** + * ç™»ćœ•æŽˆæƒç”šæˆ·æłšć†Œçš„çœä»œäżĄæŻ + * ćŠ‚æžœç™»ćœ•æŽˆæƒæœćŠĄäžæ”ŻæŒæ­€ć±žæ€§ïŒŒćˆ™èż”ć›ž"undefined"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + province?: string; + /** + * ç™»ćœ•æŽˆæƒç”šæˆ·æłšć†Œçš„ćŸŽćž‚äżĄæŻ + * ćŠ‚æžœç™»ćœ•æŽˆæƒæœćŠĄäžæ”ŻæŒæ­€ć±žæ€§ïŒŒćˆ™èż”ć›ž"undefined"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + city?: string; + /** + * ç™»ćœ•æŽˆæƒç”šæˆ·æłšć†Œçš„ć›œćź¶äżĄæŻ + * ćŠ‚æžœç™»ćœ•æŽˆæƒæœćŠĄäžæ”ŻæŒæ­€ć±žæ€§ïŒŒćˆ™èż”ć›ž"undefined"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/oauth.html](http://www.html5plus.org/doc/zh_cn/oauth.html) + */ + country?: string; +} + +/** + * PaymentæšĄć—çźĄç†æ”Żä»˜ćŠŸèƒœïŒŒç”šäșŽæäŸ›çœ‘éĄ”ćź‰ć…šæ”Żä»˜èƒœćŠ›ïŒŒæ”ŻæŒé€šèż‡WebæŽ„ćŁèż›èĄŒæ”Żä»˜æ“äœœă€‚é€šèż‡plus.paymentćŻèŽ·ć–æ”Żä»˜çźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ +interface PlusPayment { + /** + * æ”Żä»˜é€šé“ćŻčè±Ą + * PaymentChannelćŻčè±ĄèĄšç€șç‰čćźšçš„æ”Żä»˜é€šé“ïŒŒç”šäșŽć‘çł»ç»ŸèŻ·æ±‚æ”Żä»˜æ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + PaymentChannel?: PlusPaymentPaymentChannel; + /** + * IAPèźąć•æ•°æźćŻčè±Ą + * æèż°IAPć•†ć“èźąć•äżĄæŻïŒŒćŠ‚æ ‡èŻ†ă€æ•°é‡ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + OrderStatementIAP?: PlusPaymentOrderStatementIAP; + /** + * æ”Żä»˜æ“äœœç»“æžœćŻčè±Ą + * PaymentResultćŻčè±ĄèĄšç€șæ”Żä»˜æ“äœœèż”ć›žç»“æžœïŒŒç”šäșŽçĄźèꀿ”Żä»˜æ“äœœæˆćŠŸă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + PaymentResult?: PlusPaymentPaymentResult; + /** + * IAP敆擁ćŻčè±Ą + * æèż°IAPć•†ć“èŻŠç»†äżĄæŻïŒŒćŠ‚æ ‡èŻ†ă€ä»·æ Œă€æ ‡éą˜ă€æèż°äżĄæŻç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + IAPProduct?: PlusPaymentIAPProduct; + /** + * 莭äč°IAP敆擁ćŻčè±Ą + * æèż°èŽ­äč°çš„IAPć•†ć“èŻŠç»†äżĄæŻïŒŒćŠ‚æ ‡èŻ†ă€æ•°é‡ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + IAPProductInfo?: PlusPaymentIAPProductInfo; + /** + * 莭äč°IAP敆擁äș€æ˜“äżĄæŻćŻčè±Ą + * æèż°èŽ­äč°çš„IAP敆擁äș€æ˜“èŻŠç»†äżĄæŻïŒŒćŠ‚èŽ­äč°ć•†ć“äżĄæŻă€äș€æ˜“æ—„æœŸă€èźąć•æ ‡èŻ†ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + IAPTransaction?: PlusPaymentIAPTransaction; + /** + * èŽ·ć–æ”Żä»˜é€šé“ + * ćœšèż›èĄŒæ”Żä»˜æ“äœœć‰éœ€èŽ·ć–ç»ˆç«Żæ”ŻæŒçš„æ”Żä»˜é€šé“ćˆ—èĄšïŒŒç”šäșŽæç€șç”šæˆ·èż›èĄŒé€‰æ‹©ă€‚ + * èŽ·ć–æ”Żä»˜é€šé“æˆćŠŸćŽé€šèż‡successCBć›žè°ƒèż”ć›žæ”ŻæŒçš„æ‰€æœ‰é€šé“ćˆ—èĄšïŒŒèŽ·ć–æ”Żä»˜é€šé“ćˆ—èĄšć€±èŽ„ćˆ™é€šèż‡errorCBć›žè°ƒèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + getChannels(successCB?: (result: PlusPayment []) => void, errorCB?: (result: any) => void): void; + /** + * èŻ·æ±‚æ”Żä»˜æ“äœœ + * è°ƒç”šæŒ‡ćźšçš„æ”Żä»˜é€šé“èż›èĄŒæ”Żä»˜æ“äœœïŒŒć…¶äž­statementćŒ…ć«æ”Żä»˜æ“äœœçš„ç›žć…łäżĄæŻïŒŒæ”Żä»˜æšĄć—ć°†ćŒčć‡șæ”Żä»˜ç•ŒéąäŸ›ç”šæˆ·èż›èĄŒæ”Żä»˜äżĄæŻçš„èŸ“ć…„çĄźèź€æ“äœœă€‚ + * ç”šæˆ·æ”Żä»˜æ“äœœæˆćŠŸćŽé€šèż‡successCBć›žè°ƒèż”ć›žæ”Żä»˜æ“äœœç»“æžœïŒŒæ”Żä»˜æ“äœœć€±èŽ„ćˆ™é€šèż‡errorCBć›žè°ƒèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + request(channel?: PlusPaymentPaymentChannel, statement?: string, successCB?: (result: PlusPaymentPaymentResult) => void, errorCB?: (result: any) => void): void; +} + +/** + * æ”Żä»˜é€šé“ćŻčè±Ą + * PaymentChannelćŻčè±ĄèĄšç€șç‰čćźšçš„æ”Żä»˜é€šé“ïŒŒç”šäșŽć‘çł»ç»ŸèŻ·æ±‚æ”Żä»˜æ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ +interface PlusPaymentPaymentChannel { + /** + * æ”Żä»˜é€šé“æ ‡èŻ† + * 甹äșŽæ ‡èŻ†æ”Żä»˜é€šé“ïŒš + * "alipay" - èĄšç€șæ”Żä»˜ćźïŒ› + * "wxpay" - èĄšç€șćŸźäżĄæ”Żä»˜ïŒ› + * "appleiap" - èĄšç€șè‹č果ćș”ç”šć†…æ”Żä»˜ïŒ› + * "qhpay" - èĄšç€ș360èšćˆæ”Żä»˜ïŒˆä»…360æ‰‹ćŠ©æ”ćș”ç”šçŽŻćąƒäž‹æ”ŻæŒïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + id?: string; + /** + * æ”Żä»˜é€šé“æèż° + * æ”Żä»˜é€šé“çš„æèż°äżĄæŻïŒŒćŠ‚â€œæ”Żä»˜ćźâ€ă€â€œćŸźäżĄâ€ă€â€œIn-App Purchase”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + description?: string; + /** + * æ”Żä»˜é€šé“æœćŠĄæ˜ŻćŠćź‰èŁ… + * 通澾ç‰čćźšçš„æ”Żä»˜é€šé“äŸè”–çł»ç»Ÿćź‰èŁ…ç›žć…łçš„æœćŠĄïŒŒæ­€ć±žæ€§ç”šäșŽæ ‡èŻ†ć…¶æœćŠĄæ˜ŻćŠćź‰èŁ…ïŒŒćŠ‚æžœæČĄæœ‰ćź‰èŁ…ćˆ™äžșfalseïŒŒćŠćˆ™äžștrue。 + * è‹„çł»ç»ŸçŽŻćąƒäž­æČĄæœ‰ćź‰èŁ…ç›žć…łçš„æœćŠĄïŒŒćˆ™ćŻèƒœćŻŒè‡Žè°ƒç”šæ”Żä»˜æ“äœœć€±èŽ„ïŒŒèż™æ—¶ćŻä»„è°ƒç”šinstallServiceæ–čæł•èż›èĄŒćź‰èŁ…ă€‚ + * æłšæ„ïŒšćŠ‚æžœæ”Żä»˜é€šé“äžéœ€èŠäŸè”–çł»ç»Ÿćź‰èŁ…æœćŠĄïŒŒćˆ™æ°žèżœèż”ć›žtrueă€‚äŸ‹ćŠ‚æ”Żä»˜ćźïŒŒćŠ‚æžœèźŸć€‡äžŠæœȘćź‰èŁ…æ”Żä»˜ćźćźąæˆ·ç«Żćˆ™è°ƒç”šWapéĄ”éąèż›èĄŒæ”Żä»˜ïŒŒć› æ­€ć€Œć›șćźšèż”ć›žtrue + * è€ŒćŸźäżĄæ”Żä»˜ćˆ™äŸè”–ćŸźäżĄćźąæˆ·ç«ŻïŒŒćŠ‚æžœèźŸć€‡äžŠæœȘćź‰èŁ…ćŸźäżĄćźąæˆ·ç«Żćˆ™serviceReadyć€Œäžșfalse歀时ćș”èŻ„æç€șç”šæˆ·ćź‰èŁ…ćŸźäżĄćźąæˆ·ç«Żæ‰èƒœèż›èĄŒæ”Żä»˜æ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + serviceReady?: boolean; + /** + * ćź‰èŁ…æ”Żä»˜é€šé“äŸè”–çš„æœćŠĄ + * ćŻčäșŽæŸäș›æ”Żä»˜é€šé“ïŒŒé€šćžžç‰čćźšçš„æ”Żä»˜é€šé“äŸè”–çł»ç»Ÿćź‰èŁ…ç›žć…łçš„æœćŠĄïŒŒè°ƒç”šæ­€æ–čæł•ć°†ćź‰èŁ…ć…¶äŸè”–çš„æ”Żä»˜æœćŠĄă€‚ + * ćŠ‚æ”Żä»˜ćźïŒŒćˆ™ćœšçł»ç»Ÿäž­ćź‰èŁ…æ”Żä»˜ćźćźąæˆ·ç«Żçš‹ćșă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + installService(): void; + /** + * 搑IAPæœćŠĄć™šèŻ·æ±‚æ”Żä»˜èźąć• + * IAPæ”Żä»˜ćœšè°ƒç”šplus.payment.requestæ–čæł•æ”Żä»˜ć‰éĄ»ć…ˆć‘æœćŠĄć™šèŻ·æ±‚èŽ·ć–ć•†ć“çš„èŻŠç»†äżĄæŻïŒŒćŠćˆ™äŒšæ”Żä»˜ć€±èŽ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + requestOrder(ids?: any [], successCB?: (result: PlusPayment []) => void, errorCB?: (result: any) => void): void; + /** + * 搑IAPæœćŠĄć™šèŻ·æ±‚ć·Č经莭äč°çš„éžæ¶ˆè€—æ€§ć•†ć“ć’Œèźąé˜…ć•†ć“ + * æłšæ„ïŒšäžèƒœèŽ·ć–ć·Č莭äč°çš„æ¶ˆè€—æ€§ć•†ć“ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + restoreComplateRequest(options?: any, successCB?: (result: PlusPayment []) => void): void; +} + +/** + * IAPèźąć•æ•°æźćŻčè±Ą + * æèż°IAPć•†ć“èźąć•äżĄæŻïŒŒćŠ‚æ ‡èŻ†ă€æ•°é‡ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ +interface PlusPaymentOrderStatementIAP { + /** + * ć•†ć“çš„æ ‡èŻ† + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + productid?: string; + /** + * 莭äč°ç”šæˆ·ćç§° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + username?: string; + /** + * ć•†ć“æ•°é‡ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + quantity?: string; +} + +/** + * æ”Żä»˜æ“äœœç»“æžœćŻčè±Ą + * PaymentResultćŻčè±ĄèĄšç€șæ”Żä»˜æ“äœœèż”ć›žç»“æžœïŒŒç”šäșŽçĄźèꀿ”Żä»˜æ“äœœæˆćŠŸă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ +interface PlusPaymentPaymentResult { + /** + * æ”Żä»˜é€šé“ćŻčè±Ą + * 甹äșŽć‘è”·æ”Żä»˜æ“äœœçš„æ”Żä»˜é€šé“ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + channel?: PlusPaymentPaymentChannel; + /** + * äș€æ˜“çŒ–ć·äżĄæŻ + * ćŠ‚æžœæ”Żä»˜ćčłć°äžæ”ŻæŒæ­€æ•°æźćˆ™èż”曞undefined。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + tradeno?: string; + /** + * äș€æ˜“æèż°äżĄæŻ + * ćŠ‚æžœæ”Żä»˜ćčłć°äžæ”ŻæŒæ­€æ•°æźćˆ™èż”曞undefined。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + description?: boolean; + /** + * æŸ„æ‰Ÿæ”Żä»˜äș€æ˜“äżĄæŻćœ°ć€ + * 甹äșŽć‘æ”Żä»˜ćčłć°æŸ„èŻąäș€æ˜“äżĄæŻïŒŒćŠ‚æžœæ”Żä»˜ćčłć°äžæ”ŻæŒæ­€æ•°æźćˆ™èż”曞undefined。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + url?: boolean; + /** + * æ”Żä»˜æ“äœœæŒ‡çșčäżĄæŻ + * 甹äșŽć‘æ”Żä»˜ćčłć°æŸ„èŻąæ”Żä»˜èźąć•äżĄæŻïŒŒćŠ‚æžœæ”Żä»˜ćčłć°äžæ”ŻæŒæ­€æ•°æźćˆ™èż”曞undefined。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + signature?: string; + /** + * æ”Żä»˜ćčłć°èż”ć›žçš„ćŽŸć§‹æ•°æź + * ćŠ‚æžœæ”Żä»˜ćčłć°èż”曞key-value类枋歗珊äžČïŒŒćˆ™ç»„ćˆæˆçŹŠćˆJSONæ ŒćŒçš„ć­—çŹŠäžČ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + rawdata?: string; +} + +/** + * IAP敆擁ćŻčè±Ą + * æèż°IAPć•†ć“èŻŠç»†äżĄæŻïŒŒćŠ‚æ ‡èŻ†ă€ä»·æ Œă€æ ‡éą˜ă€æèż°äżĄæŻç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ +interface PlusPaymentIAPProduct { + /** + * ć•†ć“çš„æ ‡èŻ† + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + productid?: string; + /** + * ć•†ć“çš„ä»·æ Œ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + price?: string; + /** + * ć•†ć“æ ‡éą˜ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + title?: string; + /** + * ć•†ć“çš„æèż°äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + description?: string; +} + +/** + * 莭äč°IAP敆擁ćŻčè±Ą + * æèż°èŽ­äč°çš„IAPć•†ć“èŻŠç»†äżĄæŻïŒŒćŠ‚æ ‡èŻ†ă€æ•°é‡ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ +interface PlusPaymentIAPProductInfo { + /** + * ć•†ć“çš„æ ‡èŻ† + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + productIdentifier?: string; + /** + * ć•†ć“çš„æ•°é‡ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + quantity?: string; +} + +/** + * 莭äč°IAP敆擁äș€æ˜“äżĄæŻćŻčè±Ą + * æèż°èŽ­äč°çš„IAP敆擁äș€æ˜“èŻŠç»†äżĄæŻïŒŒćŠ‚èŽ­äč°ć•†ć“äżĄæŻă€äș€æ˜“æ—„æœŸă€èźąć•æ ‡èŻ†ç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ +interface PlusPaymentIAPTransaction { + /** + * 莭äč°ć•†ć“çš„äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + payment?: string; + /** + * 莭äč°ć•†ć“çš„äș€æ˜“æ—„期 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + transactionDate?: string; + /** + * 莭äč°ć•†ć“çš„äș€æ˜“èźąć•æ ‡è݆ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + transactionIdentifier?: string; + /** + * 莭äč°ć•†ć“çš„äș€æ˜“æ”¶æź + * base64çŒ–ç æ ŒćŒć­—çŹŠäžČæ•°æźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + transactionReceipt?: string; + /** + * 莭äč°ć•†ć“çš„äș€æ˜“状态 + * ćŻć–ć€ŒïŒš"1"äžșæ”Żä»˜æˆćŠŸïŒ›"2"äžșæ”Żä»˜ć€±èŽ„ïŒ›"3"äžșæ”Żä»˜ć·Čæąć€ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/payment.html](http://www.html5plus.org/doc/zh_cn/payment.html) + */ + transactionState?: string; +} + +/** + * PushæšĄć—çźĄç†æŽšé€æ¶ˆæŻćŠŸèƒœïŒŒćŻä»„ćźžçŽ°ćœšçșżă€çŠ»çșżçš„æ¶ˆæŻæŽšé€ïŒŒé€šèż‡plus.pushćŻèŽ·ć–æŽšé€æ¶ˆæŻçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ +interface PlusPush { + /** + * JSONćŻčè±ĄïŒŒèŽ·ć–çš„ćźąæˆ·ç«Żæ ‡èŻ†äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + ClientInfo?: PlusPushClientInfo; + /** + * JSONćŻčè±ĄïŒŒæŽšé€æ¶ˆæŻćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + PushMessage?: PlusPushPushMessage; + /** + * JSONćŻčè±ĄïŒŒèŽ·ćźąæˆ·ç«Żćˆ›ć»șæœŹćœ°æ¶ˆæŻçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + MessageOptions?: PlusPushMessageOptions; + /** + * æ·»ćŠ æŽšé€æ¶ˆæŻäș‹ä»¶ç›‘搏晚 + * æ·»ćŠ æŽšé€æ¶ˆæŻäș‹ä»¶ç›‘ćŹć™šïŒŒćœ“æŒ‡ćꚿŽšé€äș‹ä»¶ć‘ć‡șæ—¶è§Šć‘ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + addEventListener(type?: string, listener?: (result: string) => void, capture?: boolean): void; + /** + * æž…ç©șæ‰€æœ‰æŽšé€æ¶ˆæŻ + * æž…ç©șçł»ç»Ÿæ¶ˆæŻäž­ćżƒæ‰€æœ‰çš„æŽšé€æ¶ˆæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + clear(): void; + /** + * 戛ć»șæœŹćœ°æ¶ˆæŻ + * ćœšæœŹćœ°ç›ŽæŽ„ćˆ›ć»șæŽšé€æ¶ˆæŻïŒŒćč¶æ·»ćŠ ćˆ°çł»ç»Ÿæ¶ˆæŻäž­ćżƒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + createMessage(content?: string, payload?: string, options?: PlusPushMessageOptions): void; + /** + * èŽ·ć–æ‰€æœ‰æŽšé€æ¶ˆæŻ + * èŽ·ć–ćźąæˆ·ç«ŻæŽ„æ”¶ćˆ°çš„æ‰€æœ‰æŽšé€æ¶ˆæŻă€‚ + * ä»…ćŒ…æ‹Źćœšçł»ç»Ÿæ¶ˆæŻäž­ćżƒæ˜Ÿç€șçš„æŽšé€æ¶ˆæŻïŒŒäžćŒ…æ‹Źè°ƒç”šsetAutoNotification(false)æ–čæł•èźŸçœźäžæ˜Ÿç€șæŽšé€æ¶ˆæŻćŽæŽ„æ”¶ćˆ°çš„æ¶ˆæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + getAllMessage(): PlusPushPushMessage; + /** + * èŽ·ć–ćźąæˆ·ç«ŻæŽšé€æ ‡èŻ†äżĄæŻ + * ćźąæˆ·ç«Żæ ‡èŻ†äżĄæŻç”šäșŽäžšćŠĄæœćŠĄć™šäž‹ć‘æŽšé€æ¶ˆæŻæ—¶æäș€ç»™æŽšé€æœćŠĄć™šçš„æ•°æźïŒŒç”šäșŽèŻŽæ˜Žäž‹ć‘æŽšé€æ¶ˆæŻçš„æŽ„æ”¶è€…ïŒˆćźąæˆ·ç«ŻïŒ‰ă€‚éœ€èŠćźąæˆ·ç«ŻćœšçŹŹäž€æŹĄèżèĄŒæ—¶æäș€ćˆ°äžšćŠĄæœćŠĄć™šäżć­˜ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + getClientInfo(): PlusPushClientInfo; + /** + * èźŸçœźçš‹ćșæ˜ŻćŠć°†æ¶ˆæŻæ˜Ÿç€șćœšçł»ç»Ÿæ¶ˆæŻäž­ćżƒ + * é»˜èź€æƒ…ć†”äž‹çš‹ćșćœšæŽ„æ”¶ćˆ°æŽšé€æ¶ˆæŻćŽć°†äŒšćœšçł»ç»Ÿæ¶ˆæŻäž­ćżƒæ˜Ÿç€șïŒŒé€šèż‡æ­€æ–čæł•ćŻć…łé—­é»˜èź€èĄŒäžșïŒŒæŽ„æ”¶ćˆ°æŽšé€æ¶ˆæŻćŽäžćœšçł»ç»Ÿæ¶ˆæŻäž­ćżƒæ˜Ÿç€șïŒŒé€šèż‡addEventListeneræ–čæł•的“receive”äș‹ä»¶ç›‘ćŹć€„ç†æŽ„æ”¶ćˆ°çš„æ¶ˆæŻă€‚ + * ćœšèż™ç§æšĄćŒäž‹ćŻé€šèż‡createMessageæ–čæł•ćˆ›ć»șćœšçł»ç»Ÿæ¶ˆæŻäž­ćżƒæ˜Ÿç€șçš„æ¶ˆæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + setAutoNotification(notify?: boolean): void; + /** + * ćˆ é™€æŽšé€æ¶ˆæŻ + * ćˆ é™€çł»ç»Ÿæ¶ˆæŻäž­ćżƒæŒ‡ćźšçš„æŽšé€æ¶ˆæŻïŒŒćŻé€šèż‡getAllMessageæ–čæł•èŽ·ć–æ‰€æœ‰çš„æ¶ˆæŻćŽèż›èĄŒæ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + remove(message?: PlusPushPushMessage): void; +} + +/** + * JSONćŻčè±ĄïŒŒèŽ·ć–çš„ćźąæˆ·ç«Żæ ‡èŻ†äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ +interface PlusPushClientInfo { + /** + * èźŸć€‡ä»€ç‰ŒïŒˆiOSèźŸć€‡ć”Żäž€æ ‡èŻ†ïŒ‰ïŒŒç”šäșŽAPNSæœćŠĄæŽšé€äž­æ ‡èŻ†èźŸć€‡çš„èș«ä»œ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + token?: string; + /** + * æŽšé€æœćŠĄä»€ç‰ŒïŒˆèźŸć€‡ć”Żäž€æ ‡èŻ†ïŒ‰ïŒŒç”šäșŽæ ‡èŻ†æŽšé€äżĄæŻæŽ„æ”¶è€…èș«ä»œ + * 第侉æ–čæŽšé€æœćŠĄć™šçźĄç†çš„èźŸć€‡ć”Żäž€æ ‡èŻ†ïŒŒćœšiOSćčłć°æ­€ć€Œé€šćžžäžŽtokenäžćŒïŒ›ćœšć…¶ćźƒćčłć°æ­€ć€Œé€šćžžäžŽtokenć€Œäž€è‡Žă€‚ + * æ­€ć€ŒäžŽèźŸć€‡ćŠćș”ç”šéƒœç›žć…łïŒŒćłäžćŒçš„apk/ipaćź‰èŁ…ćˆ°ćŒäž€ć°èźŸć€‡äžŠçš„ć€Œéƒœäžç›žćŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + clientid?: string; + /** + * 第侉æ–čæŽšé€æœćŠĄçš„ćș”甚标è݆ + * 第侉æ–čæŽšé€æœćŠĄć™šçźĄç†çš„ćș”ç”šæ ‡èŻ†ïŒŒé€šćžžéœ€èŠćœšçŹŹäž‰æ–čæŽšé€æœćŠĄć™šćčłć°èż›èĄŒæłšć†ŒèŽ·ć–ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + appid?: string; + /** + * 第侉æ–čæŽšé€æœćŠĄć™šçš„ćș”ç”šé”źć€Œ + * 第侉æ–čæŽšé€æœćŠĄć™šçźĄç†çš„ćș”ç”šé”źć€ŒïŒŒé€šćžžéœ€èŠćœšçŹŹäž‰æ–čæŽšé€æœćŠĄć™šćčłć°èż›èĄŒæłšć†ŒèŽ·ć–ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + appkey?: string; +} + +/** + * JSONćŻčè±ĄïŒŒæŽšé€æ¶ˆæŻćŻčè±Ą + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ +interface PlusPushPushMessage { + /** + * æŽšé€æ¶ˆæŻæ˜Ÿç€șçš„æ ‡éą˜ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + title?: string; + /** + * æŽšé€æ¶ˆæŻæ˜Ÿç€ș的憅ćźč + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + content?: string; + /** + * æŽšé€æ¶ˆæŻæ‰żèœœçš„æ•°æź + * ćŠ‚æžœæŽšé€æ¶ˆæŻäž­äŒ èŸ“çš„æ•°æźäžçŹŠćˆJSONæ ŒćŒïŒŒćˆ™äœœäžșStringç±»ćž‹æ•°æźäżć­˜ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + payload?: any; + /** + * Apple APNSæŽšé€ćèźźæ•°æź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + aps?: any; +} + +/** + * JSONćŻčè±ĄïŒŒèŽ·ćźąæˆ·ç«Żćˆ›ć»șæœŹćœ°æ¶ˆæŻçš„ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ +interface PlusPushMessageOptions { + /** + * èŠćŻćŠšæ”ćș”甚的appid + * é»˜èź€ć€Œäžșćœ“ć‰æ”ćș”甚的appid。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + appid?: string; + /** + * æ˜ŻćŠèŠ†ç›–äžŠäž€æŹĄæç€șçš„æ¶ˆæŻ + * ćŻć–ć€Œtrue或falsetrueäžș芆盖falseäžèŠ†ç›–ïŒŒé»˜èź€äžșpermissionäž­èźŸçœźçš„coverć€Œă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + cover?: boolean; + /** + * 提ç€șæ¶ˆæŻć»¶èżŸæ˜Ÿç€ș的时闎 + * ćœ“èźŸć€‡æŽ„æ”¶ćˆ°æŽšé€æ¶ˆæŻćŽïŒŒćŻäžç«‹ćłæ˜Ÿç€șïŒŒè€Œæ˜Żć»¶èżŸäž€æź”æ—¶é—Žæ˜Ÿç€șïŒŒć»¶èżŸæ—¶é—Žć•äœäžșsïŒŒé»˜èź€äžș0sïŒŒç«‹ćłæ˜Ÿç€ș。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + delay?: number; + /** + * æŽšé€æ¶ˆæŻçš„ć›Ÿæ ‡ + * æœŹćœ°ć›Ÿç‰‡ćœ°ć€ïŒŒç›žćŻčè·ŻćŸ„ - 盾ćŻčäșŽćœ“ć‰éĄ”靱的hostäœçœźïŒŒćŠ‚"a.jpg"ïŒŒæłšæ„ćœ“ć‰éĄ”éąäžșçœ‘ç»œćœ°ć€ćˆ™äžæ”ŻæŒïŒ› 绝ćŻčè·ŻćŸ„ - çł»ç»Ÿç»ćŻčè·ŻćŸ„ïŒŒćŠ‚Androidćčłć°"/sdcard/logo.png"ïŒŒæ­€ç±»è·ŻćŸ„é€šćžžé€šèż‡ć…¶ćźƒ5+ APIèŽ·ć–çš„ïŒ› æ‰©ć±•ç›žćŻčè·ŻćŸ„URL(RelativeURL) - 仄"_"ćŒ€ć€Žçš„ç›žćŻčè·ŻćŸ„ïŒŒćŠ‚"_www/a.jpg" æœŹćœ°è·ŻćŸ„URL - 仄“file://â€ćŒ€ć€ŽïŒŒćŽéąè·Ÿéšçł»ç»Ÿç»ćŻčè·ŻćŸ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + icon?: string; + /** + * æŽšé€æ¶ˆæŻçš„æç€ș音 + * 星ç€șæ¶ˆæŻæ—¶çš„æ’­æ”Ÿçš„æç€șéŸłïŒŒćŻć–ć€ŒïŒš + * “system”-èĄšç€șäœżç”šçł»ç»Ÿé€šçŸ„æç€șéŸłïŒ› + * “none”-èĄšç€șäžäœżç”šæç€șéŸłïŒ› + * é»˜èź€ć€Œäžș“system”。 + * - system: äœżç”šçł»ç»Ÿé€šçŸ„æç€ș音 + * - none: äžäœżç”šæç€ș音 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + sound?: 'system' | 'none'; + /** + * æŽšé€æ¶ˆæŻçš„æ ‡éą˜ + * ćœšçł»ç»Ÿæ¶ˆæŻäž­ćżƒæ˜Ÿç€șçš„é€šçŸ„æ¶ˆæŻæ ‡éą˜ïŒŒé»˜èź€ć€Œäžș繋ćșçš„ćç§°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + title?: string; + /** + * æ¶ˆæŻäžŠæ˜Ÿç€ș的提ç€șæ—¶é—Ž + * é»˜èź€äžșćœ“ć‰æ—¶é—ŽïŒŒćŠ‚æžœć»¶èżŸæ˜Ÿç€șćˆ™äœżç”šć»¶æ—¶ćŽæ˜Ÿç€șæ¶ˆæŻçš„æ—¶é—Žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/push.html](http://www.html5plus.org/doc/zh_cn/push.html) + */ + when?: Date; +} + +/** + * ShareæšĄć—çźĄç†ćźąæˆ·ç«Żçš„ç€Ÿäș€ćˆ†äș«ćŠŸèƒœïŒŒæäŸ›è°ƒç”šç»ˆç«Żç€Ÿäș€èœŻä»¶çš„ćˆ†äș«èƒœćŠ›ă€‚é€šèż‡plus.sharećŻèŽ·ć–ç€Ÿäș€ćˆ†äș«çźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ +interface PlusShare { + /** + * JSONćŻčè±ĄïŒŒćˆ†äș«æŽˆæƒèź€èŻć‚æ•°é€‰éĄč + * æ­€ćŻčè±Ąæ”ŻæŒçš„ć±žæ€§ć€Œç”±ćˆ†äș«æœćŠĄçš„æŽˆæƒèź€èŻæšĄć—ćźšäč‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + AuthOptions?: PlusShareAuthOptions; + /** + * 戆äș«æŽˆæƒæŽ§ä»¶ćŻčè±Ą + * AuthorizećŻčè±ĄèĄšç€ș戆äș«æŽ§ä»¶ćŻčè±ĄïŒŒç”šäșŽćœšçȘ—ćŁäž­æ˜Ÿç€ș戆äș«æŽ§ä»¶ïŒŒäœżç”šæ­€ćŻčè±ĄćŻè‡Ș漚äč‰ćˆ†äș«æŽˆæƒç•Œéąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + Authorize?: PlusShareAuthorize; + /** + * JSONćŻčè±ĄïŒŒç”šæˆ·äœçœźäżĄæŻ + * GeoPositionćŻčè±Ąç”šäșŽèĄšç€șç”šæˆ·ćˆ†äș«æ¶ˆæŻæ—¶çš„äœçœźäżĄæŻă€‚ç”šäșŽæ ‡èŻ†ćˆ†äș«æ“äœœæ—¶ç”šæˆ·çš„äœçœźäżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + GeoPosition?: PlusShareGeoPosition; + /** + * 戆äș«æœćŠĄćŻčè±Ą + * ShareServicećŻčè±Ąç”šäșŽèĄšç€ș戆äș«æœćŠĄïŒŒćœšJSäž­äžșćŻčè±ĄïŒŒç”šäșŽć‘çł»ç»ŸèŻ·æ±‚ćˆ†äș«æ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + ShareService?: PlusShareShareService; + /** + * 戆äș«æœćŠĄæ ‡è݆ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + ShareServerIdentity?: PlusShareShareServerIdentity; + /** + * JSONćŻčè±ĄïŒŒćˆ†äș«æ¶ˆæŻćŻčè±Ą + * ShareMessagećŻčè±Ąç”šäșŽèĄšç€ș戆äș«æ¶ˆæŻć†…ćźčïŒŒćœšJSäž­äžșJSONćŻčè±ĄïŒŒç”šäșŽć‘çł»ç»Ÿć‘é€ćˆ†äș«äżĄæŻæ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + ShareMessage?: PlusShareShareMessage; + /** + * JSONćŻčè±ĄïŒŒäżć­˜ćˆ†äș«æ¶ˆæŻæ‰©ć±•äżĄæŻ + * ShareMessageExtraćŻčè±Ąç”šäșŽäżć­˜ć„ćˆ†äș«ćčłć°æ‰©ć±•çš„ć‚æ•°ïŒŒç”šäșŽè‡Ș漚äč‰ćˆ†äș«ćŠŸèƒœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + ShareMessageExtra?: PlusShareShareMessageExtra; + /** + * JSONćŻčè±ĄïŒŒćŸźäżĄć°çš‹ćșäżĄæŻ + * 甹äșŽé…çœźćˆ†äș«ć°çš‹ćșçš„ć‚æ•°ïŒŒćŠ‚ć°çš‹ćșæ ‡èŻ†ă€éĄ”éąè·ŻćŸ„ç­‰ă€‚ + * æłšæ„ïŒšćˆ†äș«çš„ć°çš‹ćșéœ€èŠćœšćŸźäżĄćŒ€æ”Ÿćčłć°ć…łè”çš„ćŒ€ć‘è€…èŽŠć·äž‹ïŒŒćŠćˆ™äŒšćˆ†äș«ć€±èŽ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + WeixinMiniProgramOptions?: PlusShareWeixinMiniProgramOptions; + /** + * èŽ·ć–ćˆ†äș«æœćŠĄ + * èŽ·ć–ç»ˆç«Żæ”ŻæŒçš„ćˆ†äș«é€šé“ćˆ—èĄšïŒŒćŻç”šäșŽæç€șç”šæˆ·èż›èĄŒćˆ†äș«æœćŠĄć™šçš„é€‰æ‹©ă€‚èŽ·ć–ćˆ†äș«æœćŠĄæˆćŠŸćŽé€šèż‡successCBć›žè°ƒèż”ć›žæ”ŻæŒçš„æ‰€æœ‰æœćŠĄćˆ—èĄšïŒŒèŽ·ć–æœćŠĄć€±èŽ„ćˆ™é€šèż‡errorCBć›žè°ƒèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + getServices(successCB?: (result: PlusShare []) => void, errorCB?: (result: any) => void): void; + /** + * äœżç”šçł»ç»Ÿç»„ä»¶ć‘é€ćˆ†äș« + * è°ƒç”šçł»ç»Ÿćˆ†äș«ç»„ä»¶ćˆ†äș«æ¶ˆæŻïŒŒé€šèż‡msgć‚æ•°èźŸçœźćˆ†äș«ć†…ćźč。 + * ć‘é€æˆćŠŸćŽé€šèż‡successCBć›žè°ƒć‡œæ•°é€šçŸ„æ“äœœćźŒæˆïŒŒć‘é€ć€±èŽ„ćˆ™é€šèż‡errorCBć›žè°ƒèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + sendWithSystem(msg?: PlusShareShareMessage, successCB?: () => void, errorCB?: (result: any) => void): void; +} + +/** + * JSONćŻčè±ĄïŒŒćˆ†äș«æŽˆæƒèź€èŻć‚æ•°é€‰éĄč + * æ­€ćŻčè±Ąæ”ŻæŒçš„ć±žæ€§ć€Œç”±ćˆ†äș«æœćŠĄçš„æŽˆæƒèź€èŻæšĄć—ćźšäč‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ +interface PlusShareAuthOptions { + /** + * 戆äș«æœćŠĄćčłć°ç”łèŻ·çš„appid + * ćŠšæ€èźŸçœźćˆ†äș«æœćŠĄæŽˆæƒèź€èŻæ—¶éœ€èŠäœżç”šçš„appidïŒŒä»…éœ€èŠæ­€ć‚æ•°çš„ćˆ†äș«æœćŠĄïŒˆćŠ‚â€œćŸźäżĄâ€ă€â€œQQâ€ïŒ‰æ”ŻæŒă€‚ + * ćŠ‚æžœæœȘèźŸçœźćˆ™äœżç”šèżèĄŒçŽŻćąƒäž­ć†…çœźçš„appidć€ŒïŒˆćŠ‚ćœšHBuilder侭揯朹manifest.json的“SDKé…çœźâ€éĄčäž­èż›èĄŒèźŸçœźïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + appid?: string; + /** + * 戆äș«æœćŠĄćčłć°ç”łèŻ·çš„appkey + * ćŠšæ€èźŸçœźćˆ†äș«æœćŠĄæŽˆæƒèź€èŻæ—¶éœ€èŠäœżç”šçš„appkeyïŒŒä»…éœ€èŠæ­€ć‚æ•°çš„ćˆ†äș«æœćŠĄïŒˆćŠ‚â€œæ–°æ”ȘćŸźćšâ€ïŒ‰æ”ŻæŒă€‚ + * ćŠ‚æžœæœȘèźŸçœźćˆ™äœżç”šèżèĄŒçŽŻćąƒäž­ć†…çœźçš„appkeyć€ŒïŒˆćŠ‚ćœšHBuilder侭揯朹manifest.json的“SDKé…çœźâ€éĄčäž­èż›èĄŒèźŸçœźïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + appkey?: string; + /** + * 戆äș«æœćŠĄćčłć°ç”łèŻ·çš„appsecret + * ćŠšæ€èźŸçœźćˆ†äș«æœćŠĄäž­éœ€èŠäœżç”šçš„appsecretïŒŒä»…éœ€èŠæ­€ć‚æ•°çš„ćˆ†äș«æœćŠĄïŒˆćŠ‚â€œćŸźäżĄâ€ă€â€œæ–°æ”ȘćŸźćšâ€ïŒ‰æ”ŻæŒă€‚ + * ćŠ‚æžœæœȘèźŸçœźćˆ™äœżç”šèżèĄŒçŽŻćąƒäž­ć†…çœźçš„appsecretć€ŒïŒˆćŠ‚ćœšHBuilder侭揯朹manifest.json的“SDKé…çœźâ€éĄčäž­èż›èĄŒèźŸçœźïŒ‰ïŒ›ćœ“ćŒ€æ”Ÿćčłć°ç”łèŻ·çš„appsecretć€Œæ¶‰ćŠćˆ°ćź‰ć…šé—źéą˜æ—¶ïŒŒćŻćœšćș”ç”šèżèĄŒæ—¶ä»ŽæœćŠĄć™šèŽ·ć–ïŒŒç„¶ćŽé€šèż‡æ­€apićŠšæ€èźŸçœźă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + appsecret?: string; + /** + * 戆äș«æœćŠĄćčłć°ç”łèŻ·çš„redirect_url + * ćŠšæ€èźŸçœźćˆ†äș«æœćŠĄäž­éœ€èŠäœżç”šçš„redirect_urlïŒŒä»…éœ€èŠæ­€ć‚æ•°çš„ç™»ćœ•æŽˆæƒæœćŠĄïŒˆćŠ‚â€œæ–°æ”ȘćŸźćšç™»ćœ•â€ïŒ‰æ”ŻæŒă€‚ + * ćŠ‚æžœæœȘèźŸçœźćˆ™äœżç”šèżèĄŒçŽŻćąƒäž­ć†…çœźçš„redirect_urlć€ŒïŒˆćŠ‚ćœšHBuilder侭揯朹manifest.json的SDKé…çœźéĄčäž­èż›èĄŒèźŸçœźïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + redirect_url?: string; +} + +/** + * 戆äș«æŽˆæƒæŽ§ä»¶ćŻčè±Ą + * AuthorizećŻčè±ĄèĄšç€ș戆äș«æŽ§ä»¶ćŻčè±ĄïŒŒç”šäșŽćœšçȘ—ćŁäž­æ˜Ÿç€ș戆äș«æŽ§ä»¶ïŒŒäœżç”šæ­€ćŻčè±ĄćŻè‡Ș漚äč‰ćˆ†äș«æŽˆæƒç•Œéąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ +interface PlusShareAuthorize { + /** + * 戆äș«æŽ§ä»¶ćŠ èœœćꌿˆäș‹ä»¶ + * 戆äș«æŽˆæƒæŽ§ä»¶ć†…ćźčćŠ èœœćźŒæˆäș‹ä»¶ïŒŒé€šèż‡è°ƒç”šloadæ–čæł•ćŠ èœœćˆ†äș«æŽˆæƒæŽ§ä»¶ć†…ćźčïŒŒćœ“ć†…ćźčćŠ èœœćźŒæˆæ—¶è§Šć‘ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + onloaded?: (result: any) => void; + /** + * 戆äș«æŽˆæƒèź€èŻæˆćŠŸäș‹ä»¶ + * ç”šæˆ·ćœšćˆ†äș«æŽˆæƒæŽ§ä»¶äžŠèŸ“ć…„æ“äœœæŽˆæƒæˆćŠŸæ—¶è§Šć‘ïŒŒäș‹ä»¶æ–čæł•æ ŒćŒć‚è€ƒShareSuccessCallbackć›žè°ƒć‡œæ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + onauthenticated?: () => void; + /** + * 戆äș«æŽˆæƒèź€èŻć€±èŽ„äș‹ä»¶ + * ç”šæˆ·ćœšćˆ†äș«æŽˆæƒæŽ§ä»¶äžŠèŸ“ć…„æ“äœœæŽˆæƒèź€èŻé”™èŻŻæ—¶è§Šć‘ïŒŒäș‹ä»¶æ–čæł•æ ŒćŒć‚è€ƒShareErrorCallbackć›žè°ƒć‡œæ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + onerror?: (result: any) => void; + /** + * ćŠ èœœćˆ†äș«æŽˆæƒéĄ”靱 + * 戛ć»ș戆äș«æŽˆæƒéĄ”éąćŽïŒŒéœ€èŠè°ƒç”šæ­€æ–čæł•æŒ‡ćźšćˆ†äș«æœćŠĄæ ‡èŻ†æ„ćŠ èœœæŽˆæƒéĄ”éąæ•°æźïŒŒæ­€æ ‡èŻ†ćŻäœżç”šShareServicećŻčè±Ąçš„idć±žæ€§ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + load(id?: string): void; + /** + * èźŸçœźćˆ†äș«æŽˆæƒæŽ§ä»¶æ˜ŻćŠćŻè§ + * 戛ć»ș戆äș«æŽˆæƒéĄ”éąćŽïŒŒè°ƒç”šæ­€æ–čæł•èźŸçœźćˆ†äș«æŽˆæƒæŽ§ä»¶ćœšéĄ”éąäž­æ˜ŻćŠćŻè§ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + setVisible(visible?: boolean): void; +} + +/** + * JSONćŻčè±ĄïŒŒç”šæˆ·äœçœźäżĄæŻ + * GeoPositionćŻčè±Ąç”šäșŽèĄšç€șç”šæˆ·ćˆ†äș«æ¶ˆæŻæ—¶çš„äœçœźäżĄæŻă€‚ç”šäșŽæ ‡èŻ†ćˆ†äș«æ“äœœæ—¶ç”šæˆ·çš„äœçœźäżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ +interface PlusShareGeoPosition { + /** + * ç”šæˆ·äœçœźçš„çșŹćșŠćæ ‡äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + latitude?: number; + /** + * ç”šæˆ·äœçœźçš„ç»ćșŠćæ ‡äżĄæŻ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + longitude?: number; +} + +/** + * 戆äș«æœćŠĄćŻčè±Ą + * ShareServicećŻčè±Ąç”šäșŽèĄšç€ș戆äș«æœćŠĄïŒŒćœšJSäž­äžșćŻčè±ĄïŒŒç”šäșŽć‘çł»ç»ŸèŻ·æ±‚ćˆ†äș«æ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ +interface PlusShareShareService { + /** + * 戆äș«æœćŠĄæ ‡è݆ + * 甹äșŽèĄšç€ș戆äș«æœćŠĄæ ‡èŻ†ïŒš + * "sinaweibo" - èĄšç€ș新æ”ȘćŸźćšïŒ› + * "tencentweibo" - èĄšç€șè…ŸèźŻćŸźćšïŒ› + * "weixin" - èĄšç€șćŸźäżĄïŒ› + * "qq" - èĄšç€șè…ŸèźŻQQ。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + id?: PlusShareShareServerIdentity; + /** + * 戆äș«æœćŠĄæèż° + * 甹äșŽæèż°ćˆ†äș«æœćŠĄçš„äżĄæŻïŒš + * ćŠ‚â€œæ–°æ”ȘćŸźćšâ€ă€â€œè…ŸèźŻćŸźćšâ€ă€â€œćŸźäżĄâ€ă€â€œQQ”。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + description?: string; + /** + * æ˜ŻćŠæŽˆæƒèź€èŻ + * 甹äșŽæ ‡èŻ†æ­€ćˆ†äș«æ˜ŻćŠć·Čç»æŽˆæƒèź€èŻèż‡ïŒŒtrueèĄšç€șć·ČćźŒæˆæŽˆæƒèź€èŻïŒ›falseèĄšç€șæœȘćźŒæˆæŽˆæƒèź€èŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + authenticated?: boolean; + /** + * æŽˆæƒèź€èŻäżĄæŻ + * ä»…ćœšauthenticatedäžștrueæ—¶æœ‰æ•ˆïŒŒæ ‡èŻ†ćźąæˆ·èź€èŻæ ‡èŻ†äżĄæŻïŒŒç”šäșŽć‘é€ćˆ†äș«äżĄæŻă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + accessToken?: string; + /** + * æ˜ŻćŠć­˜ćœšćŻčćș”çš„ćˆ†äș«ćźąæˆ·ç«Ż + * ćŻčäșŽæŸäș›ćˆ†äș«æœćŠĄïŒŒćŻç›ŽæŽ„è°ƒç”šæœŹćœ°ćźąæˆ·ç«Żçš‹ćșèż›èĄŒæŽˆæƒèź€èŻïŒŒæ­€ć±žæ€§ćłćŻæäŸ›æ­€ç›žć…łäżĄæŻïŒŒè‹„æČĄæœ‰ćź‰èŁ…æœŹćœ°ćźąæˆ·ç«Żćˆ™ćŻèƒœè°ƒç”šć…¶ćźƒæ–čćŒèż›èĄŒćˆ†äș«æ“äœœïŒŒćŠ‚WAPæ–čćŒç­‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + nativeClient?: boolean; + /** + * æŽˆæƒèź€èŻæ“äœœ + * ćŻčæŒ‡ćźšçš„ćˆ†äș«æœćŠĄèż›èĄŒæŽˆæƒèź€èŻæ“äœœïŒŒćœšæŽˆæƒć‰ćŻé€šèż‡ShareService.authenticatedć±žæ€§ćˆ€æ–­æ˜ŻćŠć·Čç»æŽˆæƒèż‡ïŒŒé€šćžžćȘ需芁ćŻčæČĄæœ‰èż›èĄŒèż‡æŽˆæƒèź€èŻçš„æœćŠĄèż›èĄŒæŽˆæƒèź€èŻæ“äœœă€‚ + * æŽˆæƒèź€èŻæ“äœœæˆćŠŸćŽé€šèż‡successCBć›žè°ƒć‡œæ•°é€šçŸ„æ“äœœćźŒæˆïŒŒæ“äœœć€±èŽ„ćˆ™é€šèż‡errorCBć›žè°ƒèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + authorize(successCallback?: (result: PlusShareShareService) => void, errorCallback?: (result: any) => void, options?: PlusShareAuthOptions): void; + /** + * ć–æ¶ˆæŽˆæƒèź€èŻ + * ćŻčæŒ‡ćźšçš„ćˆ†äș«æœćŠĄć–æ¶ˆæŽˆæƒèź€èŻæ“äœœïŒŒć–æ¶ˆæŽˆæƒèź€èŻćŽïŒŒć†æŹĄćˆ†äș«æ—¶éœ€é‡æ–°èż›èĄŒæŽˆæƒæ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + forbid(): void; + /** + * 揑送戆äș« + * 揑送戆äș«æ¶ˆæŻïŒŒćˆ†äș«æ¶ˆæŻçš„憅ćźčé€šèż‡msgèźŸçœźă€‚ + * ć‘é€æˆćŠŸćŽé€šèż‡successCBć›žè°ƒć‡œæ•°é€šçŸ„æ“äœœćźŒæˆïŒŒć‘é€ć€±èŽ„ćˆ™é€šèż‡errorCBć›žè°ƒèż”ć›žă€‚è‹„ćˆ†äș«æœćŠĄæČĄæœ‰èż›èĄŒæŽˆæƒèź€èŻæˆ–æŽˆæƒèź€èŻć€±æ•ˆćˆ™è§Šć‘ć€±èŽ„ć›žè°ƒć‡œæ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + send(msg?: PlusShareShareMessage, successCB?: () => void, errorCB?: (result: any) => void): void; + /** + * è°ƒç”šćŸźäżĄć°çš‹ćș + * æłšæ„ïŒšéœ€ćœšćŸźäżĄćŒ€æ”Ÿćčłć°ć°†ćș”ç”šć…łè”ć°çš‹ćșæ‰èƒœæ­Łćžžè°ƒç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + launchMiniProgram(options?: PlusShareWeixinMiniProgramOptions): void; +} + +/** + * 戆äș«æœćŠĄæ ‡è݆ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ +interface PlusShareShareServerIdentity { + /** + * 新æ”ȘćŸźćš + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + sinaweibo?: string; + /** + * è…ŸèźŻćŸźćš + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + tencentweibo?: string; + /** + * ćŸźäżĄ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + weixin?: string; +} + +/** + * JSONćŻčè±ĄïŒŒćˆ†äș«æ¶ˆæŻćŻčè±Ą + * ShareMessagećŻčè±Ąç”šäșŽèĄšç€ș戆äș«æ¶ˆæŻć†…ćźčïŒŒćœšJSäž­äžșJSONćŻčè±ĄïŒŒç”šäșŽć‘çł»ç»Ÿć‘é€ćˆ†äș«äżĄæŻæ“äœœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ +interface PlusShareShareMessage { + /** + * 戆äș«æ¶ˆæŻçš„类枋 + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + type?: string; + /** + * 戆äș«æ¶ˆæŻçš„æ–‡ć­—憅ćźč + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + content?: string; + /** + * 戆äș«æ¶ˆæŻçš„ć›Ÿç‰‡ + * 戆äș«æ¶ˆæŻäž­ćŒ…ć«çš„ć›Ÿç‰‡è·ŻćŸ„ïŒŒä»…æ”ŻæŒæœŹćœ°è·ŻćŸ„ă€‚ + * è‹„ćˆ†äș«ćčłć°ä»…æ”ŻæŒæäș€äž€ćŒ ć›Ÿç‰‡ïŒŒäŒ ć…„ć€šćŒ ć›Ÿç‰‡ćˆ™ä»…æäș€çŹŹäž€ćŒ ć›Ÿç‰‡ă€‚ + * ćŠ‚æžœæœȘæŒ‡ćźštypeç±»ćž‹ïŒŒäŒ˜ć…ˆçș§éĄșćșäžșpictures>contentïŒˆćłèźŸçœźäș†picturesćˆ™èź€äžș戆äș«ć›Ÿç‰‡ç±»ćž‹ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + pictures?: any []; + /** + * 戆äș«æ¶ˆæŻçš„çŒ©ç•„ć›Ÿ + * 戆äș«æ¶ˆæŻäž­ćŒ…ć«çš„çŒ©ç•„ć›Ÿè·ŻćŸ„ïŒŒæ”ŻæŒæœŹćœ°è·ŻćŸ„ćŠçœ‘ç»œè·ŻćŸ„ă€‚ + * è‹„ćˆ†äș«ćčłć°ä»…æ”ŻæŒæäș€äž€ćŒ ć›Ÿç‰‡ïŒŒäŒ ć…„ć€šćŒ ć›Ÿç‰‡ćˆ™ä»…æäș€çŹŹäž€ćŒ ć›Ÿç‰‡ă€‚ + * ćŠ‚æžœćˆ†äș«ćčłć°çš„äżĄæŻäžæ”ŻæŒçŒ©ç•„ć›ŸïŒŒè‹„æČĄæœ‰èźŸçœźæ¶ˆæŻçš„ć›Ÿç‰‡ïŒˆpicturesïŒ‰ćˆ™äœżç”šçŒ©ç•„ć›ŸïŒŒćŠćˆ™ćżœç•„ć…¶ć±žæ€§ć€Œă€‚ + * æłšæ„ïŒšć›Ÿç‰‡æœ‰ć€§ć°é™ćˆ¶ïŒŒæŽšèć›Ÿç‰‡ć°äșŽ20Kb。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + thumbs?: any []; + /** + * 戆äș«çš„怚ćȘ’䜓蔄æș + * 戆äș«çš„怚ćȘ’䜓蔄æșćœ°ć€ïŒŒćœ“typeć€Œäžș"music"、"video"æ—¶æœ‰æ•ˆă€‚ + * æłšæ„ïŒš + * ćŸźäżĄćˆ†äș«ćčłć°æ”ŻæŒéŸłäčă€è§†éą‘ç±»ćž‹ïŒŒä»…æ”ŻæŒçœ‘ç»œćœ°ć€ïŒˆä»„http://或https://ćŒ€ć€ŽïŒ‰ïŒ› + * QQ戆äș«ćčłć°æ”ŻæŒéŸłäčç±»ćž‹ïŒŒä»…æ”ŻæŒçœ‘ç»œè·ŻćŸ„ïŒˆä»„http://或https://ćŒ€ć€ŽïŒ‰ïŒ› + * 新æ”ȘćŸźćšćˆ†äș«ćčłć°æ”ŻæŒè§†éą‘ç±»ćž‹ïŒŒä»…æ”ŻæŒæœŹćœ°æ–‡ä»¶è·ŻćŸ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + media?: string; + /** + * 戆äș«ç‹Źç«‹çš„铟掄 + * 戆äș«è”„æșćœ°ć€ïŒŒä»…æ”ŻæŒçœ‘ç»œćœ°ć€ïŒˆä»„http://或https://ćŒ€ć€ŽïŒ‰ă€‚ + * ćŠ‚æžœæœȘæŒ‡ćźštypeç±»ćž‹ïŒŒäŒ˜ć…ˆçș§éĄșćșäžșhref>pictures>contentïŒˆćłèźŸçœźäș†hrefćˆ™èź€äžș戆äș«çœ‘éĄ”ç±»ćž‹ïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + href?: string; + /** + * 戆äș«æ¶ˆæŻçš„æ ‡éą˜ + * ä»…ćŸźäżĄćˆ†äș«çœ‘éĄ”ă€éŸłéą‘ă€è§†éą‘ă€ć°çš‹ćșç±»ćž‹æ—¶æ”ŻæŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + title?: string; + /** + * 戆äș«æ¶ˆæŻäž­ćŒ…ć«çš„ç”šæˆ·ćœ°ç†äżĄæŻæ•°æź + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + geo?: PlusShareGeoPosition; + /** + * 戆äș«æ¶ˆæŻæ‰©ć±•ć‚æ•° + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + extra?: PlusShareShareMessageExtra; + /** + * 戆äș«ćŸźäżĄć°çš‹ćșć‚æ•° + * ä»…ćŸźäżĄćˆ†äș«ć°çš‹ćșç±»ćž‹æ—¶æ”ŻæŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + miniProgram?: PlusShareWeixinMiniProgramOptions; + /** + * 戆äș«æ¶ˆæŻçš„æšĄćŒ + * ćŻć–ć€ŒïŒš + * "auto" - è‡ȘćŠšé€‰æ‹©ïŒŒćŠ‚æžœć·Čç»ćź‰èŁ…ćŸźćšćźąæˆ·ç«Żćˆ™é‡‡ç”šçŒ–èŸ‘ç•Œéąèż›èĄŒćˆ†äș«ïŒŒćŠćˆ™é‡‡ç”šæ— ç•Œéąćˆ†äș«ïŒ› + * "slient" - é™é»˜ćˆ†äș«ïŒŒé‡‡ç”šæ— ç•ŒéąæšĄćŒèż›èĄŒćˆ†äș«ïŒ› + * "editable" - èż›ć…„çŒ–èŸ‘ç•ŒéąïŒŒç”šæˆ·çĄźèź€ćˆ†äș«ć†…ćźčćŽć‘é€ïŒŒćŠ‚æžœćœ“ć‰æœȘćź‰èŁ…ćŸźćšćźąæˆ·ç«Żćˆ™è§Šć‘é”™èŻŻć›žè°ƒă€‚ + * é»˜èź€ć€Œäžș"auto"。 + * 仅新æ”ȘćŸźćšćˆ†äș«æ—¶ç”Ÿæ•ˆïŒ‰ + * - auto: + * è‡ȘćŠšé€‰æ‹©ïŒŒćŠ‚æžœć·Čç»ćź‰èŁ…ćŸźćšćźąæˆ·ç«Żćˆ™é‡‡ç”šçŒ–èŸ‘ç•Œéąèż›èĄŒćˆ†äș«ïŒŒćŠćˆ™é‡‡ç”šæ— ç•Œéąćˆ†äș« + * + * - slient: + * é™é»˜ćˆ†äș«ïŒŒé‡‡ç”šæ— ç•ŒéąæšĄćŒèż›èĄŒćˆ†äș« + * + * - editable: + * èż›ć…„çŒ–èŸ‘ç•ŒéąïŒŒç”šæˆ·çĄźèź€ćˆ†äș«ć†…ćźčćŽć‘é€ïŒŒćŠ‚æžœćœ“ć‰æœȘćź‰èŁ…ćŸźćšćźąæˆ·ç«Żćˆ™è§Šć‘é”™èŻŻć›žè°ƒ + * + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + interface?: 'auto' | 'slient' | 'editable'; +} + +/** + * JSONćŻčè±ĄïŒŒäżć­˜ćˆ†äș«æ¶ˆæŻæ‰©ć±•äżĄæŻ + * ShareMessageExtraćŻčè±Ąç”šäșŽäżć­˜ć„ćˆ†äș«ćčłć°æ‰©ć±•çš„ć‚æ•°ïŒŒç”šäșŽè‡Ș漚äč‰ćˆ†äș«ćŠŸèƒœă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ +interface PlusShareShareMessageExtra { + /** + * ćŸźäżĄćˆ†äș«ćœșæ™ŻïŒŒä»…ćŸźäżĄćˆ†äș«ćčłć°æœ‰æ•ˆ + * ćŻć–ć€ŒïŒš + * "WXSceneSession"戆äș«ćˆ°ćŸźäżĄçš„â€œæˆ‘çš„ć„œć‹â€ïŒ› + * "WXSceneTimeline"戆äș«ćˆ°ćŸźäżĄçš„â€œæœ‹ć‹ćœˆâ€äž­ïŒ› + * "WXSceneFavorite"戆äș«ćˆ°ćŸźäżĄçš„â€œæˆ‘çš„æ”¶è—â€äž­ă€‚ + * é»˜èź€ć€Œäžș"WXSceneSession"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + scene?: string; +} + +/** + * JSONćŻčè±ĄïŒŒćŸźäżĄć°çš‹ćșäżĄæŻ + * 甹äșŽé…çœźćˆ†äș«ć°çš‹ćșçš„ć‚æ•°ïŒŒćŠ‚ć°çš‹ćșæ ‡èŻ†ă€éĄ”éąè·ŻćŸ„ç­‰ă€‚ + * æłšæ„ïŒšćˆ†äș«çš„ć°çš‹ćșéœ€èŠćœšćŸźäżĄćŒ€æ”Ÿćčłć°ć…łè”çš„ćŒ€ć‘è€…èŽŠć·äž‹ïŒŒćŠćˆ™äŒšćˆ†äș«ć€±èŽ„ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ +interface PlusShareWeixinMiniProgramOptions { + /** + * ćŸźäżĄć°çš‹ćșID + * æłšæ„ïŒšæ˜ŻćŸźäżĄć°çš‹ćșçš„ćŽŸć§‹ID"g_"ćŒ€ć€Žçš„ć­—çŹŠäžČïŒ‰ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + id?: string; + /** + * ćŸźäżĄć°çš‹ćșæ‰“ćŒ€çš„éĄ”éąè·ŻćŸ„ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + path?: string; + /** + * ćŸźäżĄć°çš‹ćșç‰ˆæœŹç±»ćž‹ + * ćŻć–ć€ŒïŒš + * 0-æ­ŁćŒç‰ˆïŒ› + * 1-æ”‹èŻ•ç‰ˆïŒ› + * 2-䜓éȘŒç‰ˆă€‚ + * é»˜èź€ć€Œäžș0。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + type?: number; + /** + * ć…ŒćźčäœŽç‰ˆæœŹçš„çœ‘éĄ”é“ŸæŽ„ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/share.html](http://www.html5plus.org/doc/zh_cn/share.html) + */ + webUrl?: string; +} + +/** + * SpeechæšĄć—çźĄç†èŻ­éŸłèŸ“ć…„ćŠŸèƒœïŒŒæäŸ›èŻ­éŸłèŻ†ćˆ«ćŠŸèƒœïŒŒćŻæ”ŻæŒç”šæˆ·é€šèż‡éșŠć…‹éŁŽèźŸć€‡èż›èĄŒèŻ­éŸłèŸ“ć…„ć†…ćźčă€‚é€šèż‡plus.speechćŻèŽ·ć–èŻ­éŸłèŸ“ć…„çźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ +interface PlusSpeech { + /** + * JSONćŻčè±ĄïŒŒèŻ­éŸłèŻ†ćˆ«ć‚æ•° + * æŽ§ćˆ¶èŻ­éŸłèŻ†ćˆ«ćŒ•æ“Žć†…éƒšć‚æ•°ïŒŒćœšJSäž­äžșJSONćŻčè±ĄïŒŒćœšćŻćŠšèŻ­éŸłèŻ†ćˆ«æ—¶äœżç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + SpeechRecognizeOptions?: PlusSpeechSpeechRecognizeOptions; + /** + * èŻ­éŸłèŻ†ćˆ«äș‹ä»¶ç±»ćž‹ + * æèż°èŻ­éŸłèż‡çš‹çš„è§Šć‘äș‹ä»¶ćˆ—èĄšïŒŒćŻä»„é€šèż‡è°ƒç”šplus.sppech.addEventListeneræ–čæł•èż›èĄŒæłšć†Œç›‘ćŹă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + SpeechRecoginzeEvents?: PlusSpeechSpeechRecoginzeEvents; + /** + * ćŻćŠšèŻ­éŸłèŻ†ćˆ« + * ćŻćŠšèŻ­éŸłèŻ†ćˆ«æ—¶è°ƒç”šïŒŒćœ“èŻ­éŸłèŻ†ćˆ«æˆćŠŸćŽé€šèż‡successCallbackć›žè°ƒèż”ć›žèŻ†ćˆ«ć‡șæ–‡æœŹć†…ćźčïŒŒè°ƒç”šèŻ­éŸłèŻ†ćˆ«ć€±èŽ„ćˆ™é€šèż‡errorCallbackć›žè°ƒèż”ć›žă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + startRecognize(options?: PlusSpeechSpeechRecognizeOptions, successCB?: (result: string) => void, errorCB?: (result: any) => void): void; + /** + * ćœæ­ąèŻ­éŸłèŻ†ćˆ« + * ćœ“èŻ­éŸłèŻ†ćˆ«ćźŒæˆæ—¶æˆ–ç”šæˆ·ć–æ¶ˆèŻ­éŸłèŻ†ćˆ«æ—¶è°ƒç”šïŒŒè°ƒç”šæ­€æ–čæł•ć°†ćŻŒè‡ŽerrorCallbackć›žè°ƒć‡œæ•°çš„è°ƒç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + stopRecognize(): void; + /** + * ç›‘ćŹèŻ­éŸłèŻ†ćˆ«äș‹ä»¶ + * ć‘èŻ­éŸłèŻ†ćˆ«æšĄć—æ·»ćŠ äș‹ä»¶ç›‘ćŹć™šïŒŒćœ“æŒ‡ćźšçš„äș‹ä»¶ć‘ç”Ÿæ—¶ïŒŒć°†è§Šć‘listenerć‡œæ•°çš„æ‰§èĄŒă€‚ + * ćŻć€šæŹĄè°ƒç”šæ­€æ–čæł•æ·»ćŠ ć€šäžȘç›‘ćŹć™šïŒŒćœ“ç›‘ćŹçš„äș‹ä»¶ć‘ç”Ÿæ—¶ïŒŒć°†æŒ‰ç…§æ·»ćŠ çš„ć…ˆćŽéĄșćșè§Šć‘æ‰§èĄŒă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + addEventListener(event?: PlusSpeechSpeechRecoginzeEvents, listener?: (result: any) => void, capture?: boolean): void; +} + +/** + * JSONćŻčè±ĄïŒŒèŻ­éŸłèŻ†ćˆ«ć‚æ•° + * æŽ§ćˆ¶èŻ­éŸłèŻ†ćˆ«ćŒ•æ“Žć†…éƒšć‚æ•°ïŒŒćœšJSäž­äžșJSONćŻčè±ĄïŒŒćœšćŻćŠšèŻ­éŸłèŻ†ćˆ«æ—¶äœżç”šă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ +interface PlusSpeechSpeechRecognizeOptions { + /** + * èŻ­éŸłèŻ†ćˆ«æ˜ŻćŠé‡‡ç”šæŒç»­æšĄćŒ + * èźŸçœźäžștrueèĄšç€șèŻ­éŸłćŒ•æ“ŽäžäŒšæ čæźèŻ­éŸłèŸ“ć…„è‡ȘćŠšç»“æŸïŒŒèŻ†ćˆ«ćˆ°æ–‡æœŹć†…ćźčć°†ć€šæŹĄè°ƒç”šsuccessCallbackć‡œæ•°èż”ć›žïŒŒćŠ‚æžœéœ€èŠç»“æŸèŻ­éŸłèŻ†ćˆ«ćˆ™ćż…éĄ»è°ƒç”šstopRecognizeæŽ„ćŁïŒŒé»˜èź€ć€Œäžșfalse。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + continue?: boolean; + /** + * èŻ­éŸłèŻ†ćˆ«ćŒ•æ“Žæ ‡èŻ† + * 甹äșŽć…Œćźčć€šèŻ­éŸłèŻ†ćˆ«ćŒ•æ“Žçš„æ”è§ˆć™šïŒŒäœżç”šèŻ­éŸłèŻ†ćˆ«ćŽ‚ć•†çš„äș§ć“ćç§°ïŒŒćŠ‚æœȘèźŸçœźæˆ–èźŸçœźäžæ­ŁçĄźćˆ™äœżç”šèżèĄŒçŽŻćąƒé»˜èź€çš„èŻ­éŸłèŻ†ćˆ«ćŒ•æ“Žă€‚ + * æ”ŻæŒä»„äž‹èŻ­éŸłèŻ†ćˆ«ćŒ•æ“ŽïŒš + * "baidu"-癟ćșŠèŻ­éŸłèŻ†ćˆ«ïŒ› + * "iFly"-èźŻéŁžèŻ­éŸłèŻ†ćˆ«ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + engine?: string; + /** + * èŻ­éŸłèŻ†ćˆ«ćŒ•æ“Žçš„èŻ­èš€ + * 甹äșŽćźšäč‰èŻ­éŸłèŻ†ćˆ«ćŒ•æ“Žçš„èŻ­èš€ïŒŒć…¶ć–ć€Œéœ€çŹŠćˆW3C的Language codesè§„èŒƒă€‚ + * ç›źć‰èźŻéŁžèŻ­éŸłæ”ŻæŒä»„äž‹èŻ­èš€ïŒš + * "zh-cn"-äž­æ–‡ïŒŒæ™źé€šèŻïŒ› + * "en-us"-è‹±èŻ­ïŒ› + * "zh-cantonese"-䞭文çČ€èŻ­ïŒ› + * "zh-henanese"-䞭文æČłć—èŻïŒˆç™ŸćșŠèŻ­éŸłèŻ†ćˆ«äžæ”ŻæŒæ­€èŻ­èš€ïŒ‰ă€‚ + * é»˜èź€ć€Œäžș"zh-cn"。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + lang?: string; + /** + * æŒ‡ćźšèŻ†ćˆ«ç»“æžœèŻ†ćˆ«ćŒ…æ‹Źć€šć€™é€‰ç»“æžœ + * 甹äșŽæŒ‡ćźšèŻ†ćˆ«ç»“æžœèŻ†ćˆ«ćŒ…æ‹Źć€šć€™é€‰ç»“æžœă€‚ćŠ‚nbest:3ïŒŒèŻ†ćˆ«èż”ć›ž3äžȘć€™é€‰ç»“æžœïŒŒé»˜èź€ć€Œäžș1。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + nbest?: number; + /** + * èŻ†ćˆ«ç»“æžœäž­æ˜ŻćŠćŒ…ć«æ ‡ç‚čçŹŠć· + * trueèĄšç€șèŻ†ćˆ«ç»“æžœæ–‡æœŹäž­ćŒ…ć«æ ‡ç‚čçŹŠć·ïŒŒfalseèĄšç€șèŻ†ćˆ«ç»“æžœæ–‡æœŹäž­äžćŒ…ć«æ ‡ç‚čçŹŠć·ă€‚ + * é»˜èź€ć€Œäžștrue。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + punctuation?: boolean; + /** + * èŻ­éŸłèŻ†ćˆ«è¶…æ—¶æ—¶é—Ž + * èŻ­éŸłèŻ†ćˆ«è¶…æ—¶çš„æ—¶é—ŽïŒŒć•äœäžșmsïŒŒé»˜èź€ć€Œäžș1000ïŒˆćł10ç§’ïŒ‰ă€‚ + * æłšïŒšç™ŸćșŠèŻ­éŸłèŻ†ćˆ«äžæ”ŻæŒæ­€ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + timeout?: number; + /** + * èŻ†ćˆ«æ—¶æ˜ŻćŠæ˜Ÿç€șç”šæˆ·ç•Œéą + * 甹äșŽæŒ‡ćźšèŻ†ćˆ«æ—¶æ˜ŻćŠæ˜Ÿç€șç”šæˆ·ç•ŒéąïŒŒèźŸçœźäžștrueèĄšç€ș星ç€șæ”è§ˆć™šć†…çœźèŻ­éŸłèŻ†ćˆ«ç•ŒéąïŒ›èźŸçœźäžșfalseèĄšç€ș䞍星ç€șæ”è§ˆć™šć†…çœźèŻ­éŸłèŻ†ćˆ«ç•Œéąă€‚é»˜èź€ć€Œäžștrue。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + userInterface?: boolean; + /** + * èŻ­éŸłèŻ†ćˆ«ćŒ€ć§‹äș‹ä»¶ïŒˆć·ČćșŸćŒƒïŒŒäœżç”šstartäș‹ä»¶ïŒ‰ + * äș‹ä»¶ć‡œæ•°ïŒŒèŻ­éŸłèŻ†ćˆ«ćŒ€ć§‹ćŻćŠšïŒŒćœšè°ƒç”šstartRecognizeæ–čæł•ćŽè§Šć‘ïŒŒäžŽonendäș‹ä»¶æˆćŻčè§Šć‘ă€‚ + * æłšïŒšiOSćčłć°æœȘæ”ŻæŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + onstart?: (result: any) => void; + /** + * èŻ­éŸłèŻ†ćˆ«ç»“æŸäș‹ä»¶ïŒˆć·ČćșŸćŒƒïŒŒäœżç”šendäș‹ä»¶ïŒ‰ + * äș‹ä»¶ć‡œæ•°ïŒŒèŻ­éŸłèŻ†ćˆ«ç»“æŸïŒŒćœšè°ƒç”šstopRecognizeæ–čæł•ćŽè§Šć‘ïŒŒæˆ–è€…ćœšćŒ•æ“Žć†…éƒšè‡ȘćŠšćźŒæˆèŻ­éŸłèŻ†ćˆ«ćŽè§Šć‘ïŒŒäžŽonstartäș‹ä»¶æˆćŻčè§Šć‘ă€‚ + * æłšïŒšiOSćčłć°æœȘæ”ŻæŒ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + onend?: (result: any) => void; +} + +/** + * èŻ­éŸłèŻ†ćˆ«äș‹ä»¶ç±»ćž‹ + * æèż°èŻ­éŸłèż‡çš‹çš„è§Šć‘äș‹ä»¶ćˆ—èĄšïŒŒćŻä»„é€šèż‡è°ƒç”šplus.sppech.addEventListeneræ–čæł•èż›èĄŒæłšć†Œç›‘ćŹă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ +interface PlusSpeechSpeechRecoginzeEvents { + /** + * ćŒ€ć§‹èŻ­éŸłèŻ†ćˆ« + * 调甚plus.speech.startRecognizeæ–čæł•ćŒ€ć§‹èŻ­éŸłèŻ†ćˆ«æ—¶è§Šć‘ă€‚ + * æ— ć›žè°ƒć‡œæ•°ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + start?: string; + /** + * 音量揘挖 + * ćŒ€ć§‹èŻ­éŸłèŻ†ćˆ«ćŽïŒŒéșŠć…‹éŁŽćœ•ćˆ¶ćˆ°çš„èŻ­éŸłéŸłé‡ć˜ćŒ–æ—¶è§Šć‘ă€‚ + * ć›žè°ƒć‡œæ•°ć‚æ•°event={volume:"Numberç±»ćž‹ïŒŒć–ć€ŒèŒƒć›Ž0-1"}。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + volumeChange?: string; + /** + * äžŽæ—¶èŻ­éŸłèŻ†ćˆ«ç»“æžœ + * èż”ć›žäžŽæ—¶èŻ­éŸłèŻ†ćˆ«ç»“æžœæ—¶è§Šć‘ă€‚ + * ć›žè°ƒć‡œæ•°ć‚æ•°event={partialResult:"Stringç±»ćž‹ïŒŒäžŽæ—¶èŻ†ćˆ«ç»“æžœ"}。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + recognizing?: string; + /** + * æœ€ç»ˆèŻ­éŸłèŻ†ćˆ« + * èż”ć›žæœ€ç»ˆèŻ­éŸłèŻ†ćˆ«ç»“æžœă€‚ + * ć›žè°ƒć‡œæ•°ć‚æ•°event={result:"Stringç±»ćž‹ïŒŒæœ€äœłèŻ†ćˆ«ç»“æžœ",results:"Stringæ•°ç»„ç±»ćž‹ïŒŒæ‰€æœ‰ć€™é€‰ç»“æžœ"}。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + recognition?: string; + /** + * ç»“æŸèŻ­éŸłèŻ†ćˆ« + * 调甚plus.speech.stopRecognizeæ–čæł•ç»“æŸèŻ­éŸłèŻ†ćˆ«æˆ–èŻ­éŸłèŻ†ćˆ«ćźŒæˆćŽè‡ȘćŠšç»“æŸæ—¶è§Šć‘ă€‚ + * æ— ć›žè°ƒć‡œæ•°ć‚æ•°ă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + end?: string; + /** + * èŻ­éŸłèŻ†ćˆ«é”™èŻŻ + * èŻ­éŸłèŻ†ćˆ«ć‘ç”Ÿé”™èŻŻæ—¶è§Šć‘ă€‚ + * ć›žè°ƒć‡œæ•°ć‚æ•°event={code:"Numberç±»ćž‹ïŒŒé”™èŻŻçŒ–ç ",message:"Stringç±»ćž‹ïŒŒé”™èŻŻæèż°äżĄæŻ"}。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/speech.html](http://www.html5plus.org/doc/zh_cn/speech.html) + */ + error?: string; +} + +/** + * StatisticæšĄć—çźĄç†ç»ŸèźĄćŠŸèƒœïŒŒç”šäșŽæäŸ›ćș”ç”šć†…ç»ŸèźĄçš„èƒœćŠ›ïŒŒæ”ŻæŒç»ŸèźĄć’Œćˆ†æžç”šæˆ·ć±žæ€§ć’Œç”šæˆ·èĄŒäžșæ•°æźă€‚é€šèż‡plus.statisticćŻèŽ·ć–ç»ŸèźĄçźĄç†ćŻčè±Ąă€‚ + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/statistic.html](http://www.html5plus.org/doc/zh_cn/statistic.html) + */ +interface PlusStatistic { + /** + * è§Šć‘äș‹ä»¶ + * è§Šć‘æŒ‡ćźšçš„ç»ŸèźĄäș‹ä»¶ïŒŒè§Šć‘çš„äș‹ä»¶ćż…éĄ»èŠć…ˆćœšç»ŸèźĄçœ‘ç«™äžŠæłšć†Œäș‹ä»¶ID。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/statistic.html](http://www.html5plus.org/doc/zh_cn/statistic.html) + */ + eventTrig(id?: string, value?: any): void; + /** + * çČŸçĄźæŒç»­äș‹ä»¶ + * çČŸçĄźæ—¶é•żçš„æŒç»­äș‹ä»¶ç»ŸèźĄïŒŒè§Šć‘çš„äș‹ä»¶ćż…éĄ»èŠć…ˆćœšç»ŸèźĄçœ‘ç«™äžŠæłšć†Œäș‹ä»¶ID。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/statistic.html](http://www.html5plus.org/doc/zh_cn/statistic.html) + */ + eventDuration(id?: string, duration?: number, value?: any): void; + /** + * ćŒ€ć§‹æŒç»­äș‹ä»¶ïŒˆèż‡æœŸAPIïŒŒäžæŽšèäœżç”šïŒ‰ + * ćŒ€ć§‹æŒ‡ćźšçš„æŒç»­äș‹ä»¶ç»ŸèźĄïŒŒćœ“äș‹ä»¶ç»“束时调甚eventEndæ–čæł•ïŒŒïŒŒè§Šć‘çš„äș‹ä»¶ćż…éĄ»èŠć…ˆćœšç»ŸèźĄçœ‘ç«™äžŠæłšć†Œäș‹ä»¶ID。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/statistic.html](http://www.html5plus.org/doc/zh_cn/statistic.html) + */ + eventStart(id?: string, value?: string): void; + /** + * 结束持续äș‹ä»¶ïŒˆèż‡æœŸAPIïŒŒäžæŽšèäœżç”šïŒ‰ + * ç»“æŸæŒ‡ćźšçš„æŒç»­äș‹ä»¶ç»ŸèźĄïŒŒéœ€ć…ˆè°ƒç”ševentStartæ–čæł•ćŒ€ć§‹æŒç»­äș‹ä»¶ç»ŸèźĄïŒŒè§Šć‘çš„äș‹ä»¶ćż…éĄ»èŠć…ˆćœšç»ŸèźĄçœ‘ç«™äžŠæłšć†Œäș‹ä»¶ID。 + * + * ć‚è€ƒ: [http://www.html5plus.org/doc/zh_cn/statistic.html](http://www.html5plus.org/doc/zh_cn/statistic.html) + */ + eventEnd(id?: string, label?: string): void; +} diff --git a/types/html5plus/tsconfig.json b/types/html5plus/tsconfig.json new file mode 100644 index 0000000000..634c3eb205 --- /dev/null +++ b/types/html5plus/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "html5plus-tests.ts" + ] +} \ No newline at end of file diff --git a/types/html5plus/tslint.json b/types/html5plus/tslint.json new file mode 100644 index 0000000000..661e47a018 --- /dev/null +++ b/types/html5plus/tslint.json @@ -0,0 +1,7 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "max-line-length": false, + "no-trailing-whitespace": false + } +} \ No newline at end of file From 75125724566199dbfb627163c1686da958747fcc Mon Sep 17 00:00:00 2001 From: Michael Mifsud Date: Thu, 7 Mar 2019 05:16:41 +1100 Subject: [PATCH 430/924] Add type definition for datadog-statsd-metrics-collector (#33611) * Add StatsDClient implement to node-dogstatsd * Update connect-datadog to accept a dogstatsd.StatsDClient * Add type definition for datadog-statsd-metrics-collector --- types/connect-datadog/index.d.ts | 3 +- .../datadog-statsd-metrics-collector-tests.ts | 43 +++++++++++++++++++ .../index.d.ts | 24 +++++++++++ .../tsconfig.json | 23 ++++++++++ .../tslint.json | 1 + types/node-dogstatsd/index.d.ts | 17 +++++++- 6 files changed, 109 insertions(+), 2 deletions(-) create mode 100644 types/datadog-statsd-metrics-collector/datadog-statsd-metrics-collector-tests.ts create mode 100644 types/datadog-statsd-metrics-collector/index.d.ts create mode 100644 types/datadog-statsd-metrics-collector/tsconfig.json create mode 100644 types/datadog-statsd-metrics-collector/tslint.json diff --git a/types/connect-datadog/index.d.ts b/types/connect-datadog/index.d.ts index df18c0c208..9b68fb6a4f 100644 --- a/types/connect-datadog/index.d.ts +++ b/types/connect-datadog/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for connect-datadog 0.0 // Project: https://github.com/datadog/node-connect-datadog // Definitions by: Moshe Good +// Michael Mifsud // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -19,6 +20,6 @@ declare namespace Factory { method?: boolean; protocol?: boolean; response_code?: boolean; - dogstatsd?: dogstatsd.StatsD; + dogstatsd?: dogstatsd.StatsDClient; } } diff --git a/types/datadog-statsd-metrics-collector/datadog-statsd-metrics-collector-tests.ts b/types/datadog-statsd-metrics-collector/datadog-statsd-metrics-collector-tests.ts new file mode 100644 index 0000000000..ef5691a57d --- /dev/null +++ b/types/datadog-statsd-metrics-collector/datadog-statsd-metrics-collector-tests.ts @@ -0,0 +1,43 @@ +import datadog = require('node-dogstatsd'); +import Collector = require('datadog-statsd-metrics-collector'); + +const client = new datadog.StatsD('localhost'); + +// constructors +let collector = new Collector(client); +collector = new Collector(client, 1000); + +// interface +const key = 'key'; +const timeValue = 99; +const sampleRate = 0.85; +const incrementBy = 7; +const decrementBy = 5; +const gaugeValue = 199; +const tags: string[] = ['tag1', 'tag2']; + +collector.timing(key, timeValue); +collector.timing(key, timeValue, sampleRate); +collector.timing(key, timeValue, sampleRate, tags); + +collector.increment(key); +collector.increment(key, sampleRate); +collector.increment(key, sampleRate, tags); + +collector.incrementBy(key, incrementBy); +collector.incrementBy(key, incrementBy, tags); + +collector.decrement(key); +collector.decrement(key, sampleRate); +collector.decrement(key, sampleRate, tags); + +collector.decrementBy(key, decrementBy); +collector.decrementBy(key, decrementBy, tags); + +collector.gauge(key, gaugeValue); +collector.gauge(key, gaugeValue, sampleRate); +collector.gauge(key, gaugeValue, sampleRate, tags); + +collector.histogram(key, timeValue); +collector.histogram(key, timeValue, sampleRate); +collector.histogram(key, timeValue, sampleRate, tags); diff --git a/types/datadog-statsd-metrics-collector/index.d.ts b/types/datadog-statsd-metrics-collector/index.d.ts new file mode 100644 index 0000000000..741c5a9f43 --- /dev/null +++ b/types/datadog-statsd-metrics-collector/index.d.ts @@ -0,0 +1,24 @@ +// Type definitions for datadog-statsd-metrics-collector 1.1 +// Project: https://github.com/xzyfer/datadog-statsd-metrics-collector#readme +// Definitions by: Michael Mifsud +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import dogstatsd = require('node-dogstatsd'); + +declare class Collector implements dogstatsd.StatsDClient { + constructor(client: dogstatsd.StatsDClient, delayMilliseconds?: number); + + timing(stat: string, time: number, sample_rate?: number, tags?: string[]): void; + + increment(stat: string, sample_rate?: number, tags?: string[]): void; + incrementBy(stat: string, value: number, tags?: string[]): void; + + decrement(stat: string, sample_rate?: number, tags?: string[]): void; + decrementBy(stat: string, value: number, tags?: string[]): void; + + gauge(stat: string, value: number, sample_rate?: number, tags?: string[]): void; + + histogram(stat: string, time: number, sample_rate?: number, tags?: string[]): void; +} + +export = Collector; diff --git a/types/datadog-statsd-metrics-collector/tsconfig.json b/types/datadog-statsd-metrics-collector/tsconfig.json new file mode 100644 index 0000000000..d136060376 --- /dev/null +++ b/types/datadog-statsd-metrics-collector/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "datadog-statsd-metrics-collector-tests.ts" + ] +} diff --git a/types/datadog-statsd-metrics-collector/tslint.json b/types/datadog-statsd-metrics-collector/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/datadog-statsd-metrics-collector/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/node-dogstatsd/index.d.ts b/types/node-dogstatsd/index.d.ts index 36f8145202..8e818f7cb6 100644 --- a/types/node-dogstatsd/index.d.ts +++ b/types/node-dogstatsd/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for Datadog's nodejs metrics client node-dogstatsd // Project: https://github.com/joybro/node-dogstatsd // Definitions by: Chris Bobo +// Michael Mifsud // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module "node-dogstatsd" { @@ -9,7 +10,21 @@ declare module "node-dogstatsd" { global_tags?: string[]; } - export class StatsD { + export interface StatsDClient { + timing(stat: string, time: number, sample_rate?: number, tags?: string[]): void; + + increment(stat: string, sample_rate?: number, tags?: string[]): void; + incrementBy(stat: string, value: number, tags?: string[]): void; + + decrement(stat: string, sample_rate?: number, tags?: string[]): void; + decrementBy(stat: string, value: number, tags?: string[]): void; + + gauge(stat: string, value: number, sample_rate?: number, tags?: string[]): void; + + histogram(stat: string, time: number, sample_rate?: number, tags?: string[]): void; + } + + export class StatsD implements StatsDClient { constructor(host: string, port?: number, socket?: string, options?: StatsDOptions); timing(stat: string, time: number, sample_rate?: number, tags?: string[]): void; From 322e9ec92ef43cb895984b1e1296baf5ad2616a1 Mon Sep 17 00:00:00 2001 From: Derek Ries Date: Wed, 6 Mar 2019 10:23:24 -0800 Subject: [PATCH 431/924] Updates react-map-gl to include onNativeClick prop --- types/react-map-gl/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/react-map-gl/index.d.ts b/types/react-map-gl/index.d.ts index 4d147d3611..45752cb2d6 100644 --- a/types/react-map-gl/index.d.ts +++ b/types/react-map-gl/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-map-gl 4.0 +// Type definitions for react-map-gl 4.0.13 // Project: https://github.com/uber/react-map-gl#readme // Definitions by: Robert Imig // Fabio Berta @@ -226,6 +226,7 @@ export interface InteractiveMapProps extends StaticMapProps { keyboard?: boolean; onHover?: (event: PointerEvent) => void; onClick?: (event: PointerEvent) => void; + onNativeClick?: (event: PointerEvent) => void; onDblClick?: (event: PointerEvent) => void; onContextMenu?: (event: PointerEvent) => void; onMouseDown?: (event: PointerEvent) => void; From c372d80438392c137a0851a8599ecc050a6b1ae7 Mon Sep 17 00:00:00 2001 From: Jordi Oliveras Rovira Date: Wed, 6 Mar 2019 19:52:01 +0100 Subject: [PATCH 432/924] Remove sudo: false setting from travis.yml --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9bd31bda14..ab47e3af2e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,5 @@ language: node_js node_js: - 8 -sudo: false - notifications: email: false From 506669b0a683996dd0f807fbe12fe72cc3d11784 Mon Sep 17 00:00:00 2001 From: Derek Ries Date: Wed, 6 Mar 2019 11:07:54 -0800 Subject: [PATCH 433/924] removed patch version --- types/react-map-gl/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-map-gl/index.d.ts b/types/react-map-gl/index.d.ts index 45752cb2d6..04c4d9aed9 100644 --- a/types/react-map-gl/index.d.ts +++ b/types/react-map-gl/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-map-gl 4.0.13 +// Type definitions for react-map-gl 4.0 // Project: https://github.com/uber/react-map-gl#readme // Definitions by: Robert Imig // Fabio Berta From d7e81294df74998de39d441db1840c4101dcb479 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Wed, 6 Mar 2019 11:14:16 -0800 Subject: [PATCH 434/924] Use correct npm name for png-async deprecation --- notNeededPackages.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/notNeededPackages.json b/notNeededPackages.json index 8e0d726046..0edaa82c1e 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -1135,8 +1135,8 @@ "asOfVersion": "2.15.0" }, { - "libraryName": "node-png-async", - "typingsPackageName": "node-png-async", + "libraryName": "png-async", + "typingsPackageName": "png-async", "sourceRepoURL": "https://github.com/kanreisa/node-png-async", "asOfVersion": "0.9.4" }, From 4de5967e61fd772dfe07fc0eeb10a98d21a5cd73 Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Wed, 6 Mar 2019 20:25:27 +0100 Subject: [PATCH 435/924] [types/react] Fix regression with PropsWithChildren [The Travis build is lying] (#33462) * Fix regression * Update index.d.ts * Update index.d.ts --- types/react/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index 29123092e6..dd7756d2b2 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -427,7 +427,7 @@ declare namespace React { // always pass children as variadic arguments to `createElement`. // In the future, if we can define its call signature conditionally // on the existence of `children` in `P`, then we should remove this. - readonly props: Readonly>; + readonly props: Readonly

& Readonly<{ children?: ReactNode }>; state: Readonly; /** * @deprecated From c650a04ddef9ee4a4d51004006a54ba00fb6ed7c Mon Sep 17 00:00:00 2001 From: Dimitri Benin Date: Sat, 2 Mar 2019 21:42:25 +0100 Subject: [PATCH 436/924] [ora] Remove types --- notNeededPackages.json | 6 + types/ora/index.d.ts | 290 ------------------------------------- types/ora/ora-tests.ts | 49 ------- types/ora/tsconfig.json | 24 --- types/ora/tslint.json | 1 - types/ora/v0/index.d.ts | 34 ----- types/ora/v0/ora-tests.ts | 8 - types/ora/v0/tsconfig.json | 28 ---- types/ora/v0/tslint.json | 1 - types/ora/v1/index.d.ts | 137 ------------------ types/ora/v1/ora-tests.ts | 49 ------- types/ora/v1/tsconfig.json | 29 ---- types/ora/v1/tslint.json | 1 - 13 files changed, 6 insertions(+), 651 deletions(-) delete mode 100644 types/ora/index.d.ts delete mode 100644 types/ora/ora-tests.ts delete mode 100644 types/ora/tsconfig.json delete mode 100644 types/ora/tslint.json delete mode 100644 types/ora/v0/index.d.ts delete mode 100644 types/ora/v0/ora-tests.ts delete mode 100644 types/ora/v0/tsconfig.json delete mode 100644 types/ora/v0/tslint.json delete mode 100644 types/ora/v1/index.d.ts delete mode 100644 types/ora/v1/ora-tests.ts delete mode 100644 types/ora/v1/tsconfig.json delete mode 100644 types/ora/v1/tslint.json diff --git a/notNeededPackages.json b/notNeededPackages.json index 0edaa82c1e..d13d8d3073 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -1176,6 +1176,12 @@ "sourceRepoURL": "http://onsen.io", "asOfVersion": "2.0.0" }, + { + "libraryName": "ora", + "typingsPackageName": "ora", + "sourceRepoURL": "https://github.com/sindresorhus/ora", + "asOfVersion": "3.2.0" + }, { "libraryName": "p-event", "typingsPackageName": "p-event", diff --git a/types/ora/index.d.ts b/types/ora/index.d.ts deleted file mode 100644 index 13104b0b5c..0000000000 --- a/types/ora/index.d.ts +++ /dev/null @@ -1,290 +0,0 @@ -// Type definitions for ora 3.1 -// Project: https://github.com/sindresorhus/ora -// Definitions by: Basarat Ali Syed -// Christian Rackerseder -// BendingBender -// Aleh Zasypkin -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -/// - -export = ora; - -/** - * Elegant terminal spinner. - * - * @param options If a string is provided, it is treated as a shortcut for `options.text`. - */ -declare function ora(options?: ora.Options | string): ora.Ora; - -declare namespace ora { - /** - * Starts a spinner for a promise. The spinner is stopped with `.succeed()` if the promise fulfills - * or with `.fail()` if it rejects. - * - * @param action - * @param options If a string is provided, it is treated as a shortcut for `options.text`. - * @returns The spinner instance. - */ - function promise(action: PromiseLike, options?: Options | string): Ora; - - interface Ora { - /** - * A boolean of whether the instance is currently spinning. - */ - readonly isSpinning: boolean; - - /** - * Change the text. - */ - text: string; - - /** - * Change the spinner color. - */ - color: Color; - - /** - * Change the spinner. - */ - spinner: SpinnerName | Spinner; - - /** - * Change the spinner indent. - */ - indent: number; - - /** - * Start the spinner. - * - * @param text Set the current text. - * @returns The spinner instance. - */ - start(text?: string): Ora; - - /** - * Stop and clear the spinner. - * - * @returns The spinner instance. - */ - stop(): Ora; - - /** - * Stop the spinner, change it to a green `✔` and persist the current text, or `text` if provided. - * - * @param text will persist text if provided - * @returns The spinner instance. - */ - succeed(text?: string): Ora; - - /** - * Stop the spinner, change it to a red `✖` and persist the current text, or `text` if provided. - * - * @param text will persist text if provided - * @returns The spinner instance. - */ - fail(text?: string): Ora; - - /** - * Stop the spinner, change it to a yellow `⚠` and persist the current text, or `text` if provided. - * - * @param text will persist text if provided - * @returns The spinner instance. - */ - warn(text?: string): Ora; - - /** - * Stop the spinner, change it to a blue `â„č` and persist the current text, or `text` if provided. - * - * @param text will persist text if provided - * @returns The spinner instance. - */ - info(text?: string): Ora; - - /** - * Stop the spinner and change the symbol or text. - * - * @param options - * @returns The spinner instance. - */ - stopAndPersist(options?: PersistOptions): Ora; - - /** - * Clear the spinner. - * @returns The spinner instance. - */ - clear(): Ora; - - /** - * Manually render a new frame. - * @returns The spinner instance. - */ - render(): Ora; - - /** - * Get a new frame. - * @returns The spinner instance. - */ - frame(): Ora; - } - - interface Options { - /** - * Text to display after the spinner. - */ - text?: string; - /** - * Name of one of the provided spinners. See `example.js` in this repo if you want to test out different spinners. - * On Windows, it will always use the line spinner as the Windows command-line doesn't have proper Unicode support. - * - * Or an object like: - * - * @example - * { - * interval: 80, // optional - * frames: ['-', '+', '-'] - * } - * - * @default 'dots' - */ - spinner?: SpinnerName | Spinner; - /** - * Color of the spinner. - * @default 'cyan' - */ - color?: Color; - /** - * Set to `false` to stop Ora from hiding the cursor. - * @default true - */ - hideCursor?: boolean; - /** - * Indent the spinner with the given number of spaces. - * @default 0 - */ - indent?: number; - /** - * Interval between each frame. - * - * Spinners provide their own recommended interval, so you don't really need to specify this. - * @default Provided by the spinner or 100 - */ - interval?: number; - /** - * Stream to write the output. - * - * You could for example set this to `process.stdout` instead. - * @default process.stderr - */ - stream?: NodeJS.WritableStream; - /** - * Force enable/disable the spinner. If not specified, the spinner will be enabled - * if the `stream` is being run inside a TTY context (not spawned or piped) and/or not in a CI environment. - * - * Note that `{isEnabled: false}` doesn't mean it won't output anything. It just means it won't output the spinner, - * colors, and other ansi escape codes. It will still log text. - */ - isEnabled?: boolean; - } - - interface PersistOptions { - /** - * Symbol to replace the spinner with. - * @default ' ' - */ - symbol?: string; - /** - * Text to be persisted. - * @default Current text - */ - text?: string; - } - - interface Spinner { - interval?: number; - frames: string[]; - } - - type SpinnerName = - | 'dots' - | 'dots2' - | 'dots3' - | 'dots4' - | 'dots5' - | 'dots6' - | 'dots7' - | 'dots8' - | 'dots9' - | 'dots10' - | 'dots11' - | 'dots12' - | 'line' - | 'line2' - | 'pipe' - | 'simpleDots' - | 'simpleDotsScrolling' - | 'star' - | 'star2' - | 'flip' - | 'hamburger' - | 'growVertical' - | 'growHorizontal' - | 'balloon' - | 'balloon2' - | 'noise' - | 'bounce' - | 'boxBounce' - | 'boxBounce2' - | 'triangle' - | 'arc' - | 'circle' - | 'squareCorners' - | 'circleQuarters' - | 'circleHalves' - | 'squish' - | 'toggle' - | 'toggle2' - | 'toggle3' - | 'toggle4' - | 'toggle5' - | 'toggle6' - | 'toggle7' - | 'toggle8' - | 'toggle9' - | 'toggle10' - | 'toggle11' - | 'toggle12' - | 'toggle13' - | 'arrow' - | 'arrow2' - | 'arrow3' - | 'bouncingBar' - | 'bouncingBall' - | 'smiley' - | 'monkey' - | 'hearts' - | 'clock' - | 'earth' - | 'moon' - | 'runner' - | 'pong' - | 'shark' - | 'dqpb' - | 'weather' - | 'christmas' - | 'grenade' - | 'point' - | 'layer'; - - type Color = - | 'black' - | 'red' - | 'green' - | 'yellow' - | 'blue' - | 'magenta' - | 'cyan' - | 'white' - | 'gray'; -} diff --git a/types/ora/ora-tests.ts b/types/ora/ora-tests.ts deleted file mode 100644 index 4e06c11248..0000000000 --- a/types/ora/ora-tests.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { PassThrough } from 'stream'; -import ora = require('ora'); - -const spinner = ora('Loading unicorns'); -ora({ text: 'Loading unicorns' }); -ora({ spinner: 'squish' }); -ora({ spinner: { frames: ['-', '+', '-'] } }); -ora({ spinner: { interval: 80, frames: ['-', '+', '-'] } }); -ora({ color: 'cyan' }); -ora({ color: 'foo' }); // $ExpectError -ora({ hideCursor: true }); -ora({ indent: 1 }); -ora({ interval: 80 }); -ora({ stream: new PassThrough() }); -ora({ isEnabled: true }); - -spinner.color = 'yellow'; -spinner.text = 'Loading rainbows'; -spinner.isSpinning; // $ExpectType boolean -spinner.isSpinning = true; // $ExpectError -spinner.spinner = 'dots'; -spinner.indent = 5; - -spinner.start(); -spinner.start('Test text'); -spinner.stop(); -spinner.succeed(); -spinner.succeed('fooed'); -spinner.fail(); -spinner.fail('failed to foo'); -spinner.warn(); -spinner.warn('warn foo'); -spinner.info(); -spinner.info('info foo'); -spinner.stopAndPersist(); -spinner.stopAndPersist({ text: 'all done' }); -spinner.stopAndPersist({ symbol: '@', text: 'all done' }); -spinner.clear(); -spinner.render(); -spinner.frame(); - -const resolves = Promise.resolve(1); -ora.promise(resolves, 'foo'); -ora.promise(resolves, { - stream: new PassThrough(), - text: 'foo', - color: 'blue', - isEnabled: true, -}); diff --git a/types/ora/tsconfig.json b/types/ora/tsconfig.json deleted file mode 100644 index 302dc253cc..0000000000 --- a/types/ora/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true, - "esModuleInterop": true - }, - "files": [ - "index.d.ts", - "ora-tests.ts" - ] -} diff --git a/types/ora/tslint.json b/types/ora/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/ora/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" } diff --git a/types/ora/v0/index.d.ts b/types/ora/v0/index.d.ts deleted file mode 100644 index 771f6beef6..0000000000 --- a/types/ora/v0/index.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -// Type definitions for ora 0.3 -// Project: https://github.com/sindresorhus/ora -// Definitions by: Basarat Ali Syed , Christian Rackerseder -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -type Color = 'black' | 'red' | 'green' | 'yellow' | 'blue' | 'magenta' | 'cyan' | 'white' | 'gray'; -interface Options { - text?: string; - spinner?: string | Spinner; - color?: Color; - interval?: number; - stream?: NodeJS.WritableStream; - enabled?: boolean; -} -interface Spinner { - interval?: number; - frames: string[]; -} -interface Instance { - start(): Instance; - stop(): Instance; - succeed(): Instance; - fail(): Instance; - stopAndPersist(symbol?: string): Instance; - clear(): Instance; - render(): Instance; - frame(): Instance; - text: string; - color: Color; -} -declare function ora(options: Options | string): Instance; -export = ora; diff --git a/types/ora/v0/ora-tests.ts b/types/ora/v0/ora-tests.ts deleted file mode 100644 index b6e2a671dc..0000000000 --- a/types/ora/v0/ora-tests.ts +++ /dev/null @@ -1,8 +0,0 @@ -import ora = require('ora'); - -const spinner = ora('Loading unicorns').start(); - -setTimeout(() => { - spinner.color = 'yellow'; - spinner.text = 'Loading rainbows'; -}, 1000); diff --git a/types/ora/v0/tsconfig.json b/types/ora/v0/tsconfig.json deleted file mode 100644 index b614f6cbc4..0000000000 --- a/types/ora/v0/tsconfig.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": true, - "baseUrl": "../../", - "typeRoots": [ - "../../" - ], - "paths": { - "ora": [ - "ora/v0" - ] - }, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "ora-tests.ts" - ] -} \ No newline at end of file diff --git a/types/ora/v0/tslint.json b/types/ora/v0/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/ora/v0/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" } diff --git a/types/ora/v1/index.d.ts b/types/ora/v1/index.d.ts deleted file mode 100644 index a3099f6cd9..0000000000 --- a/types/ora/v1/index.d.ts +++ /dev/null @@ -1,137 +0,0 @@ -// Type definitions for ora 1.3 -// Project: https://github.com/sindresorhus/ora -// Definitions by: Basarat Ali Syed -// Christian Rackerseder -// BendingBender -// Aleh Zasypkin -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -type SpinnerName = - 'dots' - | 'dots2' - | 'dots3' - | 'dots4' - | 'dots5' - | 'dots6' - | 'dots7' - | 'dots8' - | 'dots9' - | 'dots10' - | 'dots11' - | 'dots12' - | 'line' - | 'line2' - | 'pipe' - | 'simpleDots' - | 'simpleDotsScrolling' - | 'star' - | 'star2' - | 'flip' - | 'hamburger' - | 'growVertical' - | 'growHorizontal' - | 'balloon' - | 'balloon2' - | 'noise' - | 'bounce' - | 'boxBounce' - | 'boxBounce2' - | 'triangle' - | 'arc' - | 'circle' - | 'squareCorners' - | 'circleQuarters' - | 'circleHalves' - | 'squish' - | 'toggle' - | 'toggle2' - | 'toggle3' - | 'toggle4' - | 'toggle5' - | 'toggle6' - | 'toggle7' - | 'toggle8' - | 'toggle9' - | 'toggle10' - | 'toggle11' - | 'toggle12' - | 'toggle13' - | 'arrow' - | 'arrow2' - | 'arrow3' - | 'bouncingBar' - | 'bouncingBall' - | 'smiley' - | 'monkey' - | 'hearts' - | 'clock' - | 'earth' - | 'moon' - | 'runner' - | 'pong' - | 'shark' - | 'dqpb'; - -type Color = 'black' | 'red' | 'green' | 'yellow' | 'blue' | 'magenta' | 'cyan' | 'white' | 'gray'; - -interface Options { - text?: string; - spinner?: SpinnerName | Spinner; - color?: Color; - interval?: number; - stream?: NodeJS.WritableStream; - enabled?: boolean; - hideCursor?: boolean; -} - -interface PersistOptions { - symbol?: string; - text?: string; -} - -interface Spinner { - interval?: number; - frames: string[]; -} - -declare class Ora { - start(text?: string): Ora; - - stop(): Ora; - - succeed(text?: string): Ora; - - fail(text?: string): Ora; - - warn(text?: string): Ora; - - info(text?: string): Ora; - - stopAndPersist(options?: PersistOptions | string): Ora; - - clear(): Ora; - - render(): Ora; - - frame(): Ora; - - text: string; - - color: Color; - - frameIndex: number; -} - -interface oraFactory { - (options?: Options | string): Ora; - - new (options?: Options | string): Ora; - - promise(action: PromiseLike, options?: Options | string): Ora; -} - -declare const ora: oraFactory; - -export = ora; diff --git a/types/ora/v1/ora-tests.ts b/types/ora/v1/ora-tests.ts deleted file mode 100644 index 56a0d498c3..0000000000 --- a/types/ora/v1/ora-tests.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { PassThrough } from 'stream'; -import Ora = require('ora'); - -const spinner = Ora('Loading unicorns').start(); - -const spinnerNothing = Ora().start(); - -const spinnerNew = new Ora({ - text: 'Loading unicorns', - spinner: 'squish' -}); - -const spinnerNew2 = new Ora({ - stream: new PassThrough(), - text: 'foo', - color: 'cyan', - enabled: true -}); - -spinner.start(); -spinner.start('Test text'); - -setTimeout(() => { - spinner.color = 'yellow'; - spinner.text = 'Loading rainbows'; -}, 1000); - -setTimeout(() => { - spinner.succeed(); -}, 2000); - -spinner.succeed(); -spinner.succeed('fooed'); -spinner.fail(); -spinner.fail('failed to foo'); -spinner.warn(); -spinner.info(); -spinner.stopAndPersist(); -spinner.stopAndPersist('@'); -spinner.stopAndPersist({text: 'all done'}); -spinner.stopAndPersist({symbol: '@', text: 'all done'}); - -const resolves = Promise.resolve(1); -Ora.promise(resolves, { - stream: new PassThrough(), - text: 'foo', - color: 'blue', - enabled: true -}); diff --git a/types/ora/v1/tsconfig.json b/types/ora/v1/tsconfig.json deleted file mode 100644 index ad30053dff..0000000000 --- a/types/ora/v1/tsconfig.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../../", - "typeRoots": [ - "../../" - ], - "paths": { - "ora": [ - "ora/v1" - ] - }, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true, - "esModuleInterop": true - }, - "files": [ - "index.d.ts", - "ora-tests.ts" - ] -} diff --git a/types/ora/v1/tslint.json b/types/ora/v1/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/ora/v1/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" } From 9faaa89c157520ae5e7ba93f6b8dcc41fa3afe28 Mon Sep 17 00:00:00 2001 From: Michael Mifsud Date: Thu, 7 Mar 2019 09:46:54 +1100 Subject: [PATCH 437/924] Fix node-dogstatsd constructor type definition As per the documentation the `socket` argument to the constructor is an optional Socket type not a string type. Using a string would result in a fatal error. --- types/node-dogstatsd/index.d.ts | 7 ++++++- types/node-dogstatsd/node-dogstatsd-tests.ts | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/types/node-dogstatsd/index.d.ts b/types/node-dogstatsd/index.d.ts index 8e818f7cb6..9f3c56dff9 100644 --- a/types/node-dogstatsd/index.d.ts +++ b/types/node-dogstatsd/index.d.ts @@ -4,7 +4,10 @@ // Michael Mifsud // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + declare module "node-dogstatsd" { + import * as dgram from 'dgram'; export interface StatsDOptions { global_tags?: string[]; @@ -25,7 +28,9 @@ declare module "node-dogstatsd" { } export class StatsD implements StatsDClient { - constructor(host: string, port?: number, socket?: string, options?: StatsDOptions); + public socket: dgram.Socket + + constructor(host: string, port?: number, socket?: dgram.Socket, options?: StatsDOptions); timing(stat: string, time: number, sample_rate?: number, tags?: string[]): void; diff --git a/types/node-dogstatsd/node-dogstatsd-tests.ts b/types/node-dogstatsd/node-dogstatsd-tests.ts index 072c5b168e..949ed73eac 100644 --- a/types/node-dogstatsd/node-dogstatsd-tests.ts +++ b/types/node-dogstatsd/node-dogstatsd-tests.ts @@ -1,12 +1,14 @@ +import * as dgram from 'dgram'; import * as datadog from 'node-dogstatsd'; function test_statsd_client() { // can create client with defaults let client = new datadog.StatsD('localhost'); let options: datadog.StatsDOptions = { global_tags: ['environment:definitely_typed']}; + const socket: dgram.Socket = dgram.createSocket('udp4'); // can create client with all params - client = new datadog.StatsD('localhost', 8125, null, options); + client = new datadog.StatsD('localhost', 8125, socket, options); let key: string = 'key'; let timeValue: number = 99; From a142998ff0eeb54e33e21f0e767b7a12187cdb85 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Thu, 7 Mar 2019 00:24:30 +0100 Subject: [PATCH 438/924] fix(ansi-escapes): make arguments to functions optional (#33423) --- types/ansi-escapes/index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types/ansi-escapes/index.d.ts b/types/ansi-escapes/index.d.ts index 519d429545..d01e74661a 100644 --- a/types/ansi-escapes/index.d.ts +++ b/types/ansi-escapes/index.d.ts @@ -19,10 +19,10 @@ declare namespace Ansi { interface AnsiEscapes { cursorTo(x: number, y?: number): string; cursorMove(x: number, y?: number): string; - cursorUp(count: number): string; - cursorDown(count: number): string; - cursorForward(count: number): string; - cursorBackward(count: number): string; + cursorUp(count?: number): string; + cursorDown(count?: number): string; + cursorForward(count?: number): string; + cursorBackward(count?: number): string; cursorLeft: string; cursorSavePosition: string; From eed96d4372ed55c81eb7e7708c5f3ea02c579ddd Mon Sep 17 00:00:00 2001 From: Richard Date: Thu, 7 Mar 2019 00:29:48 +0100 Subject: [PATCH 439/924] aws-lambda Authorizer response context only allows booleans, numbers and strings (#33437) * Context only allows booleans, numbers and strings * add richardcornelissen as contributor --- types/aws-lambda/index.d.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/types/aws-lambda/index.d.ts b/types/aws-lambda/index.d.ts index 6ebccd452a..d3bee679b3 100644 --- a/types/aws-lambda/index.d.ts +++ b/types/aws-lambda/index.d.ts @@ -27,6 +27,7 @@ // Erik DalĂ©n // LoĂŻk Gaonac'h // Roberto Zen +// Richard Cornelissen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -536,10 +537,10 @@ export type StatementResource = MaybeStatementPrincipal & ({ Resource: string | export type StatementPrincipal = MaybeStatementResource & ({ Principal: PrincipalValue } | { NotPrincipal: PrincipalValue }); /** * API Gateway CustomAuthorizer AuthResponse.PolicyDocument.Statement. - * http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html#api-gateway-custom-authorizer-output + * https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-lambda-authorizer-output.html */ export interface AuthResponseContext { - [name: string]: any; + [name: string]: boolean | number | string; } /** From a1dfe0ee2586937a420583565eefba009edbcd26 Mon Sep 17 00:00:00 2001 From: Carlos Urango Date: Wed, 6 Mar 2019 18:31:32 -0500 Subject: [PATCH 440/924] Add Howler 2.1.1 definitions (#33438) * Add Howler 2.1.1 definitions * fix unlock event name --- types/howler/index.d.ts | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/types/howler/index.d.ts b/types/howler/index.d.ts index 5ee9c40627..6ab3d6e8f0 100644 --- a/types/howler/index.d.ts +++ b/types/howler/index.d.ts @@ -1,20 +1,25 @@ -// Type definitions for howler.js v2.0.5 +// Type definitions for howler.js v2.1.1 // Project: https://github.com/goldfire/howler.js -// Definitions by: Pedro Casaubon , Alexander Leon , Nicholas Higgins +// Definitions by: Pedro Casaubon +// Alexander Leon +// Nicholas Higgins +// Carlos Urango // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped interface HowlerGlobal { - mute(muted: boolean): void; + mute(muted: boolean): this; volume(): number; volume(volume: number): this; codecs(ext: string): boolean; - unload(): void; + unload(): this; usingWebAudio: boolean; + html5PoolSize: number; noAudio: boolean; - mobileAutoEnable: boolean; + autoUnlock: boolean; autoSuspend: boolean; ctx: AudioContext; masterGain: GainNode; + stereo(pan: number): this; pos(x: number, y: number, z: number): this | void; orientation(x: number, y: number, z: number, xUp: number, yUp: number, zUp: number): this | void; @@ -51,6 +56,7 @@ interface IHowlProperties { onrate?: (soundId: number) => void; onseek?: (soundId: number) => void; onfade?: (soundId: number) => void; + onunlock?: (soundId: number) => void; } interface Howl { @@ -75,7 +81,9 @@ interface Howl { loop(loop?: boolean, id?: number): this; playing(id?: number): boolean; duration(id?: number): number; - + state(): 'unloaded' | 'loading' | 'loaded'; + load(): this; + unload(): void; on(event: 'load', callback: () => void, id?: number): this; on(event: 'loaderror', callback: (soundId: number, error: any) => void, id?: number): this; @@ -90,6 +98,7 @@ interface Howl { on(event: 'seek', callback: (soundId: number) => void, id?: number): this; on(event: 'fade', callback: (soundId: number) => void, id?: number): this; on(event: string, callback: Function, id?: number): this; + on(event: 'unlock', callback: (soundId: number) => void, id?: number): this; once(event: 'load', callback: () => void, id?: number): this; once(event: 'loaderror', callback: (soundId: number, error: any) => void, id?: number): this; @@ -104,12 +113,10 @@ interface Howl { once(event: 'seek', callback: (soundId: number) => void, id?: number): this; once(event: 'fade', callback: (soundId: number) => void, id?: number): this; once(event: string, callback: Function, id?: number): this; + once(event: 'unlock', callback: (soundId: number) => void, id?: number): this; off(event: string, callback?: Function, id?: number): this; - state(): 'unloaded' | 'loading' | 'loaded'; - load(): void; - unload(): void; stereo(pan: number, id?: number): this | void; pos(x: number, y: number, z: number, id?: number): this | void; orientation(x: number, y: number, z: number, xUp: number, yUp: number, zUp: number): this | void; From 46d861bb9865a1a17ccc1104a3f95fe72f1c8630 Mon Sep 17 00:00:00 2001 From: Jojoshua Date: Wed, 6 Mar 2019 19:50:33 -0500 Subject: [PATCH 441/924] Fix linting --- types/tabulator-tables/index.d.ts | 1037 ++++++++--------- .../tabulator-tables-tests.ts | 244 ++-- 2 files changed, 631 insertions(+), 650 deletions(-) diff --git a/types/tabulator-tables/index.d.ts b/types/tabulator-tables/index.d.ts index 3a3e3de64a..328cf80865 100644 --- a/types/tabulator-tables/index.d.ts +++ b/types/tabulator-tables/index.d.ts @@ -4,45 +4,47 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 +// tslint:disable:max-line-length +// tslint:disable:jsdoc-format +// tslint:disable:no-trailing-whitespace + declare namespace Tabulator { interface Options extends OptionsGeneral, OptionsHistory, OptionsLocale, OptionsDownload, OptionsColumns, OptionsRows, OptionsData, OptionsSorting, OptionsFiltering, OptionsRowGrouping, OptionsPagination, OptionsPersistentConfiguration, OptionsClipboard, OptionsDataTree, OptionsCell {} interface OptionsCells extends CellCallbacks { - /**The validationFailed event is triggered when the value entered into a cell during an edit fails to pass validation. */ + /** The validationFailed event is triggered when the value entered into a cell during an edit fails to pass validation. */ validationFailed?: (cell: CellComponent, value: any, validators: Validator[] | StandardValidatorType[]) => void; } - type OptionsDataTree = { - /**To enable data trees in your table, set the dataTree property to true in your table constructor: */ + interface OptionsDataTree { + /** To enable data trees in your table, set the dataTree property to true in your table constructor: */ dataTree?: boolean; - /** By default the toggle element will be inserted into the first column on the table. If you want the toggle element to be inserted in a different column you can pass the feild name of the column to the dataTreeElementColumn setup option*/ + /** By default the toggle element will be inserted into the first column on the table. If you want the toggle element to be inserted in a different column you can pass the feild name of the column to the dataTreeElementColumn setup option*/ dataTreeElementColumn?: boolean | string; - /**Show tree branch icon */ + /** Show tree branch icon */ dataTreeBranchElement?: boolean | string; - /**Tree level indent in pixels */ + /** Tree level indent in pixels */ dataTreeChildIndent?: number; - /**By default Tabulator will look for child rows in the _children field of a row data object. You can change this to look in a different field using the dataTreeChildField property in your table constructor: */ + /** By default Tabulator will look for child rows in the _children field of a row data object. You can change this to look in a different field using the dataTreeChildField property in your table constructor: */ dataTreeChildField?: string; - /**The toggle button that allows users to collapse and expand the column can be customised to meet your needs. There are two options, dataTreeExpandElement and dataTreeCollapseElement, that can be set to replace the default toggle elements with your own. + /** The toggle button that allows users to collapse and expand the column can be customised to meet your needs. There are two options, dataTreeExpandElement and dataTreeCollapseElement, that can be set to replace the default toggle elements with your own. Both options can take either an html string representing the contents of the toggle element */ dataTreeCollapseElement?: string | HTMLElement | boolean; - /** */ + /** The toggle button that allows users to expand the column */ dataTreeExpandElement?: string | HTMLElement | boolean; - /** By default all nodes on the tree will start collapsed, you can customize the initial expansion state of the tree using the dataTreeStartExpanded option. - * - This option can take one of three possible value types, either a boolean to indicate whether all nodes should start expanded or collapsed: */ + /** By default all nodes on the tree will start collapsed, you can customize the initial expansion state of the tree using the dataTreeStartExpanded option.* + This option can take one of three possible value types, either a boolean to indicate whether all nodes should start expanded or collapsed: */ dataTreeStartExpanded?: boolean | boolean[] | ((row: RowComponent, level: number) => boolean); - }; - type OptionsClipboard = { - /**You can enable clipboard functionality using the clipboard config option. It can take one of four possible values: + } + interface OptionsClipboard { + /** You can enable clipboard functionality using the clipboard config option. It can take one of four possible values: true - enable clipboard copy and paste "copy" - enable only copy functionality "paste" - enable only paste functionality false - disable all clipboard functionality (default) */ clipboard?: boolean | "copy" | "paste"; - /** - * The copy selector is a function that is used to choose which data is copied into the clipboard. Tabulator comes with a few different selectors built in: + /** * The copy selector is a function that is used to choose which data is copied into the clipboard. Tabulator comes with a few different selectors built in: active - Copy all table data currently displayed in the table to the clipboard (default) table - Copy all table data to the clipboard, including data that is currently filtered out selected - Copy the currently selected rows to the clipboard, including data that is currently filtered out @@ -51,12 +53,12 @@ declare namespace Tabulator { These selectors can also be used when programatically triggering a copy event. in this case if the selector is not specified it will default to the value set in the clipboardCopySelector property (which is active by default). */ clipboardCopySelector?: "active" | "table" | "selected"; - /** The copy formatter is used to take the row data provided by the selector and turn it into a text string for the clipboard. + /** The copy formatter is used to take the row data provided by the selector and turn it into a text string for the clipboard. There is one built in copy formatter called table, if you have extended the clipboard module and want to change the default you can use the clipboardCopyFormatter property. you can also pass in a formatting function directly into this property.*/ clipboardCopyFormatter?: "table" | ((rowData: any[]) => string); - /**By default Tabulator will include the column header titles in any clipboard data, this can be turned off by passing a value of false to the clipboardCopyHeader property: */ + /** By default Tabulator will include the column header titles in any clipboard data, this can be turned off by passing a value of false to the clipboardCopyHeader property: */ clipboardCopyHeader?: boolean; - /** Tabulator has one built in paste parser, that is designed to take a table formatted text string from the clipboard and turn it into row data. it breaks the tada into rows on a newline character \n and breaks the rows down to columns on a tab character \t. + /** Tabulator has one built in paste parser, that is designed to take a table formatted text string from the clipboard and turn it into row data. it breaks the tada into rows on a newline character \n and breaks the rows down to columns on a tab character \t. It will then attempt to work out which columns in the data correspond to columns in the table. It tries three different ways to achieve this. First it checks the values of all columns in the first row of data to see if they match the titles of columns in the table. If any of the columns don't match it then tries the same approach but with the column fields. If either of those options match, Tabulator will map those columns to the incoming data and import it into rows. If there is no match then Tabulator will assume the columns in the data are in the same order as the visible columns in the table and import them that way. @@ -64,19 +66,19 @@ declare namespace Tabulator { If you extend the clipboard module to add your own parser, you can set it to be used as default with the clipboardPasteParser property.*/ clipboardPasteParser?: string | ((clipboard: any) => any[]); - /**Once the data has been parsed into row data, it will be passed to a paste action to be added to the table. There are three inbuilt paste actions: + /** Once the data has been parsed into row data, it will be passed to a paste action to be added to the table. There are three inbuilt paste actions: insert - Inserts data into the table using the addRows function (default) update - Updates data in the table using the updateOrAddData function replace - replaces all data in the table using the setData function */ clipboardPasteAction?: "insert" | "update" | "replace"; - /**By default Tabulator will copy some of the tables styling along with the data to give a better visual appearance when pasted into other documents. + /** By default Tabulator will copy some of the tables styling along with the data to give a better visual appearance when pasted into other documents. If you want to only copy the unstyled data then you should set the clipboardCopyStyled option to false in the table options object: */ clipboardCopyStyled?: boolean; - /**By default Tabulator includes column headers, row groups and column calculations in the clipboard output. + /** By default Tabulator includes column headers, row groups and column calculations in the clipboard output. You can choose to remove column headers groups, row groups or column calculations from the output data by setting the values in the clipboardCopyConfig option in the table definition: */ clipboardCopyConfig?: @@ -87,56 +89,50 @@ declare namespace Tabulator { } | boolean; - /**The clipboardCopied event is triggered whenever data is copied to the clipboard. */ + /** The clipboardCopied event is triggered whenever data is copied to the clipboard. */ clipboardCopied: () => void; - /**The clipboardPasted event is triggered whenever data is successfuly pasted into the table. */ + /** The clipboardPasted event is triggered whenever data is successfuly pasted into the table. */ clipboardPasted: () => void; - /**The clipboardPasteError event is triggered whenever an atempt to paste data into the table has failed because it was rejected by the paste parser. */ + /** The clipboardPasteError event is triggered whenever an atempt to paste data into the table has failed because it was rejected by the paste parser. */ clipboardPasteError: () => void; - }; + } - type OptionsPersistentConfiguration = { - /**ID tag used to identify persistent storage information */ + interface OptionsPersistentConfiguration { + /** ID tag used to identify persistent storage information */ persistenceID?: string; - /** Persistence information can either be stored in a cookie or in the localSotrage object, you can use the persistenceMode to choose which. It can take three possible values: + /** Persistence information can either be stored in a cookie or in the localSotrage object, you can use the persistenceMode to choose which. It can take three possible values: local - (string) Store the persistence information in the localStorage object cookie - (string) Store the persistence information in a cookie true - (boolean) check if localStorage is available and store persistence information, otherwise store in cookie (Default option) */ persistenceMode?: "local" | "cookie" | true; - /**Enable persistsnt storage of column layout information */ + /** Enable persistsnt storage of column layout information */ persistentLayout?: boolean; - /**You can ensure the data sorting is stored for the next page load by setting the persistentSort option to true */ + /** You can ensure the data sorting is stored for the next page load by setting the persistentSort option to true */ persistentSort?: boolean; - /** You can ensure the data filtering is stored for the next page load by setting the persistentFilter option to true*/ + /** You can ensure the data filtering is stored for the next page load by setting the persistentFilter option to true*/ persistentFilter?: boolean; - }; + } - type OptionsPagination = { - /**Choose pagination method, "local" or "remote" */ + interface OptionsPagination { + /** Choose pagination method, "local" or "remote" */ pagination?: "remote" | "local"; - /**Set the number of rows in each page */ + /** Set the number of rows in each page */ paginationSize?: number; - /** Setting this option to true will cause Tabulator to create a list of page size options, that are multiples of the current page size. In the example below, the list will have the values of 5, 10, 15 and 20. + /** Setting this option to true will cause Tabulator to create a list of page size options, that are multiples of the current page size. In the example below, the list will have the values of 5, 10, 15 and 20. When using the page size selector like this, if you use the setPageSize function to set the page size to a value not in the list, the list will be regenerated using the new page size as the starting valuer */ paginationSizeSelector?: true | number[]; - /** By default the pagination controls are added to the footer of the table. If you wish the controls to be created in another element pass a DOM node or a CSS selector for that element to the paginationElement option.*/ + /** By default the pagination controls are added to the footer of the table. If you wish the controls to be created in another element pass a DOM node or a CSS selector for that element to the paginationElement option.*/ paginationElement?: HTMLElement | "string"; - /**Lookup list to link expected data feilds from the server to their function - * default - * { + /** Lookup list to link expected data feilds from the server to their function * default* { "current_page":"current_page", "last_page":"last_page", "data":"data", - } - * - * + }* * */ paginationDataReceived?: Record; - /**Lookup list to link fields expected by the server to their function - * default: - * { + /** Lookup list to link fields expected by the server to their function* default:* { "page":"page", "size":"size", "sorters":"sorters", @@ -144,31 +140,29 @@ declare namespace Tabulator { } */ paginationDataSent?: Record; - /**When using the addRow function on a paginated table, rows will be added relative to the current page (ie to the top or bottom of the current page), with overflowing rows being shifted onto the next page. + /** When using the addRow function on a paginated table, rows will be added relative to the current page (ie to the top or bottom of the current page), with overflowing rows being shifted onto the next page. If you would prefer rows to be added relative to the table (firs/last page) then you can use the paginationAddRow option. it can take one of two values: page - add rows relative to current page (default) table - add rows relative to the table */ paginationAddRow?: "table" | "page"; - /** The number of pagination page buttons shown in the footer using the paginationButtonCount option. By default this has a value of 5.*/ + /** The number of pagination page buttons shown in the footer using the paginationButtonCount option. By default this has a value of 5.*/ paginationButtonCount?: number; - }; + } - type OptionsRowGrouping = { - /**String/function to select field to group rows by */ + interface OptionsRowGrouping { + /** String/function to select field to group rows by */ groupBy?: string | ((data: any) => any); - /**By default Tabulator will create groups for rows based on the values contained in the row data. if you want to explicitly define which field values groups should be created for at each level, you can use the groupValues option. + /** By default Tabulator will create groups for rows based on the values contained in the row data. if you want to explicitly define which field values groups should be created for at each level, you can use the groupValues option. This option takes an array of value arrays, each item in the first array should be a list of acceptable field values for groups at that level */ groupValues?: any[][]; - /**You can use the setGroupHeader function to change the header generation function for each group. This function has one argument and takes the same values as passed to the groupHeader setup option. */ - groupHeader?: ((value: any, count: number, data: any, group: GroupComponent) => string) | ((value: any, count: number, data: any) => string)[]; + /** You can use the setGroupHeader function to change the header generation function for each group. This function has one argument and takes the same values as passed to the groupHeader setup option. */ + groupHeader?: ((value: any, count: number, data: any, group: GroupComponent) => string) | Array<(value: any, count: number, data: any) => string>; - /**You can set the default open state of groups using the groupStartOpen property - * - * This can take one of three possible values: + /** You can set the default open state of groups using the groupStartOpen property* * This can take one of three possible values: true - all groups start open (default value) false - all groups start closed @@ -178,40 +172,38 @@ declare namespace Tabulator { */ groupStartOpen?: boolean | ((value: any, count: number, data: any, group: GroupComponent) => boolean); - /**By default Tabulator allows users to toggle a group open or closed by clicking on the arrow icon in the left of the group header. If you would prefer a different behaviour you can use the groupToggleElement option to choose a different option: - * - * The option can take one of three values: + /** By default Tabulator allows users to toggle a group open or closed by clicking on the arrow icon in the left of the group header. If you would prefer a different behaviour you can use the groupToggleElement option to choose a different option:* * The option can take one of three values: arrow - togggle group on arrow element click header - toggle group on click anywhere on the group header element false - prevent clicking anywhere in the group toggling the group */ groupToggleElement?: "arrow" | "header" | false; - /**show/hide column calculations when group is closed */ + /** show/hide column calculations when group is closed */ groupClosedShowCalcs?: boolean; - /**The dataGrouping callback is triggered whenever a data grouping event occurs, before grouping happens. */ + /** The dataGrouping callback is triggered whenever a data grouping event occurs, before grouping happens. */ dataGrouping?: () => void; - /**The dataGrouping callback is triggered whenever a data grouping event occurs, after grouping happens. */ + /** The dataGrouping callback is triggered whenever a data grouping event occurs, after grouping happens. */ dataGrouped?: () => void; - /**The groupVisibilityChanged callback is triggered whenever a group changes between hidden and visible states. */ + /** The groupVisibilityChanged callback is triggered whenever a group changes between hidden and visible states. */ groupVisibilityChanged?: (group: GroupComponent, visible: boolean) => void; - /**The groupClick callback is triggered when a user clicks on a group header. */ + /** The groupClick callback is triggered when a user clicks on a group header. */ groupClick?: GroupEventCallback; - /**The groupDblClick callback is triggered when a user double clicks on a group header. */ + /** The groupDblClick callback is triggered when a user double clicks on a group header. */ groupDblClick?: GroupEventCallback; - /**The groupContext callback is triggered when a user right clicks on a group header. + /** The groupContext callback is triggered when a user right clicks on a group header. If you want to prevent the browsers context menu being triggered in this event you will need to include the preventDefault() function in your callback. */ groupContext?: GroupEventCallback; - /**The groupTap callback is triggered when a user taps on a group header on a touch display. */ + /** The groupTap callback is triggered when a user taps on a group header on a touch display. */ groupTap?: GroupEventCallback; - /**The groupDblTap callback is triggered when a user taps on a group header on a touch display twice in under 300ms. */ + /** The groupDblTap callback is triggered when a user taps on a group header on a touch display twice in under 300ms. */ groupDblTap?: GroupEventCallback; - /**The groupTapHold callback is triggered when a user taps on a group header on a touch display and holds their finger down for over 1 second */ + /** The groupTapHold callback is triggered when a user taps on a group header on a touch display and holds their finger down for over 1 second */ groupTapHold?: GroupEventCallback; - }; + } interface Filter { field: string; @@ -219,50 +211,48 @@ declare namespace Tabulator { value: any; } - type FilterFunction = (field: string, type: Tabulator.FilterType, value: any) => void; + type FilterFunction = (field: string, type: FilterType, value: any) => void; - type OptionsFiltering = { - /**Array of filters to be applied on load. */ + interface OptionsFiltering { + /** Array of filters to be applied on load. */ initialFilter?: Filter[]; - /**array of initial values for header filters. */ - initialHeaderFilter?: Pick[]; + /** array of initial values for header filters. */ + initialHeaderFilter?: Array>; - /**The dataFiltering callback is triggered whenever a filter event occurs, before the filter happens. */ + /** The dataFiltering callback is triggered whenever a filter event occurs, before the filter happens. */ dataFiltering?: (filters: Filter[]) => void; - /**The dataFiltered callback is triggered after the table dataset is filtered. */ + /** The dataFiltered callback is triggered after the table dataset is filtered. */ dataFiltered?: (filters: Filter[], rows: RowComponent[]) => void; - }; - type OptionsSorting = { - /**Array of sorters to be applied on load. */ + } + interface OptionsSorting { + /** Array of sorters to be applied on load. */ initialSort?: Sorter[]; - /**reverse the order that multiple sorters are applied to the table. */ + /** reverse the order that multiple sorters are applied to the table. */ sortOrderReverse?: boolean; - }; + } interface Sorter { column: string; dir: SortDirection; } - type OptionsData = { - /**A unique index value should be present for each row of data if you want to be able to programatically alter that data at a later point, this should be either numeric or a string. By default Tabulator will look for this value in the id field for the data. If you wish to use a different field as the index, set this using the index option parameter. */ + interface OptionsData { + /** A unique index value should be present for each row of data if you want to be able to programatically alter that data at a later point, this should be either numeric or a string. By default Tabulator will look for this value in the id field for the data. If you wish to use a different field as the index, set this using the index option parameter. */ index?: number | string; - //**Array to hold data that should be loaded on table creation */ + /** Array to hold data that should be loaded on table creation */ data?: any[]; - /**If you wish to retrieve your data from a remote source you can set the URL for the request in the ajaxURL option. */ + /** If you wish to retrieve your data from a remote source you can set the URL for the request in the ajaxURL option. */ ajaxURL?: string; - /**Parameters to be passed to remote Ajax data loading request */ + /** Parameters to be passed to remote Ajax data loading request */ ajaxParams?: {}; - /**The HTTP request type for Ajax requests or config object for the request */ + /** The HTTP request type for Ajax requests or config object for the request */ ajaxConfig?: HttpMethod | AjaxConfig; - /**When using a request method other than "GET" Tabulator will send any parameters with a content type of form data. You can change the content type with the ajaxContentType option. This will ensure parameters are sent in the format you expect, with the correct headers. - * - * The ajaxContentType option can take one of two values: + /** When using a request method other than "GET" Tabulator will send any parameters with a content type of form data. You can change the content type with the ajaxContentType option. This will ensure parameters are sent in the format you expect, with the correct headers. * * The ajaxContentType option can take one of two values: "form" - send parameters as form data (default option) "json" - send parameters as JSON encoded string If you want to use a custom content type then you can pass a content type formatter object into the ajaxContentType option. this object must have two properties, the headers property should contain all headers that should be sent with the request and the body property should contain a function that returns the body content of the request @@ -270,21 +260,21 @@ declare namespace Tabulator { ajaxContentType?: "form" | "json" | AjaxContentType; - /**If you need more control over the url of the request that you can get from the ajaxURL and ajaxParams properties, the you can use the ajaxURLGenerator property to pass in a callback that will generate the URL for you. + /** If you need more control over the url of the request that you can get from the ajaxURL and ajaxParams properties, the you can use the ajaxURLGenerator property to pass in a callback that will generate the URL for you. The callback should return a string representing the URL to be requested. */ ajaxURLGenerator?: (url: string, config: any, params: any) => string; - /**callback function to replace inbuilt ajax request functionality */ + /** callback function to replace inbuilt ajax request functionality */ ajaxRequestFunc?: (url: string, config: any, params: any) => Promise; - /**Send filter config to server instead of processing locally */ + /** Send filter config to server instead of processing locally */ ajaxFiltering?: boolean; - /**Send sorter config to server instead of processing locally */ + /** Send sorter config to server instead of processing locally */ ajaxSorting?: boolean; - /**If you are loading a lot of data from a remote source into your table in one go, it can sometimes take a long time for the server to return the request, which can slow down the user experience. + /** If you are loading a lot of data from a remote source into your table in one go, it can sometimes take a long time for the server to return the request, which can slow down the user experience. To speed things up in this situation Tabulator has a progressive load mode, this uses the pagination module to make a series of requests for part of the data set, one at a time, appending it to the table as the data arrives. This mode can be enable using the ajaxProgressiveLoad option. No pagination controls will be visible on screen, it just reusues the functionality of the pagination module to sequentially load the data. @@ -292,26 +282,26 @@ declare namespace Tabulator { There are two different progressive loading modes, to give you a choice of how data is loaded into the table. */ ajaxProgressiveLoad?: "load" | "scroll"; - /**By default tabulator will make the requests to fill the table as quickly as possible. On some servers these repeates requests from the same client may trigger rate limiting or security systems. In this case you can use the ajaxProgressiveLoadDelay option to add a delay in milliseconds between each page request. */ + /** By default tabulator will make the requests to fill the table as quickly as possible. On some servers these repeates requests from the same client may trigger rate limiting or security systems. In this case you can use the ajaxProgressiveLoadDelay option to add a delay in milliseconds between each page request. */ ajaxProgressiveLoadDelay?: number; - /**The ajaxProgressiveLoadScrollMargin property determines how close to the bottom of the table in pixels, the scroll bar must be before the next page worth of data is loaded, by default it is set to twice the height of the table. */ + /** The ajaxProgressiveLoadScrollMargin property determines how close to the bottom of the table in pixels, the scroll bar must be before the next page worth of data is loaded, by default it is set to twice the height of the table. */ ajaxProgressiveLoadScrollMargin?: number; - /**Show loader while data is loading, can also take a function that must return a boolean */ + /** Show loader while data is loading, can also take a function that must return a boolean */ ajaxLoader?: boolean | (() => boolean); - /**html for loader element */ + /** html for loader element */ ajaxLoaderLoading?: string; - /**html for the loader element in the event of an error */ + /** html for the loader element in the event of an error */ ajaxLoaderError?: string; - /**The ajaxRequesting callback is triggered when ever an ajax request is made. */ + /** The ajaxRequesting callback is triggered when ever an ajax request is made. */ ajaxRequesting?: (url: string, params: any) => boolean; - /**The ajaxResponse callback is triggered when a successful ajax request has been made. This callback can also be used to modify the received data before it is parsed by the table. If you use this callback it must return the data to be parsed by Tabulator, otherwise no data will be rendered */ + /** The ajaxResponse callback is triggered when a successful ajax request has been made. This callback can also be used to modify the received data before it is parsed by the table. If you use this callback it must return the data to be parsed by Tabulator, otherwise no data will be rendered */ ajaxResponse?: (url: string, params: any, response: any) => any; - /**The ajaxError callback is triggered there is an error response to an ajax request. */ + /** The ajaxError callback is triggered there is an error response to an ajax request. */ ajaxError?: (xhr: any, textStatus: any, errorThrown: any) => void; - }; + } interface AjaxContentType { headers: JSONRecord; @@ -326,16 +316,16 @@ declare namespace Tabulator { credentials?: string; } - type OptionsRows = { - /**Tabulator also allows you to define a row level formatter using the rowFormatter option. this lets you alter each row of the table based on the data it contains. + interface OptionsRows { + /** Tabulator also allows you to define a row level formatter using the rowFormatter option. this lets you alter each row of the table based on the data it contains. The function accepts one argument, the RowComponent for the row being formatted. */ rowFormatter?: (row: RowComponent) => any; - /**The position in the table for new rows to be added, "bottom" or "top" */ + /** The position in the table for new rows to be added, "bottom" or "top" */ addRowPos?: "bottom" | "top"; - /**The selectable option can take one of a several values: + /** The selectable option can take one of a several values: false - selectable rows are disabled true - selectable rows are enabled, and you can select as many as you want @@ -343,37 +333,37 @@ declare namespace Tabulator { "highlight" (default) - rows have the same hover stylings as selectable rows but do not change state when clicked. This is great for when you want to show that a row is clickable but don't want it to be selectable. */ selectable?: boolean | number | "highlight"; - /**By default you can select a range of rows by holding down the shift key and click dragging over a number of rows to toggle the selected state state of all rows the cursor passes over. + /** By default you can select a range of rows by holding down the shift key and click dragging over a number of rows to toggle the selected state state of all rows the cursor passes over. If you would prefere to select a range of row by clicking on the first row then holding down shift and clicking on the end row then you can acheive this by setting the selectableRangeMode to click */ selectableRangeMode?: "click"; - /**By default, row selection works on a rolling basis, if you set the selectable option to a numeric value then when you select past this number of rows, the first row to be selected will be deselected. If you want to disable this behaviour and instead prevent selection of new rows once the limit is reached you can set the selectableRollingSelection option to false. */ + /** By default, row selection works on a rolling basis, if you set the selectable option to a numeric value then when you select past this number of rows, the first row to be selected will be deselected. If you want to disable this behaviour and instead prevent selection of new rows once the limit is reached you can set the selectableRollingSelection option to false. */ selectableRollingSelection?: boolean; - /**By default Tabulator will maintain selected rows when the table is filtered, sorted or paginated (but NOT when the setData function is used). If you want the selected rows to be cleared whenever the table view is updated then set the selectablePersistence option to false. */ + /** By default Tabulator will maintain selected rows when the table is filtered, sorted or paginated (but NOT when the setData function is used). If you want the selected rows to be cleared whenever the table view is updated then set the selectablePersistence option to false. */ selectablePersistence?: boolean; - /**You many want to exclude certain rows from being selected. The selectableCheck options allows you to pass a function to check if the current row should be selectable, returning true will allow row selection, false will result in nothing happening. The function should accept a RowComponent as its first argument. */ + /** You many want to exclude certain rows from being selected. The selectableCheck options allows you to pass a function to check if the current row should be selectable, returning true will allow row selection, false will result in nothing happening. The function should accept a RowComponent as its first argument. */ selectableCheck?: (row: RowComponent) => boolean; - /**To allow the user to move rows up and down the table, set the movableRows parameter in the options: */ + /** To allow the user to move rows up and down the table, set the movableRows parameter in the options: */ movableRows?: boolean; - /**Tabulator also allows you to move rows between tables. To enable this you should supply either a valid CSS selector string a DOM node for the table or the Tabuator object for the table to the movableRowsConnectedTables option. if you want to connect to multple tables then you can pass in an array of values to this option. */ + /** Tabulator also allows you to move rows between tables. To enable this you should supply either a valid CSS selector string a DOM node for the table or the Tabuator object for the table to the movableRowsConnectedTables option. if you want to connect to multple tables then you can pass in an array of values to this option. */ movableRowsConnectedTables?: string | string[] | HTMLElement | HTMLElement[]; - /**The movableRowsSender option should be set on the sending table, and sets the action that should be taken after the row has been successfuly dropped into the receiving table. + /** The movableRowsSender option should be set on the sending table, and sets the action that should be taken after the row has been successfuly dropped into the receiving table. There are several inbuilt sender functions: false - do nothing(default) - delete - deletes the row from the table + delete - deletes the row from the table You can also pass a callback to the movableRowsSender option for custom sender functionality */ movableRowsSender?: false | "delete" | ((fromRow: RowComponent, toRow: RowComponent, toTable: Tabulator) => any); - /** The movableRowsReceiver option should be set on the receiving tables, and sets the action that should be taken when the row is dropped into the table. + /** The movableRowsReceiver option should be set on the receiving tables, and sets the action that should be taken when the row is dropped into the table. There are several inbuilt receiver functions: insert - inserts row next to the row it was dropped on, if not dropped on a row it is added to the table (default) @@ -382,11 +372,10 @@ declare namespace Tabulator { replace - replaces the row it is dropped on with the sent row*/ movableRowsReceiver?: "insert" | "add" | "update" | "replace" | ((fromRow: RowComponent, toRow: RowComponent, fromTable: Tabulator) => any); - /**You can allow the user to manually resize rows by dragging the top or bottom border of a row. To enable this functionality, set the resizableRows property to true */ + /** You can allow the user to manually resize rows by dragging the top or bottom border of a row. To enable this functionality, set the resizableRows property to true */ resizableRows?: boolean; - /** - * The default ScrollTo position can be set using the scrollToRowPosition option. It can take one of four possible values: + /** * The default ScrollTo position can be set using the scrollToRowPosition option. It can take one of four possible values: top - position row with its top edge at the top of the table (default) center - position row with its top edge in the center of the table @@ -395,86 +384,86 @@ declare namespace Tabulator { */ scrollToRowPosition?: ScrollToRowPostition; - /**The default option for triggering a ScrollTo on a visible element can be set using the scrollToRowIfVisible option. It can take a boolean value: + /** The default option for triggering a ScrollTo on a visible element can be set using the scrollToRowIfVisible option. It can take a boolean value: true - scroll to row, even if it is visible (default) false - scroll to row, unless it is currently visible, then don't move */ scrollToRowIfVisible?: boolean; - /**The dataTreeRowExpanded callback is triggered when a row with child rows is expanded to reveal the children. */ + /** The dataTreeRowExpanded callback is triggered when a row with child rows is expanded to reveal the children. */ dataTreeRowExpanded?: (row: RowComponent, level: number) => void; - /**The dataTreeRowCollapsed callback is triggered when a row with child rows is collapsed to hide its children.*/ + /** The dataTreeRowCollapsed callback is triggered when a row with child rows is collapsed to hide its children.*/ dataTreeRowCollapsed?: (row: RowComponent, level: number) => void; - /**The movableRowsSendingStart callback is triggered on the sending table when a row is picked up from a sending table. */ + /** The movableRowsSendingStart callback is triggered on the sending table when a row is picked up from a sending table. */ movableRowsSendingStart?: (toTables: any[]) => void; - /**The movableRowsSent callback is triggered on the sending table when a row has been successfuly received by a receiving table. */ + /** The movableRowsSent callback is triggered on the sending table when a row has been successfuly received by a receiving table. */ movableRowsSent?: (fromRow: RowComponent, toRow: RowComponent, toTable: Tabulator) => void; - /**The movableRowsSentFailed callback is triggered on the sending table when a row has failed to be received by the receiving table.*/ + /** The movableRowsSentFailed callback is triggered on the sending table when a row has failed to be received by the receiving table.*/ movableRowsSentFailed?: (fromRow: RowComponent, toRow: RowComponent, toTable: Tabulator) => void; - /**The movableRowsSendingStop callback is triggered on the sending table after a row has been dropped and any senders and receivers have been handled. */ + /** The movableRowsSendingStop callback is triggered on the sending table after a row has been dropped and any senders and receivers have been handled. */ movableRowsSendingStop?: (toTables: any[]) => void; - /**The movableRowsReceivingStart callback is triggered on a receiving table when a connection is established with a sending table. */ + /** The movableRowsReceivingStart callback is triggered on a receiving table when a connection is established with a sending table. */ movableRowsReceivingStart?: (fromRow: RowComponent, toTable: Tabulator) => void; - /**The movableRowsReceived callback is triggered on a receiving table when a row has been successfuly received.*/ + /** The movableRowsReceived callback is triggered on a receiving table when a row has been successfuly received.*/ movableRowsReceived?: (fromRow: RowComponent, toRow: RowComponent, fromTable: Tabulator) => void; - /**The movableRowsReceivedFailed callback is triggered on a receiving table when a row receiver has returned false.*/ + /** The movableRowsReceivedFailed callback is triggered on a receiving table when a row receiver has returned false.*/ movableRowsReceivedFailed?: (fromRow: RowComponent, toRow: RowComponent, fromTable: Tabulator) => void; - /**The movableRowsReceivingStop callback is triggered on a receiving table after a row has been dropped and any senders and receivers have been handled.*/ + /** The movableRowsReceivingStop callback is triggered on a receiving table after a row has been dropped and any senders and receivers have been handled.*/ movableRowsReceivingStop?: (fromTable: Tabulator) => void; - /**The rowClick callback is triggered when a user clicks on a row. */ + /** The rowClick callback is triggered when a user clicks on a row. */ rowClick?: RowEventCallback; - /**The rowDblClick callback is triggered when a user double clicks on a row. */ + /** The rowDblClick callback is triggered when a user double clicks on a row. */ rowDblClick?: RowEventCallback; - /**The rowContext callback is triggered when a user right clicks on a row. + /** The rowContext callback is triggered when a user right clicks on a row. If you want to prevent the browsers context menu being triggered in this event you will need to include the preventDefault() function in your callback. */ rowContext?: RowEventCallback; - /**The rowTap callback is triggered when a user taps on a row on a touch display. */ + /** The rowTap callback is triggered when a user taps on a row on a touch display. */ rowTap?: RowEventCallback; - /**The rowDblTap callback is triggered when a user taps on a row on a touch display twice in under 300ms. */ + /** The rowDblTap callback is triggered when a user taps on a row on a touch display twice in under 300ms. */ rowDblTap?: RowEventCallback; - /**The rowTapHold callback is triggered when a user taps on a row on a touch display and holds their finger down for over 1 second. */ + /** The rowTapHold callback is triggered when a user taps on a row on a touch display and holds their finger down for over 1 second. */ rowTapHold?: RowEventCallback; - /**The rowMouseEnter callback is triggered when the mouse pointer enters a row. */ + /** The rowMouseEnter callback is triggered when the mouse pointer enters a row. */ rowMouseEnter?: RowEventCallback; - /**The rowMouseLeave callback is triggered when the mouse pointer leaves a row. */ + /** The rowMouseLeave callback is triggered when the mouse pointer leaves a row. */ rowMouseLeave?: RowEventCallback; - /** The rowMouseOver callback is triggered when the mouse pointer enters a row or any of its child elements.*/ + /** The rowMouseOver callback is triggered when the mouse pointer enters a row or any of its child elements.*/ rowMouseOver?: RowEventCallback; - /**The rowMouseOut callback is triggered when the mouse pointer leaves a row or any of its child elements. */ + /** The rowMouseOut callback is triggered when the mouse pointer leaves a row or any of its child elements. */ rowMouseOut?: RowEventCallback; - /**The rowMouseMove callback is triggered when the mouse pointer moves over a row. */ + /** The rowMouseMove callback is triggered when the mouse pointer moves over a row. */ rowMouseMove?: RowEventCallback; - /**The rowAdded callback is triggered when a row is added to the table by the addRow and updateOrAddRow functions. */ + /** The rowAdded callback is triggered when a row is added to the table by the addRow and updateOrAddRow functions. */ rowAdded?: RowChangedCallback; - /**The rowUpdated callback is triggered when a row is updated by the updateRow, updateOrAddRow, updateData or updateOrAddData, functions. */ + /** The rowUpdated callback is triggered when a row is updated by the updateRow, updateOrAddRow, updateData or updateOrAddData, functions. */ rowUpdated?: RowChangedCallback; - /**The rowDeleted callback is triggered when a row is deleted from the table by the deleteRow function. */ + /** The rowDeleted callback is triggered when a row is deleted from the table by the deleteRow function. */ rowDeleted?: RowChangedCallback; - /**The rowMoved callback will be triggered when a row has been successfuly moved. */ + /** The rowMoved callback will be triggered when a row has been successfuly moved. */ rowMoved?: RowChangedCallback; - /**The rowResized callback will be triggered when a row has been resized by the user. */ + /** The rowResized callback will be triggered when a row has been resized by the user. */ rowResized?: RowChangedCallback; - /**Whenever the number of selected rows changes, through selection or deselection, the rowSelectionChanged event is triggered. This passes an array of the data objects for each row in the order they were selected as the first argument, and an array of row components for each of the rows in order of selection as the second argument. */ + /** Whenever the number of selected rows changes, through selection or deselection, the rowSelectionChanged event is triggered. This passes an array of the data objects for each row in the order they were selected as the first argument, and an array of row components for each of the rows in order of selection as the second argument. */ rowSelectionChanged?: (data: any[], rows: RowComponent[]) => void; - /**The rowSelected event is triggered when a row is selected, either by the user or programatically. */ + /** The rowSelected event is triggered when a row is selected, either by the user or programatically. */ rowSelected?: RowChangedCallback; - /**The rowDeselected event is triggered when a row is deselected, either by the user or programatically. */ + /** The rowDeselected event is triggered when a row is deselected, either by the user or programatically. */ rowDeselected?: RowChangedCallback; - }; + } - type OptionsColumns = { - /**The column definitions are provided to Tabluator in the columns property of the table constructor object and should take the format of an array of objects, with each object representing the configuration of one column. */ + interface OptionsColumns { + /** The column definitions are provided to Tabluator in the columns property of the table constructor object and should take the format of an array of objects, with each object representing the configuration of one column. */ columns?: ColumnDefinition[]; /** @@ -482,15 +471,15 @@ declare namespace Tabulator { */ autoColumns?: boolean; - /**By default Tabulator will use the fitData layout mode, which will resize the tables columns to fit the data held in each column, unless you specify a width or minWidth in the column constructor. If the width of all columns exceeds the width of the containing element, a scroll bar will appear. */ + /** By default Tabulator will use the fitData layout mode, which will resize the tables columns to fit the data held in each column, unless you specify a width or minWidth in the column constructor. If the width of all columns exceeds the width of the containing element, a scroll bar will appear. */ layout?: "fitData" | "fitColumns" | "fitDataFill"; - /**To keep the layout of the columns consistent, once the column widths have been set on the first data load (either from the data property in the constructor or the setData function) they will not be changed when new data is loaded. + /** To keep the layout of the columns consistent, once the column widths have been set on the first data load (either from the data property in the constructor or the setData function) they will not be changed when new data is loaded. If you would prefer that the column widths adjust to the data each time you load it into the table you can set the layoutColumnsOnNewData property to true. */ layoutColumnsOnNewData?: boolean; - /**Responsive layout will automatically hide/show columns to fit the width of the Tabulator element. This allows for clean rendering of tables on smaller mobile devices, showing important data while avoiding horizontal scroll bars. You can enable responsive layouts using the responsiveLayout option. + /** Responsive layout will automatically hide/show columns to fit the width of the Tabulator element. This allows for clean rendering of tables on smaller mobile devices, showing important data while avoiding horizontal scroll bars. You can enable responsive layouts using the responsiveLayout option. There are two responsive layout modes available: @@ -503,15 +492,15 @@ declare namespace Tabulator { When responsive layout is enabled, all columns are given a default responsive value of 1. The higher you set this value the sooner that column will be hidden as the table width decreases. If two columns have the same responsive value then they are hidden from right to left (as defined in the column definition array, ignoring user moving of the columns). If you set the value to 0 then the column will never be hidden regardless of how narrow the table gets. */ responsiveLayout?: boolean | "hide" | "collapse"; - /**Collapsed lists are displayed to the user by default, if you would prefer they start closed so the user can open them you can use the responsiveLayoutCollapseStartOpen option */ + /** Collapsed lists are displayed to the user by default, if you would prefer they start closed so the user can open them you can use the responsiveLayoutCollapseStartOpen option */ responsiveLayoutCollapseStartOpen?: boolean; - /**By default any formatter set on the column is applied to the value that will appear in the list. while this works for most formatters it can cause issues with the progress formatter which relies on being inside a cell. + /** By default any formatter set on the column is applied to the value that will appear in the list. while this works for most formatters it can cause issues with the progress formatter which relies on being inside a cell. If you would like to disable column formatting in the collapsed list, you can use the responsiveLayoutCollapseUseFormatters option: */ responsiveLayoutCollapseUseFormatters?: boolean; - /**If you set the responsiveLayout option to collapse the values from hidden columns will be displayed in a title/value list under the row. + /** If you set the responsiveLayout option to collapse the values from hidden columns will be displayed in a title/value list under the row. In this mode an object containing the title of each hidden column and its value is generated and then used to generate a list displayed in a div .tabulator-responsive-collapse under the row data. @@ -520,44 +509,44 @@ declare namespace Tabulator { This function should return an empty string if there is no data to display. */ responsiveLayoutCollapseFormatter?: (data: any[]) => any; - /**It is possible to set a minimum column width to prevent resizing columns from becoming too small. + /** It is possible to set a minimum column width to prevent resizing columns from becoming too small. This can be set globally, by setting the columnMinWidth option to the column width when you create your Tabulator. This option can be overridden on a per column basis by setting the minWidth property on the column definition. */ columnMinWidth?: number; - /**By default it is possible to manually resize columns by dragging the borders of the column in both the column headers and the cells of the column. + /** By default it is possible to manually resize columns by dragging the borders of the column in both the column headers and the cells of the column. If you want to alter this behaviour you can use the resizableColumns to choose where the resize handles are available. */ resizableColumns?: true | false | "header" | "cell"; - /**To allow the user to move columns along the table, set the movableColumns parameter in the options: */ + /** To allow the user to move columns along the table, set the movableColumns parameter in the options: */ movableColumns?: boolean; - /**Header tooltips can be set globally using the tooltipsHeader options parameter */ + /** Header tooltips can be set globally using the tooltipsHeader options parameter */ tooltipsHeader?: boolean; - /**You can use the columnVertAlign option to set how the text in your column headers should be vertically */ + /** You can use the columnVertAlign option to set how the text in your column headers should be vertically */ columnVertAlign?: "top" | "middle" | "bottom"; - /**The default placeholder text used for input elements can be set using the headerFilterPlaceholder option in the table definition */ + /** The default placeholder text used for input elements can be set using the headerFilterPlaceholder option in the table definition */ headerFilterPlaceholder?: string; - /**The default ScrollTo position can be set using the scrollToColumnPosition option. It can take one of three possible values: + /** The default ScrollTo position can be set using the scrollToColumnPosition option. It can take one of three possible values: left - position column with its left edge at the left of the table (default) center - position column with its left edge in the center of the table right - position column with its right edge at the right of the table */ scrollToColumnPosition?: ScrollToColumnPosition; - /**The default option for triggering a ScrollTo on a visible element can be set using the scrollToColumnIfVisible option. It can take a boolean value: + /** The default option for triggering a ScrollTo on a visible element can be set using the scrollToColumnIfVisible option. It can take a boolean value: true - scroll to column, even if it is visible (default) false - scroll to column, unless it is currently visible, then don't move */ scrollToColumnIfVisible?: boolean; - /**By default column calculations are shown at the top and bottom of the table, unless row grouping is enabled, in which case they are shown at the top and bottom of each group. + /** By default column calculations are shown at the top and bottom of the table, unless row grouping is enabled, in which case they are shown at the top and bottom of each group. The columnCalcs option lets you decided where the calculations should be displayed, it can take one of four values: @@ -567,26 +556,26 @@ declare namespace Tabulator { group - show calcs in groups only */ columnCalcs?: boolean | "both" | "table" | "group"; - /**If you need to use the . character as part of your field name, you can change the separator to any other character using the nestedFieldSeparator option + /** If you need to use the . character as part of your field name, you can change the separator to any other character using the nestedFieldSeparator option * Set to false to disable nested data parsing */ nestedFieldSeparator?: string | boolean; - /**multiple or single column sorting */ + /** multiple or single column sorting */ columnHeaderSortMulti?: boolean; - /**The columnMoved callback will be triggered when a column has been successfuly moved. */ + /** The columnMoved callback will be triggered when a column has been successfuly moved. */ columnMoved?: (column: ColumnComponent, columns: any[]) => void; columnResized?: (column: ColumnComponent) => void; - /**The columnVisibilityChanged callback is triggered whenever a column changes between hidden and visible states. */ + /** The columnVisibilityChanged callback is triggered whenever a column changes between hidden and visible states. */ columnVisibilityChanged?: (column: ColumnComponent, visible: boolean) => void; - /**The columnTitleChanged callback is triggered whenever a user edits a column title when the editableTitle parameter has been enabled in the column definition array. */ + /** The columnTitleChanged callback is triggered whenever a user edits a column title when the editableTitle parameter has been enabled in the column definition array. */ columnTitleChanged?: (column: ColumnComponent) => void; - }; + } - type OptionsCell = { - /**The cellClick callback is triggered when a user left clicks on a cell, it can be set on a per column basis using the option in the columns definition object. */ + interface OptionsCell { + /** The cellClick callback is triggered when a user left clicks on a cell, it can be set on a per column basis using the option in the columns definition object. */ cellClick?: CellEventCallback; cellDblClick?: CellEventCallback; cellContext?: CellEventCallback; @@ -601,32 +590,31 @@ declare namespace Tabulator { cellEditing?: CellEditEventCallback; cellEdited?: CellEditEventCallback; cellEditCancelled?: CellEditEventCallback; - }; + } - type OptionsGeneral = { - /**Sets the height of the containing element, can be set to any valid height css value. If set to false (the default), the height of the table will resize to fit the table data. */ + interface OptionsGeneral { + /** Sets the height of the containing element, can be set to any valid height css value. If set to false (the default), the height of the table will resize to fit the table data. */ height?: string | number | false; - /**Enable rendering using the Virtual DOM engine */ + /** Enable rendering using the Virtual DOM engine */ virtualDom?: boolean; - /**Manually set the size of the virtual DOM buffer */ + /** Manually set the size of the virtual DOM buffer */ virtualDomBuffer?: boolean; - /**placeholder element to display on empty table */ + /** placeholder element to display on empty table */ placeholder?: string | HTMLElement; - /**Footer element to display for the table */ + /** Footer element to display for the table */ footerElement?: string | HTMLElement; - /**Function to generate tooltips for cells */ + /** Function to generate tooltips for cells */ tooltips?: GlobalTooltipOption; - /**When to regenerate cell tooltip value */ + /** When to regenerate cell tooltip value */ tooltipGenerationMode?: "load"; - /**Keybinding configuration object */ + /** Keybinding configuration object */ keybindings?: false | KeyBinding; - /** - * The reactivity systems allow Tabulator to watch arrays and objects passed into the table for changes and then automatically update the table. + /** * The reactivity systems allow Tabulator to watch arrays and objects passed into the table for changes and then automatically update the table. This approach means you no longer need to worry about calling a number of different functions on the table to make changes, you simply update the array or object you originally passed into the table and Tabulator will take care of the rest. @@ -636,17 +624,17 @@ declare namespace Tabulator { reactiveData?: boolean; - //Not listed in options-------------------- - /**Tabulator will automatically attempt to redraw the data contained in the table if the containing element for the table is resized. To disable this functionality, set the autoResize property to false */ + // Not listed in options-------------------- + /** Tabulator will automatically attempt to redraw the data contained in the table if the containing element for the table is resized. To disable this functionality, set the autoResize property to false */ autoResize?: boolean; - /**When a the tabulator constructor is called, the tableBuilding callback will triggered */ + /** When a the tabulator constructor is called, the tableBuilding callback will triggered */ tableBuilding?: () => void; - /**When a the tabulator constructor is called and the table has finished being rendered, the tableBuilt callback will triggered: */ + /** When a the tabulator constructor is called and the table has finished being rendered, the tableBuilt callback will triggered: */ tableBuilt?: () => void; - /**The renderStarted callback is triggered whenever all the rows in the table are about to be rendered. This can include: + /** The renderStarted callback is triggered whenever all the rows in the table are about to be rendered. This can include: Data is loaded into the table when setData is called A page is loaded through any form of pagination Rows are added to the table during progressive rendering @@ -656,31 +644,31 @@ declare namespace Tabulator { The redraw function is called */ renderStarted?: () => void; - /**The renderComplete callback is triggered after the table has been rendered */ + /** The renderComplete callback is triggered after the table has been rendered */ renderComplete?: () => void; - /**The htmlImporting callback is triggered when Tabulator starts importing data from an HTML table. */ + /** The htmlImporting callback is triggered when Tabulator starts importing data from an HTML table. */ htmlImporting?: EmptyCallback; - /**The htmlImported callback is triggered when Tabulator finishes importing data from an HTML table. */ + /** The htmlImported callback is triggered when Tabulator finishes importing data from an HTML table. */ htmlImported?: EmptyCallback; - /**The dataLoading callback is triggered whenever new data is loaded into the table. */ + /** The dataLoading callback is triggered whenever new data is loaded into the table. */ dataLoading?: (data: any) => void; - /**The dataLoaded callback is triggered when a new set of data is loaded into the table. */ + /** The dataLoaded callback is triggered when a new set of data is loaded into the table. */ dataLoaded?: (data: any) => void; - /**The dataEdited callback is triggered whenever the table data is changed by the user. Triggers for this include editing any cell in the table, adding a row and deleting a row. */ + /** The dataEdited callback is triggered whenever the table data is changed by the user. Triggers for this include editing any cell in the table, adding a row and deleting a row. */ dataEdited?: (data: any) => void; - /**Whenever a page has been loaded, the pageLoaded callback is called, passing the current page number as an argument. */ + /** Whenever a page has been loaded, the pageLoaded callback is called, passing the current page number as an argument. */ pageLoaded?: (pageno: number) => void; - /**The dataSorting callback is triggered whenever a sort event occurs, before sorting happens. */ + /** The dataSorting callback is triggered whenever a sort event occurs, before sorting happens. */ dataSorting?: (sorters: Sorter[]) => void; - /**The dataSorted callback is triggered after the table dataset is sorted. */ + /** The dataSorted callback is triggered after the table dataset is sorted. */ dataSorted?: (sorters: Sorter[], rows: RowComponent[]) => void; - }; + } type DownloadType = "csv" | "json" | "xlsx" | "pdf"; @@ -690,14 +678,14 @@ declare namespace Tabulator { } interface DownloadCSV { - /**By default CSV files are created using a comma (,) delimiter. If you need to change this for any reason the you can pass the options object with a delimiter property to the download function which will then use this delimiter instead of the comma. */ + /** By default CSV files are created using a comma (,) delimiter. If you need to change this for any reason the you can pass the options object with a delimiter property to the download function which will then use this delimiter instead of the comma. */ delimiter?: "string"; - /**If you need the output CSV to include a byte order mark (BOM) to ensure that output with UTF-8 characters can be correctly interpereted across didfferent applications, you should set the bom option to true */ + /** If you need the output CSV to include a byte order mark (BOM) to ensure that output with UTF-8 characters can be correctly interpereted across didfferent applications, you should set the bom option to true */ bom?: boolean; } interface DownloadXLXS { - /**The sheet name must be a valid Excel sheet name, and cannot include any of the following characters \, /, *, [, ], :, */ + /** The sheet name must be a valid Excel sheet name, and cannot include any of the following characters \, /, *, [, ], :, */ sheetName?: string; } @@ -710,21 +698,21 @@ declare namespace Tabulator { autoTable?: {} | ((doc: any) => any); } - type OptionsDownload = { - /**If you want to make any bulk changes to the table data before it is parsed into the download file you can pass a mutator function to the downloadDataFormatter option in the table definition */ + interface OptionsDownload { + /** If you want to make any bulk changes to the table data before it is parsed into the download file you can pass a mutator function to the downloadDataFormatter option in the table definition */ downloadDataFormatter?: (data: any[]) => any; - /**The downloadReady callback allows you to intercept the download file data before the users is prompted to save the file. + /** The downloadReady callback allows you to intercept the download file data before the users is prompted to save the file. In order for the download to proceed the downloadReady callback is expected to return a blob of file to be downloaded. If you would prefer to abort the download you can return false from this callback. This could be useful for example if you want to send the created file to a server via ajax rather than allowing the user to download the file. */ downloadReady?: (fileContents: any, blob: any) => any; - /**The downloadComplete callback is triggered when the user has been prompted to download the file. */ + /** The downloadComplete callback is triggered when the user has been prompted to download the file. */ downloadComplete?: () => void; - /**By default Tabulator includes column headers, row groups and column calculations in the download output. + /** By default Tabulator includes column headers, row groups and column calculations in the download output. You can choose to remove column headers groups, row groups or column calculations from the output data by setting the values in the downloadConfig option in the table definition: */ @@ -733,229 +721,220 @@ declare namespace Tabulator { rowGroups?: boolean; columnCalcs?: boolean; }; - }; + } - type OptionsLocale = { - /**You can set the current local in one of two ways. If you want to set it when the table is created, simply include the locale option in your Tabulator constructor. You can either pass in a string matching one of the language options you have defined, or pass in the boolean true which will cause Tabulator to auto-detect the browsers language settings from the navigator.language object. */ + interface OptionsLocale { + /** You can set the current local in one of two ways. If you want to set it when the table is created, simply include the locale option in your Tabulator constructor. You can either pass in a string matching one of the language options you have defined, or pass in the boolean true which will cause Tabulator to auto-detect the browsers language settings from the navigator.language object. */ locale?: boolean | string; - /**You can store as many languages as you like, creating an object inside the langs object with a property of the locale code for that language. A list of locale codes can be found here. + /** You can store as many languages as you like, creating an object inside the langs object with a property of the locale code for that language. A list of locale codes can be found here. At present there are three parts of the table that can be localised, the column headers, the header filter placeholder text and the pagination buttons. To localize the pagination buttons, create a pagination property inside your language object and give it the properties outlined below. If you wish you can also localize column titles by adding a columns property to your language object. You should store a property of the field name of the column you wish to change, with a value of its title. Any fields that match this will use this title instead of the one provided by the column definition array. */ langs?: any; - /**When a localization event has occurred , the localized callback will triggered, passing the current locale code and language object: */ + /** When a localization event has occurred , the localized callback will triggered, passing the current locale code and language object: */ localized?: (locale: string, lang: any) => void; - }; + } type HistoryAction = "cellEdit" | "rowAdd" | "rowDelete" | "rowMoved"; - type OptionsHistory = { - /**Enable user interaction history functionality */ + interface OptionsHistory { + /** Enable user interaction history functionality */ history?: boolean; - /**The historyUndo event is triggered when the undo action is triggered. */ + /** The historyUndo event is triggered when the undo action is triggered. */ historyUndo: (action: HistoryAction, component: CellComponent | RowComponent, data: any) => void; - /**The historyRedo event is triggered when the redo action is triggered. */ + /** The historyRedo event is triggered when the redo action is triggered. */ historyRedo: (action: HistoryAction, component: CellComponent | RowComponent, data: any) => void; - }; + } interface ColumnLayout { - /**title - Required This is the title that will be displayed in the header for this column */ + /** title - Required This is the title that will be displayed in the header for this column */ title: string; - /**field - Required (not required in icon/button columns) this is the key for this column in the data array*/ + /** field - Required (not required in icon/button columns) this is the key for this column in the data array*/ field?: string; - /**visible - (boolean, default - true) determines if the column is visible. (see Column Visibility for more details */ + /** visible - (boolean, default - true) determines if the column is visible. (see Column Visibility for more details */ visible?: boolean; - /**sets the width of this column, this can be set in pixels or as a percentage of total table width (if not set the system will determine the best) */ + /** sets the width of this column, this can be set in pixels or as a percentage of total table width (if not set the system will determine the best) */ width?: number | string; } interface ColumnDefinition extends ColumnLayout, CellCallbacks { - //Layout - /**sets the text alignment for this column */ - align?: "left" | "center" | "right"; //Align? - /**sets the minimum width of this column, this should be set in pixels (this takes priority over the global option of columnMinWidth) */ + // Layout + /** sets the text alignment for this column */ + align?: "left" | "center" | "right"; // Align? + /** sets the minimum width of this column, this should be set in pixels (this takes priority over the global option of columnMinWidth) */ minWidth?: number; - /**The widthGrow property should be used on columns without a width property set. The value is used to work out what fraction of the available will be allocated to the column. The value should be set to a number greater than 0, by default any columns with no width set have a widthGrow value of 1 */ + /** The widthGrow property should be used on columns without a width property set. The value is used to work out what fraction of the available will be allocated to the column. The value should be set to a number greater than 0, by default any columns with no width set have a widthGrow value of 1 */ widthGrow?: number; - /**The widthShrink property should be used on columns with a width property set. The value is used to work out how to shrink columns with a fixed width when the table is too narrow to fit in all the columns. The value should be set to a number greater than 0, by default columns with a width set have a widthShrink value of 0, meaning they will not be shrunk if the table gets too narrow, and may cause the horizontal scrollbar to appear. */ + /** The widthShrink property should be used on columns with a width property set. The value is used to work out how to shrink columns with a fixed width when the table is too narrow to fit in all the columns. The value should be set to a number greater than 0, by default columns with a width set have a widthShrink value of 0, meaning they will not be shrunk if the table gets too narrow, and may cause the horizontal scrollbar to appear. */ widthShrink?: number; - /**set whether column can be resized by user dragging its edges */ + /** set whether column can be resized by user dragging its edges */ resizable?: boolean; - /**You can freeze the position of columns on the left and right of the table using the frozen property in the column definition array. This will keep the column still when the table is scrolled horizontally. */ + /** You can freeze the position of columns on the left and right of the table using the frozen property in the column definition array. This will keep the column still when the table is scrolled horizontally. */ frozen?: boolean; - /**an integer to determine when the column should be hidden in responsive mode */ + /** an integer to determine when the column should be hidden in responsive mode */ responsive?: number; - /**sets the on hover tooltip for each cell in this column - * - * The tooltip parameter can take three different types of value + /** sets the on hover tooltip for each cell in this column * * The tooltip parameter can take three different types of value boolean - a value of false disables the tooltip, a value of true sets the tooltip of the cell to its value string - a string that will be displayed for all cells in the matching column/table. function - a callback function that returns the string for the cell - - * Note: setting a tooltip value on a column will override the global setting. + * Note: setting a tooltip value on a column will override the global setting. */ tooltip?: string | GlobalTooltipOption; - /**sets css classes on header and cells in this column. (value should be a string containing space separated class names) */ + /** sets css classes on header and cells in this column. (value should be a string containing space separated class names) */ cssClass?: string; - /**sets the column as a row handle, allowing it to be used to drag movable rows. */ + /** sets the column as a row handle, allowing it to be used to drag movable rows. */ rowHandle?: boolean; - /**When the getHtml function is called, hide the column from the output. */ + /** When the getHtml function is called, hide the column from the output. */ hideInHtml?: boolean; - //Data Manipulation - /** By default Tabulator will attempt to guess which sorter should be applied to a column based on the data contained in the first row. It can determine sorters for strings, numbers, alphanumeric sequences and booleans, anything else will be treated as a string. + // Data Manipulation + /** By default Tabulator will attempt to guess which sorter should be applied to a column based on the data contained in the first row. It can determine sorters for strings, numbers, alphanumeric sequences and booleans, anything else will be treated as a string. To specify a sorter to be used on a column use the sorter property in the columns definition object You can pass an optional additional property with sorter, sorterParams that should contain an object with additional information for configuring the sorter*/ sorter?: "string" | "number" | "alphanum" | "boolean" | "exists" | "date" | "time" | "datetime" | "array" | ((a: any, b: any, aRow: RowComponent, bRow: RowComponent, column: ColumnComponent, dir: SortDirection, sorterParams: {}) => number); - /**If you want to dynamically generate the sorterParams at the time the sort is called you can pass a function into the property that should return the params object. */ + /** If you want to dynamically generate the sorterParams at the time the sort is called you can pass a function into the property that should return the params object. */ sorterParams?: ColumnDefinitionSorterParams | ColumnSorterParamLookupFunction; - /** set how you would like the data to be formatted*/ + /** set how you would like the data to be formatted*/ formatter?: Formatter; - /** You can pass an optional additional parameter with the formatter, formatterParams that should contain an object with additional information for configuring the formatter.*/ + /** You can pass an optional additional parameter with the formatter, formatterParams that should contain an object with additional information for configuring the formatter.*/ formatterParams?: FormatterParams; - /**alter the row height to fit the contents of the cell instead of hiding overflow */ + /** alter the row height to fit the contents of the cell instead of hiding overflow */ variableHeight?: boolean; - /** There are some circumstances where you may want to block editibility of a cell for one reason or another. To meet this need you can use the editable option. This lets you set a callback that is executed before the editor is built, if this callback returns true the editor is added, if it returns false the edit is aborted and the cell remains a non editable cell. The function is passed one parameter, the CellComponent of the cell about to be edited. You can also pass a boolean value instead of a function to this property.*/ + /** There are some circumstances where you may want to block editibility of a cell for one reason or another. To meet this need you can use the editable option. This lets you set a callback that is executed before the editor is built, if this callback returns true the editor is added, if it returns false the edit is aborted and the cell remains a non editable cell. The function is passed one parameter, the CellComponent of the cell about to be edited. You can also pass a boolean value instead of a function to this property.*/ editable?: boolean | ((cell: CellComponent) => boolean); - /**When a user clicks on an editable column the will be able to edit the value for that cell. + /** When a user clicks on an editable column the will be able to edit the value for that cell. By default Tabulator will use an editor that matches the current formatter for that cell. if you wish to specify a specific editor, you can set them per column using the editor option in the column definition. Passing a value of true to this option will result in Tabulator applying the editor that best matches the columns formatter, if present. You can pass an optional additional parameter with the editor, editorParams that should contain an object with additional information for configuring the editor. */ editor?: Editor; - /** */ + /** additional parameters you can pass to the editor */ editorParams?: EditorParams; - /**Validators are used to ensure that any user input into your editable cells matches your requirements. + /** Validators are used to ensure that any user input into your editable cells matches your requirements. Validators can be applied by using the validator property in a columns definition object (see Define Columns for more details). */ validator?: StandardValidatorType | StandardValidatorType[] | Validator | Validator[]; - /**Mutators are used to alter data as it is parsed into Tabulator. For example if you wanted to convert a numeric column into a boolean based on its value, before the data is used to build the table. + /** Mutators are used to alter data as it is parsed into Tabulator. For example if you wanted to convert a numeric column into a boolean based on its value, before the data is used to build the table. You can set mutators on a per column basis using the mutator option in the column definition object. You can pass an optional additional parameter with mutator, mutatorParams that should contain an object with additional information for configuring the mutator. */ mutator?: CustomMutator; - /**You can pass an optional additional parameter with mutator, mutatorParams that should contain an object with additional information for configuring the mutator. */ + /** You can pass an optional additional parameter with mutator, mutatorParams that should contain an object with additional information for configuring the mutator. */ mutatorParams?: CustomMutatorParams; - /** only called when data is loaded via a command {eg. setData). */ + /** only called when data is loaded via a command {eg. setData). */ mutatorData?: CustomMutator; mutatorDataParams?: CustomMutatorParams; - /**only called when data is changed via a user editing a cell. */ + /** only called when data is changed via a user editing a cell. */ mutatorEdit?: CustomMutator; mutatorEditParams?: CustomMutatorParams; - /**only called when data is changed via a user editing a cell. */ + /** only called when data is changed via a user editing a cell. */ mutatorClipboard?: CustomMutator; mutatorClipboardParams?: CustomMutatorParams; - /** Accessors are used to alter data as it is extracted from the table, through commands, the clipboard, or download. + /** Accessors are used to alter data as it is extracted from the table, through commands, the clipboard, or download. You can set accessors on a per column basis using the accessor option in the column definition object.*/ accessor?: CustomAccessor; - /** Each accessor function has its own matching params option, for example accessorDownload has accessorDownloadParams.*/ + /** Each accessor function has its own matching params option, for example accessorDownload has accessorDownloadParams.*/ accessorParams?: CustomAccessorParams; - /**only called when data is being converted into a downloadable file. */ + /** only called when data is being converted into a downloadable file. */ accessorDownload?: CustomAccessor; - /** */ + /** additional parameters you can pass to the accessorDownload */ accessorDownloadParams?: CustomAccessorParams; - /**only called when data is being copied into the clipboard. */ + /** only called when data is being copied into the clipboard. */ accessorClipboard?: CustomAccessor; - /** */ + /** additional parameters you can pass to the accessorClipboard*/ accessorClipboardParams?: CustomAccessorParams; - /**show or hide column in downloaded data */ + /** show or hide column in downloaded data */ download?: boolean; - /**set custom title for column in download */ + /** set custom title for column in download */ downloadTitle?: string; - /** the column calculation to be displayed at the top of this column(see Column Calculations for more details) */ + /** the column calculation to be displayed at the top of this column(see Column Calculations for more details) */ topCalc?: ColumnCalc; - /**additional parameters you can pass to the topCalc calculation function (see Column Calculations for more details) */ + /** additional parameters you can pass to the topCalc calculation function (see Column Calculations for more details) */ topCalcParams?: ColumnCalcParams; - /**formatter for the topCalc calculation cell */ + /** formatter for the topCalc calculation cell */ topCalcFormatter?: Formatter; - /** additional parameters you can pass to the topCalcFormatter function */ + /** additional parameters you can pass to the topCalcFormatter function */ topCalcFormatterParams?: FormatterParams; bottomCalc?: ColumnCalc; bottomCalcParams?: ColumnCalcParams; bottomCalcFormatter?: Formatter; - /** additional parameters you can pass to the bottomCalcFormatter function */ + /** additional parameters you can pass to the bottomCalcFormatter function */ bottomCalcFormatterParams?: FormatterParams; - //Column Header - /**By default all columns in a table are sortable by clicking on the column header, if you want to disable this behaviour, set the headerSort property to false in the column definition array: */ + // Column Header + /** By default all columns in a table are sortable by clicking on the column header, if you want to disable this behaviour, set the headerSort property to false in the column definition array: */ headerSort?: boolean; - /**set the starting sort direction when a user first clicks on a header */ + /** set the starting sort direction when a user first clicks on a header */ headerSortStartingDir?: SortDirection; - /**allow tristate toggling of column header sort direction */ + /** allow tristate toggling of column header sort direction */ headerSortTristate?: boolean; - /** callback for when user clicks on the header for this column*/ + /** callback for when user clicks on the header for this column*/ headerClick?: ColumnEventCallback; - /** callback for when user double clicks on the header for this column */ + /** callback for when user double clicks on the header for this column */ headerDblClick?: ColumnEventCallback; - /**callback for when user right clicks on the header for this column */ + /** callback for when user right clicks on the header for this column */ headerContext?: ColumnEventCallback; - /** callback for when user taps on a header for this column, triggered in touch displays. */ + /** callback for when user taps on a header for this column, triggered in touch displays. */ headerTap?: ColumnEventCallback; - /**callback for when user double taps on a header for this column, triggered in touch displays when a user taps the same header twice in under 300ms */ + /** callback for when user double taps on a header for this column, triggered in touch displays when a user taps the same header twice in under 300ms */ headerDblTap?: ColumnEventCallback; - /**callback for when user taps and holds on a header for this column, triggered in touch displays when a user taps and holds the same header for 1 second. */ + /** callback for when user taps and holds on a header for this column, triggered in touch displays when a user taps and holds the same header for 1 second. */ headerTapHold?: ColumnEventCallback; - /**sets the on hover tooltip for the column header - * - * The tooltip headerTooltip can take three different types of value + /** sets the on hover tooltip for the column header* * The tooltip headerTooltip can take three different types of value boolean - a value of false disables the tooltip, a value of true sets the tooltip of the column header to its title value. string - a string that will be displayed for the tooltip. - function - a callback function that returns the string for the column header - * + function - a callback function that returns the string for the column header* */ headerTooltip?: boolean | string | ((column: ColumnComponent) => string); - /**change the orientation of the column header to vertical - * - * The headerVertical property can take one of three values: + /** change the orientation of the column header to vertical* * The headerVertical property can take one of three values: false - vertical columns disabled (default value) true - vertical columns enabled - "flip" - vertical columns enabled, with text direction flipped by 180 degrees - * + "flip" - vertical columns enabled, with text direction flipped by 180 degrees* */ headerVertical?: boolean | "flip"; - /**allows the user to edit the header titles */ + /** allows the user to edit the header titles */ editableTitle?: boolean; - /** formatter function for header title */ + /** formatter function for header title */ titleFormatter?: Formatter; - /**additional parameters you can pass to the header title formatter */ + /** additional parameters you can pass to the header title formatter */ titleFormatterParams?: FormatterParams; - /** filtering of columns from elements in the header */ + /** filtering of columns from elements in the header */ headerFilter?: Editor; - /**additional parameters you can pass to the header filter */ + /** additional parameters you can pass to the header filter */ headerFilterParams?: EditorParams; - /** placeholder text for the header filter */ + /** placeholder text for the header filter */ headerFilterPlaceholder?: string; - /** function to check when the header filter is empty */ + /** function to check when the header filter is empty */ headerFilterEmptyCheck?: ValueBooleanCallback; - /** By default Tabulator will try and match the comparison type to the type of element used for the header filter. + /** By default Tabulator will try and match the comparison type to the type of element used for the header filter. Standard input elements will use the "like" filter, this allows for the matches to be displayed as the user types. @@ -963,50 +942,50 @@ You can pass an optional additional property with sorter, sorterParams that shou If you want to specify the type of filter used you can pass it to the headerFilterFunc option in the column definition object. This will take any of the standard filters outlined above or a custom function*/ headerFilterFunc?: FilterType | ((headerValue: any, rowValue: any, rowdata: any, filterparams: any) => boolean); - /** additional parameters object passed to the headerFilterFunc function */ + /** additional parameters object passed to the headerFilterFunc function */ headerFilterFuncParams?: any; - /**disable live filtering of the table */ + /** disable live filtering of the table */ headerFilterLiveFilter?: boolean; } interface CellCallbacks { - //Cell Events - /**callback for when user clicks on a cell in this column */ + // Cell Events + /** callback for when user clicks on a cell in this column */ cellClick?: CellEventCallback; - /** callback for when user double clicks on a cell in this column */ + /** callback for when user double clicks on a cell in this column */ cellDblClick?: CellEventCallback; - /**callback for when user right clicks on a cell in this column */ + /** callback for when user right clicks on a cell in this column */ cellContext?: CellEventCallback; - /**callback for when user taps on a cell in this column, triggered in touch displays. */ + /** callback for when user taps on a cell in this column, triggered in touch displays. */ cellTap?: CellEventCallback; - /** callback for when user double taps on a cell in this column, triggered in touch displays when a user taps the same cell twice in under 300ms. */ + /** callback for when user double taps on a cell in this column, triggered in touch displays when a user taps the same cell twice in under 300ms. */ cellDblTap?: CellEventCallback; - /** callback for when user taps and holds on a cell in this column, triggered in touch displays when a user taps and holds the same cell for 1 second.*/ + /** callback for when user taps and holds on a cell in this column, triggered in touch displays when a user taps and holds the same cell for 1 second.*/ cellTapHold?: CellEventCallback; - /**callback for when the mouse pointer enters a cell */ + /** callback for when the mouse pointer enters a cell */ cellMouseEnter?: CellEventCallback; - /** callback for when the mouse pointer leaves a cell */ + /** callback for when the mouse pointer leaves a cell */ cellMouseLeave?: CellEventCallback; - /** callback for when the mouse pointer enters a cell or one of its child elements */ + /** callback for when the mouse pointer enters a cell or one of its child elements */ cellMouseOver?: CellEventCallback; - /**callback for when the mouse pointer enters a cell or one of its child elements */ + /** callback for when the mouse pointer enters a cell or one of its child elements */ cellMouseOut?: CellEventCallback; - /**callback for when the mouse pointer moves over a cell */ + /** callback for when the mouse pointer moves over a cell */ cellMouseMove?: CellEventCallback; - //Cell editing - /**callback for when a cell in this column is being edited by the user */ + // Cell editing + /** callback for when a cell in this column is being edited by the user */ cellEditing?: CellEditEventCallback; - /**callback for when a cell in this column has been edited by the user */ + /** callback for when a cell in this column has been edited by the user */ cellEdited?: CellEditEventCallback; - /** callback for when an edit on a cell in this column is aborted by the user */ + /** callback for when an edit on a cell in this column is aborted by the user */ cellEditCancelled?: CellEditEventCallback; } @@ -1022,7 +1001,7 @@ You can pass an optional additional property with sorter, sorterParams that shou type CustomMutatorParams = {} | ((value: any, data: any, type: "data" | "edit", cell?: CellComponent) => any); type CustomAccessor = (value: any, data: any, type: "data" | "download" | "clipboard", AccessorParams: any, column?: ColumnComponent) => any; type CustomAccessorParams = {} | ((value: any, data: any, type: "data" | "download" | "clipboard", column?: ColumnComponent) => any); - type ColumnCalc = "avg" | "max" | "min" | "sum" | "concat" | "count" | ((values: Array, data: Array, calcParams: {}) => number); + type ColumnCalc = "avg" | "max" | "min" | "sum" | "concat" | "count" | ((values: any[], data: any[], calcParams: {}) => number); type ColumnCalcParams = (values: any, data: any) => any; type Formatter = "plaintext" | "textarea" | "html" | "money" | "image" | "datetime" | "datetimediff" | "link" | "tickCross" | "color" | "star" | "traffic" | "progress" | "lookup" | "buttonTick" | "buttonCross" | "rownum" | "handle" | ((cell: CellComponent, formatterParams: {}, onRendered: EmptyCallback) => string | HTMLElement); type FormatterParams = MoneyParams | ImageParams | LinkParams | DateTimeParams | DateTimeDifferenceParams | TickCrossParams | TrafficParams | StarRatingParams | JSONRecord | ((cell: CellComponent) => {}); @@ -1035,7 +1014,7 @@ You can pass an optional additional property with sorter, sorterParams that shou type ScrollToColumnPosition = "left" | "center" | "middle" | "right"; interface MoneyParams { - //Money + // Money decimal?: string; thousand?: string; symbol?: string; @@ -1043,12 +1022,12 @@ You can pass an optional additional property with sorter, sorterParams that shou precision?: boolean | number; } interface ImageParams { - //Image + // Image height?: string; width?: string; } interface LinkParams { - //Link + // Link labelField?: string; label?: string; urlPrefix?: string; @@ -1058,21 +1037,21 @@ You can pass an optional additional property with sorter, sorterParams that shou } interface DateTimeParams { - //datetime + // datetime inputFormat?: string; outputFormat?: string; invalidPlaceholder?: true | string | number | ValueStringCallback; } interface DateTimeDifferenceParams extends DateTimeParams { - //Date Time Difference + // Date Time Difference date?: any; humanize?: boolean; unit?: "years" | "months" | "weeks" | "days" | "hours" | "minutes" | "seconds"; suffix?: boolean; } interface TickCrossParams { - //Tick Cross + // Tick Cross allowEmpty?: boolean; allowTruthy?: boolean; tickElement?: boolean | string; @@ -1080,32 +1059,32 @@ You can pass an optional additional property with sorter, sorterParams that shou } interface TrafficParams { - //Traffic + // Traffic min?: number; max?: number; color?: Color; } interface ProgressBarParams extends TrafficParams { - //Progress Bar + // Progress Bar legend?: string | true | ValueStringCallback; legendColor?: Color; legendAlign?: Align; } interface StarRatingParams { - //Star Rating + // Star Rating stars?: number; } interface NumberParams { - //range,number + // range,number min?: number; max?: number; step?: number; } interface CheckboxParams { - //tick + // tick tristate?: boolean; indeterminateValue?: string; } @@ -1120,7 +1099,10 @@ You can pass an optional additional property with sorter, sorterParams that shou value?: string | number | boolean; options?: SelectLabelValue[]; } - type SelectLabelValue = { label: string; value: string | number | boolean }; + interface SelectLabelValue { + label: string; + value: string | number | boolean; + } interface AutoCompleteParams { values: true | string[] | JSONRecord; @@ -1176,96 +1158,63 @@ You can pass an optional additional property with sorter, sorterParams that shou copyToClipboard?: string | boolean; } - //Components------------------------------------------------------------------- - interface CellComponent { - /**The getValue function returns the current value for the cell. */ - getValue: () => any; - /**The getOldValue function returns the previous value of the cell. Very usefull in the event of cell update callbacks. */ - getOldValue: () => any; - /**The restoreOldValue reverts the value of the cell back to its previous value, without triggering any of the cell edit callbacks. */ - restoreOldValue: () => any; - /**The getElement function returns the DOM node for the cell. */ - - getElement: () => HTMLElement; - /**The getTable function returns the Tabulator object for the table containing the cell. */ - getTable: () => Tabulator; - /**The getRow function returns the RowComponent for the row that contains the cell. */ - getRow: () => RowComponent; - - /**The getColumn function returns the ColumnComponent for the column that contains the cell. */ - getColumn: () => ColumnComponent; - - /**The getData function returns the data for the row that contains the cell. */ - getData: () => {}; - /**The getField function returns the field name for the column that contains the cell. */ - getField: () => string; - /**You can change the value of the cell using the setValue function. The first parameter should be the new value for the cell, the second optional parameter will apply the column mutators to the value when set to true (default = true). */ - setValue: (value: any, mutate?: boolean) => void; - /**If you are making manual adjustments to elements contained withing the cell, or the cell itself, it may sometimes be necessary to recalculate the height of all the cells in the row to make sure they remain aligned. Call the checkHeight function to check if the height of the cell has changed and normalize the row if it has. */ - checkHeight: () => void; - /**You and programatically cause a cell to open its editor element using the edit function */ - edit: (ignoreEditable?: boolean) => void; - /**You and programatically cancel a cell edit that is currently in progress by calling the cancelEdit function */ - cancelEdit: () => void; - /**When a cell is being edited it is possible to move the editor focus from the current cell to one if its neighbours. There are a number of functions that can be called on the nav function to move the focus in different directions. */ - nav: () => CellNavigation; - } + // Components------------------------------------------------------------------- interface CellNavigation { - /**prev - next editable cell on the left, if none available move to the right most editable cell on the row above */ + /** prev - next editable cell on the left, if none available move to the right most editable cell on the row above */ prev: () => boolean; - /**next - next editable cell on the right, if none available move to left most editable cell on the row below */ + /** next - next editable cell on the right, if none available move to left most editable cell on the row below */ next: () => boolean; - /**left - next editable cell on the left, return false if none available on row */ + /** left - next editable cell on the left, return false if none available on row */ left: () => boolean; - /**right - next editable cell on the right, return false if none available on row */ + /** right - next editable cell on the right, return false if none available on row */ right: () => boolean; - /**up - move to the same cell in the row above */ + /** up - move to the same cell in the row above */ up: () => void; - /**down - move to the same cell in the row below */ + /** down - move to the same cell in the row below */ down: () => void; } interface RowComponent { - /**The getData function returns the data object for the row.*/ + /** The getData function returns the data object for the row.*/ getData: () => {}; - /**The getElement function returns the DOM node for the row.*/ + /** The getElement function returns the DOM node for the row.*/ getElement: () => HTMLElement; - /**The getTable function returns the Tabulator object for the table containing the row. */ + /** The getTable function returns the Tabulator object for the table containing the row. */ getTable: () => Tabulator; - /**The getNextRow function returns the Row Component for the next visible row in the table, if there is no next row it will return a value of false */ + /** The getNextRow function returns the Row Component for the next visible row in the table, if there is no next row it will return a value of false */ getNextRow: () => RowComponent | false; - /**The getNextRow function returns the Row Component for the previous visible row in the table, if there is no next row it will return a value of false */ + /** The getNextRow function returns the Row Component for the previous visible row in the table, if there is no next row it will return a value of false */ getPrevRow: () => RowComponent | false; - /**The getCells function returns an array of CellComponent objects, one for each cell in the row.*/ - getCells: () => Array; - /**The getCell function returns the CellComponent for the specified column from this row.*/ + /** The getCells function returns an array of CellComponent objects, one for each cell in the row.*/ + getCells: () => CellComponent[]; + /** The getCell function returns the CellComponent for the specified column from this row.*/ getCell: (column: ColumnComponent | HTMLElement | string) => CellComponent; - /**The getIndex function returns the index value for the row. (this is the value from the defined index column, NOT the row's position in the table)*/ + /** The getIndex function returns the index value for the row. (this is the value from the defined index column, NOT the row's position in the table)*/ getIndex: () => any; - /**Use the getPosition function to retrieve the numerical position of a row in the table. By default this will return the position of the row in all data, including data currently filtered out of the table. + /** Use the getPosition function to retrieve the numerical position of a row in the table. By default this will return the position of the row in all data, including data currently filtered out of the table. If you want to get the position of the row in the currently filtered/sorted data, you can pass a value of true to the optional first argument of the function. */ getPosition: (filteredPosition?: boolean) => number; - /**When using grouped rows, you can retrieve the group component for the current row using the getGroup function. */ + /** When using grouped rows, you can retrieve the group component for the current row using the getGroup function. */ getGroup: () => GroupComponent; - /**The delete function deletes the row, removing its data from the table + /** The delete function deletes the row, removing its data from the table * * The delete method returns a promise, this can be used to run any other commands that have to be run after the row has been deleted. By running them in the promise you ensure they are only run after the row has been deleted. */ delete: () => Promise; - /**The scrollTo function will scroll the table to the row if it passes the current filters.*/ + /** The scrollTo function will scroll the table to the row if it passes the current filters.*/ scrollTo: () => Promise; - /**The pageTo function will load the page for the row if it passes the current filters.*/ + /** The pageTo function will load the page for the row if it passes the current filters.*/ pageTo: () => Promise; - /** You can move a row next to another row using the move function. + /** You can move a row next to another row using the move function. The first argument should be the target row that you want to move to, and can be any of the standard row component look up options. @@ -1273,116 +1222,150 @@ You can pass an optional additional property with sorter, sorterParams that shou move: (lookup: RowComponent | HTMLElement | number, belowTarget?: boolean) => void; - /**You can update the data in the row using the update function. You should pass an object to the function containing any fields you wish to update. This object will not replace the row data, only the fields included in the object will be updated.*/ + /** You can update the data in the row using the update function. You should pass an object to the function containing any fields you wish to update. This object will not replace the row data, only the fields included in the object will be updated.*/ update: (data: {}) => Promise; - /**The select function will select the current row.*/ + /** The select function will select the current row.*/ select: () => void; - /**The deselect function will deselect the current row.*/ + /** The deselect function will deselect the current row.*/ deselect: () => void; - /**The deselect function will toggle the current row.*/ + /** The deselect function will toggle the current row.*/ toggleSelect: () => void; - /**The isSelected function will return a boolean representing the current selected state of the row. */ + /** The isSelected function will return a boolean representing the current selected state of the row. */ isSelected: () => boolean; - /**If you are making manual adjustments to elements contained within the row, it may sometimes be necessary to recalculate the height of all the cells in the row to make sure they remain aligned. Call the normalizeHeight function to do this.*/ + /** If you are making manual adjustments to elements contained within the row, it may sometimes be necessary to recalculate the height of all the cells in the row to make sure they remain aligned. Call the normalizeHeight function to do this.*/ normalizeHeight: () => void; - /**If you want to re-format a row once it has been rendered to re-trigger the cell formatters and the rowFormatter callback, Call the reformat function. */ + /** If you want to re-format a row once it has been rendered to re-trigger the cell formatters and the rowFormatter callback, Call the reformat function. */ reformat: () => void; - /**You can freeze a row at the top of the table by calling the freeze function. This will insert the row above the scrolling portion of the table in the table header. */ + /** You can freeze a row at the top of the table by calling the freeze function. This will insert the row above the scrolling portion of the table in the table header. */ freeze: () => void; - /**A frozen row can be unfrozen using the unfreeze function. This will remove the row from the table header and re-insert it back in the table. */ + /** A frozen row can be unfrozen using the unfreeze function. This will remove the row from the table header and re-insert it back in the table. */ unfreeze: () => void; - /**When the tree structure is enabled the treeExpand function will expand current row and show its children. */ + /** When the tree structure is enabled the treeExpand function will expand current row and show its children. */ treeExpand: () => void; - /**When the tree structure is enabled the treeCollapse function will collapse current row and hide its children */ + /** When the tree structure is enabled the treeCollapse function will collapse current row and hide its children */ treeCollapse: () => void; - /**When the tree structure is enabled the treeToggle function will toggle the collapsed state of the current row. */ + /** When the tree structure is enabled the treeToggle function will toggle the collapsed state of the current row. */ treeToggle: () => void; - /**When the tree structure is enabled the getTreeParent function will return the Row Component for the parent of this row. If no parent exists, a value of false will be returned. */ + /** When the tree structure is enabled the getTreeParent function will return the Row Component for the parent of this row. If no parent exists, a value of false will be returned. */ getTreeParent: () => RowComponent | false; - /**When the tree structure is enabled the getTreeChildren function will return an array of Row Components for this rows children. */ + /** When the tree structure is enabled the getTreeChildren function will return an array of Row Components for this rows children. */ getTreeChildren: () => RowComponent[]; } interface GroupComponent { - /**The getElement function returns the DOM node for the group header. */ + /** The getElement function returns the DOM node for the group header. */ getElement: () => HTMLElement; - /**The getTable function returns the Tabulator object for the table containing the group */ + /** The getTable function returns the Tabulator object for the table containing the group */ getTable: () => Tabulator; - /**The getKey function returns the unique key that is shared between all rows in this group. */ + /** The getKey function returns the unique key that is shared between all rows in this group. */ getKey: () => any; - /**The getRows function returns an array of RowComponent objects, one for each row in the group */ + /** The getRows function returns an array of RowComponent objects, one for each row in the group */ getRows: () => RowComponent[]; - /**The getSubGroups function returns an array of GroupComponent objects, one for each sub group of this group. */ + /** The getSubGroups function returns an array of GroupComponent objects, one for each sub group of this group. */ getSubGroups: () => GroupComponent[]; - /**The getParentGroup function returns the GroupComponent for the parent group of this group. if no parent exists, this function will return false */ + /** The getParentGroup function returns the GroupComponent for the parent group of this group. if no parent exists, this function will return false */ getParentGroup: () => GroupComponent | false; - /** The getVisibility function returns a boolean to show if the group is visible, a value of true means it is visible.*/ + /** The getVisibility function returns a boolean to show if the group is visible, a value of true means it is visible.*/ getVisibility: () => boolean; - /**The show function shows the group if it is hidden. */ + /** The show function shows the group if it is hidden. */ show: () => void; - /**The hide function hides the group if it is visible. */ + /** The hide function hides the group if it is visible. */ hide: () => void; - /**The toggle function toggles the visibility of the group, switching between hidden and visible. */ + /** The toggle function toggles the visibility of the group, switching between hidden and visible. */ toggle: () => void; } interface ColumnComponent { /*The getElement function returns the DOM node for the colum*/ getElement: () => HTMLElement; - /**The getTable function returns the Tabulator object for the table containing the column */ + /** The getTable function returns the Tabulator object for the table containing the column */ getTable: () => Tabulator; - /**The getDefinition function returns the column definition object for the column.*/ + /** The getDefinition function returns the column definition object for the column.*/ getDefinition: () => ColumnDefinition; - /**The getField function returns the field name for the column.*/ + /** The getField function returns the field name for the column.*/ getField: () => string; - /**The getCells function returns an array of CellComponent objects, one for each cell in the column.*/ - getCells: () => Array; + /** The getCells function returns an array of CellComponent objects, one for each cell in the column.*/ + getCells: () => CellComponent[]; - /**The getNextColumn function returns the Column Component for the next visible column in the table, if there is no next column it will return a value of false. */ + /** The getNextColumn function returns the Column Component for the next visible column in the table, if there is no next column it will return a value of false. */ getNextColumn: () => ColumnComponent | false; - /**The getPrevColumn function returns the Column Component for the previous visible column in the table, if there is no previous column it will return a value of false. */ + /** The getPrevColumn function returns the Column Component for the previous visible column in the table, if there is no previous column it will return a value of false. */ getPrevColumn: () => ColumnComponent | false; - /**The getVisibility function returns a boolean to show if the column is visible, a value of true means it is visible.*/ + /** The getVisibility function returns a boolean to show if the column is visible, a value of true means it is visible.*/ getVisibility: () => boolean; - /**The show function shows the column if it is hidden.*/ + /** The show function shows the column if it is hidden.*/ show: () => void; - /**The hide function hides the column if it is visible.*/ + /** The hide function hides the column if it is visible.*/ hide: () => void; - /**The toggle function toggles the visibility of the column, switching between hidden and visible.*/ + /** The toggle function toggles the visibility of the column, switching between hidden and visible.*/ toggle: () => void; - /**The delete function deletes the column, removing it from the table*/ + /** The delete function deletes the column, removing it from the table*/ delete: () => void; - /**The scrollTo function will scroll the table to the column if it is visible. */ + /** The scrollTo function will scroll the table to the column if it is visible. */ scrollTo: () => Promise; - /**The getSubColumns function returns an array of ColumnComponent objects, one for each sub column of this column. */ + /** The getSubColumns function returns an array of ColumnComponent objects, one for each sub column of this column. */ getSubColumns: () => ColumnComponent[]; - /**The getParentColumn function returns the ColumnComponent for the parent column of this column. if no parent exists, this function will return false */ + /** The getParentColumn function returns the ColumnComponent for the parent column of this column. if no parent exists, this function will return false */ getParentColumn: () => ColumnComponent | false; - /**The headerFilterFocus function will place focus on the header filter element for this column if it exists. */ + /** The headerFilterFocus function will place focus on the header filter element for this column if it exists. */ headerFilterFocus: () => void; - /**The setHeaderFilterValue function set the value of the columns header filter element to the value provided in the first argument. */ + /** The setHeaderFilterValue function set the value of the columns header filter element to the value provided in the first argument. */ setHeaderFilterValue: (value: any) => void; - /**The reloadHeaderFilter function rebuilds the header filter element, updating any params passed into the editor used to generate the filter. */ + /** The reloadHeaderFilter function rebuilds the header filter element, updating any params passed into the editor used to generate the filter. */ reloadHeaderFilter: () => void; } + + interface CellComponent { + /** The getValue function returns the current value for the cell. */ + getValue: () => any; + /** The getOldValue function returns the previous value of the cell. Very usefull in the event of cell update callbacks. */ + getOldValue: () => any; + /** The restoreOldValue reverts the value of the cell back to its previous value, without triggering any of the cell edit callbacks. */ + restoreOldValue: () => any; + /** The getElement function returns the DOM node for the cell. */ + + getElement: () => HTMLElement; + /** The getTable function returns the Tabulator object for the table containing the cell. */ + getTable: () => Tabulator; + /** The getRow function returns the RowComponent for the row that contains the cell. */ + getRow: () => RowComponent; + + /** The getColumn function returns the ColumnComponent for the column that contains the cell. */ + getColumn: () => ColumnComponent; + + /** The getData function returns the data for the row that contains the cell. */ + getData: () => {}; + /** The getField function returns the field name for the column that contains the cell. */ + getField: () => string; + /** You can change the value of the cell using the setValue function. The first parameter should be the new value for the cell, the second optional parameter will apply the column mutators to the value when set to true (default = true). */ + setValue: (value: any, mutate?: boolean) => void; + /** If you are making manual adjustments to elements contained withing the cell, or the cell itself, it may sometimes be necessary to recalculate the height of all the cells in the row to make sure they remain aligned. Call the checkHeight function to check if the height of the cell has changed and normalize the row if it has. */ + checkHeight: () => void; + /** You and programatically cause a cell to open its editor element using the edit function */ + edit: (ignoreEditable?: boolean) => void; + /** You and programatically cancel a cell edit that is currently in progress by calling the cancelEdit function */ + cancelEdit: () => void; + /** When a cell is being edited it is possible to move the editor focus from the current cell to one if its neighbours. There are a number of functions that can be called on the nav function to move the focus in different directions. */ + nav: () => CellNavigation; + } } -//Tabulator.prototype.(?!registerModule|helpers|_)\w+ +// Tabulator.prototype.(?!registerModule|helpers|_)\w+ declare class Tabulator { constructor(selector: string | HTMLElement, options?: Tabulator.Options); @@ -1394,12 +1377,12 @@ declare class Tabulator { modules: any; options: Tabulator.Options; - /**You have a choice of four file types to choose from: + /** You have a choice of four file types to choose from: csv - Comma separated value file json - JSON formatted text file xlsx - Excel File (Requires the SheetJS Library) pdf - PDF File (Requires the jsPDF Library and jsPDF-AutoTable Plugin) - To trigger a download, call the download function, passing the file type (from the above list) as the first argument, and an optional second argument of the file name for the download (if this is left out it will be "Tabulator.ext"). The optional third argument is an object containing any setup options for the formatter, such as the delimiter choice for CSV's). + To trigger a download, call the download function, passing the file type (from the above list) as the first argument, and an optional second argument of the file name for the download (if this is left out it will be "Tabulator.ext"). The optional third argument is an object containing any setup options for the formatter, such as the delimiter choice for CSV's). The PDF downloader requires that the jsPDF Library and jsPDF-AutoTable Plugin be included on your site, this can be included with the following script tags. @@ -1407,84 +1390,84 @@ declare class Tabulator { */ download: (downloadType: Tabulator.DownloadType | ((columns: Tabulator.ColumnDefinition[], data: any, options: any, setFileContents: any) => any), fileName: string, params?: Tabulator.DownloadOptions) => void; - /**If you want to open the generated file in a new browser tab rather than downloading it straight away, you can use the downloadToTab function. This is particularly useful with the PDF downloader, as it allows you to preview the resulting PDF in a new browser ta */ + /** If you want to open the generated file in a new browser tab rather than downloading it straight away, you can use the downloadToTab function. This is particularly useful with the PDF downloader, as it allows you to preview the resulting PDF in a new browser ta */ downloadToTab: (downloadType: Tabulator.DownloadType, fileName: string, params?: Tabulator.DownloadOptions) => void; - /**The copyToClipboard function allows you to copy the current table data to the clipboard. + /** The copyToClipboard function allows you to copy the current table data to the clipboard. The first argument is the copy selector, you can choose from any of the built in options or pass a function in to the argument, that must return the selected row components. If you leave this argument undefined, Tabulator will use the value of the clipboardCopySelector property, which has a default value of table */ copyToClipboard: (type: "selection" | "table") => void; - /**With history enabled you can use the undo function to automatically undo a user action, the more times you call the function, the further up the history log you go. */ + /** With history enabled you can use the undo function to automatically undo a user action, the more times you call the function, the further up the history log you go. */ undo: () => boolean; - /**You can use the getHistoryUndoSize function to get a count of the number of history undo actions available. */ + /** You can use the getHistoryUndoSize function to get a count of the number of history undo actions available. */ getHistoryUndoSize: () => number | false; - /**With history enabled you can use the redo function to automatically redo user action that has been undone, the more times you call the function, the further up the history log you go. once a user interacts with the table then can no longer redo any further actions until an undo is performe */ + /** With history enabled you can use the redo function to automatically redo user action that has been undone, the more times you call the function, the further up the history log you go. once a user interacts with the table then can no longer redo any further actions until an undo is performe */ redo: () => boolean; - /**You can use the getHistoryRedoSize function to get a count of the number of history redo actions available.*/ + /** You can use the getHistoryRedoSize function to get a count of the number of history redo actions available.*/ getHistoryRedoSize: () => number | false; - /**Deconstructor */ + /** Deconstructor */ destroy: () => void; - /**By default Tabulator will only allow files with a .json extension to be loaded into the table. + /** By default Tabulator will only allow files with a .json extension to be loaded into the table. You can allow any other type of file into the file picker by passing the extension or mime type into the first argument of the setDataFromLocalFile function as a comma separated list. This argument will accept any of the values valid for the accept field of an input element */ setDataFromLocalFile: (extensions: string) => void; setData: (data: any, params?: any, config?: any) => Promise; - /**You can remove all data from the table using clearData */ + /** You can remove all data from the table using clearData */ clearData: () => void; - /**You can retrieve the data stored in the table using the getData function. */ + /** You can retrieve the data stored in the table using the getData function. */ getData: (activeOnly?: boolean) => any[]; getDataCount: (activeOnly?: boolean) => number; - /**The searchRows function allows you to retreive an array of row components that match any filters you pass in. it accepts the same arguments as the setFilter function. */ + /** The searchRows function allows you to retreive an array of row components that match any filters you pass in. it accepts the same arguments as the setFilter function. */ searchRows: Tabulator.FilterFunction; - /**The searchData function allows you to retreive an array of table row data that match any filters you pass in. it accepts the same arguments as the setFilter function. */ + /** The searchData function allows you to retreive an array of table row data that match any filters you pass in. it accepts the same arguments as the setFilter function. */ searchData: Tabulator.FilterFunction; - /**You can retrieve the table data as a simple HTML table using the getHtml function. */ + /** You can retrieve the table data as a simple HTML table using the getHtml function. */ getHtml: (activeOnly?: boolean) => void; - /**You can retrieve the current AJAX URL of the table with the getAjaxUrl function. + /** You can retrieve the current AJAX URL of the table with the getAjaxUrl function. * * This will return a HTML encoded string of the table data. By default getHtml will return a table containing all the data held in the Tabulator. If you only want to access the currently filtered/sorted elements, you can pass a value of true to the first argument of the function. */ getAjaxUrl: () => string; - /**The replaceData function lets you silently replace all data in the table without updating scroll position, sort or filtering, and without triggering the ajax loading popup. This is great if you have a table you want to periodically update with new/updated information without alerting the user to a change. + /** The replaceData function lets you silently replace all data in the table without updating scroll position, sort or filtering, and without triggering the ajax loading popup. This is great if you have a table you want to periodically update with new/updated information without alerting the user to a change. It takes the same arguments as the setData function, and behaves in the same way when loading data (ie, it can make ajax requests, parse JSON etc) */ - replaceData: (data?: {}[] | string, params?: any, config?: any) => Promise; - /**If you want to update an existing set of data in the table, without completely replacing the data as the setData method would do, you can use the updateData method. + replaceData: (data?: Array<{}> | string, params?: any, config?: any) => Promise; + /** If you want to update an existing set of data in the table, without completely replacing the data as the setData method would do, you can use the updateData method. This function takes an array of row objects and will update each row based on its index value. (the index defaults to the "id" parameter, this can be set using the index option in the tabulator constructor). Options without an index will be ignored, as will items with an index that is not already in the table data. The addRow function should be used to add new data to the table. */ - updateData: (data: {}[]) => Promise; - /**The addData method returns a promise, this can be used to run any other commands that have to be run after the data has been loaded into the table. By running them in the promise you ensure they are only run after the table has loaded the data. */ - addData: (data?: {}[], addToTop?: boolean, positionTarget?: Tabulator.RowLookup) => Promise; + updateData: (data: Array<{}>) => Promise; + /** The addData method returns a promise, this can be used to run any other commands that have to be run after the data has been loaded into the table. By running them in the promise you ensure they are only run after the table has loaded the data. */ + addData: (data?: Array<{}>, addToTop?: boolean, positionTarget?: Tabulator.RowLookup) => Promise; - /**If the data you are passng to the table contains a mix of existing rows to be updated and new rows to be added then you can call the updateOrAddData function. This will check each row object provided and update the existing row if available, or else create a new row with the data. */ - updateOrAddData: (data: {}[]) => Promise; - /**To rereive the DOM Node of a specific row, you can retrieve the RowComponent with the getRow function, then use the getElement function on the component. The first argument is the row you are looking for, it will take any of the standard row component look up options. */ + /** If the data you are passng to the table contains a mix of existing rows to be updated and new rows to be added then you can call the updateOrAddData function. This will check each row object provided and update the existing row if available, or else create a new row with the data. */ + updateOrAddData: (data: Array<{}>) => Promise; + /** To rereive the DOM Node of a specific row, you can retrieve the RowComponent with the getRow function, then use the getElement function on the component. The first argument is the row you are looking for, it will take any of the standard row component look up options. */ getRow: (row: Tabulator.RowLookup) => Tabulator.RowComponent; - /**You can retrieve the Row Component of a row at a given position in the table using getRowFromPosition function. By default this will return the row based in its position in all table data, including data currently filtered out of the table. + /** You can retrieve the Row Component of a row at a given position in the table using getRowFromPosition function. By default this will return the row based in its position in all table data, including data currently filtered out of the table. If you want to get a row based on its position in the currently filtered/sorted data, you can pass a value of true to the optional second argument of the function. */ getRowFromPosition: (position: number, activeOnly?: boolean) => void; - /**You can delete any row in the table using the deleteRow function. */ + /** You can delete any row in the table using the deleteRow function. */ deleteRow: (row: Tabulator.RowLookup) => void; - /**You can add a row to the table using the addRow function. + /** You can add a row to the table using the addRow function. The first argument should be a row data object. If you do not pass data for a column, it will be left empty. To create a blank row (ie for a user to fill in), pass an empty object to the function. The second argument is optional and determines whether the row is added to the top or bottom of the table. A value of true will add the row to the top of the table, a value of false will add the row to the bottom of the table. If the parameter is not set the row will be placed according to the addRowPos global option. */ addRow: (data?: {}, addToTop?: boolean, positionTarget?: Tabulator.RowLookup) => Promise; - /**If you don't know whether a row already exists you can use the updateOrAddRow function. This will check if a row with a matching index exists, if it does it will update it, if not it will add a new row with that data. This takes the same arguments as the updateRow function. */ + /** If you don't know whether a row already exists you can use the updateOrAddRow function. This will check if a row with a matching index exists, if it does it will update it, if not it will add a new row with that data. This takes the same arguments as the updateRow function. */ updateOrAddRow: (row: Tabulator.RowLookup, data: {}) => Promise; - /**You can update any row in the table using the updateRow function. + /** You can update any row in the table using the updateRow function. The first argument is the row you want to update, it will take any of the standard row component look up options. @@ -1495,7 +1478,7 @@ declare class Tabulator { This function will return true if the update was successful or false if the requested row could not be found. If the new data matches the existing row data, no update will be performed. */ updateRow: (row: Tabulator.RowLookup, data: {}) => boolean; - /**If you want to trigger an animated scroll to a row then you can use the scrollToRow function. + /** If you want to trigger an animated scroll to a row then you can use the scrollToRow function. The first argument should be any of the standard row component look up options for the row you want to scroll to. @@ -1503,7 +1486,7 @@ declare class Tabulator { The third argument is optional, and is a boolean used to set if the table should scroll if the row is already visible, true to scroll, false to not, if omitted it will be set to the value of the scrollToRowIfVisible option, which defaults to true */ scrollToRow: (row: Tabulator.RowLookup, position?: Tabulator.ScrollToRowPostition, ifVisible?: boolean) => Promise; - /**If you want to programmatically move a row to a new position you can use the moveRow function. + /** If you want to programmatically move a row to a new position you can use the moveRow function. The first argument should be the row you want to move, and can be any of the standard row component look up options. @@ -1511,116 +1494,114 @@ declare class Tabulator { The third argument determines whether the row is moved to above or below the target row. A value of false will cause to the row to be placed below the target row, a value of true will result in the row being placed above the target */ moveRow: (fromRow: Tabulator.RowLookup, toRow: Tabulator.RowLookup, placeAboveTarget?: boolean) => void; - /**You can retrieve all the row components in the table using the getRows function. - * By default getRows will return an array containing all the Row Component's held in the Tabulator. If you only want to access the currently filtered/sorted elements, you can pass a value of true to the first argument of the function. + /** You can retrieve all the row components in the table using the getRows function.* By default getRows will return an array containing all the Row Component's held in the Tabulator. If you only want to access the currently filtered/sorted elements, you can pass a value of true to the first argument of the function. */ getRows: (activeOnly?: boolean) => Tabulator.RowComponent[]; - /**Use the getRowPosition function to retrieve the numerical position of a row in the table. By default this will return the position of the row in all data, including data currently filtered out of the table. + /** Use the getRowPosition function to retrieve the numerical position of a row in the table. By default this will return the position of the row in all data, including data currently filtered out of the table. The first argument is the row you are looking for, it will take any of the standard row component look up options. If you want to get the position of the row in the currently filtered/sorted data, you can pass a value of true to the optional second argument of the function. Note: If the row is not found, a value of -1 will be returned, row positions start at 0 */ getRowPosition: (row: Tabulator.RowLookup, activeOnly?: boolean) => number; - /**To replace the current column definitions for a table use the setColumns function. This function takes a column definition array as its only argument. */ + /** To replace the current column definitions for a table use the setColumns function. This function takes a column definition array as its only argument. */ setColumns: (definitions: Tabulator.ColumnDefinition[]) => void; - /**To get an array of Column Components for the current table setup, call the getColumns function. This will only return actual data columns not column groups. - * - * To get a structured array of Column Components that includes column groups, pass a value of true as an argument. + /** To get an array of Column Components for the current table setup, call the getColumns function. This will only return actual data columns not column groups. + ** To get a structured array of Column Components that includes column groups, pass a value of true as an argument. */ getColumns: (includeColumnGroups?: boolean) => Tabulator.ColumnComponent[] | Tabulator.GroupComponent[]; - /**Using the getColumn function you can retrieve the Column Component */ + /** Using the getColumn function you can retrieve the Column Component */ getColumn: (column: Tabulator.ColumnLookup) => Tabulator.ColumnComponent; - /**To get the current column definition array (including any changes made through user actions, such as resizing or re-ordering columns), call the getColumnDefinitions function. this will return the current columns definition array. */ + /** To get the current column definition array (including any changes made through user actions, such as resizing or re-ordering columns), call the getColumnDefinitions function. this will return the current columns definition array. */ getColumnDefinitions: () => Tabulator.ColumnDefinition[]; - /**If you want to handle column layout persistence manually, for example storing it in a database to use elsewhere, you can use the getColumnLayout function to retrieve a layout object for the current table. */ + /** If you want to handle column layout persistence manually, for example storing it in a database to use elsewhere, you can use the getColumnLayout function to retrieve a layout object for the current table. */ getColumnLayout: () => Tabulator.ColumnLayout[]; - /**If you have previously used the getColumnLayout function to retrieve a tables layout, you can use the setColumnLayout function to apply it to a table. */ + /** If you have previously used the getColumnLayout function to retrieve a tables layout, you can use the setColumnLayout function to apply it to a table. */ setColumnLayout: (layout: Tabulator.ColumnLayout) => void; - /**You can show a hidden column at any point using the showColumn function. */ + /** You can show a hidden column at any point using the showColumn function. */ showColumn: (column?: Tabulator.ColumnLookup) => void; - /**You can hide a visible column at any point using the hideColumn function. */ + /** You can hide a visible column at any point using the hideColumn function. */ hideColumn: (column?: Tabulator.ColumnLookup) => void; - /**You can toggle the visibility of a column at any point using the toggleColumn function. */ + /** You can toggle the visibility of a column at any point using the toggleColumn function. */ toggleColumn: (column?: Tabulator.ColumnLookup) => void; - /**If you wish to add a single column to the table, you can do this using the addColumn function. + /** If you wish to add a single column to the table, you can do this using the addColumn function. * This function takes three arguments: Columns Definition - The column definition object for the column you want to add. Before (optional) - Determines how to position the new column. A value of true will insert the column to the left of existing columns, a value of false will insert it to the right. If a Position argument is supplied then this will determine whether the new colum is inserted before or after this column. Position (optional) - The field to insert the new column next to, this can be any of the standard column component look up options. - * +* */ addColumn: (definition: Tabulator.ColumnDefinition, insertRightOfTarget?: boolean, positionTarget?: Tabulator.ColumnLookup) => void; - /**To permanently remove a column from the table deleteColumn function. This function takes any of the standard column component look up options as its first parameter */ + /** To permanently remove a column from the table deleteColumn function. This function takes any of the standard column component look up options as its first parameter */ deleteColumn: (column: Tabulator.ColumnLookup) => void; - /**If you want to trigger an animated scroll to a column then you can use the scrollToColumn function. The first argument should be any of the standard column component look up options for the column you want to scroll to. + /** If you want to trigger an animated scroll to a column then you can use the scrollToColumn function. The first argument should be any of the standard column component look up options for the column you want to scroll to. The second argument is optional, and is used to set the position of the column, it should be a string with a value of either left, middle or right, if omitted it will be set to the value of the scrollToColumnPosition option which has a default value of left. The third argument is optional, and is a boolean used to set if the table should scroll if the column is already visible, true to scroll, false to not, if omitted it will be set to the value of the scrollToColumnIfVisible option, which defaults to true */ scrollToColumn: (column: Tabulator.ColumnLookup, position?: Tabulator.ScrollToColumnPosition, ifVisible?: boolean) => Promise; - /**You can also set the language at any point after the table has loaded using the setLocale function, which takes the same range of values as the locale setup option mentioned above. */ + /** You can also set the language at any point after the table has loaded using the setLocale function, which takes the same range of values as the locale setup option mentioned above. */ setLocale: (locale: string | boolean) => void; - /**It is possible to retrieve the locale code currently being used by Tabulator using the getLocale function: */ + /** It is possible to retrieve the locale code currently being used by Tabulator using the getLocale function: */ getLocale: () => string; - /**You can then access these at any point using the getLang function, which will return the language object for the currently active locale. */ + /** You can then access these at any point using the getLang function, which will return the language object for the currently active locale. */ getLang: (locale?: string) => any; - /**If the size of the element containing the Tabulator changes (and you are not able to use the in built auto-resize functionality) or you create a table before its containing element is visible, it will necessary to redraw the table to make sure the rows and columns render correctly. + /** If the size of the element containing the Tabulator changes (and you are not able to use the in built auto-resize functionality) or you create a table before its containing element is visible, it will necessary to redraw the table to make sure the rows and columns render correctly. This can be done by calling the redraw method. For example, to trigger a redraw whenever the viewport width is changed. The redraw function also has an optional boolean argument that when set to true triggers a full rerender of the table including all data on all rows.*/ redraw: (force?: boolean) => void; - /**If you want to manually change the height of the table at any time, you can use the setHeight function, which will also redraw the virtual DOM if necessary. */ + /** If you want to manually change the height of the table at any time, you can use the setHeight function, which will also redraw the virtual DOM if necessary. */ setHeight: (height: number) => void; - /**You can trigger sorting using the setSort function */ + /** You can trigger sorting using the setSort function */ setSort: (sortList: string | Tabulator.Sorter[], dir?: Tabulator.SortDirection) => void; getSorters: () => void; - /**To remove all sorting from the table, call the clearSort function. */ + /** To remove all sorting from the table, call the clearSort function. */ clearSort: () => void; - /**To set a filter you need to call the setFilter method, passing the field you wish to filter, the comparison type and the value to filter for. + /** To set a filter you need to call the setFilter method, passing the field you wish to filter, the comparison type and the value to filter for. This function will replace any exiting filters on the table with the specified filter If you want to perform a more complicated filter then you can pass a callback function to the setFilter method, you can also pass an optional second argument, an object with parameters to be passed to the filter function. */ setFilter: (p1: string | Tabulator.Filter[] | any[] | ((data: any, filterParams: any) => boolean), p2?: Tabulator.FilterType | {}, value?: any) => void; - /**If you want to add another filter to the existing filters then you can call the addFilter function: */ + /** If you want to add another filter to the existing filters then you can call the addFilter function: */ addFilter: Tabulator.FilterFunction; - /**You can retrieve an array of the current programtic filters using the getFilters function, this will not include any of the header filters: */ + /** You can retrieve an array of the current programtic filters using the getFilters function, this will not include any of the header filters: */ getFilters: (includeHeaderFilters: boolean) => Tabulator.Filter[]; - /**You can programatically set the header filter value of a column by calling the setHeaderFilterValue function, This function takes any of the standard column component look up options as its first parameter, with the value for the header filter as the second option */ + /** You can programatically set the header filter value of a column by calling the setHeaderFilterValue function, This function takes any of the standard column component look up options as its first parameter, with the value for the header filter as the second option */ setHeaderFilterValue: (column: Tabulator.ColumnLookup, value: string) => void; - /**You can programatically set the focus on a header filter element by calling the setHeaderFilterFocus function, This function takes any of the standard column component look up options as its first parameter */ + /** You can programatically set the focus on a header filter element by calling the setHeaderFilterFocus function, This function takes any of the standard column component look up options as its first parameter */ setHeaderFilterFocus: (column: Tabulator.ColumnLookup) => void; - /**If you just want to retrieve the current header filters, you can use the getHeaderFilters function: */ + /** If you just want to retrieve the current header filters, you can use the getHeaderFilters function: */ getHeaderFilters: () => Tabulator.Filter[]; - /**If you want to remove one filter from the current list of filters you can use the removeFilter function: */ + /** If you want to remove one filter from the current list of filters you can use the removeFilter function: */ removeFilter: Tabulator.FilterFunction; - /**To remove all filters from the table, use the clearFilter function. */ + /** To remove all filters from the table, use the clearFilter function. */ clearFilter: (includeHeaderFilters: boolean) => void; - /**To remove just the header filters, leaving the programatic filters in place, use the clearHeaderFilter function. */ + /** To remove just the header filters, leaving the programatic filters in place, use the clearHeaderFilter function. */ clearHeaderFilter: () => void; - /**To programmatically select a row you can use the selectRow function. + /** To programmatically select a row you can use the selectRow function. To select a specific row you can pass the any of the standard row component look up options into the first argument of the function. If you leave the argument blank you will select all rows (if you have set the selectable option to a numeric value, it will be ignored when selecting all rows). */ selectRow: (row?: Tabulator.RowLookup) => void; deselectRow: (row?: Tabulator.RowLookup) => void; toggleSelectRow: (row?: Tabulator.RowLookup) => void; - /**To get the RowComponent's for the selected rows at any time you can use the getSelectedRows function. + /** To get the RowComponent's for the selected rows at any time you can use the getSelectedRows function. This will return an array of RowComponent's for the selected rows in the order in which they were selected. */ getSelectedRows: () => Tabulator.RowComponent[]; - /**To get the data objects for the selected rows you can use the getSelectedData function. + /** To get the data objects for the selected rows you can use the getSelectedData function. This will return an array of the selected rows data objects in the order in which they were selected */ getSelectedData: () => any[]; - /**set the maxmum page */ + /** set the maxmum page */ setMaxPage: (max: number) => void; - /**When pagination is enabled the table footer will contain a number of pagination controls for navigating through the data. + /** When pagination is enabled the table footer will contain a number of pagination controls for navigating through the data. In addition to these controls it is possible to change page using the setPage function The setPage function takes one parameter, which should be an integer representing the page you wish to see. There are also four strings that you can pass into the parameter for special functions. @@ -1632,43 +1613,40 @@ declare class Tabulator { The setPage method returns a promise, this can be used to run any other commands that have to be run after the data has been loaded into the table. By running them in the promise you ensure they are only run after the table has loaded the data. */ setPage: (page: number | "first" | "prev" | "next" | "last") => Promise; - /**You can load the page for a specific row using the setPageToRow function and passing in any of the standard row component look up options for the row you want to scroll to. - * - * The setPageToRow method returns a promise, this can be used to run any other commands that have to be run after the data has been loaded into the table. By running them in the promise you ensure they are only run after the table has loaded the data. + /** You can load the page for a specific row using the setPageToRow function and passing in any of the standard row component look up options for the row you want to scroll to. + ** The setPageToRow method returns a promise, this can be used to run any other commands that have to be run after the data has been loaded into the table. By running them in the promise you ensure they are only run after the table has loaded the data. */ setPageToRow: (row: Tabulator.RowLookup) => Promise; - /**You can change the page size at any point by using the setPageSize function. (this setting will be ignored if using remote pagination with the page size set by the server) */ + /** You can change the page size at any point by using the setPageSize function. (this setting will be ignored if using remote pagination with the page size set by the server) */ setPageSize: (size: number) => void; - /**To retrieve the number of rows allowed per page you can call the getPageSize function: */ + /** To retrieve the number of rows allowed per page you can call the getPageSize function: */ getPageSize: () => number; - /**You can change to show the previous page using the previousPage function. */ + /** You can change to show the previous page using the previousPage function. */ previousPage: () => Promise; - /**You can change to show the next page using the previousPage function. */ + /** You can change to show the next page using the previousPage function. */ nextPage: () => Promise; - /**To retrieve the current page use the getPage function. this will return the number of the current page. If pagination is disabled this will return false. */ + /** To retrieve the current page use the getPage function. this will return the number of the current page. If pagination is disabled this will return false. */ getPage: () => number | false; - /**To retrieve the maximum available page use the getPageMax function. this will return the number of the maximum available page. If pagination is disabled this will return false. */ + /** To retrieve the maximum available page use the getPageMax function. this will return the number of the maximum available page. If pagination is disabled this will return false. */ getPageMax: () => number | false; - /**You can use the setGroupBy function to change the fields that rows are grouped by. This function has one argument and takes the same values as passed to the groupBy setup option. */ + /** You can use the setGroupBy function to change the fields that rows are grouped by. This function has one argument and takes the same values as passed to the groupBy setup option. */ setGroupBy: (groups: string | ((data: any) => any)) => void; - /**You can use the setGroupStartOpen function to change the default open state of groups. This function has one argument and takes the same values as passed to the groupStartOpen setup option. - * - * Note: If you use the setGroupStartOpen or setGroupHeader before you have set any groups on the table, the table will not update until the setGroupBy function is called. + /** You can use the setGroupStartOpen function to change the default open state of groups. This function has one argument and takes the same values as passed to the groupStartOpen setup option. + ** Note: If you use the setGroupStartOpen or setGroupHeader before you have set any groups on the table, the table will not update until the setGroupBy function is called. */ setGroupStartOpen: (values: boolean | ((value: any, count: number, data: any, group: Tabulator.GroupComponent) => boolean)) => void; - /**You can use the setGroupHeader function to change the header generation function for each group. This function has one argument and takes the same values as passed to the groupHeader setup option. */ - setGroupHeader: (values: ((value: any, count: number, data: any, group: Tabulator.GroupComponent) => string) | ((value: any, count: number, data: any) => string)[]) => void; - /**You can use the getGroups function to retrieve an array of all the first level Group Components in the table. */ + /** You can use the setGroupHeader function to change the header generation function for each group. This function has one argument and takes the same values as passed to the groupHeader setup option. */ + setGroupHeader: (values: ((value: any, count: number, data: any, group: Tabulator.GroupComponent) => string) | Array<(value: any, count: number, data: any) => string>) => void; + /** You can use the getGroups function to retrieve an array of all the first level Group Components in the table. */ getGroups: () => Tabulator.GroupComponent[]; - /**get grouped table data in the same format as getData() */ + /** get grouped table data in the same format as getData() */ getGroupedData: (activeOnly?: boolean) => any; - /**You can retrieve the results of the column calculations at any point using the getCalcResults function. - * For a table without grouped rows, this will return an object with top and bottom properties, that contain a row data object for all the columns in the table for the top calculations and bottom calculations respectively. + /** You can retrieve the results of the column calculations at any point using the getCalcResults function.* For a table without grouped rows, this will return an object with top and bottom properties, that contain a row data object for all the columns in the table for the top calculations and bottom calculations respectively. */ getCalcResults: () => any; - /**Use the navigatePrev function to shift focus to the next editable cell on the left, if none available move to the right most editable cell on the row above. + /** Use the navigatePrev function to shift focus to the next editable cell on the left, if none available move to the right most editable cell on the row above. * * Note: These actions will only work when a cell is editable and has focus. @@ -1676,31 +1654,28 @@ declare class Tabulator { * */ navigatePrev: () => void; - /**Use the navigateNext function to shift focus to the next editable cell on the right, if none available move to left most editable cell on the row below. - * + /** Use the navigateNext function to shift focus to the next editable cell on the right, if none available move to left most editable cell on the row below.* * Note: These actions will only work when a cell is editable and has focus. Note: Navigation commands will only focus on editable cells, that is cells with an editor and if present an editable function that returns true. * */ navigateNext: () => void; - /**Use the navigateLeft function to shift focus to next editable cell on the left, return false if none available on row. - * + /** Use the navigateLeft function to shift focus to next editable cell on the left, return false if none available on row.* * Note: These actions will only work when a cell is editable and has focus. Note: Navigation commands will only focus on editable cells, that is cells with an editor and if present an editable function that returns true. * */ navigateLeft: () => void; - /**Use the navigateRight function to shift focus to next editable cell on the right, return false if none available on row. - * + /** Use the navigateRight function to shift focus to next editable cell on the right, return false if none available on row.* * Note: These actions will only work when a cell is editable and has focus. Note: Navigation commands will only focus on editable cells, that is cells with an editor and if present an editable function that returns true. * */ navigateRight: () => void; - /**Use the navigateUp function to shift focus to the same cell in the row above. + /** Use the navigateUp function to shift focus to the same cell in the row above. * Note: These actions will only work when a cell is editable and has focus. @@ -1718,7 +1693,7 @@ declare class Tabulator { */ navigateDown: () => void; - /**A lot of the modules come with a range of default settings to make setting up your table easier, for example the sorters, formatters and editors that ship with Tabulator as standard. + /** A lot of the modules come with a range of default settings to make setting up your table easier, for example the sorters, formatters and editors that ship with Tabulator as standard. If you are using a lot of custom settings over and over again (for example a custom sorter). you can end up re-delcaring it several time for different tables. To make your life easier Tabulator allows you to extend the default setup of each module to make your custom options as easily accessible as the defaults. diff --git a/types/tabulator-tables/tabulator-tables-tests.ts b/types/tabulator-tables/tabulator-tables-tests.ts index 470dce2c76..3a33817b4f 100644 --- a/types/tabulator-tables/tabulator-tables-tests.ts +++ b/types/tabulator-tables/tabulator-tables-tests.ts @@ -1,37 +1,40 @@ -//constructor +// tslint:disable:no-object-literal-type-assertion +// tslint:disable:whitespace + +// constructor let table = new Tabulator("#test"); table.copyToClipboard("selection"); table.searchRows("name", "<", 3); table.setFilter("name", "<=", 3); table.setFilter([ - { field: "age", type: ">", value: 52 }, //filter by age greater than 52 - { field: "height", type: "<", value: 142 }, //and by height less than 142 - { field: "name", type: "in", value: ["steve", "bob", "jim"] } //name must be steve, bob or jim + { field: "age", type: ">", value: 52 }, // filter by age greater than 52 + { field: "height", type: "<", value: 142 }, // and by height less than 142 + { field: "name", type: "in", value: ["steve", "bob", "jim"] } // name must be steve, bob or jim ]); table.setFilter( (data, filterParams) => { - //data - the data for the row being filtered - //filterParams - params object passed to the filter - return data.name == "bob" && data.height < filterParams.height; //must return a boolean, true if it passes the filter. + // data - the data for the row being filtered + // filterParams - params object passed to the filter + return data.name === "bob" && data.height < filterParams.height; // must return a boolean, true if it passes the filter. }, { height: 3 } ); table.setFilter("age", "in", ["steve", "bob", "jim"]); table.setFilter([ - { field: "age", type: ">", value: 52 }, //filter by age greater than 52 + { field: "age", type: ">", value: 52 }, // filter by age greater than 52 [ - { field: "height", type: "<", value: 142 }, //with a height of less than 142 - { field: "name", type: "=", value: "steve" } //or a name of steve + { field: "height", type: "<", value: 142 }, // with a height of less than 142 + { field: "name", type: "=", value: "steve" } // or a name of steve ] ]); table .setPageToRow(12) - .then(function() { - //run code after table has been successfuly updated + .then(() => { + // run code after table has been successfuly updated }) - .catch(function(error) { - //handle error loading data + .catch(error => { + // handle error loading data }); table.setGroupBy("gender"); @@ -45,48 +48,50 @@ table.setGroupHeader((value, count, data) => { }); table.setSort([ - { column: "age", dir: "asc" }, //sort by this first - { column: "height", dir: "desc" } //then sort by this second + { column: "age", dir: "asc" }, // sort by this first + { column: "height", dir: "desc" } // then sort by this second ]); table .scrollToColumn("age", "middle", false) - .then(function() { - //run code after column has been scrolled to + .then(() => { + // run code after column has been scrolled to }) - .catch(function(error) { - //handle error scrolling to column + .catch(error => { + // handle error scrolling to column }); table .updateOrAddData([{ id: 1, name: "bob" }, { id: 3, name: "steve" }]) - .then(function(rows) { - //rows - array of the row components for the rows updated or added - //run code after data has been updated + .then(rows => { + // rows - array of the row components for the rows updated or added + // run code after data has been updated }) - .catch(function(error) { - //handle error updating data + .catch(error => { + // handle error updating data }); table.updateData([{ id: 1, name: "bob", gender: "male" }, { id: 2, name: "Jenny", gender: "female" }]); table .updateData([{ id: 1, name: "bob" }]) - .then(function() { - //run code after data has been updated + .then(() => { + // run code after data has been updated }) - .catch(function(error) { - //handle error updating data + .catch(error => { + // handle error updating data }); let row1: Tabulator.RowComponent; let row2: Tabulator.RowComponent; -//column definitions -let colDef: Tabulator.ColumnDefinition = {} as Tabulator.ColumnDefinition; -colDef.title = "title"; +// column definitions +let colDef: Tabulator.ColumnDefinition = { title: "title" }; colDef.sorter = customSorter; -function customSorter(a: any, b: any, aRow: Tabulator.RowComponent, bRow: Tabulator.RowComponent, column: Tabulator.ColumnComponent, dir: Tabulator.SortDirection, sorterParams: Tabulator.ColumnDefinitionSorterParams): number { +// prettier-ignore +function customSorter(a: any, b: any, aRow: Tabulator.RowComponent, + bRow: Tabulator.RowComponent, column: Tabulator.ColumnComponent, + dir: Tabulator.SortDirection, sorterParams: Tabulator.ColumnDefinitionSorterParams): number { return 1; } @@ -101,20 +106,20 @@ colDef.formatterParams = { }; colDef.formatterParams = cell => { - //cell - the cell component + // cell - the cell component - //do some processing and return the param object + // do some processing and return the param object return { param1: "green" }; }; -//List lookup +// List lookup colDef.formatterParams = { small: "Cute", medium: "Fine", big: 2, huge: true }; -//Custom Formatter +// Custom Formatter colDef.formatter = (cell: Tabulator.CellComponent, formatterParams: {}, onRendered) => { onRendered = () => {}; return ""; @@ -122,33 +127,33 @@ colDef.formatter = (cell: Tabulator.CellComponent, formatterParams: {}, onRender colDef.editor = true; colDef.editor = "number"; -colDef.editor = function(cell, onRendered, success, cancel, editorParams) { - //cell - the cell component for the editable cell - //onRendered - function to call when the editor has been rendered - //success - function to call to pass the successfuly updated value to Tabulator - //cancel - function to call to abort the edit and return to a normal cell - //editorParams - params object passed into the editorParams column definition property +colDef.editor = (cell, onRendered, success, cancel, editorParams) => { + // cell - the cell component for the editable cell + // onRendered - function to call when the editor has been rendered + // success - function to call to pass the successfuly updated value to Tabulator + // cancel - function to call to abort the edit and return to a normal cell + // editorParams - params object passed into the editorParams column definition property - //create and style editor - var editor = document.createElement("input"); + // create and style editor + const editor = document.createElement("input"); editor.setAttribute("type", "date"); - //create and style input + // create and style input editor.style.padding = "3px"; editor.style.width = "100%"; editor.style.boxSizing = "border-box"; - //Set value of editor to the current value of the cell + // Set value of editor to the current value of the cell editor.value = moment(cell.getValue(), "DD/MM/YYYY"); - //set focus on the select box when the editor is selected (timeout allows for editor to be added to DOM) - onRendered(function() { + // set focus on the select box when the editor is selected (timeout allows for editor to be added to DOM) + onRendered(() => { editor.focus(); editor.style.cssText = "100%"; }); - //when the value has been set, trigger the cell to update + // when the value has been set, trigger the cell to update function successFunc() { success(moment(editor.value, "YYYY-MM-DD")); } @@ -156,10 +161,10 @@ colDef.editor = function(cell, onRendered, success, cancel, editorParams) { editor.addEventListener("change", successFunc); editor.addEventListener("blur", successFunc); - //return the editor element + // return the editor element return editor; }; -//Dummy function +// Dummy function function moment(a: any, b: any) { return ""; } @@ -174,10 +179,10 @@ colDef.editorParams = {}; colDef.editorParams = { values: [ { - //option group + // option group label: "Men", options: [ - //options in option group + // options in option group { label: "Steve Boberson", value: "steve" @@ -189,10 +194,10 @@ colDef.editorParams = { ] }, { - //option group + // option group label: "Women", options: [ - //options in option group + // options in option group { label: "Jenny Jillerson", value: "jenny" @@ -204,7 +209,7 @@ colDef.editorParams = { ] }, { - //ungrouped option + // ungrouped option label: "Other", value: "other" } @@ -221,34 +226,34 @@ colDef.editorParams = { values: selectParamValues }; -colDef.editorParams = function(cell) { +colDef.editorParams = cell => { return {}; }; let autoComplete: Tabulator.AutoCompleteParams = { - showListOnEmpty: true, //show all values when the list is empty, - freetext: true, //allow the user to set the value of the cell to a free text entry - allowEmpty: true, //allow empty string values + showListOnEmpty: true, // show all values when the list is empty, + freetext: true, // allow the user to set the value of the cell to a free text entry + allowEmpty: true, // allow empty string values searchFunc: (term, values) => { - //search for exact matches - var matches: string[] = []; + // search for exact matches + const matches: string[] = []; return matches; }, - listItemFormatter: function(value, title) { - //prefix all titles with the work "Mr" + listItemFormatter: (value, title) => { + // prefix all titles with the work "Mr" return "Mr " + title; }, - values: true //create list of values from all values contained in this column + values: true // create list of values from all values contained in this column }; colDef.editorParams = autoComplete; colDef.editorParams = { values: [ { - //option group + // option group label: "Men", options: [ - //options in option group + // options in option group { label: "Steve Boberson", value: "steve" @@ -260,10 +265,10 @@ colDef.editorParams = { ] }, { - //option group + // option group label: "Women", options: [ - //options in option group + // options in option group { label: "Jenny Jillerson", value: "jenny" @@ -275,14 +280,14 @@ colDef.editorParams = { ] }, { - //ungrouped option + // ungrouped option label: "Other", value: "other" } ] }; -//Validators +// Validators colDef.validator = { type: (cell, value, parameters) => { return true; @@ -306,59 +311,60 @@ let validators: Tabulator.Validator[] = [ colDef.headerFilterFunc = "!="; colDef.headerFilterFunc = (headerValue, rowValue, rowData, filterParams) => { - return rowData.name == filterParams.name && rowValue < headerValue; //must return a boolean, true if it passes the filter. + return rowData.name === filterParams.name && rowValue < headerValue; // must return a boolean, true if it passes the filter. }; -//Cell Component -let cell: Tabulator.CellComponent = {} as Tabulator.CellComponent; +// Cell Component + +let cell = {}; cell.nav().down(); let data = cell.getData(); table = cell.getTable(); -//Row Component -let row: Tabulator.RowComponent = {} as Tabulator.RowComponent; +// Row Component +let row = {}; row.delete() - .then(function() { - //run code after row has been deleted + .then(() => { + // run code after row has been deleted }) - .catch(function(error) { - //handle error deleting row + .catch(error => { + // handle error deleting row }); -//Options -let options: Tabulator.Options = {} as Tabulator.Options; +// Options +let options = {}; options.keybindings = { navPrev: "ctrl + 1", navNext: false }; options.downloadDataFormatter = data => { - // data.forEach(function(row){ - // row.age = row.age >= 18 ? "adult" : "child"; + // data.forEach(function(row){ + // row.age = row.age >= 18 ? "adult" : "child"; }; options.downloadConfig = { - columnGroups: false, //include column groups in column headers for download - rowGroups: false, //do not include row groups in download - columnCalcs: false //do not include column calculation rows in download + columnGroups: false, // include column groups in column headers for download + rowGroups: false, // do not include row groups in download + columnCalcs: false // do not include column calculation rows in download }; options.ajaxConfig = "GET"; options.ajaxConfig = { - mode: "cors", //set request mode to cors - credentials: "same-origin", //send cookies with the request from the matching origin + mode: "cors", // set request mode to cors + credentials: "same-origin", // send cookies with the request from the matching origin headers: { - Accept: "application/json", //tell the server we need JSON back - "X-Requested-With": "XMLHttpRequest", //fix to help some frameworks respond correctly to request - "Content-type": "application/json; charset=utf-8", //set the character encoding of the request - "Access-Control-Allow-Origin": "http://yout-site.com" //the URL origin of the site making the request + Accept: "application/json", // tell the server we need JSON back + "X-Requested-With": "XMLHttpRequest", // fix to help some frameworks respond correctly to request + "Content-type": "application/json; charset=utf-8", // set the character encoding of the request + "Access-Control-Allow-Origin": "http:// yout-site.com" // the URL origin of the site making the request } }; options.ajaxConfig = { - method: "POST", //set request type to Position + method: "POST", // set request type to Position headers: { - "Content-type": "application/json; charset=utf-8" //set specific content type + "Content-type": "application/json; charset=utf-8" // set specific content type } }; @@ -366,16 +372,16 @@ options.ajaxContentType = { headers: { "Content-Type": "text/html" }, - body: function(url, config, params) { - //url - the url of the request - //config - the fetch config object - //params - the request parameters + body: (url, config, params) => { + // url - the url of the request + // config - the fetch config object + // params - the request parameters - //return comma list of params:values - var output = []; + // return comma list of params:values + const output = []; - for (var key in params) { - output.push(key + ":" + params[key]); + for (const key in params) { + output.push(`${key} ":" ${params[key]}`); } return output.join(","); @@ -385,31 +391,31 @@ options.ajaxContentType = { options.initialSort = [{ column: "name", dir: "asc" }, { column: "name2", dir: "desc" }]; options.initialFilter = [{ field: "color", type: "=", value: "red" }]; options.initialHeaderFilter = [ - { field: "color", value: "red" } //set the initial value of the header filter to "red" + { field: "color", value: "red" } // set the initial value of the header filter to "red" ]; options.groupValues = [ - ["red", "blue", "green"], //create groups for color values of "red", "blue", and "green", - [10, 20, 30] //create sub groups for ages of 10, 20 and 30 + ["red", "blue", "green"], // create groups for color values of "red", "blue", and "green", + [10, 20, 30] // create sub groups for ages of 10, 20 and 30 ]; options.groupHeader = (value, count, data, group) => { - //value - the value all members of this group share - //count - the number of rows in this group - //data - an array of all the row data objects in this group - //group - the group component for the group + // value - the value all members of this group share + // count - the number of rows in this group + // data - an array of all the row data objects in this group + // group - the group component for the group - return value + "(" + count + " item)"; + return `${value} (${count}item)`; }; options.groupHeader = [ - function(value, count, data) { - //generate header contents for gender groups - return value + "(" + count + " item)"; + (value, count, data) => { + // generate header contents for gender groups + return `${value} (${count}item)`; }, - function(value, count, data) { - //generate header contents for color groups - return value + "(" + count + " item)"; + (value, count, data) => { + // generate header contents for color groups + return `${value} (${count}item)`; } ]; @@ -419,7 +425,7 @@ options.paginationDataReceived = { }; options.clipboardPasteParser = clipboard => { - return []; //return array + return []; // return array }; options.cellEditing = cell => { From 7ea404d70bf96f7530d2f402913cc6a58317a383 Mon Sep 17 00:00:00 2001 From: "Adam A. Zerella" Date: Wed, 6 Mar 2019 15:49:56 +1100 Subject: [PATCH 442/924] Added type defs for is-date-object --- types/is-date-object/index.d.ts | 8 +++++++ types/is-date-object/is-date-object-tests.ts | 14 +++++++++++ types/is-date-object/tsconfig.json | 25 ++++++++++++++++++++ types/is-date-object/tslint.json | 3 +++ 4 files changed, 50 insertions(+) create mode 100644 types/is-date-object/index.d.ts create mode 100644 types/is-date-object/is-date-object-tests.ts create mode 100644 types/is-date-object/tsconfig.json create mode 100644 types/is-date-object/tslint.json diff --git a/types/is-date-object/index.d.ts b/types/is-date-object/index.d.ts new file mode 100644 index 0000000000..08885dce51 --- /dev/null +++ b/types/is-date-object/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for is-date-object 1.0 +// Project: https://github.com/ljharb/is-date-object +// Definitions by: Adam Zerella +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function isDateObject(value?: any): boolean; + +export = isDateObject; diff --git a/types/is-date-object/is-date-object-tests.ts b/types/is-date-object/is-date-object-tests.ts new file mode 100644 index 0000000000..68fb22d684 --- /dev/null +++ b/types/is-date-object/is-date-object-tests.ts @@ -0,0 +1,14 @@ +import isDate = require("is-date-object"); + +isDate(); +isDate(undefined); +isDate(null); +isDate(false); +isDate(true); +isDate(42); +isDate('foo'); +isDate([]); +isDate({}); +isDate(/a/g); +isDate(new RegExp('a', 'g')); +isDate(new Date()); diff --git a/types/is-date-object/tsconfig.json b/types/is-date-object/tsconfig.json new file mode 100644 index 0000000000..7c42b57df2 --- /dev/null +++ b/types/is-date-object/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [ + + ], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "is-date-object-tests.ts" + ] +} diff --git a/types/is-date-object/tslint.json b/types/is-date-object/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/is-date-object/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file From 56de1e479c09182b87d995775b1397dccebe6f0e Mon Sep 17 00:00:00 2001 From: "Adam A. Zerella" Date: Wed, 6 Mar 2019 16:17:47 +1100 Subject: [PATCH 443/924] Updated any type to unknown --- types/is-date-object/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/is-date-object/index.d.ts b/types/is-date-object/index.d.ts index 08885dce51..da3444ad91 100644 --- a/types/is-date-object/index.d.ts +++ b/types/is-date-object/index.d.ts @@ -2,7 +2,8 @@ // Project: https://github.com/ljharb/is-date-object // Definitions by: Adam Zerella // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.3 -declare function isDateObject(value?: any): boolean; +declare function isDateObject(value?: unknown): boolean; export = isDateObject; From 28e01537831d35cdafce4d4ac8e6cc89d413bc8f Mon Sep 17 00:00:00 2001 From: "Adam A. Zerella" Date: Wed, 6 Mar 2019 16:17:47 +1100 Subject: [PATCH 444/924] Updated any type to unknown --- types/is-date-object/index.d.ts | 6 +++++- types/is-date-object/is-date-object-tests.ts | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/types/is-date-object/index.d.ts b/types/is-date-object/index.d.ts index da3444ad91..4564b5e34b 100644 --- a/types/is-date-object/index.d.ts +++ b/types/is-date-object/index.d.ts @@ -4,6 +4,10 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 3.3 -declare function isDateObject(value?: unknown): boolean; +type InvalidTypes = undefined | null | boolean | string | number | [] | {}; + +declare function isDateObject(value: Date): true; +declare function isDateObject(value: InvalidTypes | unknown): false; +declare function isDateObject(value?: unknown): false; export = isDateObject; diff --git a/types/is-date-object/is-date-object-tests.ts b/types/is-date-object/is-date-object-tests.ts index 68fb22d684..9946c42d54 100644 --- a/types/is-date-object/is-date-object-tests.ts +++ b/types/is-date-object/is-date-object-tests.ts @@ -7,6 +7,7 @@ isDate(false); isDate(true); isDate(42); isDate('foo'); +isDate((): void => {}); isDate([]); isDate({}); isDate(/a/g); From 0454d3a6a6c0c4559e55752091b41512737131b5 Mon Sep 17 00:00:00 2001 From: "Adam A. Zerella" Date: Thu, 7 Mar 2019 12:18:39 +1100 Subject: [PATCH 445/924] Updated return type for unknown param value --- types/is-date-object/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/is-date-object/index.d.ts b/types/is-date-object/index.d.ts index 4564b5e34b..55865a2a2e 100644 --- a/types/is-date-object/index.d.ts +++ b/types/is-date-object/index.d.ts @@ -7,7 +7,7 @@ type InvalidTypes = undefined | null | boolean | string | number | [] | {}; declare function isDateObject(value: Date): true; -declare function isDateObject(value: InvalidTypes | unknown): false; -declare function isDateObject(value?: unknown): false; +declare function isDateObject(value: InvalidTypes | unknown): boolean; +declare function isDateObject(value?: unknown): boolean; export = isDateObject; From 44c10e7262bd247dfce56590136beebd13ec49c3 Mon Sep 17 00:00:00 2001 From: Alan Choi Date: Thu, 7 Mar 2019 10:13:58 +0900 Subject: [PATCH 446/924] keep element type when string literal array passed When select options is an array of string literal union type, select must return the same type of value. --- types/storybook__addon-knobs/index.d.ts | 1 + .../storybook__addon-knobs-tests.tsx | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/types/storybook__addon-knobs/index.d.ts b/types/storybook__addon-knobs/index.d.ts index 3aab101f74..dbfd84a13d 100644 --- a/types/storybook__addon-knobs/index.d.ts +++ b/types/storybook__addon-knobs/index.d.ts @@ -52,6 +52,7 @@ export function object(name: string, value: T, groupId?: string): T; export function radios(name: string, options: { [s: string]: T }, value?: T, groupId?: string): string; export function select(name: string, options: { [s: string]: T }, value: T, groupId?: string): T; +export function select(name: string, options: ReadonlyArray, value: T, groupId?: string): T; export function select(name: string, options: ReadonlyArray, value: string, groupId?: string): string; export function date(name: string, value?: Date, groupId?: string): Date; diff --git a/types/storybook__addon-knobs/storybook__addon-knobs-tests.tsx b/types/storybook__addon-knobs/storybook__addon-knobs-tests.tsx index 75ab4c79a9..d09447f75d 100644 --- a/types/storybook__addon-knobs/storybook__addon-knobs-tests.tsx +++ b/types/storybook__addon-knobs/storybook__addon-knobs-tests.tsx @@ -94,7 +94,15 @@ stories.add('dynamic knobs', () => { }); const readonlyOptionsArray: ReadonlyArray = ['hi']; -select('With readonly array', readonlyOptionsArray, readonlyOptionsArray[0]); +select('With readonly string array', readonlyOptionsArray, readonlyOptionsArray[0]); + +type StringLiteralType = 'Apple' | 'Banana' | 'Grapes'; +const stringLiteralArray: StringLiteralType[] = ['Apple', 'Banana', 'Grapes']; + +let selectedFruit: StringLiteralType; + +// type of value returned from `select` must be `StringLiteralType`. +selectedFruit = select('With string literal array', stringLiteralArray, stringLiteralArray[0]); const optionsObject = { Apple: { taste: 'sweet', color: 'red' }, From 2bbab68802af8be26a4f268f25764bc7f7c80c32 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Thu, 7 Mar 2019 13:57:30 +1100 Subject: [PATCH 447/924] Update types/is-date-object/index.d.ts Co-Authored-By: adamzerella --- types/is-date-object/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/is-date-object/index.d.ts b/types/is-date-object/index.d.ts index 55865a2a2e..3ad24b15af 100644 --- a/types/is-date-object/index.d.ts +++ b/types/is-date-object/index.d.ts @@ -8,6 +8,7 @@ type InvalidTypes = undefined | null | boolean | string | number | [] | {}; declare function isDateObject(value: Date): true; declare function isDateObject(value: InvalidTypes | unknown): boolean; -declare function isDateObject(value?: unknown): boolean; +declare function isDateObject(value?: object): boolean; +declare function isDateObject(value?: null | undefined | boolean | string | number | symbol | bigint | Array | Function): false; export = isDateObject; From b11d95d4336819d9f36703248bd87b6772e30ee1 Mon Sep 17 00:00:00 2001 From: Adam Zerella Date: Thu, 7 Mar 2019 13:58:48 +1100 Subject: [PATCH 448/924] Update index.d.ts --- types/is-date-object/index.d.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/types/is-date-object/index.d.ts b/types/is-date-object/index.d.ts index 3ad24b15af..52b2f3ac84 100644 --- a/types/is-date-object/index.d.ts +++ b/types/is-date-object/index.d.ts @@ -4,10 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 3.3 -type InvalidTypes = undefined | null | boolean | string | number | [] | {}; - declare function isDateObject(value: Date): true; -declare function isDateObject(value: InvalidTypes | unknown): boolean; declare function isDateObject(value?: object): boolean; declare function isDateObject(value?: null | undefined | boolean | string | number | symbol | bigint | Array | Function): false; From 585d4ff9650d7eec6bffab2d4bfc019ed4e233d0 Mon Sep 17 00:00:00 2001 From: jgresham Date: Wed, 6 Mar 2019 19:06:13 -0800 Subject: [PATCH 449/924] Highcharts.ganttChart(). Initial types for basic gantt chart --- types/highcharts/index.d.ts | 19 ++++++++++++++++--- types/highcharts/test/index.ts | 30 ++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/types/highcharts/index.d.ts b/types/highcharts/index.d.ts index 51028bd6af..2c4b14c797 100644 --- a/types/highcharts/index.d.ts +++ b/types/highcharts/index.d.ts @@ -4,6 +4,7 @@ // Dan Lewi Harkestad // Albert Ozimek // JuliĂ«n Hanssens +// Johns Gresham // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -6018,7 +6019,11 @@ declare namespace Highcharts { * The id of a series in the drilldown.series array to use for a drilldown for this point. * @since 3.0.8 */ - drilldown?: string; + drilldown?: string; + /** + * The end value of the point. For gantt datetime axes, the end value is the timestamp in milliseconds since 1970. + */ + end?: number; /** * Individual point events */ @@ -6097,7 +6102,11 @@ declare namespace Highcharts { * Whether to display a slice offset from the center. * @default false */ - sliced?: boolean; + sliced?: boolean; + /** + * The start value of the point. For gantt datetime axes, the start value is the timestamp in milliseconds since 1970. + */ + start?: number; /** * The value of the point, resulting in a relative area of the point in the treemap. */ @@ -7256,7 +7265,11 @@ declare namespace Highcharts { * As Highcharts.Chart, but without need for the new keyword. * @since 4.2.0 */ - chart(renderTo: string | HTMLElement, options: Options, callback?: (chart: ChartObject) => void): ChartObject; + chart(renderTo: string | HTMLElement, options: Options, callback?: (chart: ChartObject) => void): ChartObject; + /** + * Highcharts ganttChart which doesn't require the new keyword. Required Highcharts Gantt module. + */ + ganttChart(renderTo: string | HTMLElement, options: Options, callback?: (chart: ChartObject) => void): ChartObject; /** * An array containing the current chart objects in the page. A chart's position in the array is preserved * throughout the page's lifetime. When a chart is destroyed, the array item becomes undefined. diff --git a/types/highcharts/test/index.ts b/types/highcharts/test/index.ts index 1474ee7e9c..9ac03d1f81 100644 --- a/types/highcharts/test/index.ts +++ b/types/highcharts/test/index.ts @@ -2856,3 +2856,33 @@ function test_WrapTooltipBehavior() { // Many prototype functions use this so arrow functions should only be used to replace behaviors. }); } + +// Tests Highcharts.ganttChart, which usings the Gantt module +function test_GanttChart() { + Highcharts.ganttChart('ganttChartContainer', { + xAxis: { + min: Date.UTC(2014, 9, 18), + max: Date.UTC(2014, 12, 20) + }, + series: [{ + name: 'Project 1', + data: [ + { + name: 'Lemon Tea', + start: Date.UTC(2014, 10, 18), + end: Date.UTC(2014, 11, 20) + }, + { + name: 'Stapler', + start: Date.UTC(2014, 11, 18), + end: Date.UTC(2014, 12, 20) + }, + { + name: 'Sierra', + start: Date.UTC(2014, 12, 18), + end: Date.UTC(2014, 12, 20) + }, + ], + }], + }); +} From 7d67be826cc8c13f7cd238167204704a9408a045 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Wed, 6 Mar 2019 19:33:09 -0800 Subject: [PATCH 450/924] Try to add conditional update-codeowners to travis --- .travis.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.travis.yml b/.travis.yml index 9bd31bda14..fa657d16d7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,3 +6,15 @@ sudo: false notifications: email: false + +jobs: + include: + - stage: build + script: npm install + script: npm run build + script: npm run test + - stage: codeowners + script: npm run update-codeowners +stages: + - name: codeowners + if: env(TRAVIS_EVENT_TYPE) = cron \ No newline at end of file From 704068364b2b32773ca32a8b2178625dec4715f7 Mon Sep 17 00:00:00 2001 From: breeze9527 Date: Thu, 7 Mar 2019 14:26:10 +0800 Subject: [PATCH 451/924] [amap-js-api] merge test file & update lint rule --- types/amap-js-api/amap-js-api-tests.ts | 3376 +++++++++++++++++ types/amap-js-api/index.d.ts | 2 +- types/amap-js-api/overlay/markerShape.d.ts | 2 +- types/amap-js-api/test/arryBounds.ts | 18 - types/amap-js-api/test/bounds.ts | 30 - types/amap-js-api/test/browser.ts | 141 - types/amap-js-api/test/convert-from.ts | 25 - types/amap-js-api/test/dom-util.ts | 47 - types/amap-js-api/test/event.ts | 74 - types/amap-js-api/test/geometry-util.ts | 158 - types/amap-js-api/test/layer/buildings.ts | 40 - types/amap-js-api/test/layer/canvasLayer.ts | 53 - types/amap-js-api/test/layer/flexible.ts | 54 - types/amap-js-api/test/layer/imageLayer.ts | 51 - types/amap-js-api/test/layer/layer.ts | 34 - types/amap-js-api/test/layer/layerGroup.ts | 115 - types/amap-js-api/test/layer/massMarks.ts | 83 - types/amap-js-api/test/layer/tileLayer.ts | 60 - types/amap-js-api/test/layer/videoLayer.ts | 51 - types/amap-js-api/test/layer/wms.ts | 89 - types/amap-js-api/test/layer/wmts.ts | 69 - types/amap-js-api/test/lnglat.ts | 48 - types/amap-js-api/test/map.ts | 338 -- types/amap-js-api/test/overlay/bezierCurve.ts | 155 - types/amap-js-api/test/overlay/circle.ts | 150 - types/amap-js-api/test/overlay/contextMenu.ts | 48 - types/amap-js-api/test/overlay/ellipse.ts | 117 - types/amap-js-api/test/overlay/geoJSON.ts | 106 - types/amap-js-api/test/overlay/icon.ts | 32 - types/amap-js-api/test/overlay/infoWindow.ts | 81 - types/amap-js-api/test/overlay/marker.ts | 195 - types/amap-js-api/test/overlay/markerShape.ts | 26 - types/amap-js-api/test/overlay/overlay.ts | 27 - .../amap-js-api/test/overlay/overlayGroup.ts | 108 - types/amap-js-api/test/overlay/polygon.ts | 123 - types/amap-js-api/test/overlay/polyline.ts | 139 - types/amap-js-api/test/overlay/rectangle.ts | 121 - types/amap-js-api/test/overlay/text.ts | 169 - types/amap-js-api/test/pixel.ts | 42 - types/amap-js-api/test/preset.ts | 29 - types/amap-js-api/test/size.ts | 16 - types/amap-js-api/test/util.ts | 79 - types/amap-js-api/test/view2d.ts | 22 - types/amap-js-api/tsconfig.json | 43 +- types/amap-js-api/tslint.json | 9 +- 45 files changed, 3381 insertions(+), 3414 deletions(-) create mode 100644 types/amap-js-api/amap-js-api-tests.ts delete mode 100644 types/amap-js-api/test/arryBounds.ts delete mode 100644 types/amap-js-api/test/bounds.ts delete mode 100644 types/amap-js-api/test/browser.ts delete mode 100644 types/amap-js-api/test/convert-from.ts delete mode 100644 types/amap-js-api/test/dom-util.ts delete mode 100644 types/amap-js-api/test/event.ts delete mode 100644 types/amap-js-api/test/geometry-util.ts delete mode 100644 types/amap-js-api/test/layer/buildings.ts delete mode 100644 types/amap-js-api/test/layer/canvasLayer.ts delete mode 100644 types/amap-js-api/test/layer/flexible.ts delete mode 100644 types/amap-js-api/test/layer/imageLayer.ts delete mode 100644 types/amap-js-api/test/layer/layer.ts delete mode 100644 types/amap-js-api/test/layer/layerGroup.ts delete mode 100644 types/amap-js-api/test/layer/massMarks.ts delete mode 100644 types/amap-js-api/test/layer/tileLayer.ts delete mode 100644 types/amap-js-api/test/layer/videoLayer.ts delete mode 100644 types/amap-js-api/test/layer/wms.ts delete mode 100644 types/amap-js-api/test/layer/wmts.ts delete mode 100644 types/amap-js-api/test/lnglat.ts delete mode 100644 types/amap-js-api/test/map.ts delete mode 100644 types/amap-js-api/test/overlay/bezierCurve.ts delete mode 100644 types/amap-js-api/test/overlay/circle.ts delete mode 100644 types/amap-js-api/test/overlay/contextMenu.ts delete mode 100644 types/amap-js-api/test/overlay/ellipse.ts delete mode 100644 types/amap-js-api/test/overlay/geoJSON.ts delete mode 100644 types/amap-js-api/test/overlay/icon.ts delete mode 100644 types/amap-js-api/test/overlay/infoWindow.ts delete mode 100644 types/amap-js-api/test/overlay/marker.ts delete mode 100644 types/amap-js-api/test/overlay/markerShape.ts delete mode 100644 types/amap-js-api/test/overlay/overlay.ts delete mode 100644 types/amap-js-api/test/overlay/overlayGroup.ts delete mode 100644 types/amap-js-api/test/overlay/polygon.ts delete mode 100644 types/amap-js-api/test/overlay/polyline.ts delete mode 100644 types/amap-js-api/test/overlay/rectangle.ts delete mode 100644 types/amap-js-api/test/overlay/text.ts delete mode 100644 types/amap-js-api/test/pixel.ts delete mode 100644 types/amap-js-api/test/preset.ts delete mode 100644 types/amap-js-api/test/size.ts delete mode 100644 types/amap-js-api/test/util.ts delete mode 100644 types/amap-js-api/test/view2d.ts diff --git a/types/amap-js-api/amap-js-api-tests.ts b/types/amap-js-api/amap-js-api-tests.ts new file mode 100644 index 0000000000..41b0638526 --- /dev/null +++ b/types/amap-js-api/amap-js-api-tests.ts @@ -0,0 +1,3376 @@ +/** + * preset.ts + */ + +declare const map: AMap.Map; +declare const lnglat: AMap.LngLat; +declare const size: AMap.Size; +declare const lnglatTuple: [number, number]; +declare const pixel: AMap.Pixel; +declare const markerShape: AMap.MarkerShape; +declare const icon: AMap.Icon; +declare const bounds: AMap.Bounds; +declare const div: HTMLDivElement; +declare const lang: AMap.Lang; +declare const domEle: HTMLElement; +declare const canvasEle: HTMLCanvasElement; +declare const imgEle: HTMLImageElement; + +declare const circle: AMap.Circle; +declare const marker: AMap.Marker; +declare const layer: AMap.Layer; +declare const tileLayer: AMap.TileLayer; +declare const massMarksLayer: AMap.MassMarks; + +// declare const videoLayer: AMap.VideoLayer; +// declare const buildings: AMap.Buildings; +// declare const canvasLayer: AMap.CanvasLayer; +// declare const flexible: AMap.TileLayer.Flexible; +// declare const imageLayer: AMap.ImageLayer; +// declare const tileLayerGroup: AMap.LayerGroup; +// declare const layerGroup: AMap.LayerGroup; +// declare const trafficLayer: AMap.TileLayer.Traffic; +// declare const bezierCurve: AMap.BezierCurve; +// declare const contextMenu: AMap.ContextMenu; +// declare const polyline: AMap.Polyline; +// declare const polygon: AMap.Polygon; + +/** + * arryBounds.ts + */ + +// $ExpectType ArrayBounds +const testArrayBounds = new AMap.ArrayBounds([lnglat, lnglat, lnglat]); + +// $ExpectType LngLat[] +testArrayBounds.bounds; + +// $ExpectType boolean +testArrayBounds.contains(lnglat); + +// $ExpectType Bounds +testArrayBounds.toBounds(); + +// $ExpectType LngLat +testArrayBounds.getCenter(); + +/** + * bounds.ts + */ + +// $ExpectType Bounds +const testBounds = new AMap.Bounds(lnglat, lnglat); + +// $ExpectType boolean +testBounds.contains(lnglat); +// $ExpectType boolean +testBounds.contains(lnglatTuple); + +// $ExpectType LngLat +testBounds.getCenter(); + +// $ExpectType LngLat +testBounds.getSouthWest(); + +// $ExpectType LngLat +testBounds.getSouthEast(); + +// $ExpectType LngLat +testBounds.getNorthEast(); + +// $ExpectType LngLat +testBounds.getNorthWest(); + +// $ExpectType string +testBounds.toString(); + +/** + * browser.ts + */ + +const brwoser = AMap.Browser; + +// $ExpectType string +brwoser.ua; + +// $ExpectType boolean +brwoser.mobile; + +const plat: 'android' | 'ios' | 'windows' | 'mac' | 'other' = brwoser.plat; + +// $ExpectType boolean +brwoser.mac; + +// $ExpectType boolean +brwoser.windows; + +// $ExpectType boolean +brwoser.ios; + +// $ExpectType boolean +brwoser.iPad; + +// $ExpectType boolean +brwoser.iPhone; + +// $ExpectType boolean +brwoser.android; + +// $ExpectType boolean +brwoser.android23; + +// $ExpectType boolean +brwoser.chrome; + +// $ExpectType boolean +brwoser.firefox; + +// $ExpectType boolean +brwoser.safari; + +// $ExpectType boolean +brwoser.wechat; + +// $ExpectType boolean +brwoser.uc; + +// $ExpectType boolean +brwoser.qq; + +// $ExpectType boolean +brwoser.ie; + +// $ExpectType boolean +brwoser.ie6; + +// $ExpectType boolean +brwoser.ie7; + +// $ExpectType boolean +brwoser.ie8; + +// $ExpectType boolean +brwoser.ie9; + +// $ExpectType boolean +brwoser.ie10; + +// $ExpectType boolean +brwoser.ie11; + +// $ExpectType boolean +brwoser.edge; + +// $ExpectType boolean +brwoser.ielt9; + +// $ExpectType boolean +brwoser.baidu; + +// $ExpectType boolean +brwoser.isLocalStorage; + +// $ExpectType boolean +brwoser.isGeolocation; + +// $ExpectType boolean +brwoser.mobileWebkit; + +// $ExpectType boolean +brwoser.mobileWebkit3d; + +// $ExpectType boolean +brwoser.mobileOpera; + +// $ExpectType boolean +brwoser.retina; + +// $ExpectType boolean +brwoser.touch; + +// $ExpectType boolean +brwoser.msPointer; + +// $ExpectType boolean +brwoser.pointer; + +// $ExpectType boolean +brwoser.webkit; + +// $ExpectType boolean +brwoser.ie3d; + +// $ExpectType boolean +brwoser.webkit3d; + +// $ExpectType boolean +brwoser.gecko3d; + +// $ExpectType boolean +brwoser.opera3d; + +// $ExpectType boolean +brwoser.any3d; + +// $ExpectType boolean +brwoser.isCanvas; + +// $ExpectType boolean +brwoser.isSvg; + +// $ExpectType boolean +brwoser.isVML; + +// $ExpectType boolean +brwoser.isWorker; + +// $ExpectType boolean +brwoser.isWebsocket; + +// $ExpectType boolean +brwoser.isWebGL(); + +/** + * convert-from.ts + */ + +declare const convertType: 'baidu' | 'mapbar' | 'gps' | null; +// $ExpectType void +AMap.convertFrom(lnglat, convertType, (status, result) => { + const temp: 'complete' | 'error' = status; + if (typeof result !== 'string') { + // $ExpectType string + result.info; + // $ExpectType LngLat[] + result.locations; + } else { + // $ExpectType string + result; + } +}); +// $ExpectType void +AMap.convertFrom([lnglat], null, () => { }); +// $ExpectType void +AMap.convertFrom(lnglatTuple, null, () => { }); +// $ExpectType void +AMap.convertFrom([lnglatTuple], null, () => { }); + +/** + * dom-util.ts + */ + +const domUtil = AMap.DomUtil; + +// $ExpectType Size +domUtil.getViewport(div); + +// $ExpectType Pixel +domUtil.getViewportOffset(div); + +// $ExpectType HTMLDivElement +domUtil.create('div'); +// $ExpectType HTMLAnchorElement +domUtil.create('a'); +// $ExpectType HTMLDivElement +domUtil.create('div', div); +// $ExpectType HTMLDivElement +domUtil.create('div', div, 'className'); + +// $ExpectType void +domUtil.setClass(div); +// $ExpectType void +domUtil.setClass(div, 'className'); + +// $ExpectType boolean +domUtil.hasClass(div, 'className'); + +// $ExpectType void +domUtil.removeClass(div, 'className'); + +// $ExpectType void +domUtil.setOpacity(div, 1); + +// $ExpectType void +domUtil.rotate(div, 10); +// $ExpectType void +domUtil.rotate(div, 10, { x: 10, y: 10 }); + +const util2: typeof AMap.DomUtil = domUtil.setCss(div, { textAlign: 'left' }); +// $ExpectError +domUtil.setCss(div, { textAlign: 10 }); + +// $ExpectType void +domUtil.empty(div); + +// $ExpectType void +domUtil.remove(div); + +/** + * event.ts + */ + +// $ExpectType Map +map.on('hotspotclick', (event: AMap.Map.EventMap['hotspotclick']) => { + // $ExpectType "hotspotclick" + event.type; + // $ExpectType string + event.id; + // $ExpectType LngLat + event.lnglat; +}); + +// $ExpectType EventListener<0> +AMap.event.addDomListener(div, 'click', event => { + // $ExpectType number + event.clientX; +}); + +// $ExpectType EventListener<1> +AMap.event.addListener(map, 'hotspotclick', function(event: AMap.Map.EventMap['hotspotclick']) { + // $ExpectType "hotspotclick" + event.type; + // $ExpectType string + event.id; + // $ExpectType LngLat + event.lnglat; + // $ExpectType number + this.test; +}, { test: 1 }); +AMap.event.addListener(map, 'click', (event: AMap.Map.EventMap['click']) => { + // $ExpectType "click" + event.type; + // $ExpectType LngLat + event.lnglat; + // $ExpectType Map + event.target; +}); + +// $ExpectType EventListener<1> +const eventListener = AMap.event.addListenerOnce(map, 'hotspotclick', function(event: AMap.Map.EventMap['hotspotclick']) { + // $ExpectType "hotspotclick" + event.type; + // $ExpectType string + event.id; + // $ExpectType LngLat + event.lnglat; + // $ExpectType number + this.test; +}, { test: 1 }); + +// $ExpectType void +AMap.event.removeListener(eventListener); + +// $ExpectType void +AMap.event.trigger(map, 'click', { + lnglat, + pixel, + target: map +}); +// $ExpectType void +AMap.event.trigger(map, 'hotspotclick', { + lnglat, + name: 'name', + id: 'id', + isIndoorPOI: true +}); +// $ExpectType void +AMap.event.trigger(map, 'complete'); + +/** + * geometry-util.ts + */ + +{ + const point = lnglat; + const pointTuple = lnglatTuple; + const line = [point]; + const lineTuple = [pointTuple]; + const ring = [point]; + const ringTuple = [pointTuple]; + const polygon = [ring]; + const polygonTuple = [ringTuple]; + const geometryUtil = AMap.GeometryUtil; + + // $ExpectType number + geometryUtil.distance(point, point); + // $ExpectType number + geometryUtil.distance(pointTuple, pointTuple); + // $ExpectType number + geometryUtil.distance(point, line); + // $ExpectType number + geometryUtil.distance(pointTuple, lineTuple); + + // $ExpectType number + geometryUtil.ringArea(ring); + // $ExpectType number + geometryUtil.ringArea(ringTuple); + + // $ExpectType boolean + geometryUtil.isClockwise(ring); + // $ExpectType boolean + geometryUtil.isClockwise(ringTuple); + + // $ExpectType number + geometryUtil.distanceOfLine(line); + // $ExpectType number + geometryUtil.distanceOfLine(lineTuple); + + // $ExpectType [number, number][] + geometryUtil.ringRingClip(ring, ring); + // $ExpectType [number, number][] + geometryUtil.ringRingClip(ringTuple, ringTuple); + + // $ExpectType boolean + geometryUtil.doesRingRingIntersect(ring, ring); + // $ExpectType boolean + geometryUtil.doesRingRingIntersect(ringTuple, ringTuple); + + // $ExpectType boolean + geometryUtil.doesLineRingIntersect(line, ring); + // $ExpectType boolean + geometryUtil.doesLineRingIntersect(lineTuple, ringTuple); + + // $ExpectType boolean + geometryUtil.doesLineLineIntersect(line, line); + // $ExpectType boolean + geometryUtil.doesLineLineIntersect(lineTuple, lineTuple); + + // $ExpectType boolean + geometryUtil.doesSegmentPolygonIntersect(point, point, polygon); + // $ExpectType boolean + geometryUtil.doesSegmentPolygonIntersect(pointTuple, pointTuple, polygonTuple); + + // $ExpectType boolean + geometryUtil.doesSegmentRingIntersect(point, point, ring); + // $ExpectType boolean + geometryUtil.doesSegmentRingIntersect(pointTuple, pointTuple, ringTuple); + + // $ExpectType boolean + geometryUtil.doesSegmentLineIntersect(point, point, line); + // $ExpectType boolean + geometryUtil.doesSegmentLineIntersect(pointTuple, pointTuple, lineTuple); + + // $ExpectType boolean + geometryUtil.doesSegmentsIntersect(point, point, point, point); + // $ExpectType boolean + geometryUtil.doesSegmentsIntersect(pointTuple, pointTuple, pointTuple, pointTuple); + + // $ExpectType boolean + geometryUtil.isPointInRing(point, ring); + // $ExpectType boolean + geometryUtil.isPointInRing(pointTuple, ringTuple); + + // $ExpectType boolean + geometryUtil.isRingInRing(ring, ring); + // $ExpectType boolean + geometryUtil.isRingInRing(ringTuple, ringTuple); + + // $ExpectType boolean + geometryUtil.isPointInPolygon(point, polygon); + // $ExpectType boolean + geometryUtil.isPointInPolygon(pointTuple, polygonTuple); + + // $ExpectType [number, number][] + geometryUtil.makesureClockwise(lineTuple); + + // $ExpectType [number, number][] + geometryUtil.makesureAntiClockwise(lineTuple); + + // $ExpectType [number, number] + geometryUtil.closestOnSegment(point, point, point); + // $ExpectType [number, number] + geometryUtil.closestOnSegment(pointTuple, pointTuple, pointTuple); + + // $ExpectType [number, number] + geometryUtil.closestOnSegment(point, point, point); + // $ExpectType [number, number] + geometryUtil.closestOnSegment(pointTuple, pointTuple, pointTuple); + + // $ExpectType [number, number] + geometryUtil.closestOnLine(point, line); + // $ExpectType [number, number] + geometryUtil.closestOnLine(pointTuple, lineTuple); + + // $ExpectType number + geometryUtil.distanceToSegment(point, point, point); + // $ExpectType number + geometryUtil.distanceToSegment(pointTuple, pointTuple, pointTuple); + + // $ExpectType number + geometryUtil.distanceToLine(point, line); + // $ExpectType number + geometryUtil.distanceToLine(pointTuple, lineTuple); + + // $ExpectType boolean + geometryUtil.isPointOnSegment(point, point, point); + // $ExpectType boolean + geometryUtil.isPointOnSegment(point, point, point, 1); + // $ExpectType boolean + geometryUtil.isPointOnSegment(pointTuple, pointTuple, pointTuple); + // $ExpectType boolean + geometryUtil.isPointOnSegment(pointTuple, pointTuple, pointTuple, 1); + + // $ExpectType boolean + geometryUtil.isPointOnLine(point, line); + // $ExpectType boolean + geometryUtil.isPointOnLine(point, line, 1); + // $ExpectType boolean + geometryUtil.isPointOnLine(pointTuple, lineTuple); + // $ExpectType boolean + geometryUtil.isPointOnLine(pointTuple, lineTuple, 1); + + // $ExpectType boolean + geometryUtil.isPointOnRing(point, ring); + // $ExpectType boolean + geometryUtil.isPointOnRing(point, ring, 1); + // $ExpectType boolean + geometryUtil.isPointOnRing(pointTuple, ringTuple); + // $ExpectType boolean + geometryUtil.isPointOnRing(pointTuple, ringTuple, 1); + + // $ExpectType boolean + geometryUtil.isPointOnPolygon(point, polygon); + // $ExpectType boolean + geometryUtil.isPointOnPolygon(point, polygon, 1); + // $ExpectType boolean + geometryUtil.isPointOnPolygon(pointTuple, polygonTuple); + // $ExpectType boolean + geometryUtil.isPointOnPolygon(pointTuple, polygonTuple, 1); +} + +/** + * lnglat.ts + */ + +// $ExpectType LngLat +new AMap.LngLat(114, 22); +// $ExpectType LngLat +const testLnglat = new AMap.LngLat(113, 21); + +// $ExpectType LngLat +testLnglat.offset(1, 2); + +// $ExpectType number +testLnglat.distance(testLnglat); +// $ExpectType number +testLnglat.distance([testLnglat]); + +// $ExpectType number +testLnglat.getLng(); + +// $ExpectType number +testLnglat.getLat(); + +// $ExpectType boolean +testLnglat.equals(testLnglat); + +// $ExpectType string +testLnglat.toString(); + +// $ExpectType LngLat +testLnglat.add(testLnglat); +// $ExpectType LngLat +testLnglat.add(testLnglat, true); + +// $ExpectType LngLat +testLnglat.subtract(testLnglat); +// $ExpectType LngLat +testLnglat.subtract(testLnglat, true); + +// $ExpectType LngLat +testLnglat.divideBy(1); +// $ExpectType LngLat +testLnglat.divideBy(1, true); + +// $ExpectType LngLat +testLnglat.multiplyBy(1); +// $ExpectType LngLat +testLnglat.multiplyBy(1, true); + +/** + * map.ts + */ + +// $ExpectType Map +new AMap.Map('map'); +// $ExpectType Map +new AMap.Map(div); + +// $ExpectType Map +new AMap.Map(div, {}); + +// $ExpectType Map +const testMap = new AMap.Map(div, { + layers: [tileLayer], + zoom: 15, + center: [1, 2], + labelzIndex: 110, + zooms: [5, 15], + lang: 'zh_cn', + defaultCursor: 'default', + crs: 'EPSG4326', + animateEnable: true, + isHotspot: false, + defaultLayer: tileLayer, + rotateEnable: true, + resizeEnable: true, + showIndoorMap: true, + // indoorMap, // TODO + expandZoomRange: true, + dragEnable: true, + zoomEnable: true, + doubleClickZoom: true, + keyboardEnable: true, + jogEnable: true, + scrollWheel: true, + touchZoom: true, + mapStyle: '', + features: ['road'], + showBuildingBlock: true, + skyColor: '#fff', + preloadMode: true, + mask: [[1, 2], [2, 3], [3, 4]] +}); + +// $ExpectType number +testMap.getZoom(); + +// $ExpectType Layer[] +testMap.getLayers(); + +// $ExpectType LngLat +testMap.getCenter(); + +// $ExpectType HTMLElement | null +testMap.getContainer(); + +testMap.getCity(city => { + // $ExpectType string + city.city; + // $ExpectType string + city.citycode; + // $ExpectType string + city.district; + // $ExpectType string | never[] + city.province; +}); + +// $ExpectType Bounds +testMap.getBounds(); + +// $ExpectType number +testMap.getLabelzIndex(); + +// $ExpectType Lang +testMap.getLang(); + +// $ExpectType Size +testMap.getSize(); + +// $ExpectType number +testMap.getRotation(); + +// $ExpectType Status +const mapStatus = testMap.getStatus(); +// $ExpectType boolean +mapStatus.animateEnable; +// $ExpectType boolean +mapStatus.doubleClickZoom; +// $ExpectType boolean +mapStatus.dragEnable; +// $ExpectType boolean +mapStatus.isHotspot; +// $ExpectType boolean +mapStatus.jogEnable; +// $ExpectType boolean +mapStatus.keyboardEnable; +// $ExpectType boolean +mapStatus.pitchEnable; +// $ExpectType boolean +mapStatus.resizeEnable; +// $ExpectType boolean +mapStatus.rotateEnable; +// $ExpectType boolean +mapStatus.scrollWheel; +// $ExpectType boolean +mapStatus.touchZoom; +// $ExpectType boolean +mapStatus.zoomEnable; + +// $ExpectType string +testMap.getDefaultCursor(); + +// $ExpectType number +testMap.getResolution(); + +// $ExpectType number +testMap.getScale(); +// $ExpectType number +testMap.getScale(1); + +// $ExpectType void +testMap.setZoom(1); + +// $ExpectType void +testMap.setLabelzIndex(1); + +// $ExpectType void +testMap.setLayers([tileLayer]); + +// $ExpectType void +testMap.setCenter(lnglat); +// $ExpectType void +testMap.setCenter([1, 2]); + +// $ExpectType void +testMap.setZoomAndCenter(13, lnglat); +// $ExpectType void +testMap.setZoomAndCenter(13, [1, 2]); + +// $ExpectType void +testMap.setCity('city', (coord, zoom) => { + // $ExpectType string + coord[0]; + // $ExpectType string + coord[1]; + // $ExpectType number + zoom; +}); + +// $ExpectType Bounds +testMap.setBounds(bounds); + +// $ExpectType void +testMap.setLimitBounds(bounds); + +// $ExpectType void +testMap.clearLimitBounds(); + +// $ExpectType void +testMap.setLang('zh_cn'); + +// $ExpectType void +testMap.setRotation(1); + +// $ExpectType void +testMap.setStatus({}); +// $ExpectType void +testMap.setStatus({ + animateEnable: true, + doubleClickZoom: true, + dragEnable: true, + isHotspot: true, + jogEnable: true, + keyboardEnable: true, + pitchEnable: false, + resizeEnable: false, + rotateEnable: false, + scrollWheel: true, + touchZoom: true, + zoomEnable: true +}); + +// $ExpectType void +testMap.setDefaultCursor('default'); + +// $ExpectType void +testMap.zoomIn(); + +// $ExpectType void +testMap.zoomOut(); + +// $ExpectType void +testMap.panTo([1, 2]); +// $ExpectType void +testMap.panTo(lnglat); + +// $ExpectType void +testMap.panBy(1, 2); + +// $ExpectType void +testMap.clearMap(); + +// $ExpectType Map +testMap.plugin('plugin name', () => { }); +// $ExpectType Map +testMap.plugin(['plugin name'], () => { }); + +// $ExpectType void +testMap.clearInfoWindow(); + +// $ExpectType LngLat +testMap.pixelToLngLat(pixel); +// $ExpectType LngLat +testMap.pixelToLngLat(pixel, 1); + +// $ExpectType Pixel +testMap.lnglatToPixel(lnglat); +// $ExpectType Pixel +testMap.lnglatToPixel(lnglat, 1); + +// $ExpectType LngLat +testMap.containerToLngLat(pixel); + +// $ExpectType Pixel +testMap.lngLatToContainer(lnglat); +// $ExpectType Pixel +testMap.lnglatTocontainer(lnglat); + +// $ExpectType void +testMap.setMapStyle(''); +// $ExpectType string +testMap.getMapStyle(); + +// $ExpectType void +testMap.setFeatures('all'); +// $ExpectType void +testMap.setFeatures(['bg']); + +const feature: 'all' | 'bg' | 'point' | 'road' | 'building' | AMap.Map.Feature[] = testMap.getFeatures(); + +// $ExpectType void +testMap.setDefaultLayer(tileLayer); + +// $ExpectType void +testMap.setPitch(1); +// $ExpectType number +testMap.getPitch(); + +// $ExpectType ViewMode +testMap.getViewMode_(); + +// $ExpectType Pixel +testMap.lngLatToGeodeticCoord(lnglat); +// $ExpectType Pixel +testMap.lngLatToGeodeticCoord(lnglatTuple); + +// $ExpectType LngLat +testMap.geodeticCoordToLngLat(pixel); + +// $ExpectType void +testMap.destroy(); + +declare function dblClickHandler(this: AMap.Map, event: AMap.Map.EventMap['dblclick']): void; + +// $ExpectType Map +testMap.on('click', (event: AMap.Map.EventMap['click']) => { + // $ExpectType "click" + event.type; + // $ExpectType Pixel + event.pixel; + // $ExpectType LngLat + event.lnglat; + // $ExpectType Map + event.target; +}); +// $ExpectType Map +testMap.on('dblclick', dblClickHandler); +// $ExpectType Map +testMap.on('complete', (event: AMap.Map.EventMap['complete']) => { + // $ExpectType "complete" + event.type; + // $ExpectError + event.value; +}); +// $ExpectType Map +testMap.on('hotspotclick', (event: AMap.Map.EventMap['hotspotclick']) => { + // $ExpectType string + event.id; + // $ExpectType LngLat + event.lnglat; + // $ExpectType string + event.name; + // $ExpectType "hotspotclick" + event.type; +}); +// $ExpectType Map +testMap.on('custom', (event: AMap.Event<'custom', { test: string }>) => { + // $ExpectType "custom" + event.type; + // $ExpectType string + event.test; +}); + +// $ExpectType Map +testMap.off('dblclick', dblClickHandler); +// $ExpectType Map +testMap.off('click', 'mv'); + +// $ExpectType Map +testMap.emit('click', { + target: testMap, + lnglat, + pixel +}); + +testMap.emit('complete'); +// $ExpectType Map +testMap.emit('hotspotclick', { + lnglat, + name: '123', + id: '123', + isIndoorPOI: true +}); +// $ExpectType Map +testMap.emit('custom', { + test: 1 +}); +// $ExpectType Map +testMap.emit('custom', undefined); + +/** + * pixel.ts + */ + +// $ExpectType Pixel +new AMap.Pixel(10, 20); +// $ExpectType Pixel +const testPixel = new AMap.Pixel(10, 20); + +// $ExpectType number +testPixel.getX(); + +// $ExpectType number +testPixel.getY(); + +// $ExpectType boolean +testPixel.equals(testPixel); + +// $ExpectType string +testPixel.toString(); + +// $ExpectType Pixel +testPixel.add({ x: 1, y: 2 }); +// $ExpectType Pixel +testPixel.add({ x: 1, y: 2 }, false); + +// $ExpectType Pixel +testPixel.round(); + +// $ExpectType Pixel +testPixel.floor(); + +// $ExpectType number +testPixel.length(); + +// $ExpectType number | null +testPixel.direction(); + +// $ExpectType Pixel +testPixel.toFixed(); +// $ExpectType Pixel +testPixel.toFixed(2); + +/** + * size.ts + */ + +// $ExpectType Size +const testSize = new AMap.Size(10, 20); + +// $ExpectType number +testSize.getHeight(); + +// $ExpectType number +testSize.getWidth(); + +// $ExpectType string +testSize.toString(); + +// $ExpectType boolean +testSize.contains({ x: 10, y: 10 }); + +/** + * util.ts + */ + +const util = AMap.Util; + +// $ExpectType string +util.colorNameToHex('colorName'); + +// $ExpectType string +util.rgbHex2Rgba('rgbHex'); + +// $ExpectType string +util.argbHex2Rgba('argbHex'); + +// $ExpectType boolean +util.isEmpty({}); +// $ExpectError +util.isEmpty(1); + +// $ExpectType number[] +util.deleteItemFromArray([1], 1); + +// $ExpectType number[] +util.deleteItemFromArrayByIndex([1], 1); + +// $ExpectType number +util.indexOf([1], 1); +// $ExpectError +util.indexOf([1], '1'); + +// $ExpectType number +util.format(1); +// $ExpectType number +util.format(1, 1); + +declare const value1: number | number[]; +// $ExpectType boolean +util.isArray(value1); +if (util.isArray(value1)) { + // $ExpectType number[] + value1; +} else { + // $ExpectType number + value1; +} + +declare const value2: number | HTMLElement; +// $ExpectType boolean +util.isDOM(value2); +if (util.isDOM(value2)) { + // $ExpectType HTMLElement + value2; +} else { + // $ExpectType number + value2; +} + +// $ExpectType boolean +util.includes([1], 1); +// $ExpectError +util.includes([1], '1'); + +// $ExpectType number +util.requestIdleCallback(() => { }); +// $ExpectType number +const idleCallbackHandle = util.requestIdleCallback(() => { }, { timeout: 1 }); + +// $ExpectType void +util.cancelIdleCallback(idleCallbackHandle); + +// $ExpectType number +util.requestAnimFrame(() => { }); +// $ExpectType number +const animFrameHandle = util.requestAnimFrame(function() { + // $ExpectType number + this.test; +}, { test: 1 }); + +// $ExpectType void +util.cancelAnimFrame(animFrameHandle); + +/** + * view2d.ts + */ + +// $ExpectType View2D +new AMap.View2D(); +// $ExpectType View2D +new AMap.View2D({}); + +// $ExpectType View2D +new AMap.View2D({ + center: [1, 2], + rotation: 1, + zoom: 10, + crs: 'EPGS3395' +}); + +// $ExpectType View2D +const testView2d = new AMap.View2D({ + center: lnglat +}); + +// $ExpectType View2D +testView2d.on('complete', () => { }); + +/** + * layer/buildings.ts + */ + +// $ExpectType Buildings +new AMap.Buildings(); +// $ExpectType Buildings +new AMap.Buildings(); +// $ExpectType Buildings +const testBuildings = new AMap.Buildings({ + zooms: [1, 18], + opacity: 0.8, + heightFactor: 1, + visible: true, + zIndex: 10, + map +}); + +testBuildings.setStyle({ + hideWithoutStyle: false, + areas: [ + { + visible: true, + rejectTexture: true, + color1: 'ffffff00', + color2: 'ffffcc00', + path: [[1, 2]] + }, + { + visible: true, + rejectTexture: true, + color1: 'ffffff00', + color2: 'ffffcc00', + path: [lnglat] + }, + { + color1: 'ff99ff00', + path: [lnglat] + }, + ] +}); + +/** + * layer/canvasLayer.ts + */ + +// $ExpectType CanvasLayer +new AMap.CanvasLayer({ + map, + bounds, + visible: true, + zooms: [1, 2], + opacity: 1 +}); + +// $ExpectType CanvasLayer +new AMap.CanvasLayer(); +// $ExpectType CanvasLayer +new AMap.CanvasLayer({}); +// $ExpectType CanvasLayer +const testCanvasLayer = new AMap.CanvasLayer({ + bounds +}); + +// $ExpectType void +testCanvasLayer.setMap(null); +// $ExpectType void +testCanvasLayer.setMap(map); + +// $ExpectType Map | null | undefined +testCanvasLayer.getMap(); + +// $ExpectType void +testCanvasLayer.show(); + +// $ExpectType void +testCanvasLayer.hide(); + +// $ExpectType number +testCanvasLayer.getzIndex(); + +// $ExpectType void +testCanvasLayer.setzIndex(10); + +// $ExpectType HTMLCanvasElement | null +testCanvasLayer.getElement(); + +// $ExpectType void +testCanvasLayer.setCanvas(canvasEle); + +// $ExpectType HTMLCanvasElement | undefined +testCanvasLayer.getCanvas(); + +/** + * layer/flexible.ts + */ + +// $ExpectType Flexible +new AMap.TileLayer.Flexible(); +// $ExpectType Flexible +new AMap.TileLayer.Flexible({}); +// $ExpectType Flexible +const testFlexible = new AMap.TileLayer.Flexible({ + createTile(x, y, z, success, fail) { + // $ExpectType number + x; + // $ExpectType number + y; + // $ExpectType number + z; + // $ExpectType void + success(imgEle); + // $ExpectType void + success(canvasEle); + // $ExpectType void + fail(); + }, + cacheSize: 10, + opacity: 1, + visible: true, + map, + zIndex: 1, + zooms: [1, 2] +}); + +// $ExpectType void +testFlexible.setMap(null); +// $ExpectType void +testFlexible.setMap(map); + +// $ExpectType Map | null | undefined +testFlexible.getMap(); + +// $ExpectType void +testFlexible.show(); + +// $ExpectType void +testFlexible.hide(); + +// $ExpectType void +testFlexible.setzIndex(10); + +// $ExpectType number +testFlexible.getzIndex(); + +/** + * layer/imageLayer.ts + */ + +// $ExpectType ImageLayer +new AMap.ImageLayer({ + map, + bounds, + visible: true, + zooms: [1, 2], + opacity: 1 +}); + +// $ExpectType ImageLayer +new AMap.ImageLayer(); +// $ExpectType ImageLayer +new AMap.ImageLayer({}); +// $ExpectType ImageLayer +const testImageLayer = new AMap.ImageLayer({ + bounds +}); + +// $ExpectType void +testImageLayer.setMap(null); +// $ExpectType void +testImageLayer.setMap(map); + +// $ExpectType Map | null | undefined +testImageLayer.getMap(); + +// $ExpectType void +testImageLayer.show(); + +// $ExpectType void +testImageLayer.hide(); + +// $ExpectType number +testImageLayer.getzIndex(); + +// $ExpectType void +testImageLayer.setzIndex(10); + +// $ExpectType HTMLImageElement | null +testImageLayer.getElement(); + +// $ExpectType void +testImageLayer.setImageUrl('url'); + +// $ExpectType string | undefined +testImageLayer.getImageUrl(); + +/** + * layer/layer.ts + */ + +// $ExpectError +new AMap.Layer(); + +// $ExpectType HTMLDivElement | undefined +layer.getContainer(); + +// $ExpectType [number, number] +layer.getZooms(); + +// $ExpectType void +layer.setOpacity(1); + +// $ExpectType number +layer.getOpacity(); + +// $ExpectType void +layer.show(); + +// $ExpectType void +layer.hide(); + +// $ExpectType void +layer.setMap(); +// $ExpectType void +layer.setMap(map); + +// $ExpectType void +layer.setzIndex(1); + +// $ExpectType number +layer.getzIndex(); + +/** + * layer/layerGroup.ts + */ + +// $ExpectError +new AMap.LayerGroup(); + +// $ExpectType LayerGroup +new AMap.LayerGroup(tileLayer); +// $ExpectType LayerGroup +const testTileLayerGroup = new AMap.LayerGroup([tileLayer]); +// $ExpectType LayerGroup +const testAnyLauerGroup = new AMap.LayerGroup([]); + +// $ExpectType LayerGroup +testTileLayerGroup.addLayer(tileLayer); +// $ExpectType LayerGroup +testTileLayerGroup.addLayer([tileLayer]); +// $ExpectError +testTileLayerGroup.addLayer(massMarksLayer); + +// $ExpectType TileLayer[] +testTileLayerGroup.getLayers(); + +// $ExpectType TileLayer | null +testTileLayerGroup.getLayer(function(item, index, list) { + // $ExpectType TileLayer + item; + // $ExpectType number + index; + // $ExpectType TileLayer[] + list; + // $ExpectType null + this; + + return true; +}); + +testTileLayerGroup.hasLayer(function(item, index, list) { + // $ExpectType TileLayer + item; + // $ExpectType number + index; + // $ExpectType TileLayer[] + list; + // $ExpectType null + this; + + return true; +}); +testTileLayerGroup.hasLayer(tileLayer); + +// $ExpectType LayerGroup +testTileLayerGroup.removeLayer(tileLayer); +// $ExpectType LayerGroup +testTileLayerGroup.removeLayer([tileLayer]); + +// $ExpectType LayerGroup +testTileLayerGroup.clearLayers(); + +testTileLayerGroup.eachLayer(function(item, index, list) { + // $ExpectType TileLayer + item; + // $ExpectType number + index; + // $ExpectType TileLayer[] + list; + // $ExpectType TileLayer + this; +}); +testTileLayerGroup.eachLayer(function(item, index, list) { + // $ExpectType TileLayer + item; + // $ExpectType number + index; + // $ExpectType TileLayer[] + list; + // $ExpectType number + this.test; +}, { test: 1 }); + +// $ExpectType LayerGroup +testTileLayerGroup.setMap(map); + +// $ExpectType LayerGroup +testTileLayerGroup.hide(); + +// $ExpectType LayerGroup +testTileLayerGroup.show(); + +// $ExpectType LayerGroup +testTileLayerGroup.reload(); + +// $ExpectType LayerGroup +testTileLayerGroup.setOptions({}); + +// $ExpectType LayerGroup +testTileLayerGroup.setOptions({ + tileSize: 256 +}); +// layerGruop.setOptions({ +// // $ExpectError +// interval: 1 +// }); + +testAnyLauerGroup.addLayer(tileLayer); + +testAnyLauerGroup.addLayer(massMarksLayer); + +testAnyLauerGroup.setOptions({ + test: 1 +}); + +/** + * layer/massMarks.ts + */ + +const massMarksStyle1 = { + anchor: pixel, + url: '', + size, + rotation: 1 +}; +const massMarksStyle2 = { + anchor: pixel, + url: '', + size +}; +const massMarksData1 = { + lnglat +}; + +interface MassMarksCustomData extends AMap.MassMarks.Data { + name: string; + id: string; +} +const massMarksMassMarksCustomData: MassMarksCustomData = { + lnglat: [1, 2], + style: 1, + name: '', + id: '' +}; + +// $ExpectError +new AMap.MassMarks(); +// $ExpectError +new AMap.MassMarks([], {}); + +new AMap.MassMarks([], { + style: [massMarksStyle1, massMarksStyle2] +}); +new AMap.MassMarks([massMarksData1], { + style: [massMarksStyle1, massMarksStyle2] +}); + +// $ExpectType MassMarks +const testMassMarks = new AMap.MassMarks([massMarksMassMarksCustomData], { + style: [massMarksStyle1, massMarksStyle2] +}); + +// $ExpectType void +testMassMarks.setStyle(massMarksStyle1); +// $ExpectType void +testMassMarks.setStyle([massMarksStyle1]); + +// $ExpectType Style | Style[] +testMassMarks.getStyle(); + +// $ExpectType void +testMassMarks.setData(''); + +// $ExpectError +testMassMarks.setData(massMarksData1); +// $ExpectError +testMassMarks.setData(massMarksMassMarksCustomData); + +const massMarksCustomData = testMassMarks.getData()[0]; +// $ExpectType string +massMarksCustomData.name; +// $ExpectType string +massMarksCustomData.id; +// $ExpectType LngLat +massMarksCustomData.lnglat; + +// $ExpectType void +testMassMarks.clear(); + +testMassMarks.on('click', (event: AMap.MassMarks.EventMap['click']) => { + // $ExpectType "click" + event.type; + + // $ExpectType MassMarksCustomData + event.data; + + // $ExpectType MassMarks + event.target; +}); + +/** + * layer/tileLayer.ts + */ + +// $ExpectType TileLayer +new AMap.TileLayer(); + +// $ExpectType TileLayer +new AMap.TileLayer({}); + +// $ExpectType TileLayer +const testTileLayer = new AMap.TileLayer({ + map, + tileSize: 256, + tileUrl: '', + errorUrl: '', + getTileUrl: (x, y, z) => '', + zIndex: 1, + opacity: 0.1, + zooms: [3, 18], + detectRetina: true +}); + +// $ExpectType string[] +testTileLayer.getTiles(); + +// $ExpectType void +testTileLayer.reload(); + +// $ExpectType void +testTileLayer.setTileUrl(''); +// $ExpectType void +testTileLayer.setTileUrl((x, y, level) => { + // $ExpectType number + x; + // $ExpectType number + y; + // $ExpectType number + level; + return ''; +}); + +// $ExpectType TileLayer +testTileLayer.on('complete', () => { }); + +testTileLayer.off('complete', () => { }); + +testTileLayer.emit('complete'); + +// $ExpectType Traffic +const testTrafficLayer = new AMap.TileLayer.Traffic({}); +// $ExpectType Traffic +new AMap.TileLayer.Traffic({ + autoRefresh: true, + interval: 180 +}); + +testTrafficLayer.on('complete', () => { }); + +/** + * layer/videoLayer.ts + */ + +// $ExpectType VideoLayer +new AMap.VideoLayer({ + map, + bounds, + visible: true, + zooms: [1, 2], + opacity: 1 +}); + +// $ExpectType VideoLayer +new AMap.VideoLayer(); +// $ExpectType VideoLayer +new AMap.VideoLayer({}); +// $ExpectType VideoLayer +const testVideoLayer = new AMap.VideoLayer({ + bounds +}); + +// $ExpectType void +testVideoLayer.setMap(null); +// $ExpectType void +testVideoLayer.setMap(map); + +// $ExpectType Map | null | undefined +testVideoLayer.getMap(); + +// $ExpectType void +testVideoLayer.show(); + +// $ExpectType void +testVideoLayer.hide(); + +// $ExpectType number +testVideoLayer.getzIndex(); + +// $ExpectType void +testVideoLayer.setzIndex(10); + +// $ExpectType HTMLVideoElement | null +testVideoLayer.getElement(); + +// $ExpectType void +testVideoLayer.setVideoUrl('url'); + +// $ExpectType string | string[] | undefined +testVideoLayer.getVideoUrl(); + +/** + * layer/wms.ts + */ + +// $ExpectType WMS +new AMap.TileLayer.WMS({ + url: 'url', + params: {} +}); +// $ExpectType WMS +const testWms = new AMap.TileLayer.WMS({ + url: 'url', + blend: true, + params: { + VERSION: 'version', + LAYERS: 'layers', + STYLES: 'styles', + FORMAT: 'format', + TRANSPARENT: 'TRUE', + BGCOLOR: '#000', + EXCEPTIONS: 'exceptions', + TIME: 'time', + ELEVATION: 'elevation' + }, + zooms: [1, 2], + tileSize: 256, + opacity: 1, + zIndex: 10, + visible: true +}); + +// $ExpectType void +testWms.setMap(map); +// $ExpectType void +testWms.setMap(null); + +// $ExpectType Map | null | undefined +testWms.getMap(); + +// $ExpectType void +testWms.show(); + +// $ExpectType void +testWms.hide(); + +// $ExpectType void +testWms.setzIndex(10); + +// $ExpectType number +testWms.getzIndex(); + +// $ExpectType void +testWms.setUrl('url'); + +// $ExpectType string +testWms.getUrl(); + +// $ExpectType void +testWms.setParams({ + VERSION: 'version', + LAYERS: 'layers', + STYLES: 'styles', + FORMAT: 'format', + TRANSPARENT: 'TRUE', + BGCOLOR: '#000', + EXCEPTIONS: 'exceptions', + TIME: 'time', + ELEVATION: 'elevation' +}); + +{ + const params = testWms.getParams(); + // $ExpectType string | undefined + params.VERSION; + // $ExpectType string | undefined + params.LAYERS; + // $ExpectType string | undefined + params.STYLES; + // $ExpectType string | undefined + params.FORMAT; + // $ExpectType "TRUE" | "FALSE" | undefined + params.TRANSPARENT; + // $ExpectType string | undefined + params.BGCOLOR; + // $ExpectType string | undefined + params.EXCEPTIONS; + // $ExpectType string | undefined + params.TIME; + // $ExpectType string | undefined + params.ELEVATION; +} + +/** + * layer/wmts.ts + */ + +// $ExpectType WMTS +new AMap.TileLayer.WMTS({ + url: 'url', + params: {} +}); +// $ExpectType WMTS +const testWmts = new AMap.TileLayer.WMTS({ + url: 'url', + blend: true, + tileSize: 256, + zooms: [1, 2], + opacity: 1, + zIndex: 10, + visible: true, + params: { + Version: 'version', + Layer: 'layers', + Style: 'style', + Format: 'format' + } +}); + +// $ExpectType void +testWmts.setMap(map); +// $ExpectType void +testWmts.setMap(null); + +// $ExpectType Map | null | undefined +testWmts.getMap(); + +// $ExpectType void +testWmts.show(); + +// $ExpectType void +testWmts.hide(); + +// $ExpectType void +testWmts.setzIndex(10); + +// $ExpectType number +testWmts.getzIndex(); + +// $ExpectType void +testWmts.setUrl('url'); + +// $ExpectType string +testWmts.getUrl(); + +// $ExpectType void +testWmts.setParams({ + Version: 'version', + Layer: 'layers', + Style: 'style', + Format: 'format' +}); + +{ + const params = testWmts.getParams(); + // $ExpectType string | undefined + params.Version; + // $ExpectType string | undefined + params.Layer; + // $ExpectType string | undefined + params.Style; + // $ExpectType string | undefined + params.Format; +} + +/** + * overlay/bezierCurve.ts + */ + +interface BezierCurveExtraData { + test: number; +} + +const bezierCurvePath = [ + [1, 2, 3, 4], + [1, 2, 3], + [ + [1, 2, 3], + [1, 2] + ], + [1, 2] +]; + +// $ExpectError +new AMap.BezierCurve(); +// $ExpectError +new AMap.BezierCurve({}); +// $ExpectType BezierCurve +const testBezierCurve = new AMap.BezierCurve({ + map, + path: bezierCurvePath, + strokeColor: '#FF0000', + strokeOpacity: 0.6, + strokeWeight: 10, + strokeStyle: 'dashed', + strokeDasharray: [1, 5], + zIndex: 10, + bubble: false, + showDir: true, + cursor: 'pointer', + isOutline: true, + outlineColor: '#00FF00', + borderWeight: 2 +}); + +// $ExpectType void +testBezierCurve.setPath(bezierCurvePath); + +// $ExpectType void +testBezierCurve.setPath(bezierCurvePath); + +// $ExpectType void +testBezierCurve.setOptions({}); +testBezierCurve.setOptions({ + map, + path: bezierCurvePath, + strokeColor: '#FF0000', + strokeOpacity: 0.6, + strokeWeight: 10, + strokeStyle: 'dashed', + strokeDasharray: [1, 5], + zIndex: 10, + bubble: false, + showDir: true, + cursor: 'pointer', + isOutline: true, + outlineColor: '#00FF00', + borderWeight: 2 +}); + +{ + const options = testBezierCurve.getOptions(); + + // $ExpectType number | undefined + options.borderWeight; + // $ExpectType boolean | undefined + options.bubble; + // $ExpectType boolean | undefined + options.clickable; + // $ExpectType string | undefined + options.dirColor; + // $ExpectType string | undefined + options.dirImg; + // $ExpectType {} | BezierCurveExtraData | undefined + options.extData; + // $ExpectType boolean | undefined + options.geodesic; + // $ExpectType boolean | undefined + options.isOutline; + // $ExpectType "round" | "butt" | "square" | undefined + options.lineCap; + // $ExpectType "miter" | "round" | "bevel" | undefined + options.lineJoin; + // $ExpectType Map | undefined + options.map; + // $ExpectType string | undefined + options.outlineColor; + // $ExpectType (LngLat & { controlPoints: LngLat[]; })[] | undefined + options.path; + // $ExpectType boolean | undefined + options.showDir; + // $ExpectType string | undefined + options.strokeColor; + // $ExpectType number[] | undefined + options.strokeDasharray; + // $ExpectType number | undefined + options.strokeOpacity; + // $ExpectType "dashed" | "solid" | undefined + options.strokeStyle; + // $ExpectType number | undefined + options.strokeWeight; + // $ExpectType number | undefined + options.zIndex; +} + +// $ExpectType number +testBezierCurve.getLength(); + +// $ExpectType Bounds | null +testBezierCurve.getBounds(); + +// $ExpectType void +testBezierCurve.show(); + +// $ExpectType void +testBezierCurve.hide(); + +// $ExpectType void +testBezierCurve.setMap(null); +testBezierCurve.setMap(map); + +// $ExpectType void +testBezierCurve.setExtData({ test: 1 }); +// $ExpectError +testBezierCurve.setExtData({ test: '123' }); + +// $ExpectType {} | BezierCurveExtraData +testBezierCurve.getExtData(); + +testBezierCurve.on('click', (event: AMap.BezierCurve.EventMap['click']) => { + // $ExpectType "click" + event.type; + // $ExpectType LngLat + event.lnglat; + // $ExpectType BezierCurve + event.target; +}); + +testBezierCurve.on('show', (event: AMap.BezierCurve.EventMap['show']) => { + // $ExpectType "show" + event.type; + // $ExpectType BezierCurve + event.target; +}); + +testBezierCurve.on('options', (event: AMap.BezierCurve.EventMap['options']) => { + // $ExpectType "options" + event.type; + // $ExpectError + event.target; +}); + +/** + * overlay/circle.ts + */ + +interface CircleExtraData { + test: number; +} + +// $ExpectType Circle +new AMap.Circle(); +new AMap.Circle({}); +// $ExpectType Circle +const testCircle = new AMap.Circle({ + map, + zIndex: 10, + center: lnglat, + bubble: true, + cursor: 'pointer', + radius: 1000, + strokeColor: '#FF0000', + strokeOpcity: 0.8, + strokeWeight: 3, + fillColor: '#00FF00', + fillOpacity: 0.5, + strokeStyle: 'dashed', + extData: { test: 1 }, + strokeDasharray: [2, 4] +}); + +// $ExpectType void +testCircle.setCenter(lnglat); +// $ExpectType void +testCircle.setCenter(lnglatTuple); + +// $ExpectType LngLat | undefined +testCircle.getCenter(); + +// $ExpectType Bounds | null +testCircle.getBounds(); + +// $ExpectType void +testCircle.setRadius(100); + +// $ExpectType number +testCircle.getRadius(); + +// $ExpectType void +testCircle.setOptions({}); +testCircle.setOptions({ + map, + zIndex: 10, + center: lnglat, + bubble: true, + cursor: 'pointer', + radius: 1000, + strokeColor: '#FF0000', + strokeOpcity: 0.8, + strokeWeight: 3, + fillColor: '#00FF00', + fillOpacity: 0.5, + strokeStyle: 'dashed', + extData: { test: 1 }, + strokeDasharray: [2, 4] +}); + +{ + const options = testCircle.getOptions(); + // $ExpectType boolean | undefined + options.bubble; + // $ExpectType LngLat | undefined + options.center; + // $ExpectType boolean | undefined + options.clickable; + // $ExpectType {} | CircleExtraData | undefined + options.extData; + // $ExpectType string | undefined + options.fillColor; + // $ExpectType number | undefined + options.fillOpacity; + // $ExpectType "miter" | "round" | "bevel" | undefined + options.lineJoin; + // $ExpectType Map | undefined + options.map; + // $ExpectType LngLat[] | undefined + options.path; + // $ExpectType number | undefined + options.radius; + // $ExpectType string | undefined + options.strokeColor; + // $ExpectType number[] | undefined + options.strokeDasharray; + // $ExpectType number | undefined + options.strokeOpacity; + // $ExpectType "dashed" | "solid" | undefined + options.strokeStyle; + // $ExpectType number | undefined + options.strokeWeight; + // $ExpectType string | undefined + options.texture; + // $ExpectType number | undefined + options.zIndex; +} + +// $ExpectType Bounds | null +testCircle.getBounds(); + +// $ExpectType void +testCircle.hide(); + +// $ExpectType void +testCircle.show(); + +// $ExpectType void +testCircle.setMap(null); +// $ExpectType void +testCircle.setMap(map); + +// $ExpectType void +testCircle.setExtData({ test: 2 }); +// $ExpectError +testCircle.setExtData({ test: '1' }); + +// $ExpectType {} | CircleExtraData +testCircle.getExtData(); + +// $ExpectType boolean +testCircle.contains(lnglat); +// $ExpectType boolean +testCircle.contains(lnglatTuple); + +testCircle.on('click', (event: AMap.Circle.EventMap['click']) => { + // $ExpectType "click" + event.type; + // $ExpectType Circle + event.target; +}); + +testCircle.on('setCenter', (event: AMap.Circle.EventMap['setCenter']) => { + // $ExpectType "setCenter" + event.type; + // $ExpectError + event.target; +}); + +testCircle.on('change', (event: AMap.Circle.EventMap['change']) => { + // $ExpectType "change" + event.type; + // $ExpectType Circle + event.target; +}); + +/** + * overlay/contextMenu.ts + */ + +interface ContextMenuExtraData { + test: number; +} +// $ExpectType ContextMenu +new AMap.ContextMenu(); +// $ExpectType ContextMenu +new AMap.ContextMenu({}); +// $ExpectType ContextMenu +const testContextMenu = new AMap.ContextMenu({ + content: '

content
', +}); + +// $ExpectType void +testContextMenu.addItem('item', function() { + // $ExpectType HTMLLIElement + this; +}); +// $ExpectType void +testContextMenu.addItem('item', () => { }, 1); + +// $ExpectType void +testContextMenu.removeItem('item', () => {}); + +// $ExpectType void +testContextMenu.open(map, lnglatTuple); +// $ExpectType void +testContextMenu.open(map, lnglat); + +// $ExpectType void +testContextMenu.close(); + +testContextMenu.on('items', (event: AMap.ContextMenu.EventMap['items']) => { + // $ExpectType "items" + event.type; +}); + +testContextMenu.on('open', (event: AMap.ContextMenu.EventMap['open']) => { + // $ExpectType "open" + event.type; + // $ExpectType ContextMenu + event.target; +}); + +/** + * overlay/ellipse.ts + */ + +interface EllipseExtraData { + test: number; +} +// $ExpectType Ellipse +new AMap.Ellipse(); +// $ExpectType Ellipse +new AMap.Ellipse({}); +// $ExpectType Ellipse +const testEllipse = new AMap.Ellipse({ + map, + zIndex: 10, + center: lnglat, + radius: [10000, 15000], + bubble: false, + cursor: 'pointer', + strokeColor: '#FF0000', + strokeOpacity: 0.8, + strokeWeight: 2, + fillColor: '#0000FF', + fillOpacity: 0.5, + strokeStyle: 'dashed', + extData: { test: 1 }, + strokeDasharray: [1, 5] +}); + +// $ExpectType LngLat | undefined +testEllipse.getCenter(); + +// $ExpectType void +testEllipse.setCenter(lnglat); +// $ExpectType void +testEllipse.setCenter(lnglatTuple); + +// $ExpectType Bounds | null +testEllipse.getBounds(); + +// $ExpectType void +testEllipse.setOptions({ + map, + zIndex: 10, + center: lnglat, + radius: [10000, 15000], + bubble: false, + cursor: 'pointer', + strokeColor: '#FF0000', + strokeOpacity: 0.8, + strokeWeight: 2, + fillColor: '#0000FF', + fillOpacity: 0.5, + strokeStyle: 'dashed', + extData: { test: 1 }, + strokeDasharray: [1, 5] +}); + +{ + const options = testEllipse.getOptions(); + + // $ExpectType boolean | undefined + options.bubble; + // $ExpectType LngLat | undefined + options.center; + // $ExpectType boolean | undefined + options.clickable; + // $ExpectType {} | EllipseExtraData | undefined + options.extData; + // $ExpectType string | undefined + options.fillColor; + // $ExpectType number | undefined + options.fillOpacity; + // $ExpectType "miter" | "round" | "bevel" | undefined + options.lineJoin; + // $ExpectType Map | undefined + options.map; + // $ExpectType LngLat[] | undefined + options.path; + // $ExpectType [number, number] | undefined + options.radius; + // $ExpectType string | undefined + options.strokeColor; + // $ExpectType number[] | undefined + options.strokeDasharray; + // $ExpectType number | undefined + options.strokeOpacity; + // $ExpectType "dashed" | "solid" | undefined + options.strokeStyle; + // $ExpectType number | undefined + options.strokeWeight; + // $ExpectType string | undefined + options.texture; + // $ExpectType number | undefined + options.zIndex; +} + +// $ExpectType void +testEllipse.hide(); + +// $ExpectType void +testEllipse.show(); + +// $ExpectType void +testEllipse.setMap(null); +// $ExpectType void +testEllipse.setMap(map); + +// $ExpectType void +testEllipse.setExtData({ test: 2 }); +// $ExpectType {} | EllipseExtraData +testEllipse.getExtData(); + +// $ExpectType boolean +testEllipse.contains(lnglat); +// $ExpectType boolean +testEllipse.contains(lnglatTuple); + +/** + * overlay/geoJSON.ts + */ + +interface GeoJSONExtraData { + test: number; +} + +const geoJSONObject: AMap.GeoJSON.GeoJSONObject[] = [ + { + type: 'Feature', + properties: {}, + geometry: { + type: 'Point', + coordinates: lnglatTuple + } + }, + { + type: 'Feature', + properties: { test: 1 }, + geometry: { + type: 'LineString', + coordinates: [lnglatTuple, lnglatTuple] + } + } +]; + +// $ExpectType GeoJSON +new AMap.GeoJSON(); +// $ExpectType GeoJSON +new AMap.GeoJSON({}); +// $ExpectType GeoJSON +const testGeoJSON = new AMap.GeoJSON({ + geoJSON: geoJSONObject, + getMarker(obj, lnglat) { + // $ExpectType GeoJSONObject + obj; + // $ExpectType LngLat + lnglat; + return testMarker; + }, + getPolyline(obj, lnglats) { + // $ExpectType GeoJSONObject + obj; + // $ExpectType LngLat[] + lnglats; + return testPolyline; + }, + getPolygon(obj, lnglats) { + // $ExpectType GeoJSONObject + obj; + // $ExpectType LngLat[] + lnglats; + return testPolygon; + }, + coordsToLatLng(coord) { + // $ExpectType LngLat + coord; + return coord; + } +}); + +// $ExpectType void +testGeoJSON.importData(geoJSONObject); + +// $ExpectType GeoJSON +testGeoJSON.removeOverlay(testMarker); +// $ExpectType GeoJSON +testGeoJSON.removeOverlay([testMarker]); + +// $ExpectType boolean +testGeoJSON.hasOverlay(testMarker); +// $ExpectType boolean +testGeoJSON.hasOverlay(m => m === testMarker); + +// $ExpectType GeoJSON +testGeoJSON.addOverlay(testMarker); +// $ExpectType GeoJSON +testGeoJSON.addOverlay([testMarker]); + +// $ExpectType GeoJSONObject[] +testGeoJSON.toGeoJSON(); + +// $ExpectType GeoJSON +testGeoJSON.setMap(null); +// $ExpectType GeoJSON +testGeoJSON.setMap(map); + +// $ExpectType GeoJSON +testGeoJSON.hide(); + +// $ExpectType GeoJSON +testGeoJSON.show(); + +testGeoJSON.on('click', (event: AMap.MapsEvent<'click', AMap.Overlay>) => { + // $ExpectType "click" + event.type; + // $ExpectType Overlay + event.target; +}); + +/** + * overlay/icon.ts + */ + +// $ExpectType Icon +new AMap.Icon(); +// $ExpectType Icon +new AMap.Icon({}); +// $ExpectType Icon +new AMap.Icon({ + size, + imageOffset: pixel, + image: 'image uri', + imageSize: size +}); +// $ExpectType Icon +const testIcon = new AMap.Icon({ + size: [1, 2], + imageOffset: pixel, + image: 'image uri', + imageSize: [1, 2] +}); + +// $ExpectType Size +testIcon.getImageSize(); + +// $ExpectType void +testIcon.setImageSize(size); +// $ExpectType void +testIcon.setImageSize([1, 2]); + +/** + * overlay/infoWindow.ts + */ + +interface InfoWindowExtraData { + test: number; +} + +// $ExpectType InfoWindow +new AMap.InfoWindow(); +// $ExpectType InfoWindow +new AMap.InfoWindow({}); +// $ExpectType InfoWindow +const testInfoWindow = new AMap.InfoWindow({ + isCustom: false, + autoMove: false, + closeWhenClickMap: false, + content: 'content', + size: [100, 100], + offset: new AMap.Pixel(10, 10), + position: lnglat, + showShadow: true +}); + +// $ExpectType void +testInfoWindow.open(map); +// $ExpectType void +testInfoWindow.open(map, lnglat); +// $ExpectType void +testInfoWindow.open(map, lnglatTuple); + +// $ExpectType void +testInfoWindow.close(); + +// $ExpectType boolean +testInfoWindow.getIsOpen(); + +// $ExpectType void +testInfoWindow.setContent('content'); +// $ExpectType void +testInfoWindow.setContent(div); + +// $ExpectType string | HTMLElement | undefined +testInfoWindow.getContent(); + +// $ExpectType void +testInfoWindow.setPosition(lnglat); +// $ExpectType void +testInfoWindow.setPosition(lnglatTuple); + +// $ExpectType LngLat | undefined +testInfoWindow.getPosition(); + +// $ExpectType Size | undefined +testInfoWindow.getSize(); + +testInfoWindow.on('change', (event: AMap.InfoWindow.EventMap['change']) => { + // $ExpectType "change" + event.type; + // $ExpectType InfoWindow + event.target; +}); + +testInfoWindow.on('close', (event: AMap.InfoWindow.EventMap['close']) => { + // $ExpectType "close" + event.type; + // $ExpectType InfoWindow + event.target; +}); + +testInfoWindow.on('open', (event: AMap.InfoWindow.EventMap['open']) => { + // $ExpectType "open" + event.type; + // $ExpectType InfoWindow + event.target; +}); + +/** + * overlay/marker.ts + */ + +interface MarkerExtraData { + test: number; +} + +// $ExpectType Marker +new AMap.Marker(); +// $ExpectType Marker +new AMap.Marker(); +// $ExpectType Marker +new AMap.Marker({}); +// $ExpectType Marker +const testMarker = new AMap.Marker({ + map, + position: lnglat, + offset: pixel, + icon: 'iconUrl', + content: 'htmlString', + topWhenClick: true, + raiseOnDrag: true, + cursor: 'default', + visible: true, + zIndex: 10, + angle: 10, + autoRotation: true, + animation: 'AMAP_ANIMATION_BOUNCE', + shadow: icon, + title: '123', + clickable: true, + shape: markerShape, + extData: { + test: 123 + } +}); + +// $ExpectType void +testMarker.markOnAMAP({ + name: '123', + position: [1, 2] +}); +// $ExpectType void +testMarker.markOnAMAP(); +// $ExpectType void +testMarker.markOnAMAP({}); +// $ExpectType void +testMarker.markOnAMAP({ + position: [1, 2], + name: '123' +}); + +// $ExpectType Pixel +testMarker.getOffset(); + +// $ExpectType void +testMarker.setOffset(pixel); + +// $ExpectType void +testMarker.setAnimation('AMAP_ANIMATION_BOUNCE'); + +// $ExpectType AnimationName +testMarker.getAnimation(); + +// $ExpectType void +testMarker.setClickable(true); + +// $ExpectType boolean +testMarker.getClickable(); + +// $ExpectType LngLat | undefined +testMarker.getPosition(); + +// $ExpectType void +testMarker.setPosition(lnglat); + +// $ExpectType void +testMarker.setAngle(0); + +// $ExpectType void +testMarker.setLabel(); +// $ExpectType void +testMarker.setLabel({}); +// $ExpectType void +testMarker.setLabel({ + content: 'label content', + offset: pixel +}); + +// $ExpectType Label | undefined +testMarker.getLabel(); + +// $ExpectType number +testMarker.getAngle(); + +// $ExpectType void +testMarker.setzIndex(100); + +// $ExpectType number +testMarker.getzIndex(); + +// $ExpectType void +testMarker.setIcon('icon uri'); +// $ExpectType void +testMarker.setIcon(icon); + +// $ExpectType string | Icon | undefined +testMarker.getIcon(); + +// $ExpectType void +testMarker.setDraggable(true); + +// $ExpectType boolean +testMarker.getDraggable(); + +// $ExpectType void +testMarker.setCursor('default'); + +// $ExpectType void +testMarker.setContent('content'); +// $ExpectType void +testMarker.setContent(domEle); + +// $ExpectType string | HTMLElement +testMarker.getContent(); + +// $ExpectType void +testMarker.moveAlong([lnglat], 100); +// $ExpectError +testMarker.moveAlong([[1, 2]], 100); +// $ExpectType void +testMarker.moveAlong([lnglat], 100, t => t, false); + +// $ExpectType void +testMarker.moveTo(lnglat, 100); +// $ExpectType void +testMarker.moveTo([1, 2], 100); +// $ExpectType void +testMarker.moveTo([1, 2], 100, t => t); + +// $ExpectType void +testMarker.stopMove(); + +// $ExpectType boolean +testMarker.pauseMove(); + +// $ExpectType boolean +testMarker.resumeMove(); + +// $ExpectType void +testMarker.setMap(map); + +// $ExpectType void +testMarker.setTitle('title'); +// $ExpectError +testMarker.setTitle(); + +// $ExpectType string | undefined +testMarker.getTitle(); + +// $ExpectType void +testMarker.setTop(true); + +// $ExpectType boolean +testMarker.getTop(); + +// $ExpectType void +testMarker.setShadow(); +// $ExpectType void +testMarker.setShadow(icon); +// $ExpectType void +testMarker.setShadow('shadow url'); + +// $ExpectType string | Icon | undefined +testMarker.getShadow(); + +// $ExpectType void +testMarker.setShape(); +// $ExpectType void +testMarker.setShape(markerShape); + +// $ExpectType MarkerShape | undefined +testMarker.getShape(); + +testMarker.on('click', (event: AMap.Marker.EventMap['click']) => { + // $ExpectType {} | MarkerExtraData + event.target.getExtData(); +}); + +/** + * overlay/markerShape.ts + */ + +// $ExpectType MarkerShape +new AMap.MarkerShape({ + type: 'circle', + coords: [1, 1, 1] +}); +// $ExpectType MarkerShape +new AMap.MarkerShape({ + type: 'rect', + coords: [1, 1, 1, 2] +}); +// $ExpectType MarkerShape +new AMap.MarkerShape({ + type: 'poly', + coords: [1, 2, 3, 4, 5] +}); + +// $ExpectError +new AMap.MarkerShape({ + type: 'circle', + coords: [1, 1] +}); +// $ExpectError +new AMap.MarkerShape({ + type: 'rect', + coords: [1, 1, 1, 2, 2] +}); + +/** + * overlay/overlay.ts + */ + +interface OverlayExtraData { + test: number; +} +declare const testOverlay: AMap.Overlay; + +// $ExpectType void +testOverlay.show(); + +// $ExpectType void +testOverlay.hide(); + +// $ExpectType Map | null | undefined +testOverlay.getMap(); + +// $ExpectType void +testOverlay.setMap(map); +// $ExpectType void +testOverlay.setMap(null); + +// $ExpectError +testOverlay.setExtData({ any: 123 }); + +// $ExpectError OverlayExtraData +testOverlay.getExtData(); + +/** + * overlay/overlayGroup.ts + */ + +// $ExpectType OverlayGroup, any> +const testOverlayGroup2 = new AMap.OverlayGroup(); +// $ExpectType OverlayGroup, any> +new AMap.OverlayGroup(testMarker); +// $ExpectType OverlayGroup, any> +const testOverlayGroup = new AMap.OverlayGroup([testMarker]); + +// $ExpectType OverlayGroup, any> +testOverlayGroup.addOverlay(testMarker); +// $ExpectType OverlayGroup, any> +testOverlayGroup.addOverlay([testMarker]); +// $ExpectError +testOverlayGroup.addOverlay([testCircle]); + +// $ExpectType OverlayGroup, any> +testOverlayGroup.addOverlays(testMarker); +// $ExpectType OverlayGroup, any> +testOverlayGroup.addOverlays([testMarker]); + +// $ExpectType Marker[] +testOverlayGroup.getOverlays(); + +// $ExpectType boolean +testOverlayGroup.hasOverlay(testMarker); +// $ExpectType boolean +testOverlayGroup.hasOverlay(o => o === testMarker); + +// $ExpectType OverlayGroup, any> +testOverlayGroup.removeOverlay(testMarker); +// $ExpectType OverlayGroup, any> +testOverlayGroup.removeOverlay([testMarker]); + +// $ExpectType OverlayGroup, any> +testOverlayGroup.removeOverlays(testMarker); +// $ExpectType OverlayGroup, any> +testOverlayGroup.removeOverlays([testMarker]); + +// $ExpectType OverlayGroup, any> +testOverlayGroup.clearOverlays(); + +// $ExpectType OverlayGroup, any> +testOverlayGroup.eachOverlay(function(overlay, index, overlays) { + // $ExpectType Marker + overlay; + // $ExpectType number + index; + // $ExpectType Marker[] + overlays; + // $ExpectType Marker + this; +}); + +// $ExpectType OverlayGroup, any> +testOverlayGroup.setMap(null); +// $ExpectType OverlayGroup, any> +testOverlayGroup.setMap(map); + +// $ExpectType OverlayGroup, any> +testOverlayGroup2.setOptions({ + test: 1 +}); +// $ExpectType OverlayGroup, any> +testOverlayGroup.setOptions({ + map, + position: lnglat, + offset: pixel, + icon: 'iconUrl', + content: 'htmlString', + topWhenClick: true, + raiseOnDrag: true, + cursor: 'default', + visible: true, + zIndex: 10, + angle: 10, + autoRotation: true, + animation: 'AMAP_ANIMATION_BOUNCE', + shadow: icon, + title: '123', + clickable: true, + shape: markerShape, + extData: { + test: 123 + } +}); + +// $ExpectType OverlayGroup, any> +testOverlayGroup.show(); + +// $ExpectType OverlayGroup, any> +testOverlayGroup.hide(); + +testOverlayGroup.on('click', (event: AMap.MapsEvent<'click', AMap.Overlay>) => { + // $ExpectType "click" + event.type; + // $ExpectType Overlay + event.target; +}); + +/** + * overlay/polygon.ts + */ + +interface PolygonExtraData { + test: number; +} + +const polygonPath1 = [lnglatTuple, lnglatTuple, lnglatTuple, lnglatTuple, lnglatTuple]; +const polygonPath2 = [lnglat, lnglat, lnglat, lnglat, lnglat]; + +// $ExpectType Polygon +new AMap.Polygon(); +// $ExpectType Polygon +new AMap.Polygon({}); +// $ExpectType Polygon +const testPolygon = new AMap.Polygon({ + map, + zIndex: 10, + bubble: true, + cursor: 'pointer', + strokeColor: '#00FF00', + strokeOpacity: 0.3, + strokeWeight: 5, + fillColor: '#0000FF', + fillOpacity: 0.5, + draggable: true, + extData: { test: 1 }, + strokeStyle: 'dashed', + strokeDasharray: [2, 4], + path: polygonPath1 +}); + +// $ExpectType void +testPolygon.setPath(polygonPath1); +// $ExpectType void +testPolygon.setPath(polygonPath2); +// $ExpectType void +testPolygon.setPath([polygonPath1, polygonPath2]); + +// $ExpectType LngLat[] | LngLat[][] +testPolygon.getPath(); + +// $ExpectType void +testPolygon.setOptions({ + map, + zIndex: 10, + bubble: true, + cursor: 'pointer', + strokeColor: '#00FF00', + strokeOpacity: 0.8, + strokeWeight: 5, + fillColor: '#0000FF', + fillOpacity: 0.5, + draggable: true, + extData: { test: 1 }, + strokeStyle: 'dashed', + strokeDasharray: [4, 2], + path: [polygonPath2, polygonPath1] +}); + +{ + const options = testPolygon.getOptions(); + // $ExpectType boolean | undefined + options.bubble; + // $ExpectType boolean | undefined + options.clickable; + // $ExpectType {} | PolygonExtraData | undefined + options.extData; + // $ExpectType string | undefined + options.fillColor; + // $ExpectType number | undefined + options.fillOpacity; + // $ExpectType "miter" | "round" | "bevel" | undefined + options.lineJoin; + // $ExpectType Map | undefined + options.map; + // $ExpectType LngLat[] | LngLat[][] | undefined + options.path; + // $ExpectType string | undefined + options.strokeColor; + // $ExpectType number[] | undefined + options.strokeDasharray; + // $ExpectType number | undefined + options.strokeOpacity; + // $ExpectType "dashed" | "solid" | undefined + options.strokeStyle; + // $ExpectType number | undefined + options.strokeWeight; + // $ExpectType string | undefined + options.texture; + // $ExpectType number | undefined + options.zIndex; +} + +// $ExpectType Bounds | null +testPolygon.getBounds(); + +// $ExpectType number +testPolygon.getArea(); + +// $ExpectType void +testPolygon.setMap(null); +// $ExpectType void +testPolygon.setMap(map); + +// $ExpectType void +testPolygon.setExtData({ test: 1 }); + +// $ExpectType {} | PolygonExtraData +testPolygon.getExtData(); + +// $ExpectType boolean +testPolygon.contains(lnglat); +// $ExpectType boolean +testPolygon.contains(lnglatTuple); + +testPolygon.on('click', (event: AMap.Polygon.EventMap['click']) => { + // $ExpectType "click" + event.type; + // $ExpectType Polygon + event.target; +}); + +/** + * overlay/polyline.ts + */ + +interface PolylineExtraData { + test: number; +} + +// $ExpectType Polyline +new AMap.Polyline(); +// $ExpectType Polyline +new AMap.Polyline({}); +// $ExpectType Polyline +const testPolyline = new AMap.Polyline({ + map, + zIndex: 10, + bubble: true, + cursor: 'default', + geodesic: true, + isOutline: true, + borderWeight: 1, + outlineColor: '#AA0000', + path: [lnglat], + strokeColor: '#0000AA', + strokeOpacity: 0.5, + strokeWeight: 10, + strokeStyle: 'dashed', + strokeDasharray: [20, 10, 20], + lineJoin: 'bevel', + lineCap: 'butt', + draggable: true, + extData: { test: 1 }, + showDir: true +}); +// Polyline + +// $ExpectType void +testPolyline.setPath([lnglat]); +// $ExpectType void +testPolyline.setPath([lnglatTuple]); + +// $ExpectType void +testPolyline.setOptions({}); +// $ExpectType void +testPolyline.setOptions({ + map, + zIndex: 10, + bubble: true, + cursor: 'default', + geodesic: true, + isOutline: true, + borderWeight: 1, + outlineColor: '#AA0000', + path: [lnglat, lnglat], + strokeColor: '#0000AA', + strokeOpacity: 0.5, + strokeWeight: 10, + strokeStyle: 'dashed', + strokeDasharray: [20, 10, 20], + lineJoin: 'bevel', + lineCap: 'butt', + draggable: true, + extData: { test: 1 }, + showDir: true +}); + +{ + const options = testPolyline.getOptions(); + // $ExpectType number | undefined + options.borderWeight; + // $ExpectType boolean | undefined + options.bubble; + // $ExpectType boolean | undefined + options.clickable; + // $ExpectType string | undefined + options.dirColor; + // $ExpectType string | undefined + options.dirImg; + // $ExpectType {} | PolylineExtraData | undefined + options.extData; + // $ExpectType boolean | undefined + options.geodesic; + // $ExpectType boolean | undefined + options.isOutline; + // $ExpectType "round" | "butt" | "square" | undefined + options.lineCap; + // $ExpectType "miter" | "round" | "bevel" | undefined + options.lineJoin; + // $ExpectType Map | undefined + options.map; + // $ExpectType string | undefined + options.outlineColor; + // $ExpectType LngLat[] | undefined + options.path; + // $ExpectType boolean | undefined + options.showDir; + // $ExpectType string | undefined + options.strokeColor; + // $ExpectType number[] | undefined + options.strokeDasharray; + // $ExpectType number | undefined + options.strokeOpacity; + // $ExpectType "dashed" | "solid" | undefined + options.strokeStyle; + // $ExpectType number | undefined + options.strokeWeight; + // $ExpectType number | undefined + options.zIndex; +} + +// $ExpectType number +testPolyline.getLength(); + +// $ExpectType Bounds | null +testPolyline.getBounds(); + +// $ExpectType void +testPolyline.hide(); + +// $ExpectType void +testPolyline.show(); + +// $ExpectType void +testPolyline.setMap(null); +// $ExpectType void +testPolyline.setMap(map); + +// $ExpectType void +testPolyline.setExtData({ test: 1 }); + +// $ExpectType {} | PolylineExtraData +testPolyline.getExtData(); + +testPolyline.on('click', (event: AMap.Polyline.EventMap['click']) => { + // $ExpectType "click" + event.type; + // $ExpectType Polyline + event.target; +}); + +/** + * overlay/rectangle.ts + */ + +interface RectangleExtraData { + test: number; +} + +// $ExpectType Rectangle +new AMap.Rectangle(); +// $ExpectType Rectangle +new AMap.Rectangle({}); +// $ExpectType Rectangle +const testRectangle = new AMap.Rectangle({ + map, + zIndex: 10, + bounds, + bubble: false, + cursor: 'pointer', + strokeColor: '#00FF00', + strokeOpacity: 0.8, + strokeWeight: 2, + fillColor: '#0000FF', + fillOpacity: 0.5, + strokeStyle: 'solid', + extData: { test: 1 }, + strokeDasharray: [1, 5] +}); + +// $ExpectType Bounds | undefined +testRectangle.getBounds(); + +// $ExpectType void +testRectangle.setBounds(bounds); + +// $ExpectType void +testRectangle.setOptions({}); +// $ExpectType void +testRectangle.setOptions({ + map, + zIndex: 10, + bounds, + bubble: false, + cursor: 'pointer', + strokeColor: '#00FF00', + strokeOpacity: 0.8, + strokeWeight: 2, + fillColor: '#0000FF', + fillOpacity: 0.5, + strokeStyle: 'solid', + extData: { test: 1 }, + strokeDasharray: [1, 5] +}); + +{ + const options = testRectangle.getOptions(); + // $ExpectType Bounds | undefined + options.bounds; + // $ExpectType boolean | undefined + options.bubble; + // $ExpectType boolean | undefined + options.clickable; + // $ExpectType {} | RectangleExtraData | undefined + options.extData; + // $ExpectType string | undefined + options.fillColor; + // $ExpectType number | undefined + options.fillOpacity; + // $ExpectType "miter" | "round" | "bevel" | undefined + options.lineJoin; + // $ExpectType Map | undefined + options.map; + // $ExpectType LngLat[] | undefined + options.path; + // $ExpectType string | undefined + options.strokeColor; + // $ExpectType number[] | undefined + options.strokeDasharray; + // $ExpectType number | undefined + options.strokeOpacity; + // $ExpectType "dashed" | "solid" | undefined + options.strokeStyle; + // $ExpectType number | undefined + options.strokeWeight; + // $ExpectType string | undefined + options.texture; + // $ExpectType number | undefined + options.zIndex; +} + +// $ExpectType void +testRectangle.hide(); + +// $ExpectType void +testRectangle.show(); + +// $ExpectType void +testRectangle.setExtData({test: 2}); + +// $ExpectType {} | RectangleExtraData +testRectangle.getExtData(); + +// $ExpectType boolean +testRectangle.contains(lnglat); +// $ExpectType boolean +testRectangle.contains(lnglatTuple); + +testRectangle.on('click', (event: AMap.Rectangle.EventMap['click']) => { + // $ExpectType "click" + event.type; + // $ExpectType Rectangle + event.target; +}); + +testRectangle.on('setBounds', (event: AMap.Rectangle.EventMap['setBounds']) => { + // $ExpectType "setBounds" + event.type; + // $ExpectError + event.target; +}); + +/** + * overlay/text.ts + */ + +interface TextExtraData { + test: number; +} + +// $ExpectType Text +new AMap.Text(); +// $ExpectType Text +new AMap.Text({}); +// $ExpectType Text +const testText = new AMap.Text({ + text: 'content', + textAlign: 'center', + verticalAlign: 'top', + map, + position: lnglat, + offset: pixel, + topWhenClick: true, + bubble: true, + draggable: true, + raiseOnDrag: true, + cursor: 'default', + visible: true, + zIndex: 100, + angle: 45, + autoRotation: true, + animation: 'AMAP_ANIMATION_BOUNCE', + shadow: 'https://webapi.amap.com/theme/v1.3/markers/0.png', + title: 'title', + clickable: true, + extData: { test: 1 } +}); + +// $ExpectType string +testText.getText(); + +// $ExpectType void +testText.setText('123'); + +// $ExpectType void +testText.setStyle({ + background: 'red', + width: '200px' +}); + +// $ExpectType void +testText.markOnAMAP({ + name: '123', + position: lnglatTuple +}); + +// $ExpectType Pixel +testText.getOffset(); + +// $ExpectType void +testText.setOffset(pixel); + +// $ExpectType void +testText.setAnimation('AMAP_ANIMATION_BOUNCE'); + +// $ExpectType AnimationName +testText.getAnimation(); + +// $ExpectType void +testText.setClickable(true); + +// $ExpectType boolean +testText.getClickable(); + +// $ExpectType LngLat | undefined +testText.getPosition(); + +// $ExpectType void +testText.setAngle(10); + +// $ExpectType number +testText.getAngle(); + +// $ExpectType void +testText.setzIndex(1); + +// $ExpectType number +testText.getzIndex(); + +// $ExpectType void +testText.setDraggable(true); + +// $ExpectType boolean +testText.getDraggable(); + +// $ExpectType void +testText.hide(); + +// $ExpectType void +testText.show(); + +// $ExpectType void +testText.setCursor('default'); + +// $ExpectType void +testText.moveAlong([lnglat], 100); + +// $ExpectType void +testText.moveAlong([lnglat], 100); +// $ExpectError +testText.moveAlong([[1, 2]], 100); +// $ExpectType void +testText.moveAlong([lnglat], 100, t => t, false); + +// $ExpectType void +testText.moveTo(lnglat, 100); +// $ExpectType void +testText.moveTo([1, 2], 100); +// $ExpectType void +testText.moveTo([1, 2], 100, t => t); + +// $ExpectType void +testText.stopMove(); + +// $ExpectType boolean +testText.pauseMove(); + +// $ExpectType boolean +testText.resumeMove(); + +// $ExpectType void +testText.setMap(map); + +// $ExpectType void +testText.setTitle('title'); +// $ExpectError +testText.setTitle(); + +// $ExpectType string | undefined +testText.getTitle(); + +// $ExpectType void +testText.setTop(true); + +// $ExpectType boolean +testText.getTop(); + +// $ExpectType void +testText.setShadow(); +// $ExpectType void +testText.setShadow(icon); +// $ExpectType void +testText.setShadow('shadow url'); + +// $ExpectType void +testText.setExtData({test: 1}); + +// $ExpectType {} | TextExtraData +testText.getExtData(); + +testText.on('click', (event: AMap.Text.EventMap['click']) => { + // $ExpectType "click" + event.type; + // $ExpectType Text + event.target; +}); diff --git a/types/amap-js-api/index.d.ts b/types/amap-js-api/index.d.ts index 54f79c08ea..5b8c1a5b94 100644 --- a/types/amap-js-api/index.d.ts +++ b/types/amap-js-api/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for non-npm package amap-js-sdk 1.4 +// Type definitions for non-npm package amap-js-api 1.4 // Project: https://lbs.amap.com/api/javascript-api/summary // Definitions by: breeze9527 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/types/amap-js-api/overlay/markerShape.d.ts b/types/amap-js-api/overlay/markerShape.d.ts index c8efd93850..f0d6c39bac 100644 --- a/types/amap-js-api/overlay/markerShape.d.ts +++ b/types/amap-js-api/overlay/markerShape.d.ts @@ -15,7 +15,7 @@ declare namespace AMap { type Options = CircleOptions | PolyOptions | RectOptions; } - class MarkerShape { + class MarkerShape extends EventEmitter { constructor(options: MarkerShape.Options); } } diff --git a/types/amap-js-api/test/arryBounds.ts b/types/amap-js-api/test/arryBounds.ts deleted file mode 100644 index 1ccc4d0488..0000000000 --- a/types/amap-js-api/test/arryBounds.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { - lnglat -} from './preset'; - -// $ExpectType ArrayBounds -const arrayBounds = new AMap.ArrayBounds([lnglat, lnglat, lnglat]); - -// $ExpectType LngLat[] -arrayBounds.bounds; - -// $ExpectType boolean -arrayBounds.contains(lnglat); - -// $ExpectType Bounds -arrayBounds.toBounds(); - -// $ExpectType LngLat -arrayBounds.getCenter(); diff --git a/types/amap-js-api/test/bounds.ts b/types/amap-js-api/test/bounds.ts deleted file mode 100644 index d22ba697f9..0000000000 --- a/types/amap-js-api/test/bounds.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { - lnglat, - lnglatTuple -} from './preset'; - -// $ExpectType Bounds -const bounds = new AMap.Bounds(lnglat, lnglat); - -// $ExpectType boolean -bounds.contains(lnglat); -// $ExpectType boolean -bounds.contains(lnglatTuple); - -// $ExpectType LngLat -bounds.getCenter(); - -// $ExpectType LngLat -bounds.getSouthWest(); - -// $ExpectType LngLat -bounds.getSouthEast(); - -// $ExpectType LngLat -bounds.getNorthEast(); - -// $ExpectType LngLat -bounds.getNorthWest(); - -// $ExpectType string -bounds.toString(); diff --git a/types/amap-js-api/test/browser.ts b/types/amap-js-api/test/browser.ts deleted file mode 100644 index b80d8cd3ff..0000000000 --- a/types/amap-js-api/test/browser.ts +++ /dev/null @@ -1,141 +0,0 @@ -const brwoser = AMap.Browser; - -// $ExpectType string -brwoser.ua; - -// $ExpectType boolean -brwoser.mobile; - -const plat: 'android' | 'ios' | 'windows' | 'mac' | 'other' = brwoser.plat; - -// $ExpectType boolean -brwoser.mac; - -// $ExpectType boolean -brwoser.windows; - -// $ExpectType boolean -brwoser.ios; - -// $ExpectType boolean -brwoser.iPad; - -// $ExpectType boolean -brwoser.iPhone; - -// $ExpectType boolean -brwoser.android; - -// $ExpectType boolean -brwoser.android23; - -// $ExpectType boolean -brwoser.chrome; - -// $ExpectType boolean -brwoser.firefox; - -// $ExpectType boolean -brwoser.safari; - -// $ExpectType boolean -brwoser.wechat; - -// $ExpectType boolean -brwoser.uc; - -// $ExpectType boolean -brwoser.qq; - -// $ExpectType boolean -brwoser.ie; - -// $ExpectType boolean -brwoser.ie6; - -// $ExpectType boolean -brwoser.ie7; - -// $ExpectType boolean -brwoser.ie8; - -// $ExpectType boolean -brwoser.ie9; - -// $ExpectType boolean -brwoser.ie10; - -// $ExpectType boolean -brwoser.ie11; - -// $ExpectType boolean -brwoser.edge; - -// $ExpectType boolean -brwoser.ielt9; - -// $ExpectType boolean -brwoser.baidu; - -// $ExpectType boolean -brwoser.isLocalStorage; - -// $ExpectType boolean -brwoser.isGeolocation; - -// $ExpectType boolean -brwoser.mobileWebkit; - -// $ExpectType boolean -brwoser.mobileWebkit3d; - -// $ExpectType boolean -brwoser.mobileOpera; - -// $ExpectType boolean -brwoser.retina; - -// $ExpectType boolean -brwoser.touch; - -// $ExpectType boolean -brwoser.msPointer; - -// $ExpectType boolean -brwoser.pointer; - -// $ExpectType boolean -brwoser.webkit; - -// $ExpectType boolean -brwoser.ie3d; - -// $ExpectType boolean -brwoser.webkit3d; - -// $ExpectType boolean -brwoser.gecko3d; - -// $ExpectType boolean -brwoser.opera3d; - -// $ExpectType boolean -brwoser.any3d; - -// $ExpectType boolean -brwoser.isCanvas; - -// $ExpectType boolean -brwoser.isSvg; - -// $ExpectType boolean -brwoser.isVML; - -// $ExpectType boolean -brwoser.isWorker; - -// $ExpectType boolean -brwoser.isWebsocket; - -// $ExpectType boolean -brwoser.isWebGL(); diff --git a/types/amap-js-api/test/convert-from.ts b/types/amap-js-api/test/convert-from.ts deleted file mode 100644 index 8cb9b8502c..0000000000 --- a/types/amap-js-api/test/convert-from.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { - lnglat, - lnglatTuple -} from './preset'; - -declare const convertType: 'baidu' | 'mapbar' | 'gps' | null; -// $ExpectType void -AMap.convertFrom(lnglat, convertType, (status, result) => { - const temp: 'complete' | 'error' = status; - if (typeof result !== 'string') { - // $ExpectType string - result.info; - // $ExpectType LngLat[] - result.locations; - } else { - // $ExpectType string - result; - } -}); -// $ExpectType void -AMap.convertFrom([lnglat], null, () => { }); -// $ExpectType void -AMap.convertFrom(lnglatTuple, null, () => { }); -// $ExpectType void -AMap.convertFrom([lnglatTuple], null, () => { }); diff --git a/types/amap-js-api/test/dom-util.ts b/types/amap-js-api/test/dom-util.ts deleted file mode 100644 index 6cb0bce511..0000000000 --- a/types/amap-js-api/test/dom-util.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { div } from './preset'; - -const util = AMap.DomUtil; - -// $ExpectType Size -util.getViewport(div); - -// $ExpectType Pixel -util.getViewportOffset(div); - -// $ExpectType HTMLDivElement -util.create('div'); -// $ExpectType HTMLAnchorElement -util.create('a'); -// $ExpectType HTMLDivElement -util.create('div', div); -// $ExpectType HTMLDivElement -util.create('div', div, 'className'); - -// $ExpectType void -util.setClass(div); -// $ExpectType void -util.setClass(div, 'className'); - -// $ExpectType boolean -util.hasClass(div, 'className'); - -// $ExpectType void -util.removeClass(div, 'className'); - -// $ExpectType void -util.setOpacity(div, 1); - -// $ExpectType void -util.rotate(div, 10); -// $ExpectType void -util.rotate(div, 10, { x: 10, y: 10 }); - -const util2: typeof AMap.DomUtil = util.setCss(div, { textAlign: 'left' }); -// $ExpectError -util.setCss(div, { textAlign: 10 }); - -// $ExpectType void -util.empty(div); - -// $ExpectType void -util.remove(div); diff --git a/types/amap-js-api/test/event.ts b/types/amap-js-api/test/event.ts deleted file mode 100644 index 8061b0d747..0000000000 --- a/types/amap-js-api/test/event.ts +++ /dev/null @@ -1,74 +0,0 @@ -import { - lnglat, - pixel, - map -} from './preset'; -declare var div: HTMLDivElement; -declare var input: HTMLInputElement; - -// $ExpectType Map -map.on('hotspotclick', (event: AMap.Map.EventMap['hotspotclick']) => { - // $ExpectType "hotspotclick" - event.type; - // $ExpectType string - event.id; - // $ExpectType LngLat - event.lnglat; -}); - -// $ExpectType EventListener<0> -AMap.event.addDomListener(div, 'click', event => { - // $ExpectType number - event.clientX; -}); - -// $ExpectType EventListener<1> -AMap.event.addListener(map, 'hotspotclick', function (event: AMap.Map.EventMap['hotspotclick']) { - // $ExpectType "hotspotclick" - event.type; - // $ExpectType string - event.id; - // $ExpectType LngLat - event.lnglat; - // $ExpectType number - this.test; -}, { test: 1 }); -AMap.event.addListener(map, 'click', (event: AMap.Map.EventMap['click']) => { - // $ExpectType "click" - event.type; - // $ExpectType LngLat - event.lnglat; - // $ExpectType Map - event.target; -}); - -// $ExpectType EventListener<1> -const eventListener = AMap.event.addListenerOnce(map, 'hotspotclick', function (event: AMap.Map.EventMap['hotspotclick']) { - // $ExpectType "hotspotclick" - event.type; - // $ExpectType string - event.id; - // $ExpectType LngLat - event.lnglat; - // $ExpectType number - this.test; -}, { test: 1 }); - -// $ExpectType void -AMap.event.removeListener(eventListener); - -// $ExpectType void -AMap.event.trigger(map, 'click', { - lnglat, - pixel, - target: map -}); -// $ExpectType void -AMap.event.trigger(map, 'hotspotclick', { - lnglat, - name: 'name', - id: 'id', - isIndoorPOI: true -}); -// $ExpectType void -AMap.event.trigger(map, 'complete'); diff --git a/types/amap-js-api/test/geometry-util.ts b/types/amap-js-api/test/geometry-util.ts deleted file mode 100644 index 98a8263fb0..0000000000 --- a/types/amap-js-api/test/geometry-util.ts +++ /dev/null @@ -1,158 +0,0 @@ -import { - lnglat as point, - lnglatTuple as pointTuple -} from './preset'; - -const line = [point]; -const lineTuple = [pointTuple]; -const ring = [point]; -const ringTuple = [pointTuple]; -const polygon = [ring]; -const polygonTuple = [ringTuple]; -const util = AMap.GeometryUtil; - -// $ExpectType number -util.distance(point, point); -// $ExpectType number -util.distance(pointTuple, pointTuple); -// $ExpectType number -util.distance(point, line); -// $ExpectType number -util.distance(pointTuple, lineTuple); - -// $ExpectType number -util.ringArea(ring); -// $ExpectType number -util.ringArea(ringTuple); - -// $ExpectType boolean -util.isClockwise(ring); -// $ExpectType boolean -util.isClockwise(ringTuple); - -// $ExpectType number -util.distanceOfLine(line); -// $ExpectType number -util.distanceOfLine(lineTuple); - -// $ExpectType [number, number][] -util.ringRingClip(ring, ring); -// $ExpectType [number, number][] -util.ringRingClip(ringTuple, ringTuple); - -// $ExpectType boolean -util.doesRingRingIntersect(ring, ring); -// $ExpectType boolean -util.doesRingRingIntersect(ringTuple, ringTuple); - -// $ExpectType boolean -util.doesLineRingIntersect(line, ring); -// $ExpectType boolean -util.doesLineRingIntersect(lineTuple, ringTuple); - -// $ExpectType boolean -util.doesLineLineIntersect(line, line); -// $ExpectType boolean -util.doesLineLineIntersect(lineTuple, lineTuple); - -// $ExpectType boolean -util.doesSegmentPolygonIntersect(point, point, polygon); -// $ExpectType boolean -util.doesSegmentPolygonIntersect(pointTuple, pointTuple, polygonTuple); - -// $ExpectType boolean -util.doesSegmentRingIntersect(point, point, ring); -// $ExpectType boolean -util.doesSegmentRingIntersect(pointTuple, pointTuple, ringTuple); - -// $ExpectType boolean -util.doesSegmentLineIntersect(point, point, line); -// $ExpectType boolean -util.doesSegmentLineIntersect(pointTuple, pointTuple, lineTuple); - -// $ExpectType boolean -util.doesSegmentsIntersect(point, point, point, point); -// $ExpectType boolean -util.doesSegmentsIntersect(pointTuple, pointTuple, pointTuple, pointTuple); - -// $ExpectType boolean -util.isPointInRing(point, ring); -// $ExpectType boolean -util.isPointInRing(pointTuple, ringTuple); - -// $ExpectType boolean -util.isRingInRing(ring, ring); -// $ExpectType boolean -util.isRingInRing(ringTuple, ringTuple); - -// $ExpectType boolean -util.isPointInPolygon(point, polygon); -// $ExpectType boolean -util.isPointInPolygon(pointTuple, polygonTuple); - -// $ExpectType [number, number][] -util.makesureClockwise(lineTuple); - -// $ExpectType [number, number][] -util.makesureAntiClockwise(lineTuple); - -// $ExpectType [number, number] -util.closestOnSegment(point, point, point); -// $ExpectType [number, number] -util.closestOnSegment(pointTuple, pointTuple, pointTuple); - -// $ExpectType [number, number] -util.closestOnSegment(point, point, point); -// $ExpectType [number, number] -util.closestOnSegment(pointTuple, pointTuple, pointTuple); - -// $ExpectType [number, number] -util.closestOnLine(point, line); -// $ExpectType [number, number] -util.closestOnLine(pointTuple, lineTuple); - -// $ExpectType number -util.distanceToSegment(point, point, point); -// $ExpectType number -util.distanceToSegment(pointTuple, pointTuple, pointTuple); - -// $ExpectType number -util.distanceToLine(point, line); -// $ExpectType number -util.distanceToLine(pointTuple, lineTuple); - -// $ExpectType boolean -util.isPointOnSegment(point, point, point); -// $ExpectType boolean -util.isPointOnSegment(point, point, point, 1); -// $ExpectType boolean -util.isPointOnSegment(pointTuple, pointTuple, pointTuple); -// $ExpectType boolean -util.isPointOnSegment(pointTuple, pointTuple, pointTuple, 1); - -// $ExpectType boolean -util.isPointOnLine(point, line); -// $ExpectType boolean -util.isPointOnLine(point, line, 1); -// $ExpectType boolean -util.isPointOnLine(pointTuple, lineTuple); -// $ExpectType boolean -util.isPointOnLine(pointTuple, lineTuple, 1); - -// $ExpectType boolean -util.isPointOnRing(point, ring); -// $ExpectType boolean -util.isPointOnRing(point, ring, 1); -// $ExpectType boolean -util.isPointOnRing(pointTuple, ringTuple); -// $ExpectType boolean -util.isPointOnRing(pointTuple, ringTuple, 1); - -// $ExpectType boolean -util.isPointOnPolygon(point, polygon); -// $ExpectType boolean -util.isPointOnPolygon(point, polygon, 1); -// $ExpectType boolean -util.isPointOnPolygon(pointTuple, polygonTuple); -// $ExpectType boolean -util.isPointOnPolygon(pointTuple, polygonTuple, 1); diff --git a/types/amap-js-api/test/layer/buildings.ts b/types/amap-js-api/test/layer/buildings.ts deleted file mode 100644 index 209b3c490b..0000000000 --- a/types/amap-js-api/test/layer/buildings.ts +++ /dev/null @@ -1,40 +0,0 @@ -declare var map: AMap.Map; -declare var lnglat: AMap.LngLat; - -// $ExpectType Buildings -var buildings = new AMap.Buildings(); -// $ExpectType Buildings -new AMap.Buildings(); -// $ExpectType Buildings -new AMap.Buildings({ - zooms: [1, 18], - opacity: 0.8, - heightFactor: 1, - visible: true, - zIndex: 10, - map -}); - -buildings.setStyle({ - hideWithoutStyle: false, - areas: [ - { - visible: true, - rejectTexture: true, - color1: 'ffffff00', - color2: 'ffffcc00', - path: [[1, 2]] - }, - { - visible: true, - rejectTexture: true, - color1: 'ffffff00', - color2: 'ffffcc00', - path: [lnglat] - }, - { - color1: 'ff99ff00', - path: [lnglat] - }, - ] -}); diff --git a/types/amap-js-api/test/layer/canvasLayer.ts b/types/amap-js-api/test/layer/canvasLayer.ts deleted file mode 100644 index 577d032b2c..0000000000 --- a/types/amap-js-api/test/layer/canvasLayer.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { - map, - bounds -} from '../preset'; - -declare const canvas: HTMLCanvasElement; - -// $ExpectType CanvasLayer -new AMap.CanvasLayer({ - map, - bounds, - visible: true, - zooms: [1, 2], - opacity: 1 -}); - -// $ExpectType CanvasLayer -new AMap.CanvasLayer(); -// $ExpectType CanvasLayer -new AMap.CanvasLayer({}); -// $ExpectType CanvasLayer -const canvasLayer = new AMap.CanvasLayer({ - bounds -}); - -// $ExpectType void -canvasLayer.setMap(null); -// $ExpectType void -canvasLayer.setMap(map); - -// $ExpectType Map | null | undefined -canvasLayer.getMap(); - -// $ExpectType void -canvasLayer.show(); - -// $ExpectType void -canvasLayer.hide(); - -// $ExpectType number -canvasLayer.getzIndex(); - -// $ExpectType void -canvasLayer.setzIndex(10); - -// $ExpectType HTMLCanvasElement | null -canvasLayer.getElement(); - -// $ExpectType void -canvasLayer.setCanvas(canvas); - -// $ExpectType HTMLCanvasElement | undefined -canvasLayer.getCanvas(); diff --git a/types/amap-js-api/test/layer/flexible.ts b/types/amap-js-api/test/layer/flexible.ts deleted file mode 100644 index 5a0e3f7aa7..0000000000 --- a/types/amap-js-api/test/layer/flexible.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { - map -} from '../preset'; - -const img = document.createElement('img'); -const canvas = document.createElement('canvas'); - -// $ExpectType Flexible -new AMap.TileLayer.Flexible(); -// $ExpectType Flexible -new AMap.TileLayer.Flexible({}); -// $ExpectType Flexible -const flexible = new AMap.TileLayer.Flexible({ - createTile(x, y, z, success, fail) { - // $ExpectType number - x; - // $ExpectType number - y; - // $ExpectType number - z; - // $ExpectType void - success(img); - // $ExpectType void - success(canvas); - // $ExpectType void - fail(); - }, - cacheSize: 10, - opacity: 1, - visible: true, - map, - zIndex: 1, - zooms: [1, 2] -}); - -// $ExpectType void -flexible.setMap(null); -// $ExpectType void -flexible.setMap(map); - -// $ExpectType Map | null | undefined -flexible.getMap(); - -// $ExpectType void -flexible.show(); - -// $ExpectType void -flexible.hide(); - -// $ExpectType void -flexible.setzIndex(10); - -// $ExpectType number -flexible.getzIndex(); diff --git a/types/amap-js-api/test/layer/imageLayer.ts b/types/amap-js-api/test/layer/imageLayer.ts deleted file mode 100644 index 06b9fc076e..0000000000 --- a/types/amap-js-api/test/layer/imageLayer.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { - map, - bounds -} from '../preset'; - -// $ExpectType ImageLayer -new AMap.ImageLayer({ - map, - bounds, - visible: true, - zooms: [1, 2], - opacity: 1 -}); - -// $ExpectType ImageLayer -new AMap.ImageLayer(); -// $ExpectType ImageLayer -new AMap.ImageLayer({}); -// $ExpectType ImageLayer -const imageLayer = new AMap.ImageLayer({ - bounds -}); - -// $ExpectType void -imageLayer.setMap(null); -// $ExpectType void -imageLayer.setMap(map); - -// $ExpectType Map | null | undefined -imageLayer.getMap(); - -// $ExpectType void -imageLayer.show(); - -// $ExpectType void -imageLayer.hide(); - -// $ExpectType number -imageLayer.getzIndex(); - -// $ExpectType void -imageLayer.setzIndex(10); - -// $ExpectType HTMLImageElement | null -imageLayer.getElement(); - -// $ExpectType void -imageLayer.setImageUrl('url'); - -// $ExpectType string | undefined -imageLayer.getImageUrl(); diff --git a/types/amap-js-api/test/layer/layer.ts b/types/amap-js-api/test/layer/layer.ts deleted file mode 100644 index 921c90e52d..0000000000 --- a/types/amap-js-api/test/layer/layer.ts +++ /dev/null @@ -1,34 +0,0 @@ -declare var layer: AMap.Layer; -declare var map: AMap.Map; - -// $ExpectError -new AMap.Layer(); - -// $ExpectType HTMLDivElement | undefined -layer.getContainer(); - -// $ExpectType [number, number] -layer.getZooms(); - -// $ExpectType void -layer.setOpacity(1); - -// $ExpectType number -layer.getOpacity(); - -// $ExpectType void -layer.show(); - -// $ExpectType void -layer.hide(); - -// $ExpectType void -layer.setMap(); -// $ExpectType void -layer.setMap(map); - -// $ExpectType void -layer.setzIndex(1); - -// $ExpectType number -layer.getzIndex(); diff --git a/types/amap-js-api/test/layer/layerGroup.ts b/types/amap-js-api/test/layer/layerGroup.ts deleted file mode 100644 index bcad7d6f50..0000000000 --- a/types/amap-js-api/test/layer/layerGroup.ts +++ /dev/null @@ -1,115 +0,0 @@ -declare var map: AMap.Map; -declare var tileLayer: AMap.TileLayer; -declare var massMarksLayer: AMap.MassMarks; -declare var layer: AMap.Layer; - -// $ExpectError -new AMap.LayerGroup(); - -// $ExpectType LayerGroup -new AMap.LayerGroup(tileLayer); -// $ExpectType LayerGroup -new AMap.LayerGroup([tileLayer]); - -declare var layerGruop: AMap.LayerGroup; - -// $ExpectType LayerGroup -layerGruop.addLayer(tileLayer); -// $ExpectType LayerGroup -layerGruop.addLayer([tileLayer]); -// $ExpectError -layerGruop.addLayer(massMarksLayer); - -// $ExpectType TileLayer[] -layerGruop.getLayers(); - -// $ExpectType TileLayer | null -layerGruop.getLayer(function (item, index, list) { - // $ExpectType TileLayer - item; - // $ExpectType number - index; - // $ExpectType TileLayer[] - list; - // $ExpectType null - this; - - return true; -}); - -layerGruop.hasLayer(function (item, index, list) { - // $ExpectType TileLayer - item; - // $ExpectType number - index; - // $ExpectType TileLayer[] - list; - // $ExpectType null - this; - - return true; -}); -layerGruop.hasLayer(tileLayer); - -// $ExpectType LayerGroup -layerGruop.removeLayer(tileLayer); -// $ExpectType LayerGroup -layerGruop.removeLayer([tileLayer]); - -// $ExpectType LayerGroup -layerGruop.clearLayers(); - -layerGruop.eachLayer(function (item, index, list) { - // $ExpectType TileLayer - item; - // $ExpectType number - index; - // $ExpectType TileLayer[] - list; - // $ExpectType TileLayer - this; -}); -layerGruop.eachLayer(function (item, index, list) { - // $ExpectType TileLayer - item; - // $ExpectType number - index; - // $ExpectType TileLayer[] - list; - // $ExpectType number - this.test; -}, { test: 1 }); - -// $ExpectType LayerGroup -layerGruop.setMap(map); - -// $ExpectType LayerGroup -layerGruop.hide(); - -// $ExpectType LayerGroup -layerGruop.show(); - -// $ExpectType LayerGroup -layerGruop.reload(); - -// $ExpectType LayerGroup -layerGruop.setOptions({}); - -// $ExpectType LayerGroup -layerGruop.setOptions({ - tileSize: 256 -}); -// layerGruop.setOptions({ -// // $ExpectError -// interval: 1 -// }); - -declare var layerGroup2: AMap.LayerGroup; - -layerGroup2.addLayer(tileLayer); - -layerGroup2.addLayer(massMarksLayer); - -layerGroup2.setOptions({ - test: 1 -}); diff --git a/types/amap-js-api/test/layer/massMarks.ts b/types/amap-js-api/test/layer/massMarks.ts deleted file mode 100644 index 5f4bfbf455..0000000000 --- a/types/amap-js-api/test/layer/massMarks.ts +++ /dev/null @@ -1,83 +0,0 @@ -declare var pixel: AMap.Pixel; -declare var size: AMap.Size; -declare var lnglat: AMap.LngLat; -var massMarksStyle1 = { - anchor: pixel, - url: '', - size, - rotation: 1 -}; -var massMarksStyle2 = { - anchor: pixel, - url: '', - size -}; -var massMarksData1 = { - lnglat -}; - -interface CustomData extends AMap.MassMarks.Data { - name: string; - id: string; -} -var massMarksCustomData: CustomData = { - lnglat: [1, 2], - style: 1, - name: '', - id: '' -}; - -// $ExpectError -new AMap.MassMarks(); -// $ExpectError -new AMap.MassMarks([], {}); - -new AMap.MassMarks([], { - style: [massMarksStyle1, massMarksStyle2] -}); -new AMap.MassMarks([massMarksData1], { - style: [massMarksStyle1, massMarksStyle2] -}); - -// $ExpectType MassMarks -var massMarks = new AMap.MassMarks([massMarksCustomData], { - style: [massMarksStyle1, massMarksStyle2] -}); - -// $ExpectType void -massMarks.setStyle(massMarksStyle1); -// $ExpectType void -massMarks.setStyle([massMarksStyle1]); - -// $ExpectType Style | Style[] -massMarks.getStyle(); - -// $ExpectType void -massMarks.setData(''); - -// $ExpectError -massMarks.setData(massMarksData1); -// $ExpectError -massMarks.setData(massMarksCustomData); - -var _customData = massMarks.getData()[0]; -// $ExpectType string -_customData.name; -// $ExpectType string -_customData.id; -// $ExpectType LngLat -_customData.lnglat; - -// $ExpectType void -massMarks.clear(); - -massMarks.on('click', (event: AMap.MassMarks.EventMap['click']) => { - // $ExpectType "click" - event.type; - - // $ExpectType CustomData - event.data; - - // $ExpectType MassMarks - event.target; -}); diff --git a/types/amap-js-api/test/layer/tileLayer.ts b/types/amap-js-api/test/layer/tileLayer.ts deleted file mode 100644 index 7e4e2dc2e4..0000000000 --- a/types/amap-js-api/test/layer/tileLayer.ts +++ /dev/null @@ -1,60 +0,0 @@ -declare var map: AMap.Map; - -// $ExpectType TileLayer -var tileLayer = new AMap.TileLayer(); - -// $ExpectType TileLayer -new AMap.TileLayer({}); - -// $ExpectType TileLayer -new AMap.TileLayer({ - map, - tileSize: 256, - tileUrl: '', - errorUrl: '', - getTileUrl: (x, y, z) => '', - zIndex: 1, - opacity: 0.1, - zooms: [3, 18], - detectRetina: true -}); - -// $ExpectType string[] -tileLayer.getTiles(); - -// $ExpectType void -tileLayer.reload(); - -// $ExpectType void -tileLayer.setTileUrl(''); -// $ExpectType void -tileLayer.setTileUrl((x, y, level) => { - // $ExpectType number - x; - // $ExpectType number - y; - // $ExpectType number - level; - return ''; -}); - -// Traffic - -// $ExpectType Traffic -let trafficLayer = new AMap.TileLayer.Traffic(); -// $ExpectType Traffic -new AMap.TileLayer.Traffic({}); -// $ExpectType Traffic -new AMap.TileLayer.Traffic({ - autoRefresh: true, - interval: 180 -}); - -// $ExpectType TileLayer -tileLayer.on('complete', () => { }); - -tileLayer.off('complete', () => { }); - -tileLayer.emit('complete'); - -trafficLayer.on('complete', () => { }); diff --git a/types/amap-js-api/test/layer/videoLayer.ts b/types/amap-js-api/test/layer/videoLayer.ts deleted file mode 100644 index e34718193c..0000000000 --- a/types/amap-js-api/test/layer/videoLayer.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { - map, - bounds -} from '../preset'; - -// $ExpectType VideoLayer -new AMap.VideoLayer({ - map, - bounds, - visible: true, - zooms: [1, 2], - opacity: 1 -}); - -// $ExpectType VideoLayer -new AMap.VideoLayer(); -// $ExpectType VideoLayer -new AMap.VideoLayer({}); -// $ExpectType VideoLayer -const videoLayer = new AMap.VideoLayer({ - bounds -}); - -// $ExpectType void -videoLayer.setMap(null); -// $ExpectType void -videoLayer.setMap(map); - -// $ExpectType Map | null | undefined -videoLayer.getMap(); - -// $ExpectType void -videoLayer.show(); - -// $ExpectType void -videoLayer.hide(); - -// $ExpectType number -videoLayer.getzIndex(); - -// $ExpectType void -videoLayer.setzIndex(10); - -// $ExpectType HTMLVideoElement | null -videoLayer.getElement(); - -// $ExpectType void -videoLayer.setVideoUrl('url'); - -// $ExpectType string | string[] | undefined -videoLayer.getVideoUrl(); diff --git a/types/amap-js-api/test/layer/wms.ts b/types/amap-js-api/test/layer/wms.ts deleted file mode 100644 index 255affa216..0000000000 --- a/types/amap-js-api/test/layer/wms.ts +++ /dev/null @@ -1,89 +0,0 @@ -import { - map -} from '../preset'; - -// $ExpectType WMS -new AMap.TileLayer.WMS({ - url: 'url', - params: {} -}); -// $ExpectType WMS -const wms = new AMap.TileLayer.WMS({ - url: 'url', - blend: true, - params: { - VERSION: 'version', - LAYERS: 'layers', - STYLES: 'styles', - FORMAT: 'format', - TRANSPARENT: 'TRUE', - BGCOLOR: '#000', - EXCEPTIONS: 'exceptions', - TIME: 'time', - ELEVATION: 'elevation' - }, - zooms: [1, 2], - tileSize: 256, - opacity: 1, - zIndex: 10, - visible: true -}); - -// $ExpectType void -wms.setMap(map); -// $ExpectType void -wms.setMap(null); - -// $ExpectType Map | null | undefined -wms.getMap(); - -// $ExpectType void -wms.show(); - -// $ExpectType void -wms.hide(); - -// $ExpectType void -wms.setzIndex(10); - -// $ExpectType number -wms.getzIndex(); - -// $ExpectType void -wms.setUrl('url'); - -// $ExpectType string -wms.getUrl(); - -// $ExpectType void -wms.setParams({ - VERSION: 'version', - LAYERS: 'layers', - STYLES: 'styles', - FORMAT: 'format', - TRANSPARENT: 'TRUE', - BGCOLOR: '#000', - EXCEPTIONS: 'exceptions', - TIME: 'time', - ELEVATION: 'elevation' -}); - -const params = wms.getParams(); -// $ExpectType string | undefined -params.VERSION; -// $ExpectType string | undefined -params.LAYERS; -// $ExpectType string | undefined -params.STYLES; -// $ExpectType string | undefined -params.FORMAT; -// $ExpectType "TRUE" | "FALSE" | undefined -params.TRANSPARENT; -// $ExpectType string | undefined -params.BGCOLOR; -// $ExpectType string | undefined -params.EXCEPTIONS; -// $ExpectType string | undefined -params.TIME; -// $ExpectType string | undefined -params.ELEVATION; diff --git a/types/amap-js-api/test/layer/wmts.ts b/types/amap-js-api/test/layer/wmts.ts deleted file mode 100644 index bc167c1189..0000000000 --- a/types/amap-js-api/test/layer/wmts.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { - map -} from '../preset'; - -// $ExpectType WMTS -new AMap.TileLayer.WMTS({ - url: 'url', - params: {} -}); -// $ExpectType WMTS -const wmts = new AMap.TileLayer.WMTS({ - url: 'url', - blend: true, - tileSize: 256, - zooms: [1, 2], - opacity: 1, - zIndex: 10, - visible: true, - params: { - Version: 'version', - Layer: 'layers', - Style: 'style', - Format: 'format' - } -}); - -// $ExpectType void -wmts.setMap(map); -// $ExpectType void -wmts.setMap(null); - -// $ExpectType Map | null | undefined -wmts.getMap(); - -// $ExpectType void -wmts.show(); - -// $ExpectType void -wmts.hide(); - -// $ExpectType void -wmts.setzIndex(10); - -// $ExpectType number -wmts.getzIndex(); - -// $ExpectType void -wmts.setUrl('url'); - -// $ExpectType string -wmts.getUrl(); - -// $ExpectType void -wmts.setParams({ - Version: 'version', - Layer: 'layers', - Style: 'style', - Format: 'format' -}); - -const params = wmts.getParams(); -// $ExpectType string | undefined -params.Version; -// $ExpectType string | undefined -params.Layer; -// $ExpectType string | undefined -params.Style; -// $ExpectType string | undefined -params.Format; diff --git a/types/amap-js-api/test/lnglat.ts b/types/amap-js-api/test/lnglat.ts deleted file mode 100644 index 92057953ee..0000000000 --- a/types/amap-js-api/test/lnglat.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { - lnglat -} from './preset'; - -// $ExpectType LngLat -new AMap.LngLat(114, 22); -// $ExpectType LngLat -new AMap.LngLat(113, 21); - -// $ExpectType LngLat -lnglat.offset(1, 2); - -// $ExpectType number -lnglat.distance(lnglat); -// $ExpectType number -lnglat.distance([lnglat]); - -// $ExpectType number -lnglat.getLng(); - -// $ExpectType number -lnglat.getLat(); - -// $ExpectType boolean -lnglat.equals(lnglat); - -// $ExpectType string -lnglat.toString(); - -// $ExpectType LngLat -lnglat.add(lnglat); -// $ExpectType LngLat -lnglat.add(lnglat, true); - -// $ExpectType LngLat -lnglat.subtract(lnglat); -// $ExpectType LngLat -lnglat.subtract(lnglat, true); - -// $ExpectType LngLat -lnglat.divideBy(1); -// $ExpectType LngLat -lnglat.divideBy(1, true); - -// $ExpectType LngLat -lnglat.multiplyBy(1); -// $ExpectType LngLat -lnglat.multiplyBy(1, true); diff --git a/types/amap-js-api/test/map.ts b/types/amap-js-api/test/map.ts deleted file mode 100644 index 6f2b027e60..0000000000 --- a/types/amap-js-api/test/map.ts +++ /dev/null @@ -1,338 +0,0 @@ -import { - lnglat, - bounds, - lnglatTuple, - pixel -} from './preset'; - -declare const container: HTMLDivElement; -declare const tileLayer: AMap.TileLayer; - -// declare var indoorMap: AMap.IndoorMap - -// $ExpectType Map -new AMap.Map('map'); -// $ExpectType Map -new AMap.Map(container); - -// $ExpectType Map -new AMap.Map(container, {}); - -// $ExpectType Map -const map = new AMap.Map(container, { - layers: [tileLayer], - zoom: 15, - center: [1, 2], - labelzIndex: 110, - zooms: [5, 15], - lang: 'zh_cn', - defaultCursor: 'default', - crs: 'EPSG4326', - animateEnable: true, - isHotspot: false, - defaultLayer: tileLayer, - rotateEnable: true, - resizeEnable: true, - showIndoorMap: true, - // indoorMap, // TODO - expandZoomRange: true, - dragEnable: true, - zoomEnable: true, - doubleClickZoom: true, - keyboardEnable: true, - jogEnable: true, - scrollWheel: true, - touchZoom: true, - mapStyle: '', - features: ['road'], - showBuildingBlock: true, - skyColor: '#fff', - preloadMode: true, - mask: [[1, 2], [2, 3], [3, 4]] -}); - -// $ExpectType number -map.getZoom(); - -// $ExpectType Layer[] -map.getLayers(); - -// $ExpectType LngLat -map.getCenter(); - -// $ExpectType HTMLElement | null -map.getContainer(); - -map.getCity(city => { - // $ExpectType string - city.city; - // $ExpectType string - city.citycode; - // $ExpectType string - city.district; - // $ExpectType string | never[] - city.province; -}); - -// $ExpectType Bounds -map.getBounds(); - -// $ExpectType number -map.getLabelzIndex(); - -// $ExpectType Lang -map.getLang(); - -// $ExpectType Size -map.getSize(); - -// $ExpectType number -map.getRotation(); - -// $ExpectType Status -const mapStatus = map.getStatus(); -// $ExpectType boolean -mapStatus.animateEnable; -// $ExpectType boolean -mapStatus.doubleClickZoom; -// $ExpectType boolean -mapStatus.dragEnable; -// $ExpectType boolean -mapStatus.isHotspot; -// $ExpectType boolean -mapStatus.jogEnable; -// $ExpectType boolean -mapStatus.keyboardEnable; -// $ExpectType boolean -mapStatus.pitchEnable; -// $ExpectType boolean -mapStatus.resizeEnable; -// $ExpectType boolean -mapStatus.rotateEnable; -// $ExpectType boolean -mapStatus.scrollWheel; -// $ExpectType boolean -mapStatus.touchZoom; -// $ExpectType boolean -mapStatus.zoomEnable; - -// $ExpectType string -map.getDefaultCursor(); - -// $ExpectType number -map.getResolution(); - -// $ExpectType number -map.getScale(); -// $ExpectType number -map.getScale(1); - -// $ExpectType void -map.setZoom(1); - -// $ExpectType void -map.setLabelzIndex(1); - -// $ExpectType void -map.setLayers([tileLayer]); - -// $ExpectType void -map.setCenter(lnglat); -// $ExpectType void -map.setCenter([1, 2]); - -// $ExpectType void -map.setZoomAndCenter(13, lnglat); -// $ExpectType void -map.setZoomAndCenter(13, [1, 2]); - -// $ExpectType void -map.setCity('city', (coord, zoom) => { - // $ExpectType string - coord[0]; - // $ExpectType string - coord[1]; - // $ExpectType number - zoom; -}); - -// $ExpectType Bounds -map.setBounds(bounds); - -// $ExpectType void -map.setLimitBounds(bounds); - -// $ExpectType void -map.clearLimitBounds(); - -// $ExpectType void -map.setLang('zh_cn'); - -// $ExpectType void -map.setRotation(1); - -// $ExpectType void -map.setStatus({}); -// $ExpectType void -map.setStatus({ - animateEnable: true, - doubleClickZoom: true, - dragEnable: true, - isHotspot: true, - jogEnable: true, - keyboardEnable: true, - pitchEnable: false, - resizeEnable: false, - rotateEnable: false, - scrollWheel: true, - touchZoom: true, - zoomEnable: true -}); - -// $ExpectType void -map.setDefaultCursor('default'); - -// $ExpectType void -map.zoomIn(); - -// $ExpectType void -map.zoomOut(); - -// $ExpectType void -map.panTo([1, 2]); -// $ExpectType void -map.panTo(lnglat); - -// $ExpectType void -map.panBy(1, 2); - -// $ExpectType void -map.clearMap(); - -// $ExpectType Map -map.plugin('plugin name', () => { }); -// $ExpectType Map -map.plugin(['plugin name'], () => { }); - -// $ExpectType void -map.clearInfoWindow(); - -// $ExpectType LngLat -map.pixelToLngLat(pixel); -// $ExpectType LngLat -map.pixelToLngLat(pixel, 1); - -// $ExpectType Pixel -map.lnglatToPixel(lnglat); -// $ExpectType Pixel -map.lnglatToPixel(lnglat, 1); - -// $ExpectType LngLat -map.containerToLngLat(pixel); - -// $ExpectType Pixel -map.lngLatToContainer(lnglat); -// $ExpectType Pixel -map.lnglatTocontainer(lnglat); - -// $ExpectType void -map.setMapStyle(''); -// $ExpectType string -map.getMapStyle(); - -// $ExpectType void -map.setFeatures('all'); -// $ExpectType void -map.setFeatures(['bg']); - -const feature: 'all' | 'bg' | 'point' | 'road' | 'building' | AMap.Map.Feature[] = map.getFeatures(); - -// $ExpectType void -map.setDefaultLayer(tileLayer); - -// $ExpectType void -map.setPitch(1); -// $ExpectType number -map.getPitch(); - -// $ExpectType ViewMode -map.getViewMode_(); - -// $ExpectType Pixel -map.lngLatToGeodeticCoord(lnglat); -// $ExpectType Pixel -map.lngLatToGeodeticCoord(lnglatTuple); - -// $ExpectType LngLat -map.geodeticCoordToLngLat(pixel); - -// $ExpectType void -map.destroy(); - -declare function dblClickHandler(this: AMap.Map, event: AMap.Map.EventMap['dblclick']): void; - -// $ExpectType Map -map.on('click', (event: AMap.Map.EventMap['click']) => { - // $ExpectType "click" - event.type; - // $ExpectType Pixel - event.pixel; - // $ExpectType LngLat - event.lnglat; - // $ExpectType Map - event.target; -}); -// $ExpectType Map -map.on('dblclick', dblClickHandler); -// $ExpectType Map -map.on('complete', (event: AMap.Map.EventMap['complete']) => { - // $ExpectType "complete" - event.type; - // $ExpectError - event.value; -}); -// $ExpectType Map -map.on('hotspotclick', (event: AMap.Map.EventMap['hotspotclick']) => { - // $ExpectType string - event.id; - // $ExpectType LngLat - event.lnglat; - // $ExpectType string - event.name; - // $ExpectType "hotspotclick" - event.type; -}); -// $ExpectType Map -map.on('custom', (event: AMap.Event<'custom', { test: string }>) => { - // $ExpectType "custom" - event.type; - // $ExpectType string - event.test; -}); - -// $ExpectType Map -map.off('dblclick', dblClickHandler); -// $ExpectType Map -map.off('click', 'mv'); - -// $ExpectType Map -map.emit('click', { - target: map, - lnglat, - pixel -}); - -map.emit('complete'); -// $ExpectType Map -map.emit('hotspotclick', { - lnglat, - name: '123', - id: '123', - isIndoorPOI: true -}); -// $ExpectType Map -map.emit('custom', { - test: 1 -}); -// $ExpectType Map -map.emit('custom', undefined); diff --git a/types/amap-js-api/test/overlay/bezierCurve.ts b/types/amap-js-api/test/overlay/bezierCurve.ts deleted file mode 100644 index abf0640fc9..0000000000 --- a/types/amap-js-api/test/overlay/bezierCurve.ts +++ /dev/null @@ -1,155 +0,0 @@ -import { - map, - lnglat -} from '../preset'; - -interface ExtraData { - test: number; -} - -const path = [ - [1, 2, 3, 4], - [1, 2, 3], - [ - [1, 2, 3], - [1, 2] - ], - [1, 2] -]; - -// $ExpectError -new AMap.BezierCurve(); -// $ExpectError -new AMap.BezierCurve({}); -// $ExpectType BezierCurve -const bezierCurve = new AMap.BezierCurve({ - map, - path, - strokeColor: '#FF0000', - strokeOpacity: 0.6, - strokeWeight: 10, - strokeStyle: 'dashed', - strokeDasharray: [1, 5], - zIndex: 10, - bubble: false, - showDir: true, - cursor: 'pointer', - isOutline: true, - outlineColor: '#00FF00', - borderWeight: 2 -}); - -// $ExpectType void -bezierCurve.setPath(path); - -// $ExpectType void -bezierCurve.setPath(path); - -// $ExpectType void -bezierCurve.setOptions({}); -bezierCurve.setOptions({ - map, - path, - strokeColor: '#FF0000', - strokeOpacity: 0.6, - strokeWeight: 10, - strokeStyle: 'dashed', - strokeDasharray: [1, 5], - zIndex: 10, - bubble: false, - showDir: true, - cursor: 'pointer', - isOutline: true, - outlineColor: '#00FF00', - borderWeight: 2 -}); - -const options = bezierCurve.getOptions(); - -// $ExpectType number | undefined -options.borderWeight; -// $ExpectType boolean | undefined -options.bubble; -// $ExpectType boolean | undefined -options.clickable; -// $ExpectType string | undefined -options.dirColor; -// $ExpectType string | undefined -options.dirImg; -// $ExpectType {} | ExtraData | undefined -options.extData; -// $ExpectType boolean | undefined -options.geodesic; -// $ExpectType boolean | undefined -options.isOutline; -// $ExpectType "round" | "butt" | "square" | undefined -options.lineCap; -// $ExpectType "miter" | "round" | "bevel" | undefined -options.lineJoin; -// $ExpectType Map | undefined -options.map; -// $ExpectType string | undefined -options.outlineColor; -// $ExpectType (LngLat & { controlPoints: LngLat[]; })[] | undefined -options.path; -// $ExpectType boolean | undefined -options.showDir; -// $ExpectType string | undefined -options.strokeColor; -// $ExpectType number[] | undefined -options.strokeDasharray; -// $ExpectType number | undefined -options.strokeOpacity; -// $ExpectType "dashed" | "solid" | undefined -options.strokeStyle; -// $ExpectType number | undefined -options.strokeWeight; -// $ExpectType number | undefined -options.zIndex; - -// $ExpectType number -bezierCurve.getLength(); - -// $ExpectType Bounds | null -bezierCurve.getBounds(); - -// $ExpectType void -bezierCurve.show(); - -// $ExpectType void -bezierCurve.hide(); - -// $ExpectType void -bezierCurve.setMap(null); -bezierCurve.setMap(map); - -// $ExpectType void -bezierCurve.setExtData({ test: 1 }); -// $ExpectError -bezierCurve.setExtData({ test: '123' }); - -// $ExpectType {} | ExtraData -bezierCurve.getExtData(); - -bezierCurve.on('click', (event: AMap.BezierCurve.EventMap['click']) => { - // $ExpectType "click" - event.type; - // $ExpectType LngLat - event.lnglat; - // $ExpectType BezierCurve - event.target; -}); - -bezierCurve.on('show', (event: AMap.BezierCurve.EventMap['show']) => { - // $ExpectType "show" - event.type; - // $ExpectType BezierCurve - event.target; -}); - -bezierCurve.on('options', (event: AMap.BezierCurve.EventMap['options']) => { - // $ExpectType "options" - event.type; - // $ExpectError - event.target; -}); diff --git a/types/amap-js-api/test/overlay/circle.ts b/types/amap-js-api/test/overlay/circle.ts deleted file mode 100644 index 28822b9ec9..0000000000 --- a/types/amap-js-api/test/overlay/circle.ts +++ /dev/null @@ -1,150 +0,0 @@ -import { - map, - lnglat, - lnglatTuple -} from '../preset'; - -interface ExtraData { - test: number; -} - -// $ExpectType Circle -new AMap.Circle(); -new AMap.Circle({}); -// $ExpectType Circle -const circle = new AMap.Circle({ - map, - zIndex: 10, - center: lnglat, - bubble: true, - cursor: 'pointer', - radius: 1000, - strokeColor: '#FF0000', - strokeOpcity: 0.8, - strokeWeight: 3, - fillColor: '#00FF00', - fillOpacity: 0.5, - strokeStyle: 'dashed', - extData: { test: 1 }, - strokeDasharray: [2, 4] -}); - -// $ExpectType void -circle.setCenter(lnglat); -// $ExpectType void -circle.setCenter(lnglatTuple); - -// $ExpectType LngLat | undefined -circle.getCenter(); - -// $ExpectType Bounds | null -circle.getBounds(); - -// $ExpectType void -circle.setRadius(100); - -// $ExpectType number -circle.getRadius(); - -// $ExpectType void -circle.setOptions({}); -circle.setOptions({ - map, - zIndex: 10, - center: lnglat, - bubble: true, - cursor: 'pointer', - radius: 1000, - strokeColor: '#FF0000', - strokeOpcity: 0.8, - strokeWeight: 3, - fillColor: '#00FF00', - fillOpacity: 0.5, - strokeStyle: 'dashed', - extData: { test: 1 }, - strokeDasharray: [2, 4] -}); - -const options = circle.getOptions(); -// $ExpectType boolean | undefined -options.bubble; -// $ExpectType LngLat | undefined -options.center; -// $ExpectType boolean | undefined -options.clickable; -// $ExpectType {} | ExtraData | undefined -options.extData; -// $ExpectType string | undefined -options.fillColor; -// $ExpectType number | undefined -options.fillOpacity; -// $ExpectType "miter" | "round" | "bevel" | undefined -options.lineJoin; -// $ExpectType Map | undefined -options.map; -// $ExpectType LngLat[] | undefined -options.path; -// $ExpectType number | undefined -options.radius; -// $ExpectType string | undefined -options.strokeColor; -// $ExpectType number[] | undefined -options.strokeDasharray; -// $ExpectType number | undefined -options.strokeOpacity; -// $ExpectType "dashed" | "solid" | undefined -options.strokeStyle; -// $ExpectType number | undefined -options.strokeWeight; -// $ExpectType string | undefined -options.texture; -// $ExpectType number | undefined -options.zIndex; - -// $ExpectType Bounds | null -circle.getBounds(); - -// $ExpectType void -circle.hide(); - -// $ExpectType void -circle.show(); - -// $ExpectType void -circle.setMap(null); -// $ExpectType void -circle.setMap(map); - -// $ExpectType void -circle.setExtData({ test: 2 }); -// $ExpectError -circle.setExtData({ test: '1' }); - -// $ExpectType {} | ExtraData -circle.getExtData(); - -// $ExpectType boolean -circle.contains(lnglat); -// $ExpectType boolean -circle.contains(lnglatTuple); - -circle.on('click', (event: AMap.Circle.EventMap['click']) => { - // $ExpectType "click" - event.type; - // $ExpectType Circle - event.target; -}); - -circle.on('setCenter', (event: AMap.Circle.EventMap['setCenter']) => { - // $ExpectType "setCenter" - event.type; - // $ExpectError - event.target; -}); - -circle.on('change', (event: AMap.Circle.EventMap['change']) => { - // $ExpectType "change" - event.type; - // $ExpectType Circle - event.target; -}); diff --git a/types/amap-js-api/test/overlay/contextMenu.ts b/types/amap-js-api/test/overlay/contextMenu.ts deleted file mode 100644 index 5c7173d26b..0000000000 --- a/types/amap-js-api/test/overlay/contextMenu.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { - map, - lnglat, - lnglatTuple -} from '../preset'; - -interface ExtraData { - test: number; -} -// $ExpectType ContextMenu -new AMap.ContextMenu(); -// $ExpectType ContextMenu -new AMap.ContextMenu({}); -// $ExpectType ContextMenu -const contextMenu = new AMap.ContextMenu({ - content: '
content
', -}); - -// $ExpectType void -contextMenu.addItem('item', function () { - // $ExpectType HTMLLIElement - this; -}); -// $ExpectType void -contextMenu.addItem('item', () => { }, 1); - -// $ExpectType void -contextMenu.removeItem('item', () => {}); - -// $ExpectType void -contextMenu.open(map, lnglatTuple); -// $ExpectType void -contextMenu.open(map, lnglat); - -// $ExpectType void -contextMenu.close(); - -contextMenu.on('items', (event: AMap.ContextMenu.EventMap['items']) => { - // $ExpectType "items" - event.type; -}); - -contextMenu.on('open', (event: AMap.ContextMenu.EventMap['open']) => { - // $ExpectType "open" - event.type; - // $ExpectType ContextMenu - event.target; -}); diff --git a/types/amap-js-api/test/overlay/ellipse.ts b/types/amap-js-api/test/overlay/ellipse.ts deleted file mode 100644 index c5205d9915..0000000000 --- a/types/amap-js-api/test/overlay/ellipse.ts +++ /dev/null @@ -1,117 +0,0 @@ -import { - map, - lnglat, - lnglatTuple -} from '../preset'; - -interface ExtraData { - test: number; -} -// $ExpectType Ellipse -new AMap.Ellipse(); -// $ExpectType Ellipse -new AMap.Ellipse({}); -// $ExpectType Ellipse -const ellipse = new AMap.Ellipse({ - map, - zIndex: 10, - center: lnglat, - radius: [10000, 15000], - bubble: false, - cursor: 'pointer', - strokeColor: '#FF0000', - strokeOpacity: 0.8, - strokeWeight: 2, - fillColor: '#0000FF', - fillOpacity: 0.5, - strokeStyle: 'dashed', - extData: { test: 1 }, - strokeDasharray: [1, 5] -}); - -// $ExpectType LngLat | undefined -ellipse.getCenter(); - -// $ExpectType void -ellipse.setCenter(lnglat); -// $ExpectType void -ellipse.setCenter(lnglatTuple); - -// $ExpectType Bounds | null -ellipse.getBounds(); - -// $ExpectType void -ellipse.setOptions({ - map, - zIndex: 10, - center: lnglat, - radius: [10000, 15000], - bubble: false, - cursor: 'pointer', - strokeColor: '#FF0000', - strokeOpacity: 0.8, - strokeWeight: 2, - fillColor: '#0000FF', - fillOpacity: 0.5, - strokeStyle: 'dashed', - extData: { test: 1 }, - strokeDasharray: [1, 5] -}); - -const options = ellipse.getOptions(); - -// $ExpectType boolean | undefined -options.bubble; -// $ExpectType LngLat | undefined -options.center; -// $ExpectType boolean | undefined -options.clickable; -// $ExpectType {} | ExtraData | undefined -options.extData; -// $ExpectType string | undefined -options.fillColor; -// $ExpectType number | undefined -options.fillOpacity; -// $ExpectType "miter" | "round" | "bevel" | undefined -options.lineJoin; -// $ExpectType Map | undefined -options.map; -// $ExpectType LngLat[] | undefined -options.path; -// $ExpectType [number, number] | undefined -options.radius; -// $ExpectType string | undefined -options.strokeColor; -// $ExpectType number[] | undefined -options.strokeDasharray; -// $ExpectType number | undefined -options.strokeOpacity; -// $ExpectType "dashed" | "solid" | undefined -options.strokeStyle; -// $ExpectType number | undefined -options.strokeWeight; -// $ExpectType string | undefined -options.texture; -// $ExpectType number | undefined -options.zIndex; - -// $ExpectType void -ellipse.hide(); - -// $ExpectType void -ellipse.show(); - -// $ExpectType void -ellipse.setMap(null); -// $ExpectType void -ellipse.setMap(map); - -// $ExpectType void -ellipse.setExtData({test: 2}); -// $ExpectType {} | ExtraData -ellipse.getExtData(); - -// $ExpectType boolean -ellipse.contains(lnglat); -// $ExpectType boolean -ellipse.contains(lnglatTuple); diff --git a/types/amap-js-api/test/overlay/geoJSON.ts b/types/amap-js-api/test/overlay/geoJSON.ts deleted file mode 100644 index ee8c501472..0000000000 --- a/types/amap-js-api/test/overlay/geoJSON.ts +++ /dev/null @@ -1,106 +0,0 @@ -import { - map, - lnglatTuple -} from '../preset'; - -declare const marker: AMap.Marker; -declare const polyline: AMap.Polyline; -declare const polygon: AMap.Polygon; - -interface ExtraData { - test: number; -} - -const geoJSONObject: AMap.GeoJSON.GeoJSONObject[] = [ - { - type: 'Feature', - properties: {}, - geometry: { - type: 'Point', - coordinates: lnglatTuple - } - }, - { - type: 'Feature', - properties: { test: 1 }, - geometry: { - type: 'LineString', - coordinates: [lnglatTuple, lnglatTuple] - } - } -]; - -// $ExpectType GeoJSON -new AMap.GeoJSON(); -// $ExpectType GeoJSON -new AMap.GeoJSON({}); -// $ExpectType GeoJSON -const geoJSON = new AMap.GeoJSON({ - geoJSON: geoJSONObject, - getMarker(obj, lnglat) { - // $ExpectType GeoJSONObject - obj; - // $ExpectType LngLat - lnglat; - return marker; - }, - getPolyline(obj, lnglats) { - // $ExpectType GeoJSONObject - obj; - // $ExpectType LngLat[] - lnglats; - return polyline; - }, - getPolygon(obj, lnglats) { - // $ExpectType GeoJSONObject - obj; - // $ExpectType LngLat[] - lnglats; - return polygon; - }, - coordsToLatLng(coord) { - // $ExpectType LngLat - coord; - return coord; - } -}); - -// $ExpectType void -geoJSON.importData(geoJSONObject); - -// $ExpectType GeoJSON -geoJSON.removeOverlay(marker); -// $ExpectType GeoJSON -geoJSON.removeOverlay([marker]); - -// $ExpectType boolean -geoJSON.hasOverlay(marker); -// $ExpectType boolean -geoJSON.hasOverlay(m => m === marker); - -// $ExpectType GeoJSON -geoJSON.addOverlay(marker); -// $ExpectType GeoJSON -geoJSON.addOverlay([marker]); - -// $ExpectType GeoJSONObject[] -geoJSON.toGeoJSON(); - -// $ExpectType GeoJSON -geoJSON.setMap(null); -// $ExpectType GeoJSON -geoJSON.setMap(map); - -// $ExpectType GeoJSON -geoJSON.hide(); - -// $ExpectType GeoJSON -geoJSON.show(); - -type ClickEvent = AMap.MapsEvent<'click', AMap.Overlay>; -geoJSON.on('click', (event: ClickEvent) => { - // $ExpectType "click" - event.type; - // $ExpectType Overlay - event.target; -}); diff --git a/types/amap-js-api/test/overlay/icon.ts b/types/amap-js-api/test/overlay/icon.ts deleted file mode 100644 index 8576685b8a..0000000000 --- a/types/amap-js-api/test/overlay/icon.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { - size, - pixel, - icon -} from '../preset'; - -// $ExpectType Icon -new AMap.Icon(); -// $ExpectType Icon -new AMap.Icon({}); -// $ExpectType Icon -new AMap.Icon({ - size, - imageOffset: pixel, - image: 'image uri', - imageSize: size -}); -// $ExpectType Icon -new AMap.Icon({ - size: [1, 2], - imageOffset: pixel, - image: 'image uri', - imageSize: [1, 2] -}); - -// $ExpectType Size -icon.getImageSize(); - -// $ExpectType void -icon.setImageSize(size); -// $ExpectType void -icon.setImageSize([1, 2]); diff --git a/types/amap-js-api/test/overlay/infoWindow.ts b/types/amap-js-api/test/overlay/infoWindow.ts deleted file mode 100644 index 3fa4b0e656..0000000000 --- a/types/amap-js-api/test/overlay/infoWindow.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { - map, - lnglat, - size, - pixel, - div, - lnglatTuple -} from '../preset'; - -interface ExtraData { - test: number; -} - -// $ExpectType InfoWindow -new AMap.InfoWindow(); -// $ExpectType InfoWindow -new AMap.InfoWindow({}); -// $ExpectType InfoWindow -const infoWindow = new AMap.InfoWindow({ - isCustom: false, - autoMove: false, - closeWhenClickMap: false, - content: 'content', - size: [100, 100], - offset: new AMap.Pixel(10, 10), - position: lnglat, - showShadow: true -}); - -// $ExpectType void -infoWindow.open(map); -// $ExpectType void -infoWindow.open(map, lnglat); -// $ExpectType void -infoWindow.open(map, lnglatTuple); - -// $ExpectType void -infoWindow.close(); - -// $ExpectType boolean -infoWindow.getIsOpen(); - -// $ExpectType void -infoWindow.setContent('content'); -// $ExpectType void -infoWindow.setContent(div); - -// $ExpectType string | HTMLElement | undefined -infoWindow.getContent(); - -// $ExpectType void -infoWindow.setPosition(lnglat); -// $ExpectType void -infoWindow.setPosition(lnglatTuple); - -// $ExpectType LngLat | undefined -infoWindow.getPosition(); - -// $ExpectType Size | undefined -infoWindow.getSize(); - -infoWindow.on('change', (event: AMap.InfoWindow.EventMap['change']) => { - // $ExpectType "change" - event.type; - // $ExpectType InfoWindow - event.target; -}); - -infoWindow.on('close', (event: AMap.InfoWindow.EventMap['close']) => { - // $ExpectType "close" - event.type; - // $ExpectType InfoWindow - event.target; -}); - -infoWindow.on('open', (event: AMap.InfoWindow.EventMap['open']) => { - // $ExpectType "open" - event.type; - // $ExpectType InfoWindow - event.target; -}); diff --git a/types/amap-js-api/test/overlay/marker.ts b/types/amap-js-api/test/overlay/marker.ts deleted file mode 100644 index 635ce724c8..0000000000 --- a/types/amap-js-api/test/overlay/marker.ts +++ /dev/null @@ -1,195 +0,0 @@ -import { - map, - lnglat -} from '../preset'; - -declare var pixel: AMap.Pixel; -declare var domEle: HTMLElement; -declare var markerShape: AMap.MarkerShape; -declare var icon: AMap.Icon; - -interface ExtraData { - test: number; -} - -// $ExpectType Marker -new AMap.Marker(); -// $ExpectType Marker -new AMap.Marker(); -// $ExpectType Marker -new AMap.Marker({}); -// $ExpectType Marker -const marker = new AMap.Marker({ - map, - position: lnglat, - offset: pixel, - icon: 'iconUrl', - content: 'htmlString', - topWhenClick: true, - raiseOnDrag: true, - cursor: 'default', - visible: true, - zIndex: 10, - angle: 10, - autoRotation: true, - animation: 'AMAP_ANIMATION_BOUNCE', - shadow: icon, - title: '123', - clickable: true, - shape: markerShape, - extData: { - test: 123 - } -}); - -// $ExpectType void -marker.markOnAMAP({ - name: '123', - position: [1, 2] -}); -// $ExpectType void -marker.markOnAMAP(); -// $ExpectType void -marker.markOnAMAP({}); -// $ExpectType void -marker.markOnAMAP({ - position: [1, 2], - name: '123' -}); - -// $ExpectType Pixel -marker.getOffset(); - -// $ExpectType void -marker.setOffset(pixel); - -// $ExpectType void -marker.setAnimation('AMAP_ANIMATION_BOUNCE'); - -// $ExpectType AnimationName -marker.getAnimation(); - -// $ExpectType void -marker.setClickable(true); - -// $ExpectType boolean -marker.getClickable(); - -// $ExpectType LngLat | undefined -marker.getPosition(); - -// $ExpectType void -marker.setPosition(lnglat); - -// $ExpectType void -marker.setAngle(0); - -// $ExpectType void -marker.setLabel(); -// $ExpectType void -marker.setLabel({}); -// $ExpectType void -marker.setLabel({ - content: 'label content', - offset: pixel -}); - -// $ExpectType Label | undefined -marker.getLabel(); - -// $ExpectType number -marker.getAngle(); - -// $ExpectType void -marker.setzIndex(100); - -// $ExpectType number -marker.getzIndex(); - -// $ExpectType void -marker.setIcon('icon uri'); -// $ExpectType void -marker.setIcon(icon); - -// $ExpectType string | Icon | undefined -marker.getIcon(); - -// $ExpectType void -marker.setDraggable(true); - -// $ExpectType boolean -marker.getDraggable(); - -// $ExpectType void -marker.setCursor('default'); - -// $ExpectType void -marker.setContent('content'); -// $ExpectType void -marker.setContent(domEle); - -// $ExpectType string | HTMLElement -marker.getContent(); - -// $ExpectType void -marker.moveAlong([lnglat], 100); -// $ExpectError -marker.moveAlong([[1, 2]], 100); -// $ExpectType void -marker.moveAlong([lnglat], 100, t => t, false); - -// $ExpectType void -marker.moveTo(lnglat, 100); -// $ExpectType void -marker.moveTo([1, 2], 100); -// $ExpectType void -marker.moveTo([1, 2], 100, t => t); - -// $ExpectType void -marker.stopMove(); - -// $ExpectType boolean -marker.pauseMove(); - -// $ExpectType boolean -marker.resumeMove(); - -// $ExpectType void -marker.setMap(map); - -// $ExpectType void -marker.setTitle('title'); -// $ExpectError -marker.setTitle(); - -// $ExpectType string | undefined -marker.getTitle(); - -// $ExpectType void -marker.setTop(true); - -// $ExpectType boolean -marker.getTop(); - -// $ExpectType void -marker.setShadow(); -// $ExpectType void -marker.setShadow(icon); -// $ExpectType void -marker.setShadow('shadow url'); - -// $ExpectType string | Icon | undefined -marker.getShadow(); - -// $ExpectType void -marker.setShape(); -// $ExpectType void -marker.setShape(markerShape); - -// $ExpectType MarkerShape | undefined -marker.getShape(); - -marker.on('click', (event: AMap.Marker.EventMap['click']) => { - // $ExpectType {} | ExtraData - event.target.getExtData(); -}); diff --git a/types/amap-js-api/test/overlay/markerShape.ts b/types/amap-js-api/test/overlay/markerShape.ts deleted file mode 100644 index 259b68cf20..0000000000 --- a/types/amap-js-api/test/overlay/markerShape.ts +++ /dev/null @@ -1,26 +0,0 @@ -// $ExpectType MarkerShape -new AMap.MarkerShape({ - type: 'circle', - coords: [1, 1, 1] -}); -// $ExpectType MarkerShape -new AMap.MarkerShape({ - type: 'rect', - coords: [1, 1, 1, 2] -}); -// $ExpectType MarkerShape -new AMap.MarkerShape({ - type: 'poly', - coords: [1, 2, 3, 4, 5] -}); - -// $ExpectError -new AMap.MarkerShape({ - type: 'circle', - coords: [1, 1] -}); -// $ExpectError -new AMap.MarkerShape({ - type: 'rect', - coords: [1, 1, 1, 2, 2] -}); diff --git a/types/amap-js-api/test/overlay/overlay.ts b/types/amap-js-api/test/overlay/overlay.ts deleted file mode 100644 index 6a301e7091..0000000000 --- a/types/amap-js-api/test/overlay/overlay.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { - map -} from '../preset'; -interface ExtraData { - test: number; -} -declare const overlay: AMap.Overlay; - -// $ExpectType void -overlay.show(); - -// $ExpectType void -overlay.hide(); - -// $ExpectType Map | null | undefined -overlay.getMap(); - -// $ExpectType void -overlay.setMap(map); -// $ExpectType void -overlay.setMap(null); - -// $ExpectError -overlay.setExtData({ any: 123 }); - -// $ExpectError ExtraData -overlay.getExtData(); diff --git a/types/amap-js-api/test/overlay/overlayGroup.ts b/types/amap-js-api/test/overlay/overlayGroup.ts deleted file mode 100644 index 11e04f91cf..0000000000 --- a/types/amap-js-api/test/overlay/overlayGroup.ts +++ /dev/null @@ -1,108 +0,0 @@ -import { - map, - lnglat, - pixel, - circle, - marker, - markerShape, - icon -} from '../preset'; - -// $ExpectType OverlayGroup, any> -const overlayGroup2 = new AMap.OverlayGroup(); -// $ExpectType OverlayGroup, any> -new AMap.OverlayGroup(marker); -// $ExpectType OverlayGroup, any> -const overlayGroup = new AMap.OverlayGroup([marker]); - -// $ExpectType OverlayGroup, any> -overlayGroup.addOverlay(marker); -// $ExpectType OverlayGroup, any> -overlayGroup.addOverlay([marker]); -// $ExpectError -overlayGroup.addOverlay([circle]); - -// $ExpectType OverlayGroup, any> -overlayGroup.addOverlays(marker); -// $ExpectType OverlayGroup, any> -overlayGroup.addOverlays([marker]); - -// $ExpectType Marker[] -overlayGroup.getOverlays(); - -// $ExpectType boolean -overlayGroup.hasOverlay(marker); -// $ExpectType boolean -overlayGroup.hasOverlay(o => o === marker); - -// $ExpectType OverlayGroup, any> -overlayGroup.removeOverlay(marker); -// $ExpectType OverlayGroup, any> -overlayGroup.removeOverlay([marker]); - -// $ExpectType OverlayGroup, any> -overlayGroup.removeOverlays(marker); -// $ExpectType OverlayGroup, any> -overlayGroup.removeOverlays([marker]); - -// $ExpectType OverlayGroup, any> -overlayGroup.clearOverlays(); - -// $ExpectType OverlayGroup, any> -overlayGroup.eachOverlay(function(overlay, index, overlays) { - // $ExpectType Marker - overlay; - // $ExpectType number - index; - // $ExpectType Marker[] - overlays; - // $ExpectType Marker - this; -}); - -// $ExpectType OverlayGroup, any> -overlayGroup.setMap(null); -// $ExpectType OverlayGroup, any> -overlayGroup.setMap(map); - -// $ExpectType OverlayGroup, any> -overlayGroup2.setOptions({ - test: 1 -}); -// $ExpectType OverlayGroup, any> -overlayGroup.setOptions({ - map, - position: lnglat, - offset: pixel, - icon: 'iconUrl', - content: 'htmlString', - topWhenClick: true, - raiseOnDrag: true, - cursor: 'default', - visible: true, - zIndex: 10, - angle: 10, - autoRotation: true, - animation: 'AMAP_ANIMATION_BOUNCE', - shadow: icon, - title: '123', - clickable: true, - shape: markerShape, - extData: { - test: 123 - } -}); - -// $ExpectType OverlayGroup, any> -overlayGroup.show(); - -// $ExpectType OverlayGroup, any> -overlayGroup.hide(); - -type ClickEvent = AMap.MapsEvent<'click', AMap.Overlay>; -overlayGroup.on('click', (event: ClickEvent) => { - // $ExpectType "click" - event.type; - // $ExpectType Overlay - event.target; -}); diff --git a/types/amap-js-api/test/overlay/polygon.ts b/types/amap-js-api/test/overlay/polygon.ts deleted file mode 100644 index d41a597d45..0000000000 --- a/types/amap-js-api/test/overlay/polygon.ts +++ /dev/null @@ -1,123 +0,0 @@ -import { - map, - lnglat, - lnglatTuple -} from '../preset'; - -interface ExtraData { - test: number; -} - -const path1 = [lnglatTuple, lnglatTuple, lnglatTuple, lnglatTuple, lnglatTuple]; -const path2 = [lnglat, lnglat, lnglat, lnglat, lnglat]; - -// $ExpectType Polygon -new AMap.Polygon(); -// $ExpectType Polygon -new AMap.Polygon({}); -// $ExpectType Polygon -const polygon = new AMap.Polygon({ - map, - zIndex: 10, - bubble: true, - cursor: 'pointer', - strokeColor: '#00FF00', - strokeOpacity: 0.3, - strokeWeight: 5, - fillColor: '#0000FF', - fillOpacity: 0.5, - draggable: true, - extData: { test: 1 }, - strokeStyle: 'dashed', - strokeDasharray: [2, 4], - path: path1 -}); - -// $ExpectType void -polygon.setPath(path1); -// $ExpectType void -polygon.setPath(path2); -// $ExpectType void -polygon.setPath([path1, path2]); - -// $ExpectType LngLat[] | LngLat[][] -polygon.getPath(); - -// $ExpectType void -polygon.setOptions({ - map, - zIndex: 10, - bubble: true, - cursor: 'pointer', - strokeColor: '#00FF00', - strokeOpacity: 0.8, - strokeWeight: 5, - fillColor: '#0000FF', - fillOpacity: 0.5, - draggable: true, - extData: { test: 1 }, - strokeStyle: 'dashed', - strokeDasharray: [4, 2], - path: [path2, path1] -}); - -const options = polygon.getOptions(); -// $ExpectType boolean | undefined -options.bubble; -// $ExpectType boolean | undefined -options.clickable; -// $ExpectType {} | ExtraData | undefined -options.extData; -// $ExpectType string | undefined -options.fillColor; -// $ExpectType number | undefined -options.fillOpacity; -// $ExpectType "miter" | "round" | "bevel" | undefined -options.lineJoin; -// $ExpectType Map | undefined -options.map; -// $ExpectType LngLat[] | LngLat[][] | undefined -options.path; -// $ExpectType string | undefined -options.strokeColor; -// $ExpectType number[] | undefined -options.strokeDasharray; -// $ExpectType number | undefined -options.strokeOpacity; -// $ExpectType "dashed" | "solid" | undefined -options.strokeStyle; -// $ExpectType number | undefined -options.strokeWeight; -// $ExpectType string | undefined -options.texture; -// $ExpectType number | undefined -options.zIndex; - -// $ExpectType Bounds | null -polygon.getBounds(); - -// $ExpectType number -polygon.getArea(); - -// $ExpectType void -polygon.setMap(null); -// $ExpectType void -polygon.setMap(map); - -// $ExpectType void -polygon.setExtData({ test: 1 }); - -// $ExpectType {} | ExtraData -polygon.getExtData(); - -// $ExpectType boolean -polygon.contains(lnglat); -// $ExpectType boolean -polygon.contains(lnglatTuple); - -polygon.on('click', (event: AMap.Polygon.EventMap['click']) => { - // $ExpectType "click" - event.type; - // $ExpectType Polygon - event.target; -}); diff --git a/types/amap-js-api/test/overlay/polyline.ts b/types/amap-js-api/test/overlay/polyline.ts deleted file mode 100644 index fc8d52b058..0000000000 --- a/types/amap-js-api/test/overlay/polyline.ts +++ /dev/null @@ -1,139 +0,0 @@ -import { - map, - lnglat, - lnglatTuple -} from '../preset'; - -interface ExtraData { - test: number; -} - -// $ExpectType Polyline -new AMap.Polyline(); -// $ExpectType Polyline -new AMap.Polyline({}); -// $ExpectType Polyline -const polyline = new AMap.Polyline({ - map, - zIndex: 10, - bubble: true, - cursor: 'default', - geodesic: true, - isOutline: true, - borderWeight: 1, - outlineColor: '#AA0000', - path: [lnglat], - strokeColor: '#0000AA', - strokeOpacity: 0.5, - strokeWeight: 10, - strokeStyle: 'dashed', - strokeDasharray: [20, 10, 20], - lineJoin: 'bevel', - lineCap: 'butt', - draggable: true, - extData: { test: 1 }, - showDir: true -}); -// Polyline - -// $ExpectType void -polyline.setPath([lnglat]); -// $ExpectType void -polyline.setPath([lnglatTuple]); - -// $ExpectType void -polyline.setOptions({}); -// $ExpectType void -polyline.setOptions({ - map, - zIndex: 10, - bubble: true, - cursor: 'default', - geodesic: true, - isOutline: true, - borderWeight: 1, - outlineColor: '#AA0000', - path: [lnglat, lnglat], - strokeColor: '#0000AA', - strokeOpacity: 0.5, - strokeWeight: 10, - strokeStyle: 'dashed', - strokeDasharray: [20, 10, 20], - lineJoin: 'bevel', - lineCap: 'butt', - draggable: true, - extData: { test: 1 }, - showDir: true -}); - -const options = polyline.getOptions(); -// $ExpectType number | undefined -options.borderWeight; -// $ExpectType boolean | undefined -options.bubble; -// $ExpectType boolean | undefined -options.clickable; -// $ExpectType string | undefined -options.dirColor; -// $ExpectType string | undefined -options.dirImg; -// $ExpectType {} | ExtraData | undefined -options.extData; -// $ExpectType boolean | undefined -options.geodesic; -// $ExpectType boolean | undefined -options.isOutline; -// $ExpectType "round" | "butt" | "square" | undefined -options.lineCap; -// $ExpectType "miter" | "round" | "bevel" | undefined -options.lineJoin; -// $ExpectType Map | undefined -options.map; -// $ExpectType string | undefined -options.outlineColor; -// $ExpectType LngLat[] | undefined -options.path; -// $ExpectType boolean | undefined -options.showDir; -// $ExpectType string | undefined -options.strokeColor; -// $ExpectType number[] | undefined -options.strokeDasharray; -// $ExpectType number | undefined -options.strokeOpacity; -// $ExpectType "dashed" | "solid" | undefined -options.strokeStyle; -// $ExpectType number | undefined -options.strokeWeight; -// $ExpectType number | undefined -options.zIndex; - -// $ExpectType number -polyline.getLength(); - -// $ExpectType Bounds | null -polyline.getBounds(); - -// $ExpectType void -polyline.hide(); - -// $ExpectType void -polyline.show(); - -// $ExpectType void -polyline.setMap(null); -// $ExpectType void -polyline.setMap(map); - -// $ExpectType void -polyline.setExtData({test: 1}); - -// $ExpectType {} | ExtraData -polyline.getExtData(); - -polyline.on('click', (event: AMap.Polyline.EventMap['click']) => { - // $ExpectType "click" - event.type; - // $ExpectType Polyline - event.target; -}); diff --git a/types/amap-js-api/test/overlay/rectangle.ts b/types/amap-js-api/test/overlay/rectangle.ts deleted file mode 100644 index d2cafa8f09..0000000000 --- a/types/amap-js-api/test/overlay/rectangle.ts +++ /dev/null @@ -1,121 +0,0 @@ -import { - map, - lnglat, - bounds, - lnglatTuple -} from '../preset'; - -interface ExtraData { - test: number; -} - -// $ExpectType Rectangle -new AMap.Rectangle(); -// $ExpectType Rectangle -new AMap.Rectangle({}); -// $ExpectType Rectangle -const rectangle = new AMap.Rectangle({ - map, - zIndex: 10, - bounds, - bubble: false, - cursor: 'pointer', - strokeColor: '#00FF00', - strokeOpacity: 0.8, - strokeWeight: 2, - fillColor: '#0000FF', - fillOpacity: 0.5, - strokeStyle: 'solid', - extData: { test: 1 }, - strokeDasharray: [1, 5] -}); - -// $ExpectType Bounds | undefined -rectangle.getBounds(); - -// $ExpectType void -rectangle.setBounds(bounds); - -// $ExpectType void -rectangle.setOptions({}); -// $ExpectType void -rectangle.setOptions({ - map, - zIndex: 10, - bounds, - bubble: false, - cursor: 'pointer', - strokeColor: '#00FF00', - strokeOpacity: 0.8, - strokeWeight: 2, - fillColor: '#0000FF', - fillOpacity: 0.5, - strokeStyle: 'solid', - extData: { test: 1 }, - strokeDasharray: [1, 5] -}); - -const options = rectangle.getOptions(); -// $ExpectType Bounds | undefined -options.bounds; -// $ExpectType boolean | undefined -options.bubble; -// $ExpectType boolean | undefined -options.clickable; -// $ExpectType {} | ExtraData | undefined -options.extData; -// $ExpectType string | undefined -options.fillColor; -// $ExpectType number | undefined -options.fillOpacity; -// $ExpectType "miter" | "round" | "bevel" | undefined -options.lineJoin; -// $ExpectType Map | undefined -options.map; -// $ExpectType LngLat[] | undefined -options.path; -// $ExpectType string | undefined -options.strokeColor; -// $ExpectType number[] | undefined -options.strokeDasharray; -// $ExpectType number | undefined -options.strokeOpacity; -// $ExpectType "dashed" | "solid" | undefined -options.strokeStyle; -// $ExpectType number | undefined -options.strokeWeight; -// $ExpectType string | undefined -options.texture; -// $ExpectType number | undefined -options.zIndex; - -// $ExpectType void -rectangle.hide(); - -// $ExpectType void -rectangle.show(); - -// $ExpectType void -rectangle.setExtData({test: 2}); - -// $ExpectType {} | ExtraData -rectangle.getExtData(); - -// $ExpectType boolean -rectangle.contains(lnglat); -// $ExpectType boolean -rectangle.contains(lnglatTuple); - -rectangle.on('click', (event: AMap.Rectangle.EventMap['click']) => { - // $ExpectType "click" - event.type; - // $ExpectType Rectangle - event.target; -}); - -rectangle.on('setBounds', (event: AMap.Rectangle.EventMap['setBounds']) => { - // $ExpectType "setBounds" - event.type; - // $ExpectError - event.target; -}); diff --git a/types/amap-js-api/test/overlay/text.ts b/types/amap-js-api/test/overlay/text.ts deleted file mode 100644 index c4d678493c..0000000000 --- a/types/amap-js-api/test/overlay/text.ts +++ /dev/null @@ -1,169 +0,0 @@ -import { - map, - marker, - lnglat, - pixel, - lnglatTuple, - icon -} from '../preset'; - -interface ExtraData { - test: number; -} - -// $ExpectType Text -new AMap.Text(); -// $ExpectType Text -new AMap.Text({}); -// $ExpectType Text -const text = new AMap.Text({ - text: 'content', - textAlign: 'center', - verticalAlign: 'top', - map, - position: lnglat, - offset: pixel, - topWhenClick: true, - bubble: true, - draggable: true, - raiseOnDrag: true, - cursor: 'default', - visible: true, - zIndex: 100, - angle: 45, - autoRotation: true, - animation: 'AMAP_ANIMATION_BOUNCE', - shadow: 'https://webapi.amap.com/theme/v1.3/markers/0.png', - title: 'title', - clickable: true, - extData: { test: 1 } -}); - -// $ExpectType string -text.getText(); - -// $ExpectType void -text.setText('123'); - -// $ExpectType void -text.setStyle({ - background: 'red', - width: '200px' -}); - -// $ExpectType void -text.markOnAMAP({ - name: '123', - position: lnglatTuple -}); - -// $ExpectType Pixel -text.getOffset(); - -// $ExpectType void -text.setOffset(pixel); - -// $ExpectType void -text.setAnimation('AMAP_ANIMATION_BOUNCE'); - -// $ExpectType AnimationName -text.getAnimation(); - -// $ExpectType void -text.setClickable(true); - -// $ExpectType boolean -text.getClickable(); - -// $ExpectType LngLat | undefined -text.getPosition(); - -// $ExpectType void -text.setAngle(10); - -// $ExpectType number -text.getAngle(); - -// $ExpectType void -text.setzIndex(1); - -// $ExpectType number -text.getzIndex(); - -// $ExpectType void -text.setDraggable(true); - -// $ExpectType boolean -text.getDraggable(); - -// $ExpectType void -text.hide(); - -// $ExpectType void -text.show(); - -// $ExpectType void -text.setCursor('default'); - -// $ExpectType void -text.moveAlong([lnglat], 100); - -// $ExpectType void -text.moveAlong([lnglat], 100); -// $ExpectError -text.moveAlong([[1, 2]], 100); -// $ExpectType void -text.moveAlong([lnglat], 100, t => t, false); - -// $ExpectType void -text.moveTo(lnglat, 100); -// $ExpectType void -text.moveTo([1, 2], 100); -// $ExpectType void -text.moveTo([1, 2], 100, t => t); - -// $ExpectType void -text.stopMove(); - -// $ExpectType boolean -text.pauseMove(); - -// $ExpectType boolean -text.resumeMove(); - -// $ExpectType void -text.setMap(map); - -// $ExpectType void -text.setTitle('title'); -// $ExpectError -text.setTitle(); - -// $ExpectType string | undefined -text.getTitle(); - -// $ExpectType void -text.setTop(true); - -// $ExpectType boolean -text.getTop(); - -// $ExpectType void -text.setShadow(); -// $ExpectType void -text.setShadow(icon); -// $ExpectType void -text.setShadow('shadow url'); - -// $ExpectType void -text.setExtData({test: 1}); - -// $ExpectType {} | ExtraData -text.getExtData(); - -text.on('click', (event: AMap.Text.EventMap['click']) => { - // $ExpectType "click" - event.type; - // $ExpectType Text - event.target; -}); diff --git a/types/amap-js-api/test/pixel.ts b/types/amap-js-api/test/pixel.ts deleted file mode 100644 index bcb96e4b77..0000000000 --- a/types/amap-js-api/test/pixel.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { - pixel -} from './preset'; - -// $ExpectType Pixel -new AMap.Pixel(10, 20); -// $ExpectType Pixel -new AMap.Pixel(10, 20); - -// $ExpectType number -pixel.getX(); - -// $ExpectType number -pixel.getY(); - -// $ExpectType boolean -pixel.equals(pixel); - -// $ExpectType string -pixel.toString(); - -// $ExpectType Pixel -pixel.add({ x: 1, y: 2 }); -// $ExpectType Pixel -pixel.add({ x: 1, y: 2 }, false); - -// $ExpectType Pixel -pixel.round(); - -// $ExpectType Pixel -pixel.floor(); - -// $ExpectType number -pixel.length(); - -// $ExpectType number | null -pixel.direction(); - -// $ExpectType Pixel -pixel.toFixed(); -// $ExpectType Pixel -pixel.toFixed(2); diff --git a/types/amap-js-api/test/preset.ts b/types/amap-js-api/test/preset.ts deleted file mode 100644 index 2c7bb37d59..0000000000 --- a/types/amap-js-api/test/preset.ts +++ /dev/null @@ -1,29 +0,0 @@ -declare const map: AMap.Map; -declare const lnglat: AMap.LngLat; -declare const size: AMap.Size; -declare const lnglatTuple: [number, number]; -declare const pixel: AMap.Pixel; -declare const marker: AMap.Marker; -declare const circle: AMap.Circle; -declare const markerShape: AMap.MarkerShape; -declare const icon: AMap.Icon; -declare const bounds: AMap.Bounds; -declare const div: HTMLDivElement; -declare const polygon: AMap.Polygon; -declare const lang: AMap.Lang; - -export { - map, - lnglat, - size, - lnglatTuple, - pixel, - marker, - circle, - markerShape, - icon, - bounds, - div, - polygon, - lang -}; diff --git a/types/amap-js-api/test/size.ts b/types/amap-js-api/test/size.ts deleted file mode 100644 index bdd700f532..0000000000 --- a/types/amap-js-api/test/size.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { size } from './preset'; - -// $ExpectType Size -new AMap.Size(10, 20); - -// $ExpectType number -size.getHeight(); - -// $ExpectType number -size.getWidth(); - -// $ExpectType string -size.toString(); - -// $ExpectType boolean -size.contains({ x: 10, y: 10 }); diff --git a/types/amap-js-api/test/util.ts b/types/amap-js-api/test/util.ts deleted file mode 100644 index c238070e21..0000000000 --- a/types/amap-js-api/test/util.ts +++ /dev/null @@ -1,79 +0,0 @@ -import * as preset from './preset'; - -const util = AMap.Util; - -// $ExpectType string -util.colorNameToHex('colorName'); - -// $ExpectType string -util.rgbHex2Rgba('rgbHex'); - -// $ExpectType string -util.argbHex2Rgba('argbHex'); - -// $ExpectType boolean -util.isEmpty({}); -// $ExpectError -util.isEmpty(1); - -// $ExpectType number[] -util.deleteItemFromArray([1], 1); - -// $ExpectType number[] -util.deleteItemFromArrayByIndex([1], 1); - -// $ExpectType number -util.indexOf([1], 1); -// $ExpectError -util.indexOf([1], '1'); - -// $ExpectType number -util.format(1); -// $ExpectType number -util.format(1, 1); - -declare const value1: number | number[]; -// $ExpectType boolean -util.isArray(value1); -if (util.isArray(value1)) { - // $ExpectType number[] - value1; -} else { - // $ExpectType number - value1; -} - -declare const value2: number | HTMLElement; -// $ExpectType boolean -util.isDOM(value2); -if (util.isDOM(value2)) { - // $ExpectType HTMLElement - value2; -} else { - // $ExpectType number - value2; -} - -// $ExpectType boolean -util.includes([1], 1); -// $ExpectError -util.includes([1], '1'); - -// $ExpectType number -util.requestIdleCallback(() => { }); -// $ExpectType number -const idleCallbackHandle = util.requestIdleCallback(() => { }, { timeout: 1 }); - -// $ExpectType void -util.cancelIdleCallback(idleCallbackHandle); - -// $ExpectType number -util.requestAnimFrame(() => { }); -// $ExpectType number -const animFrameHandle = util.requestAnimFrame(function () { - // $ExpectType number - this.test; -}, { test: 1 }); - -// $ExpectType void -util.cancelAnimFrame(animFrameHandle); diff --git a/types/amap-js-api/test/view2d.ts b/types/amap-js-api/test/view2d.ts deleted file mode 100644 index 2560922a5a..0000000000 --- a/types/amap-js-api/test/view2d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { lnglat } from './preset'; - -// $ExpectType View2D -new AMap.View2D(); -// $ExpectType View2D -new AMap.View2D({}); - -// $ExpectType View2D -new AMap.View2D({ - center: [1, 2], - rotation: 1, - zoom: 10, - crs: 'EPGS3395' -}); - -// $ExpectType View2D -const view2d = new AMap.View2D({ - center: lnglat -}); - -// $ExpectType View2D -view2d.on('complete', () => { }); diff --git a/types/amap-js-api/tsconfig.json b/types/amap-js-api/tsconfig.json index e63a35d326..a26facba9e 100644 --- a/types/amap-js-api/tsconfig.json +++ b/types/amap-js-api/tsconfig.json @@ -58,48 +58,9 @@ "overlay/text.d.ts", "pixel.d.ts", "size.d.ts", - "test/arryBounds.ts", - "test/bounds.ts", - "test/browser.ts", - "test/convert-from.ts", - "test/dom-util.ts", - "test/event.ts", - "test/geometry-util.ts", - "test/layer/buildings.ts", - "test/layer/canvasLayer.ts", - "test/layer/flexible.ts", - "test/layer/imageLayer.ts", - "test/layer/layer.ts", - "test/layer/layerGroup.ts", - "test/layer/massMarks.ts", - "test/layer/tileLayer.ts", - "test/layer/videoLayer.ts", - "test/layer/wms.ts", - "test/layer/wmts.ts", - "test/lnglat.ts", - "test/map.ts", - "test/overlay/bezierCurve.ts", - "test/overlay/circle.ts", - "test/overlay/contextMenu.ts", - "test/overlay/ellipse.ts", - "test/overlay/geoJSON.ts", - "test/overlay/icon.ts", - "test/overlay/infoWindow.ts", - "test/overlay/marker.ts", - "test/overlay/markerShape.ts", - "test/overlay/overlay.ts", - "test/overlay/overlayGroup.ts", - "test/overlay/polygon.ts", - "test/overlay/polyline.ts", - "test/overlay/rectangle.ts", - "test/overlay/text.ts", - "test/pixel.ts", - "test/preset.ts", - "test/size.ts", - "test/util.ts", - "test/view2d.ts", "type-util.d.ts", "util.d.ts", - "view2D.d.ts" + "view2D.d.ts", + "amap-js-api-tests.ts" ] } diff --git a/types/amap-js-api/tslint.json b/types/amap-js-api/tslint.json index ab1e56673f..f93cf8562a 100644 --- a/types/amap-js-api/tslint.json +++ b/types/amap-js-api/tslint.json @@ -1,10 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "only-arrow-functions": false, - "space-before-function-paren": false, - "no-var-keyword": false, - "no-unnecessary-class": false, - "file-name-casing": false - } + "extends": "dtslint/dt.json" } From c9c0a8d4055892ad1d328d6fc17d554bfd62d215 Mon Sep 17 00:00:00 2001 From: Wpapsco Date: Wed, 6 Mar 2019 22:35:25 -0800 Subject: [PATCH 452/924] Updated for 1.4 --- types/tmi.js/index.d.ts | 81 ++++++++++++++++++++++++++++++------ types/tmi.js/tmi.js-tests.ts | 4 +- 2 files changed, 71 insertions(+), 14 deletions(-) diff --git a/types/tmi.js/index.d.ts b/types/tmi.js/index.d.ts index 86076ce202..cfbd9500ca 100644 --- a/types/tmi.js/index.d.ts +++ b/types/tmi.js/index.d.ts @@ -1,11 +1,11 @@ -// Type definitions for tmi.js 1.3 +// Type definitions for tmi.js 1.4 // Project: https://github.com/tmijs/tmi.js // Definitions by: William Papsco // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 3.3 // Twitch IRC docs: https://dev.twitch.tv/docs/irc/ -// Last updated: 2019/2/27 +// Last updated: 2019/3/06 import { StrictEventEmitter } from "./strict-event-emitter-types"; @@ -16,6 +16,7 @@ export interface Actions { color(color: string): Promise<[string]>; commercial(channel: string, seconds: number): Promise<[string, number]>; connect(): Promise<[string, number]>; + deletemessage(channel: string, messageUUID: string): Promise<[string]>; disconnect(): Promise<[string, number]>; emoteonly(channel: string): Promise<[string]>; emoteonlyoff(channel: string): Promise<[string]>; @@ -39,11 +40,15 @@ export interface Actions { unban(channel: string, username: string): Promise<[string, string]>; unhost(channel: string): Promise<[string]>; unmod(channel: string, username: string): Promise<[string, string]>; + unvip(channel: string, username: string): Promise<[string, string]>; + vip(channel: string, username: string): Promise<[string, string]>; + vips(channel: string): Promise; whisper(username: string, message: string): Promise<[string, string]>; } export interface Events { action(channel: string, userstate: ChatUserstate, message: string, self: boolean): void; + anongiftpaidupgrade(channel: string, username: string, userstate: AnonSubGiftUpgradeUserstate): void; ban(channel: string, username: string, reason: string): void; chat(channel: string, userstate: ChatUserstate, message: string, self: boolean): void; cheer(channel: string, userstate: ChatUserstate, message: string): void; @@ -54,11 +59,13 @@ export interface Events { emoteonly(channel: string, enabled: boolean): void; emotesets(sets: string, obj: EmoteObj): void; followersonly(channel: string, enabled: boolean, length: number): void; + giftpaidupgrade(channel: string, username: string, sender: string, userstate: SubGiftUpgradeUserstate): void; hosted(channel: string, username: string, viewers: number, autohost: boolean): void; hosting(channel: string, target: string, viewers: number): void; join(channel: string, username: string, self: boolean): void; logon(): void; message(channel: string, userstate: ChatUserstate, message: string, self: boolean): void; + messagedeleted(channel: string, username: string, deletedMessage: string, userstate: DeleteUserstate): void; mod(channel: string, username: string): void; mods(channel: string, mods: string[]): void; notice(channel: string, msgid: MsgID, message: string): void; @@ -66,16 +73,21 @@ export interface Events { ping(): void; pong(latency: number): void; r9kbeta(channel: string, enabled: boolean): void; + raided(channel: string, username: string, viewers: number): void; + "raw_message": (messageCloned: { [property: string]: any }, message: { [property: string]: any }) => void; reconnect(): void; - resub(channel: string, username: string, months: number, message: string, userstate: SubUserstate, methods: ResubMethod): void; + resub(channel: string, username: string, months: number, message: string, userstate: SubUserstate, methods: SubMethods): void; roomstate(channel: string, state: RoomState): void; serverchange(channel: string): void; slowmode(channel: string, enabled: boolean, length: number): void; + subgift(channel: string, username: string, streakMonths: number, recipient: string, methods: SubMethods, userstate: SubGiftUserstate): void; + submysterygift(channel: string, username: string, numbOfSubs: number, methods: SubMethods, userstate: SubMysteryGiftUserstate): void; subscribers(channel: string, enabled: boolean): void; - subscription(channel: string, username: string, method: ResubMethod, message: string, userstate: SubUserstate): void; + subscription(channel: string, username: string, methods: SubMethods, message: string, userstate: SubUserstate): void; timeout(channel: string, username: string, reason: string, duration: number): void; unhost(channel: string, viewers: number): void; unmod(channel: string, username: string): void; + vips(channel: string, vips: string[]): void; whisper(from: string, userstate: ChatUserstate, message: string, self: boolean): void; } @@ -108,6 +120,18 @@ export interface Badges { premium?: string; } +export interface SubMethods { + prime?: boolean; + plan?: SubMethod; + planName?: string; +} + +export interface DeleteUserstate { + login?: string; + message?: string; + "target-msg-id"?: string; +} + export interface CommonUserstate { badges?: Badges; color?: string; @@ -130,13 +154,21 @@ export interface UserNoticeState extends CommonUserstate { login?: string; message?: string; "system-msg"?: string; + [paramater: string]: any; } export interface CommonSubUserstate extends UserNoticeState { - "msg-param-sub-plan"?: ResubMethod; + "msg-param-sub-plan"?: SubMethod; "msg-param-sub-plan-name"?: string; } +export interface CommonGiftSubUserstate extends CommonSubUserstate { + "msg-param-recipient-display-name"?: string; + "msg-param-recipient-id"?: string; + "msg-param-recipient-user-name"?: string; + "msg-param-months"?: boolean | string; +} + export interface ChatUserstate extends CommonUserstate { 'message-type'?: "chat" | "action" | "whisper"; username?: string; @@ -150,11 +182,28 @@ export interface SubUserstate extends CommonSubUserstate { "msg-param-streak-months"?: string | boolean; } -export interface SubGiftUserstate extends CommonSubUserstate { - 'message-type'?: "subgift" | "anonsubgift"; - "msg-param-recipient-display-name"?: string; - "msg-param-recipient-id"?: string; - "msg-param-recipient-user-name"?: string; +export interface SubMysteryGiftUserstate extends CommonSubUserstate { + 'message-type'?: "submysterygift"; + "msg-param-sender-count"?: string | boolean; +} + +export interface SubGiftUserstate extends CommonGiftSubUserstate { + 'message-type'?: "subgift"; + "msg-param-sender-count"?: string | boolean; +} + +export interface AnonSubGiftUserstate extends CommonGiftSubUserstate { + "message-type"?: "anonsubgift"; +} + +export interface SubGiftUpgradeUserstate extends CommonSubUserstate { + "message-type"?: "giftpaidupgrade"; + "msg-param-sender-name"?: string; + "msg-param-sender-login"?: string; +} + +export interface AnonSubGiftUpgradeUserstate extends CommonSubUserstate { + "message-type"?: "anongiftpaidupgrade"; } export interface RaidUserstate extends UserNoticeState { @@ -169,7 +218,15 @@ export interface RitualUserstate extends UserNoticeState { "msg-param-ritual-name"?: "new_chatter"; } -export type Userstate = ChatUserstate | SubGiftUserstate | SubUserstate | RaidUserstate | RitualUserstate; +export type Userstate = ChatUserstate | + SubUserstate | + SubGiftUserstate | + SubGiftUpgradeUserstate | + AnonSubGiftUserstate | + SubMysteryGiftUserstate | + AnonSubGiftUpgradeUserstate | + RaidUserstate | + RitualUserstate; export interface EmoteObj { [id: string]: [{ @@ -251,7 +308,7 @@ export type MsgID = "already_banned" | "whisper_limit_per_sec" | "whisper_restricted_recipient"; -export type ResubMethod = "Prime" | "1000" | "2000" | "3000"; +export type SubMethod = "Prime" | "1000" | "2000" | "3000"; export interface RoomState { "broadcaster-lang"?: string; diff --git a/types/tmi.js/tmi.js-tests.ts b/types/tmi.js/tmi.js-tests.ts index 6cd2c62629..28a380088b 100644 --- a/types/tmi.js/tmi.js-tests.ts +++ b/types/tmi.js/tmi.js-tests.ts @@ -30,7 +30,7 @@ const options: tmi.Options = { const client: tmi.Client = tmi.Client(options); client.connect().then(() => { - client.on("subscription", (channel: string, username: string, method: tmi.ResubMethod, msg: string, userstate: tmi.SubUserstate) => { + client.on("subscription", (channel: string, username: string, methods: tmi.SubMethods, msg: string, userstate: tmi.SubUserstate) => { client.say(channel, `Thank you to ${userstate["display-name"]} for subscribing!`); client.ping(); client.r9kbeta(channel); @@ -56,7 +56,7 @@ client.connect().then(() => { client.unmod(channel, username); client.whisper(username, "whisper"); client.part(channel); - switch (method) { + switch (methods.plan) { case "1000": case "2000": case "3000": From ccaaedb36c7db966284ebdefe20e4a7556dcc5dd Mon Sep 17 00:00:00 2001 From: Wpapsco Date: Wed, 6 Mar 2019 22:43:37 -0800 Subject: [PATCH 453/924] Moved index signature up the hierarchy of userstates --- types/tmi.js/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/tmi.js/index.d.ts b/types/tmi.js/index.d.ts index cfbd9500ca..0363842148 100644 --- a/types/tmi.js/index.d.ts +++ b/types/tmi.js/index.d.ts @@ -148,13 +148,13 @@ export interface CommonUserstate { "user-id"?: string; "tmi-sent-ts"?: string; flags?: string; + [paramater: string]: any; } export interface UserNoticeState extends CommonUserstate { login?: string; message?: string; "system-msg"?: string; - [paramater: string]: any; } export interface CommonSubUserstate extends UserNoticeState { From bc341d3bc709dd8e3288c46cb9811f235ff22546 Mon Sep 17 00:00:00 2001 From: breeze9527 Date: Thu, 7 Mar 2019 14:52:59 +0800 Subject: [PATCH 454/924] [amap-js-api] fix lint error --- types/amap-js-api/amap-js-api-tests.ts | 40 +++++++++++++------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/types/amap-js-api/amap-js-api-tests.ts b/types/amap-js-api/amap-js-api-tests.ts index 41b0638526..ee7a2ac583 100644 --- a/types/amap-js-api/amap-js-api-tests.ts +++ b/types/amap-js-api/amap-js-api-tests.ts @@ -2303,7 +2303,7 @@ const testGeoJSON = new AMap.GeoJSON({ obj; // $ExpectType LngLat lnglat; - return testMarker; + return marker; }, getPolyline(obj, lnglats) { // $ExpectType GeoJSONObject @@ -2330,19 +2330,19 @@ const testGeoJSON = new AMap.GeoJSON({ testGeoJSON.importData(geoJSONObject); // $ExpectType GeoJSON -testGeoJSON.removeOverlay(testMarker); +testGeoJSON.removeOverlay(marker); // $ExpectType GeoJSON -testGeoJSON.removeOverlay([testMarker]); +testGeoJSON.removeOverlay([marker]); // $ExpectType boolean -testGeoJSON.hasOverlay(testMarker); +testGeoJSON.hasOverlay(marker); // $ExpectType boolean -testGeoJSON.hasOverlay(m => m === testMarker); +testGeoJSON.hasOverlay(m => m === marker); // $ExpectType GeoJSON -testGeoJSON.addOverlay(testMarker); +testGeoJSON.addOverlay(marker); // $ExpectType GeoJSON -testGeoJSON.addOverlay([testMarker]); +testGeoJSON.addOverlay([marker]); // $ExpectType GeoJSONObject[] testGeoJSON.toGeoJSON(); @@ -2488,7 +2488,7 @@ new AMap.Marker(); // $ExpectType Marker new AMap.Marker({}); // $ExpectType Marker -const testMarker = new AMap.Marker({ +export const testMarker = new AMap.Marker({ map, position: lnglat, offset: pixel, @@ -2730,39 +2730,39 @@ testOverlay.getExtData(); // $ExpectType OverlayGroup, any> const testOverlayGroup2 = new AMap.OverlayGroup(); // $ExpectType OverlayGroup, any> -new AMap.OverlayGroup(testMarker); +new AMap.OverlayGroup(marker); // $ExpectType OverlayGroup, any> -const testOverlayGroup = new AMap.OverlayGroup([testMarker]); +const testOverlayGroup = new AMap.OverlayGroup([marker]); // $ExpectType OverlayGroup, any> -testOverlayGroup.addOverlay(testMarker); +testOverlayGroup.addOverlay(marker); // $ExpectType OverlayGroup, any> -testOverlayGroup.addOverlay([testMarker]); +testOverlayGroup.addOverlay([marker]); // $ExpectError testOverlayGroup.addOverlay([testCircle]); // $ExpectType OverlayGroup, any> -testOverlayGroup.addOverlays(testMarker); +testOverlayGroup.addOverlays(marker); // $ExpectType OverlayGroup, any> -testOverlayGroup.addOverlays([testMarker]); +testOverlayGroup.addOverlays([marker]); // $ExpectType Marker[] testOverlayGroup.getOverlays(); // $ExpectType boolean -testOverlayGroup.hasOverlay(testMarker); +testOverlayGroup.hasOverlay(marker); // $ExpectType boolean -testOverlayGroup.hasOverlay(o => o === testMarker); +testOverlayGroup.hasOverlay(o => o === marker); // $ExpectType OverlayGroup, any> -testOverlayGroup.removeOverlay(testMarker); +testOverlayGroup.removeOverlay(marker); // $ExpectType OverlayGroup, any> -testOverlayGroup.removeOverlay([testMarker]); +testOverlayGroup.removeOverlay([marker]); // $ExpectType OverlayGroup, any> -testOverlayGroup.removeOverlays(testMarker); +testOverlayGroup.removeOverlays(marker); // $ExpectType OverlayGroup, any> -testOverlayGroup.removeOverlays([testMarker]); +testOverlayGroup.removeOverlays([marker]); // $ExpectType OverlayGroup, any> testOverlayGroup.clearOverlays(); From 96f6a298d7eae6d41eab0049e64106da28834712 Mon Sep 17 00:00:00 2001 From: qiang Date: Thu, 7 Mar 2019 16:09:42 +0800 Subject: [PATCH 455/924] Added new types for uni-app --- types/uni-app/index.d.ts | 12 + types/uni-app/lib/app.d.ts | 234 ++ types/uni-app/lib/common.d.ts | 5 + types/uni-app/lib/page.d.ts | 152 + types/uni-app/lib/uni.d.ts | 6225 ++++++++++++++++++++++++++++++++ types/uni-app/lib/vue.d.ts | 15 + types/uni-app/package.json | 6 + types/uni-app/tsconfig.json | 29 + types/uni-app/tslint.json | 8 + types/uni-app/uni-app-tests.ts | 21 + 10 files changed, 6707 insertions(+) create mode 100644 types/uni-app/index.d.ts create mode 100644 types/uni-app/lib/app.d.ts create mode 100644 types/uni-app/lib/common.d.ts create mode 100644 types/uni-app/lib/page.d.ts create mode 100644 types/uni-app/lib/uni.d.ts create mode 100644 types/uni-app/lib/vue.d.ts create mode 100644 types/uni-app/package.json create mode 100644 types/uni-app/tsconfig.json create mode 100644 types/uni-app/tslint.json create mode 100644 types/uni-app/uni-app-tests.ts diff --git a/types/uni-app/index.d.ts b/types/uni-app/index.d.ts new file mode 100644 index 0000000000..207a3447e4 --- /dev/null +++ b/types/uni-app/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for non-npm package uni-app 1.0 +// Project: https://github.com/dcloudio/uni-app +// Definitions by: DCloud +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// TypeScript Version: 2.3 + +import "./lib/app"; +import "./lib/common"; +import "./lib/page"; +import "./lib/uni"; +import "./lib/vue"; diff --git a/types/uni-app/lib/app.d.ts b/types/uni-app/lib/app.d.ts new file mode 100644 index 0000000000..af29f99b17 --- /dev/null +++ b/types/uni-app/lib/app.d.ts @@ -0,0 +1,234 @@ +declare namespace App { + interface LaunchOptions { + query: number; + } + + interface ReferrerInfo { + /** + * 杄æșć°çš‹ćșæˆ–ć…ŹäŒ—ć·æˆ–App的 appId + * + * 仄䞋ćœșæ™Żæ”ŻæŒèż”ć›ž referrerInfo.appId + * - 1020ïŒˆć…ŹäŒ—ć· profile éĄ”ç›žć…łć°çš‹ćșćˆ—èĄšïŒ‰ïŒš appId + * - 1035ïŒˆć…ŹäŒ—ć·è‡Ș漚äč‰èœć•杄æșć…ŹäŒ—ć· appId + * - 1036App 戆äș«æ¶ˆæŻćĄç‰‡ïŒ‰ïŒšæ„æșćș”甚 appId + * - 1037ïŒˆć°çš‹ćșæ‰“ćŒ€ć°çš‹ćșïŒ‰ïŒšæ„æșć°çš‹ćș appId + * - 1038ïŒˆä»ŽćŠäž€äžȘ氏繋ćșèż”ć›žïŒ‰ïŒšæ„æșć°çš‹ćș appId + * - 1043ïŒˆć…ŹäŒ—ć·æšĄæżæ¶ˆæŻïŒ‰ïŒšæ„æșć…ŹäŒ—ć· appId + */ + appId: string; + /** 杄æșć°çš‹ćșäŒ èż‡æ„çš„æ•°æźïŒŒscene=1037或1038æ—¶æ”ŻæŒ */ + extraData?: any; + } + + type SceneValues = 1001 + | 1005 + | 1006 + | 1007 + | 1008 + | 1011 + | 1012 + | 1013 + | 1014 + | 1017 + | 1019 + | 1020 + | 1022 + | 1023 + | 1024 + | 1025 + | 1026 + | 1027 + | 1028 + | 1029 + | 1030 + | 1031 + | 1032 + | 1034 + | 1035 + | 1036 + | 1037 + | 1038 + | 1039 + | 1042 + | 1043 + | 1044 + | 1045 + | 1046 + | 1047 + | 1048 + | 1049 + | 1052 + | 1053 + | 1054 + | 1056 + | 1057 + | 1058 + | 1059 + | 1064 + | 1067 + | 1068 + | 1069 + | 1071 + | 1072 + | 1073 + | 1074 + | 1077 + | 1078 + | 1079 + | 1081 + | 1082 + | 1084 + | 1089 + | 1090 + | 1091 + | 1092 + | 1095 + | 1096 + | 1097 + | 1099 + | 1102 + | 1103 + | 1104 + | number; + + interface LaunchShowOption { + /** æ‰“ćŒ€ć°çš‹ćșçš„è·ŻćŸ„ */ + path: string; + /** æ‰“ćŒ€ć°çš‹ćșçš„query */ + query: AnyObject; + /** + * æ‰“ćŒ€ć°çš‹ćșçš„ćœșæ™Żć€Œ + * - 1001: ć‘çŽ°æ ć°çš‹ćșäž»ć…„ćŁïŒŒă€Œæœ€èż‘äœżç”šă€ćˆ—èĄšïŒˆćŸș础ćș“2.2.4ç‰ˆæœŹè”·ćŒ…ć«ă€Œæˆ‘çš„ć°çš‹ćșă€ćˆ—èĄšïŒ‰ + * - 1005: éĄ¶éƒšæœçŽąæĄ†çš„æœçŽąç»“æžœéĄ” + * - 1006: ć‘çŽ°æ ć°çš‹ćșäž»ć…„ćŁæœçŽąæĄ†çš„æœçŽąç»“æžœéĄ” + * - 1007: 捕äșșèŠć€©äŒšèŻäž­çš„ć°çš‹ćșæ¶ˆæŻćĄç‰‡ + * - 1008: çŸ€èŠäŒšèŻäž­çš„ć°çš‹ćșæ¶ˆæŻćĄç‰‡ + * - 1011: 扫描äșŒç»Žç  + * - 1012: é•żæŒ‰ć›Ÿç‰‡èŻ†ćˆ«äșŒç»Žç  + * - 1013: 手æœș盾憌选揖äșŒç»Žç  + * - 1014: 氏繋ćșæšĄæżæ¶ˆæŻ + * - 1017: ć‰ćŸ€äœ“éȘŒç‰ˆçš„ć…„ćŁéĄ” + * - 1019: ćŸźäżĄé’±ćŒ… + * - 1020: ć…ŹäŒ—ć· profile éĄ”ç›žć…łć°çš‹ćșćˆ—èĄš + * - 1022: èŠć€©éĄ¶éƒšçœźéĄ¶ć°çš‹ćșć…„揣 + * - 1023: ćź‰ć“çł»ç»ŸæĄŒéąć›Ÿæ ‡ + * - 1024: 氏繋ćș profile 饔 + * - 1025: 扫描䞀绎码 + * - 1026: é™„èż‘ć°çš‹ćșćˆ—èĄš + * - 1027: éĄ¶éƒšæœçŽąæĄ†æœçŽąç»“æžœéĄ”ă€Œäœżç”šèż‡çš„ć°çš‹ćșă€ćˆ—èĄš + * - 1028: æˆ‘çš„ćĄćŒ… + * - 1029: ćĄćˆžèŻŠæƒ…éĄ” + * - 1030: è‡ȘćŠšćŒ–æ”‹èŻ•äž‹æ‰“ćŒ€ć°çš‹ćș + * - 1031: é•żæŒ‰ć›Ÿç‰‡èŻ†ćˆ«äž€ç»Žç  + * - 1032: 手æœșç›žć†Œé€‰ć–äž€ç»Žç  + * - 1034: ćŸźäżĄæ”Żä»˜ćźŒæˆéĄ” + * - 1035: ć…ŹäŒ—ć·è‡Ș漚äč‰èœć• + * - 1036: App 戆äș«æ¶ˆæŻćĄç‰‡ + * - 1037: 氏繋ćșæ‰“ćŒ€ć°çš‹ćș + * - 1038: ä»ŽćŠäž€äžȘ氏繋ćșèż”曞 + * - 1039: 摇甔视 + * - 1042: æ·»ćŠ ć„œć‹æœçŽąæĄ†çš„æœçŽąç»“æžœéĄ” + * - 1043: ć…ŹäŒ—ć·æšĄæżæ¶ˆæŻ + * - 1044: 枊 shareTicket 的氏繋ćșæ¶ˆæŻćĄç‰‡ [èŻŠæƒ…]((èœŹć‘#èŽ·ć–æ›Žć€šèœŹć‘äżĄæŻ)) + * - 1045: æœ‹ć‹ćœˆćčżć‘Š + * - 1046: æœ‹ć‹ćœˆćčżć‘ŠèŻŠæƒ…éĄ” + * - 1047: æ‰«æć°çš‹ćșç  + * - 1048: é•żæŒ‰ć›Ÿç‰‡èŻ†ćˆ«ć°çš‹ćșç  + * - 1049: 手æœș盾憌选揖氏繋ćșç  + * - 1052: 捡戾的适甹闹ćș—ćˆ—èĄš + * - 1053: æœäž€æœçš„ç»“æžœéĄ” + * - 1054: éĄ¶éƒšæœçŽąæĄ†ć°çš‹ćșćż«æ·ć…„揣 + * - 1056: 音ä萿’­æ”Ÿć™šèœć• + * - 1057: é’±ćŒ…äž­çš„é“¶èĄŒćĄèŻŠæƒ…éĄ” + * - 1058: ć…ŹäŒ—ć·æ–‡ç«  + * - 1059: 䜓éȘŒç‰ˆć°çš‹ćșç»‘ćźšé‚€èŻ·éĄ” + * - 1064: ćŸźäżĄèżžWi-Fi状态栏 + * - 1067: ć…ŹäŒ—ć·æ–‡ç« ćčżć‘Š + * - 1068: é™„èż‘ć°çš‹ćșćˆ—èĄšćčżć‘Š + * - 1069: 移抚ćș”甚 + * - 1071: é’±ćŒ…äž­çš„é“¶èĄŒćĄćˆ—èĄšéĄ” + * - 1072: äșŒç»Žç æ”¶æŹŸéĄ”靱 + * - 1073: ćźąæœæ¶ˆæŻćˆ—èĄšäž‹ć‘çš„ć°çš‹ćșæ¶ˆæŻćĄç‰‡ + * - 1074: ć…ŹäŒ—ć·äŒšèŻäž‹ć‘çš„ć°çš‹ćșæ¶ˆæŻćĄç‰‡ + * - 1077: æ‘‡ć‘šèŸč + * - 1078: èżžWi-FiæˆćŠŸéĄ” + * - 1079: ćŸźäżĄæžžæˆäž­ćżƒ + * - 1081: ćźąæœæ¶ˆæŻäž‹ć‘çš„æ–‡ć­—é“Ÿ + * - 1082: ć…ŹäŒ—ć·äŒšèŻäž‹ć‘çš„æ–‡ć­—é“Ÿ + * - 1084: æœ‹ć‹ćœˆćčżć‘ŠćŽŸç”ŸéĄ” + * - 1089: ćŸźäżĄèŠć€©äž»ç•Œéąäž‹æ‹‰ïŒŒă€Œæœ€èż‘äœżç”šă€æ ïŒˆćŸș础ćș“2.2.4ç‰ˆæœŹè”·ćŒ…ć«ă€Œæˆ‘çš„ć°çš‹ćșă€æ ïŒ‰ + * - 1090: é•żæŒ‰ć°çš‹ćșćłäžŠè§’èœć•ć”€ć‡șæœ€èż‘äœżç”šćŽ†ćČ + * - 1091: ć…ŹäŒ—ć·æ–‡ç« ć•†ć“ćĄç‰‡ + * - 1092: ćŸŽćž‚æœćŠĄć…„ćŁ + * - 1095: 氏繋ćșćčżć‘Šç»„ä»¶ + * - 1096: èŠć€©èź°ćœ• + * - 1097: ćŸźäżĄæ”Żä»˜ç­ŸçșŠéĄ” + * - 1099: éĄ”éąć†…ć”Œæ’ä»¶ + * - 1102: ć…ŹäŒ—ć· profile éĄ”æœćŠĄéą„è§ˆ + * - 1103: ć‘çŽ°æ ć°çš‹ćșäž»ć…„ćŁïŒŒă€Œæˆ‘çš„ć°çš‹ćșă€ćˆ—èĄšïŒˆćŸș础ćș“2.2.4ç‰ˆæœŹè”·ćșŸćŒƒïŒ‰ + * - 1104: ćŸźäżĄèŠć€©äž»ç•Œéąäž‹æ‹‰ïŒŒă€Œæˆ‘çš„ć°çš‹ćșă€æ ïŒˆćŸș础ćș“2.2.4ç‰ˆæœŹè”·ćșŸćŒƒïŒ‰ + */ + scene: SceneValues; + /** shareTicketïŒŒèŻŠè§ [èŽ·ć–æ›Žć€šèœŹć‘äżĄæŻ]((èœŹć‘#èŽ·ć–æ›Žć€šèœŹć‘äżĄæŻ)) */ + shareTicket: string; + /** ćœ“ćœșæ™Żäžșç”±ä»ŽćŠäž€äžȘ氏繋ćșæˆ–ć…ŹäŒ—ć·æˆ–Appæ‰“ćŒ€æ—¶ïŒŒèż”ć›žæ­€ć­—æź” */ + referrerInfo?: ReferrerInfo; + } + + interface PageNotFoundOption { + /** äžć­˜ćœšéĄ”éąçš„è·ŻćŸ„ */ + path: string; + /** æ‰“ćŒ€äžć­˜ćœšéĄ”éąçš„ query */ + query: AnyObject; + /** æ˜ŻćŠæœŹæŹĄćŻćŠšçš„éŠ–äžȘéĄ”éąïŒˆäŸ‹ćŠ‚ä»Žćˆ†äș«ç­‰ć…„ćŁèż›æ„ïŒŒéŠ–äžȘéĄ”éąæ˜ŻćŒ€ć‘è€…é…çœźçš„ćˆ†äș«éĄ”éąïŒ‰ */ + isEntryPage: boolean; + } + + interface AppInstance { + /** + * ç”Ÿć‘œć‘šæœŸć›žè°ƒâ€”ç›‘ćŹćș”ç”šćˆć§‹ćŒ– + * ćș”ç”šćˆć§‹ćŒ–ćꌿˆæ—¶è§Šć‘ïŒŒć…šć±€ćȘè§Šć‘äž€æŹĄă€‚ + */ + onLaunch?(options?: LaunchShowOption): void; + /** + * ç”Ÿć‘œć‘šæœŸć›žè°ƒâ€”ç›‘ćŹćș”甚星ç€ș + * ćș”ç”šćŻćŠšïŒŒæˆ–ä»ŽćŽć°èż›ć…„ć‰ć°æ˜Ÿç€ș时 + */ + onShow?(options?: LaunchShowOption): void; + /** + * ç”Ÿć‘œć‘šæœŸć›žè°ƒâ€”ç›‘ćŹćș”甚隐藏 + * ćș”ç”šä»Žć‰ć°èż›ć…„ćŽć°æ—¶ + */ + onHide?(): void; + /** + * é”™èŻŻç›‘ćŹć‡œæ•° + * ćș”ç”šć‘ç”Ÿè„šæœŹé”™èŻŻïŒŒæˆ–è€… api + */ + onError?(/** é”™èŻŻäżĄæŻïŒŒćŒ…ć«ć †æ ˆ */error?: string): void; + /** + * éĄ”éąäžć­˜ćœšç›‘ćŹć‡œæ•° + * ćș”ç”šèŠæ‰“ćŒ€çš„éĄ”éąäžć­˜ćœšæ—¶è§Šć‘ïŒŒäŒšćžŠäžŠéĄ”éąäżĄæŻć›žè°ƒèŻ„ć‡œæ•° + * + * **æłšæ„ïŒš** + * 1. ćŠ‚æžœćŒ€ć‘è€…æČĄæœ‰æ·»ćŠ  `onPageNotFound` ç›‘ćŹïŒŒćœ“è·łèœŹéĄ”éąäžć­˜ćœšæ—¶ïŒŒć°†æŽšć…„ćŸźäżĄćźąæˆ·ç«ŻćŽŸç”Ÿçš„éĄ”éąäžć­˜ćœšæç€șéĄ”éąă€‚ + * 2. ćŠ‚æžœ `onPageNotFound` ć›žè°ƒäž­ćˆé‡ćźšć‘ćˆ°ćŠäž€äžȘäžć­˜ćœšçš„éĄ”éąïŒŒć°†æŽšć…„ćŸźäżĄćźąæˆ·ç«ŻćŽŸç”Ÿçš„éĄ”éąäžć­˜ćœšæç€șéĄ”éąïŒŒćč¶äž”äžć†ć›žè°ƒ `onPageNotFound`。 + * + */ + onPageNotFound?(options?: PageNotFoundOption): void; + } + + type AppConstructor = ( + options: AppInstance & T, + ) => void; + + interface GetAppOption { + /** + * 朹 `App` æœȘ漚ä艿—¶èż”ć›žé»˜èź€ćźžçŽ°ă€‚ćœ“Appèą«è°ƒç”šæ—¶ïŒŒé»˜èź€ćźžçŽ°äž­ćźšäč‰çš„ć±žæ€§äŒšèą«èŠ†ç›–ćˆćč¶ćˆ°Appäž­ă€‚äž€èˆŹç”šäșŽç‹Źç«‹ćˆ†ćŒ… + */ + allowDefault: boolean; + } + + type GetApp = (opts?: GetAppOption) => AppInstance & T; + } + +declare const getApp: App.GetApp; diff --git a/types/uni-app/lib/common.d.ts b/types/uni-app/lib/common.d.ts new file mode 100644 index 0000000000..c8c1ed7c54 --- /dev/null +++ b/types/uni-app/lib/common.d.ts @@ -0,0 +1,5 @@ +type AnyObject = Record; + +type KVInfer = { [K in keyof T]: T[K] }; + +type Void = T | undefined | null; diff --git a/types/uni-app/lib/page.d.ts b/types/uni-app/lib/page.d.ts new file mode 100644 index 0000000000..26d622733b --- /dev/null +++ b/types/uni-app/lib/page.d.ts @@ -0,0 +1,152 @@ +declare namespace Page { + interface CustomShareContent { + /** + * èœŹć‘æ ‡éą˜ă€‚é»˜èź€ć€ŒïŒšćœ“ć‰ćș”ç”šćç§° + */ + title?: string; + /** + * èœŹć‘è·ŻćŸ„ïŒŒćż…éĄ»æ˜Żä»„ / ćŒ€ć€Žçš„ćźŒæ•Žè·ŻćŸ„ă€‚é»˜èź€ć€ŒïŒšćœ“ć‰éĄ”éą path + */ + path?: string; + /** + * è‡Ș漚äč‰ć›Ÿç‰‡è·ŻćŸ„ïŒŒćŻä»„æ˜ŻæœŹćœ°æ–‡ä»¶è·ŻćŸ„ă€ä»Łç ćŒ…æ–‡ä»¶è·ŻćŸ„æˆ–è€…çœ‘ç»œć›Ÿç‰‡è·ŻćŸ„ă€‚æ”ŻæŒPNG揊JPGă€‚æ˜Ÿç€șć›Ÿç‰‡é•żćźœæŻ”æ˜Ż 5:4ïŒŒé»˜èź€ć€ŒïŒšäœżç”šé»˜èź€æˆȘć›Ÿ + */ + imageUrl?: string; + } + + interface PageScrollOption { + /** + * éĄ”éąćœšćž‚ç›Žæ–č搑ć·Čæ»šćŠšçš„è·çŠ»ïŒˆć•äœpx + */ + scrollTop: number; + } + + interface ShareAppMessageOption { + /** + * èœŹć‘äș‹ä»¶æ„æșă€‚ + * ćŻé€‰ć€ŒïŒš + * - `button`ïŒšéĄ”éąć†…èœŹć‘æŒ‰é’źïŒ› + * - `menu`ïŒšćłäžŠè§’èœŹć‘èœć•ă€‚ + * + */ + from: "button" | "menu" | string; + /** + * ćŠ‚æžœ `from` ć€Œæ˜Ż `button`ïŒŒćˆ™ `target` æ˜Żè§Šć‘èż™æŹĄèœŹć‘äș‹ä»¶çš„ `button`ïŒŒćŠćˆ™äžș `undefined` + */ + target: any; + /** + * éĄ”éąäž­ćŒ…ć«``ç»„ä»¶æ—¶ïŒŒèż”ć›žćœ“ć‰``的url + */ + webViewUrl?: string; + } + + interface TabItemTapOption { + /** + * èą«ç‚č懻tabItem的ćșć·ïŒŒä»Ž0ćŒ€ć§‹ + */ + index: string; + /** + * èą«ç‚č懻tabItemçš„éĄ”éąè·ŻćŸ„ + */ + pagePath: string; + /** + * èą«ç‚č懻tabItemçš„æŒ‰é’źæ–‡ć­— + */ + text: string; + } + + interface PageInstanceBaseProps { + /** + * ćˆ°ćœ“ć‰éĄ”éąçš„è·ŻćŸ„ïŒŒç±»ćž‹äžș`String` + */ + route?: string; + } + + interface PageInstance extends PageInstanceBaseProps { + /** + * ç”Ÿć‘œć‘šæœŸć›žè°ƒâ€”ç›‘ćŹéĄ”éąćŠ èœœ + * éĄ”éąćŠ èœœæ—¶è§Šć‘ă€‚äž€äžȘéĄ”éąćȘäŒšè°ƒç”šäž€æŹĄïŒŒćŻä»„ćœš onLoad çš„ć‚æ•°äž­èŽ·ć–æ‰“ćŒ€ćœ“ć‰éĄ”éąè·ŻćŸ„äž­çš„ć‚æ•°ă€‚ + */ + onLoad?( + /** + * æ‰“ćŒ€ćœ“ć‰éĄ”éąè·ŻćŸ„äž­çš„ć‚æ•° + */ + query?: { [queryKey: string]: string }, + ): void; + /** + * ç”Ÿć‘œć‘šæœŸć›žè°ƒâ€”ç›‘ćŹéĄ”éąæ˜Ÿç€ș + * éĄ”éąæ˜Ÿç€ș/ćˆ‡ć…„ć‰ć°æ—¶è§Šć‘ă€‚ + */ + onShow?(): void; + /** + * ç”Ÿć‘œć‘šæœŸć›žè°ƒâ€”ç›‘ćŹéĄ”éąćˆæŹĄæžČæŸ“ćźŒæˆ + * éĄ”éąćˆæŹĄæžČæŸ“ćźŒæˆæ—¶è§Šć‘ă€‚äž€äžȘéĄ”éąćȘäŒšè°ƒç”šäž€æŹĄïŒŒä»ŁèĄšéĄ”éąć·Čç»ć‡†ć€‡ćŠ„ćœ“ïŒŒćŻä»„ć’Œè§†ć›Ÿć±‚èż›èĄŒäș€äș’。 + */ + onReady?(): void; + /** + * ç”Ÿć‘œć‘šæœŸć›žè°ƒâ€”ç›‘ćŹéĄ”éąéšè— + * éĄ”éąéšè—/ćˆ‡ć…„ćŽć°æ—¶è§Šć‘ă€‚ 橂 `navigateTo` 或ćș•郚 `tab` ćˆ‡æąćˆ°ć…¶ä»–éĄ”éąïŒŒćș”ç”šćˆ‡ć…„搎揰等。 + */ + onHide?(): void; + /** + * ç”Ÿć‘œć‘šæœŸć›žè°ƒâ€”ç›‘ćŹéĄ”éąćžèœœ + * éĄ”éąćžèœœæ—¶è§Šć‘ă€‚ćŠ‚`redirectTo`或`navigateBack`ćˆ°ć…¶ä»–éĄ”éąæ—¶ă€‚ + */ + onUnload?(): void; + /** + * ç›‘ćŹç”šæˆ·äž‹æ‹‰ćŠšäœœ + * ç›‘ćŹç”šæˆ·äž‹æ‹‰ćˆ·æ–°äș‹ä»¶ă€‚ + * - éœ€èŠćœš`pages.json`çš„éĄ”éąé…çœźäž­ćŒ€ćŻ`enablePullDownRefresh`。 + * - ćŻä»„é€šèż‡`uni.startPullDownRefresh`è§Šć‘äž‹æ‹‰ćˆ·æ–°ïŒŒè°ƒç”šćŽè§Šć‘äž‹æ‹‰ćˆ·æ–°ćŠšç”»ïŒŒæ•ˆæžœäžŽç”šæˆ·æ‰‹ćŠšäž‹æ‹‰ćˆ·æ–°äž€è‡Žă€‚ + * - ćœ“ć€„ç†ćźŒæ•°æźćˆ·æ–°ćŽïŒŒ`uni.stopPullDownRefresh`ćŻä»„ćœæ­ąćœ“ć‰éĄ”éąçš„äž‹æ‹‰ćˆ·æ–°ă€‚ + */ + onPullDownRefresh?(): void; + /** + * éĄ”éąäžŠæ‹‰è§Šćș•äș‹ä»¶çš„ć€„ç†ć‡œæ•° + * ç›‘ćŹç”šæˆ·äžŠæ‹‰è§Šćș•äș‹ä»¶ă€‚ + * - ćŻä»„ćœš`pages.json`çš„éĄ”éąé…çœźäž­èźŸçœźè§Šć‘è·çŠ»`onReachBottomDistance`。 + * - ćœšè§Šć‘è·çŠ»ć†…æ»‘ćŠšæœŸé—ŽïŒŒæœŹäș‹ä»¶ćȘäŒšèą«è§Šć‘äž€æŹĄă€‚ + */ + onReachBottom?(): void; + /** + * 甚户ç‚čć‡»ćłäžŠè§’èœŹć‘ + * ç›‘ćŹç”šæˆ·ç‚čć‡»éĄ”éąć†…èœŹć‘æŒ‰é’źïŒˆ`